Method, system and storage medium for adjusting image pixel overlap in virtual scene
By recording and using the best definition distance in the virtual scene to adjust the resolution of picture resources, it solves the problems of flickering and blurring of picture resources due to distance in traditional virtual and reality technologies, achieving better display effects and applicability. sex.
Patent Information
- Application Number
- CN202411333825.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-09-24
AI Technical Summary
In traditional virtual and real technology, pixel points are compressed and superimposed due to distance during rendering, resulting in flickering and blurring of the picture.
By record the optimal clarity distance of the picture resources that users see in the virtual scenario in advance, calculate the distance between the user's camera and the picture resources in real time, and adjust the resolution of the picture resources according to the distance to ensure that the best display effect is maintained during the user's movement process Essence
Effectively reduce the problem of pixel overlapping and flashing due to excessive resolution, improve the display effect of picture resources, and apply to display screens of different resolution.
Smart Images

Figure CN118840258B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of virtual and reality technology, and in particular to a method, system and storage medium for adjusting pixel overlap of images in a virtual scene. Background Art
[0002] Virtual and reality technology is mainly based on computer technology, and uses and integrates the latest developments of various high technologies such as 3D graphics technology, multimedia technology, simulation technology, display technology, servo technology, etc., and uses computers and other equipment to create a virtual world with realistic 3D vision, touch, smell and other sensory experiences. Therefore, the display of resources is the most important technology in virtual and reality technology. Since users can move in the constructed virtual world when experiencing virtual and reality technology, it is necessary to ensure that resources can follow the user's pace during the rendering process to ensure the user's experience.
[0003] However, traditional resource display is affected by the underlying rendering technology or the device itself. When the distance to the image resource is far, the image resource occupies a smaller size of the entire field of view. Therefore, the pixels of the image will be compressed during the rendering process, resulting in superposition between pixels. For high-resolution image resources, the superposition phenomenon is more serious, causing the pixels of the image to flicker and the picture to be blurred. In addition, if the pixel density of the image does not match the pixel density of the display device, or the display settings are improper (such as anti-aliasing settings, pixel alignment, etc.), it may also cause problems such as pixel flickering. Therefore, the traditional image resource display still has the disadvantage of poor display effect and cannot meet the user experience of virtual and reality technology. Summary of the invention
[0004] The purpose of the present invention is to solve the problem of poor display effect of traditional image resources mentioned above and propose a method, system and storage medium for adjusting image pixel overlap in a virtual scene. The method has the advantages of flexibly adjusting the resolution of image resources according to the user's visual distance, reducing the flicker problem caused by pixel overlap, and greatly improving the display effect of image resources.
[0005] In a first aspect, the present invention achieves the above-mentioned purpose through the following technical solution, a method for adjusting the pixel overlap of an image in a virtual scene, the method comprising the following steps:
[0006] The optimal distance M is recorded in advance. The recording method is: when the image resource is recorded in the middle station, the clarity of the image resource seen by the user in the virtual scene is recorded. Figure 1 When the distance between the user's camera and the image resource is equal, the distance M is used as the optimal distance;
[0007] After the user enters the virtual scene, the real-time distance m between the user's camera and the image resource is calculated;
[0008] The resolution of the image resource is adjusted according to the size of the real-time distance m and the optimal distance M. The specific method is as follows:
[0009] If m≤M, the image resource maintains the initial resolution (w, h);
[0010] If m>M, calculate the adjustment ratio N=M / m;
[0011] Calculate the adjusted resolution (W, H) of the image resource according to the adjustment ratio N, where W=w*N, H=h*N;
[0012] The resolution of the image resource is adjusted to (W, H) in the virtual scene.
[0013] Preferably, the method further comprises setting 0.5≤N≤1, and if the calculated adjustment ratio N exceeds the range, the image resource maintains the initial resolution (w, h).
[0014] Preferably, the method for calculating the real-time distance m between the user camera and the image resource is:
[0015] Get the center point coordinates O of the image resource in the virtual scene, and get the real-time position coordinates P of the user's camera;
[0016] The distance between the coordinate O and the coordinate P is calculated as the real-time distance m.
[0017] Preferably, the method further comprises:
[0018] Select the resolution of the user's screen when the image resource is recorded in the middle platform and the optimal distance M is recorded as the default screen resolution (a, b);
[0019] Get the current screen resolution (A, B) when the user enters the virtual scene;
[0020] Calculate the scaling ratio Z = (A / a + B / b) / 2;
[0021] According to the scaling factor Z, the optimal distance M'=M / Z at the current screen resolution is calculated.
[0022] Preferably, the method for adjusting the resolution of the image resource to (W, H) in the virtual scene is:
[0023] Back up the image resources of the initial resolution;
[0024] Compress the resolution of the image resource with the initial resolution (w, h) to (W, H) to obtain a new image resource;
[0025] Replace the image resource of the initial resolution with the new image resource.
[0026] In a second aspect, the present invention achieves the above-mentioned purpose through the following technical solutions, a system for adjusting pixel overlap of images in a virtual scene, the system comprising:
[0027] The standard preset unit is used to pre-record the optimal distance M. The recording method is: when the image resource is recorded in the middle station, the clarity of the image resource seen by the user in the virtual scene is recorded. Figure 1 When the distance between the user's camera and the image resource is equal, the distance M is used as the optimal distance;
[0028] A distance detection unit, used to calculate the real-time distance m between the user's camera and the image resource after the user enters the virtual scene;
[0029] The resolution calculation unit is used to adjust the resolution of the image resource according to the size of the real-time distance m and the optimal distance M. The specific method is as follows:
[0030] If m≤M, the image resource maintains the initial resolution (w, h);
[0031] If m>M, calculate the adjustment ratio N=M / m;
[0032] Calculate the adjusted resolution (W, H) of the image resource according to the adjustment ratio N, where W=w*N, H=h*N;
[0033] The resolution adjustment unit is used to adjust the resolution of the image resource to (W, H) in the virtual scene.
[0034] Preferably, the resolution calculation unit includes setting 0.5≤N≤1, and if the calculated adjustment ratio N exceeds this range, the image resource maintains the initial resolution (w, h).
[0035] Preferably, the system further comprises:
[0036] Select the resolution of the user's screen when the image resource is recorded in the middle platform and the optimal distance M is recorded as the default screen resolution (a, b);
[0037] Get the current screen resolution (A, B) when the user enters the virtual scene;
[0038] Calculate the scaling ratio Z = (A / a + B / b) / 2;
[0039] According to the scaling factor Z, the optimal distance M'=M / Z at the current screen resolution is calculated.
[0040] Preferably, the method for adjusting the resolution of the image resource to (W, H) in the virtual scene in the resolution calculation unit is:
[0041] Back up the image resources of the initial resolution;
[0042] Compress the resolution of the image resource with the initial resolution (w, h) to (W, H) to obtain a new image resource;
[0043] Replace the image resource of the initial resolution with the new image resource.
[0044] In a third aspect, the present invention achieves the above-mentioned purpose through the following technical solution: a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method for adjusting the pixel overlap of images in a virtual scene as described in the first aspect.
[0045] Compared with the prior art, the beneficial effects of the present invention are as follows: the present invention uses the pre-recorded distance between the user's camera and the picture resource when the user views the clearest picture as the optimal distance. Therefore, in the virtual scene, as the user moves, the distance between the user's camera and the picture resource keeps changing. With the optimal distance as a reference, the resolution of the picture resource is selectively adjusted according to the distance between the user's camera and the picture resource, effectively reducing the problem of flickering caused by overlapping pixels of the picture when the user views the picture resource at a distance due to excessive resolution; and different optimal distances are set to meet the use of display screens with different resolutions, with a wider range of applications to ensure user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 The present invention is a flow chart of a method for adjusting pixel overlap of images in a virtual scene.
[0047] Figure 2 A schematic diagram of a system for adjusting pixel overlap of images in a virtual scene according to the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] Example 1
[0050] like Figure 1 As shown, a method for adjusting pixel overlap of images in a virtual scene comprises the following steps:
[0051] Step S1, pre-record the optimal distance M, the recording method is: when recording the image resource in the middle station, record the clarity of the image resource seen by the user in the virtual scene and the original Figure 1When the image resource is configured, the distance between the user's camera and the image resource is taken as the optimal distance M. The pre-recording here is performed when the image resource is configured in the scene, and the image resource is configured in the middle platform. The image resource is deleted, replaced, and added through the middle platform. It is not bound to the virtual scene. This is to facilitate the use of resources. The specific recording method is that the user first enters the virtual scene, and then a virtual character is generated in the virtual scene. The picture transmitted by the user through the user's camera is displayed on the screen to realize the picture display of the virtual scene. The position of the virtual character is bound to the user's camera. The user controls the movement of the virtual character, and the user's camera follows the movement. The picture changes during the movement. By using the virtual character to constantly adjust the position distance from the image resource, the user can see the display clarity of the image resource. When the display clarity is most appropriate, the background will record the distance between the user's camera and the image resource at this time. This distance is used as the optimal distance M, and the optimal distance M is used as a reference for subsequent image resource resolution adjustment.
[0052] Step S2: After the user enters the virtual scene, the real-time distance m between the user's camera and the image resource is calculated. In step S1, the user pre-records the optimal distance M. This user can be an administrator or a developer who builds a virtual scene. The image resources in the middle platform cannot be modified by other users. The user in step S2 is all users who use the virtual scene. After entering the virtual scene, the user can control the virtual character to walk in the scene at will. Therefore, the distance between the user's camera and the image resource can change at any time. This solution uses the optimal distance M as a reference for whether the image resolution needs to be adjusted. Therefore, it is necessary to record the real-time distance m. The distance is used as a reference for resolution adjustment because "when a high-resolution image does not completely cover the visual field, the background will automatically compress the image resolution, which will cause the pixels to overlap and cause the image to flicker and blur. The distance between the user's character and the image is used as the basis for whether the image covers the visual field." According to this reason, if the image resource uses a fixed resolution, this resolution will cause the image to be blurred if it is too small, and the pixels will flicker if it is too large, which will also cause the image to be blurred. Therefore, this solution discloses setting the image resolution to a dynamic resolution that can be adjusted with the distance between the user's camera and the image resource. The specific adjustment steps are explained in detail.
[0053] Step S3: adjusting the resolution of the image resource according to the real-time distance m and the optimal distance M. The specific method is as follows:
[0054] If m≤M, the image resource maintains the initial resolution (w, h); when the distance between the user camera and the image resource is less than the optimal distance M, the image resource occupies a large proportion of the field of view, and resolution compression is not required during rendering. Therefore, even if the resolution is larger, it will not affect the final display.
[0055] If m>M, calculate the adjustment ratio N=M / m; when the distance between the user camera and the image resource exceeds the optimal distance M, the image resource occupies a smaller proportion of the field of view, and the image resolution is compressed during rendering. Therefore, at this distance, the resolution of the image resource needs to be adjusted by reducing the resolution of the image resource, so that when the resolution is low, it will not cause pixel overlap, thereby reducing image flickering. In this step, we need to calculate the resolution adjustment ratio, which is determined by the ratio between the current distance between the user camera and the image resource and the optimal distance M. After many tests, we can find that the change in distance and resolution is linear, so here we choose to adjust the resolution of the image resource by adjusting the ratio N.
[0056] The adjusted resolution (W, H) of the image resource is calculated according to the adjustment ratio N, where W=w*N, H=h*N. According to the previous step, the value of the adjustment ratio decreases as the distance between the user camera and the image resource increases. Therefore, by multiplying the values of the resolutions w and h by the adjustment ratio N, the reduced resolution (W, H) can be obtained.
[0057] Step S4: Adjust the resolution of the image resource to (W, H) in the virtual scene. Use the image resolution adjustment technology provided by the virtual scene to adjust the resolution of the image resource to (W, H), thereby solving the problem of image flickering.
[0058] According to the above, when the distance between the user's camera and the image resource changes, the resolution of the image resource needs to be adjusted to ensure that the appropriate resolution can display clearer image content as much as possible. However, this change in distance does not need to be adjusted every time. For example, when it is less than the optimal distance M as mentioned above, no change is made, and when it exceeds the optimal distance M, the resolution needs to be reduced. However, if the distance exceeds too large, the proportion of the image resource itself in the field of view becomes very small, so even if the resolution is adjusted again, the image content cannot be seen clearly. Therefore, the method also includes setting 0.5≤N≤1. If the calculated adjustment ratio N exceeds this range, the image resource maintains the initial resolution (w, h). By limiting the size of the adjustment ratio N, it is selected whether to adjust the resolution online to avoid waste of resources caused by adjusting the resolution when the distance is too far.
[0059] The method for calculating the real-time distance m between the user camera and the image resource is:
[0060] Get the center point coordinates O of the image resource in the virtual scene, and get the real-time position coordinates P of the user's camera;
[0061] The distance between the coordinate O and the coordinate P is calculated as the real-time distance m. The calculation of the real-time distance m belongs to a distance calculation method commonly used in virtual scenes, so the principle will not be described in detail.
[0062] The above methods are all performed under the condition that the screen resolution is consistent. When the method is actually used, the following problems may occur: when the administrator uploads the image resources and determines the optimal distance M, the screen resolution of the device used is 1920*1080, but when the user uses it, the screen resolution may not be of this specification. As mentioned above, the resolution of the device itself will also affect the clarity of the image, so different adjustment methods need to be selected for different device resolutions. The method also includes:
[0063] The resolution of the user's screen when the optimal distance M is first recorded is selected as the default screen resolution (a, b). This means that when the administrator records the optimal distance M, the screen resolution of the device used is also recorded for reference.
[0064] Get the current screen resolution (A, B) when the user enters the virtual scene; this screen resolution is the resolution of the device used by the user who uses the virtual scene. This resolution may be the same as the default screen resolution or may be different, which is determined according to the user's situation.
[0065] Calculate the scaling ratio Z = (A / a + B / b) / 2; regardless of whether the default screen resolution and the current screen resolution are the same, the scaling ratio calculation needs to be performed. If they are the same, the calculated scaling ratio value is 1, so no scaling is actually required. However, if they are different, a scaling ratio Z other than 1 will be obtained.
[0066] The optimal distance M'=M / Z under the current screen resolution is calculated according to the zoom ratio Z. The optimal distance is adjusted using the zoom ratio Z calculated above. Because the clarity of the image resources seen at the same position is different for different screen resolutions, the value of the optimal distance M also needs to be changed. When the user stands at the optimal distance M on the currently used screen, the image resources seen are also at the most appropriate clarity.
[0067] Since this solution adopts the method of adjusting the image resolution online, in order not to affect the resources uploaded by the administrator in the middle platform, the method of adjusting the resolution of the image resource to (W, H) in the virtual scene is:
[0068] Back up the image resources with the initial resolution. This backed-up image resource is used for adjustment and will not affect the resources uploaded by the middle platform. Therefore, no matter how the distance between the user's camera and the image resource changes, this backed-up image resource is always used for calculation.
[0069] Compress the resolution of the image resource with the initial resolution (w, h) to (W, H) to obtain a new image resource;
[0070] Replace the image resource of the initial resolution with the new image resource.
[0071] Example 2
[0072] like Figure 2 As shown, a system for adjusting pixel overlap of images in a virtual scene, the system comprising:
[0073] The standard preset unit is used to pre-record the optimal distance M. The recording method is: when the image resource is recorded in the middle station, the clarity of the image resource seen by the user in the virtual scene is recorded. Figure 1 When the distance between the user's camera and the image resource is equal, the optimal distance M is used.
[0074] The distance detection unit is used to calculate the real-time distance m between the user camera and the image resource after the user enters the virtual scene; the method for calculating the real-time distance m between the user camera and the image resource is:
[0075] Get the center point coordinates O of the image resource in the virtual scene, and get the real-time position coordinates P of the user's camera;
[0076] The distance between the coordinate O and the coordinate P is calculated as the real-time distance m.
[0077] The resolution calculation unit is used to adjust the resolution of the image resource according to the size of the real-time distance m and the optimal distance M. The specific method is as follows:
[0078] If m≤M, the image resource maintains the initial resolution (w, h);
[0079] If m>M, calculate the adjustment ratio N=M / m;
[0080] The adjusted resolution (W, H) of the image resource is calculated according to the adjustment ratio N, where W=w*N, H=h*N.
[0081] The resolution adjustment unit is used to adjust the resolution of the image resource to (W, H) in the virtual scene.
[0082] The resolution calculation unit includes setting 0.5≤N≤1. If the calculated adjustment ratio N exceeds the range, the image resource maintains the initial resolution (w, h).
[0083] The system also includes:
[0084] Select the resolution of the user's screen when the image resource is recorded in the middle platform and the optimal distance M is recorded as the default screen resolution (a, b);
[0085] Get the current screen resolution (A, B) when the user enters the virtual scene;
[0086] Calculate the scaling ratio Z = (A / a + B / b) / 2;
[0087] According to the scaling factor Z, the optimal distance M'=M / Z at the current screen resolution is calculated.
[0088] The method for adjusting the resolution of the image resource to (W, H) in the virtual scene in the resolution calculation unit is:
[0089] Back up the image resources of the initial resolution;
[0090] Compress the resolution of the image resource with the initial resolution (w, h) to (W, H) to obtain a new image resource;
[0091] Replace the image resource of the initial resolution with the new image resource.
[0092] Embodiment 2 is essentially the same as Embodiment 1, so the specific working principles of each unit will not be described in detail.
[0093] Example 3
[0094] This embodiment proposes a storage medium, which includes a program storage area and a data storage area, wherein the program storage area can store an operating system and programs required for running an instant messaging function, etc.; the data storage area can store various instant messaging information and operation instruction sets, etc. The computer program is stored in the program storage area, and when the computer program is executed by the processor, the method for adjusting the pixel overlap of the image in the virtual scene as described in Example 1 is implemented. The processor may include one or more central processing units, or a digital processing unit, etc.
[0095] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above and that the present invention can be implemented in other specific forms without departing from the spirit or essential features of the present invention. Therefore, the embodiments should be considered exemplary and non-restrictive in all respects, and the scope of the present invention is defined by the appended claims rather than the above description, and it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims be included in the present invention.
[0096] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A method for adjusting pixel overlap of images in a virtual scene, characterized in that: The method comprises the following steps: The optimal distance M is recorded in advance. The recording method is: when recording the image resource in the middle platform, when the clarity of the image resource seen by the user in the virtual scene is consistent with the original image, the distance between the user's camera and the image resource is recorded as the optimal distance M; After the user enters the virtual scene, the real-time distance m between the user's camera and the image resource is calculated; The resolution of the image resource is adjusted according to the size of the real-time distance m and the optimal distance M. The specific method is as follows: If m≤M, the image resource maintains the initial resolution (w, h); If m>M, calculate the adjustment ratio N=M / m; Calculate the adjusted resolution (W, H) of the image resource according to the adjustment ratio N, where W=w*N, H=h*N; The resolution of the image resource is adjusted to (W, H) in the virtual scene.
2. The method for adjusting pixel overlap of images in a virtual scene according to claim 1, characterized in that: The method also includes setting 0.5≤N≤1. If the calculated adjustment ratio N exceeds the range, the image resource maintains the initial resolution (w, h).
3. The method for adjusting pixel overlap of images in a virtual scene according to claim 1, characterized in that: The method for calculating the real-time distance m between the user camera and the image resource is: Get the center point coordinates O of the image resource in the virtual scene, and get the real-time position coordinates P of the user's camera; The distance between the coordinate O and the coordinate P is calculated as the real-time distance m.
4. The method for adjusting pixel overlap of images in a virtual scene according to claim 1, characterized in that: The method further includes: Select the resolution of the user's screen when the image resource is recorded in the middle platform and the optimal distance M is recorded as the default screen resolution (a, b); Get the current screen resolution (A, B) when the user enters the virtual scene; Calculate the scaling ratio Z = (A / a + B / b) / 2; According to the scaling factor Z, the optimal distance M'=M / Z at the current screen resolution is calculated.
5. The method for adjusting pixel overlap of images in a virtual scene according to claim 1, characterized in that: The method for adjusting the resolution of the image resource to (W, H) in the virtual scene is: Back up the image resources of the initial resolution; Compress the resolution of the image resource with the initial resolution (w, h) to (W, H) to obtain a new image resource; Replace the image resource of the initial resolution with the new image resource.
6. A system for adjusting pixel overlap of images in a virtual scene, characterized in that: The system includes: The standard preset unit is used to pre-record the optimal distance M. The recording method is: when recording the image resource in the middle platform, when the clarity of the image resource seen by the user in the virtual scene is consistent with the original image, the distance between the user's camera and the image resource is recorded as the optimal distance M; A distance detection unit, used to calculate the real-time distance m between the user's camera and the image resource after the user enters the virtual scene; The resolution calculation unit is used to adjust the resolution of the image resource according to the size of the real-time distance m and the optimal distance M. The specific method is as follows: If m≤M, the image resource maintains the initial resolution (w, h); If m>M, calculate the adjustment ratio N=M / m; Calculate the adjusted resolution (W, H) of the image resource according to the adjustment ratio N, where W=w*N, H=h*N; The resolution adjustment unit is used to adjust the resolution of the image resource to (W, H) in the virtual scene.
7. The system for adjusting pixel overlap of images in a virtual scene according to claim 6, characterized in that: The resolution calculation unit includes setting 0.5≤N≤1. If the calculated adjustment ratio N exceeds the range, the image resource maintains the initial resolution (w, h).
8. The system for adjusting pixel overlap of images in a virtual scene according to claim 6, characterized in that: The system also includes: Select the resolution of the user's screen when the image resource is recorded in the middle platform and the optimal distance M is recorded as the default screen resolution (a, b); Get the current screen resolution (A, B) when the user enters the virtual scene; Calculate the scaling ratio Z = (A / a + B / b) / 2; According to the scaling factor Z, the optimal distance M'=M / Z at the current screen resolution is calculated.
9. The system for adjusting pixel overlap of images in a virtual scene according to claim 6, characterized in that: The method for adjusting the resolution of the image resource to (W, H) in the virtual scene in the resolution calculation unit is: Back up the image resources of the initial resolution; Compress the resolution of the image resource with the initial resolution (w, h) to (W, H) to obtain a new image resource; Replace the image resource of the initial resolution with the new image resource.
10. A storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method for adjusting pixel overlap of images in a virtual scene as described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Adaptive pre-filtering of video data based on gaze direction
CN115601270A
Projection device and image processing method thereof
CN118612392A