WO2022042212A1 - Method for image processing and related device thereof - Google Patents
Method for image processing and related device thereof Download PDFInfo
- Publication number
- WO2022042212A1 WO2022042212A1 PCT/CN2021/109966 CN2021109966W WO2022042212A1 WO 2022042212 A1 WO2022042212 A1 WO 2022042212A1 CN 2021109966 W CN2021109966 W CN 2021109966W WO 2022042212 A1 WO2022042212 A1 WO 2022042212A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image frame
- ith
- threshold
- black pixels
- hmd
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N13/00—Stereoscopic video systems; Multi-view video systems; Details thereof
- H04N13/30—Image reproducers
- H04N13/332—Displays for viewing with the aid of special glasses or head-mounted displays [HMD]
- H04N13/344—Displays for viewing with the aid of special glasses or head-mounted displays [HMD] with head-mounted left-right displays
-
- G—PHYSICS
- G02—OPTICS
- G02B—OPTICAL ELEMENTS, SYSTEMS OR APPARATUS
- G02B27/00—Optical systems or apparatus not provided for by any of the groups G02B1/00 - G02B26/00, G02B30/00
Definitions
- the present application relates to the technical field of virtual reality (VR), and in particular, to an image processing method and related equipment.
- VR virtual reality
- VR technology is more and more applied in real life, enabling users to enjoy an immersive visual experience.
- a terminal device can send an image to be viewed to the HMD, so that the HMD displays the image for the user to watch.
- FIG. 1 is a schematic diagram of a VR technology provided by an embodiment of the present application.
- an HMD includes a light source, a lens group, and a sensor.
- the HMD wants to display an image, it first emits a light beam to the lens group through the light source. After the light beam enters the lens group, a part of the light beam reaches the sensor according to a preset path, and this part of the light beam can form a target image at the sensor (ie, the solid line part in Figure 1). However, the other part of the beam does not travel according to the preset path, but undergoes multiple reflections and refractions in various mirrors, and finally forms an obvious ghost image at the sensor (dotted line in Figure 1).
- the picture presented by the sensor to the user includes the target image and the ghost image, and the ghost image forms a ghost near the target image, which affects the user's perception.
- the image processing method and related equipment can effectively weaken the influence of ghost images on visual effects and improve user experience.
- a first aspect of the embodiments of the present application provides an image processing method, the method comprising:
- the terminal device may first obtain the proportion of black pixels in the ith image frame of the application.
- the proportion of black pixels in the ith image frame is the ratio between the number of black pixels in the ith image frame and the number of pixels in the ith image frame, and i is an integer greater than or equal to 1.
- the terminal device determines that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, it is determined that there are large black areas and a part of brighter areas in the ith image frame. If the HMD directly displays the i-th image frame, the ghost image generated by the brighter area is projected on the black area, and the user will clearly feel the existence of the ghost image visually. At this time, the terminal device may reduce the contrast of the ith image frame to the second threshold, and reduce the brightness of the ith image frame to the third threshold, to obtain the adjusted ith image frame.
- the terminal device sends the adjusted ith image frame to the HMD, so that the HMD displays the adjusted ith image frame for the user to watch. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller. Therefore, when the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
- the method further includes: if it is determined that the proportion of black pixels in the ith image frame is less than the first threshold, then The image frame is sent to the HMD, causing the HMD to display the ith image frame.
- the method before acquiring the proportion of black pixels of the ith image frame, the method further includes: if it is determined that the proportion of black pixels of the first image frame to the ith image frame is less than The first threshold is determined, and i-1 is determined to be the fourth threshold, after acquiring the ith image frame, the ith image frame is directly sent to the HMD, so that the HMD displays the ith image frame.
- the method further includes: if determining the i+1-th image frame to the i+j-1-th image frame The proportion of black pixels is less than the first threshold, and it is determined that j-1 is the fifth threshold, then after the i+jth image frame is obtained, the i+jth image frame is directly sent to the HMD, so that the HMD Display the i+j th image frame.
- the method before acquiring the proportion of black pixels of the i-th image frame, the method further includes: acquiring the i-th image frame; if it is determined that i is greater than or equal to the sixth threshold, directly converting the i-th image frame The image frame is sent to the HMD, causing the HMD to display the ith image frame.
- acquiring the proportion of black pixels in the i-th image frame includes: acquiring the red, green, and blue RGB values of each pixel in the i-th image frame, and determining the pixels whose RGB value is 0. is a black pixel; obtain the number of black pixels of the ith image frame and the number of pixels of the ith image frame; according to the number of black pixels of the ith image frame and the pixels of the ith image frame The number of points to determine the proportion of black pixels in the i-th image frame.
- a second aspect of the embodiments of the present application provides an apparatus for image processing, the apparatus comprising:
- the first obtaining module is used to obtain the proportion of black pixels of the ith image frame, and the proportion of black pixels is between the number of black pixels of the ith image frame and the number of pixels of the ith image frame
- the ratio of , i is an integer greater than or equal to 1.
- the adjustment module is configured to reduce the contrast of the ith image frame to the second threshold and reduce the brightness of the ith image frame if it is determined that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold To the third threshold, the adjusted i-th image frame is obtained.
- the sending module is used for sending the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame.
- the adjusted ith image frame is sent to the HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller.
- the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
- the sending module is further configured to send the ith image frame to the HMD if it is determined that the proportion of black pixels in the ith image frame is less than the first threshold, so that the HMD displays the ith image frame. image frame.
- the sending module is further configured to determine that the proportion of black pixels from the first image frame to the i-1 th image frame is smaller than the first threshold, and determine that i-1 is the fourth image frame. If the threshold is set, the ith image frame is directly sent to the HMD, so that the HMD displays the ith image frame.
- the sending module is further configured to, if it is determined that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determine that the j- If 1 is the fifth threshold, after the i+j th image frame is acquired, the i+j th image frame is directly sent to the HMD, so that the HMD displays the i+j th image frame.
- the apparatus further includes: a second acquiring module, configured to acquire the i-th image frame.
- the sending module is further configured to directly send the ith image frame to the HMD if it is determined that i is greater than or equal to the sixth threshold, so that the HMD displays the ith image frame.
- the first obtaining module is further configured to: obtain the RGB value of each pixel point in the ith image frame, and determine the pixel point with the RGB value of 0 as a black pixel point. Get the number of black pixels in the ith image frame and the number of pixels in the ith image frame. According to the number of black pixels of the ith image frame and the number of pixels of the ith image frame, the proportion of black pixels of the ith image frame is determined.
- a third aspect of the embodiments of the present application provides an apparatus for image processing, the apparatus comprising:
- One or more central processing units memory, input and output interface, wired or wireless network interface, power supply;
- the memory is either ephemeral storage storage or persistent storage storage
- the central processing unit is configured to communicate with the memory, and execute the instruction operations in the memory on the image processing apparatus to perform the first aspect or the method of any possible implementation of the first aspect.
- a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, including instructions, when the instructions are executed on a computer, the computer is made to execute the first aspect or any possible implementation manner of the first aspect. method.
- a fifth aspect of the embodiments of the present application provides a computer program product containing instructions, which, when executed on a computer, cause the computer to execute the method in the first aspect or any possible implementation manner of the first aspect.
- the embodiments of the present application have the following advantages:
- the terminal device determines that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, it reduces the brightness of the ith image frame to the third threshold to obtain the adjusted ith image frame. image frame. Then, the terminal device sends the adjusted ith image frame to the HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller.
- the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
- FIG. 1 is a schematic diagram of a VR technology provided by an embodiment of the present application.
- FIG. 2 is a schematic diagram of a VR system provided by an embodiment of the present application.
- FIG. 3 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
- FIG. 4 is a schematic structural diagram of an apparatus for image processing provided by an embodiment of the present application.
- FIG. 5 is another schematic structural diagram of an apparatus for image processing provided by an embodiment of the present application.
- FIG. 2 is a schematic diagram of a VR system provided by an embodiment of the present application.
- the system includes: an HMD and a terminal device, wherein the HMD and the terminal device are communicatively connected, and the two can exchange information.
- the terminal device can send the image frame of the application to the HMD frame by frame.
- the HMD worn by the user can display the image frame for the user to watch. Therefore, when the HMD continues to display multiple consecutive image frames of the application, the user can watch the smooth application playback screen, thereby experiencing the real experience brought by the VR technology.
- an embodiment of the present application provides an image processing method.
- FIG. 3 is a schematic flowchart of an image processing method provided by an embodiment of the present application. As shown in Figure 3, the method includes:
- the terminal device can acquire the ith image frame of the application, where i is an integer greater than or equal to 1. Specifically, the terminal device may acquire each image frame of the application frame by frame, for example, the terminal device may sequentially acquire the first image frame, the second image frame, the third image frame, ..., the nth image of the application frame and so on. It should be noted that, after multiple consecutive image frames of the application are displayed by the HMD, a dynamic playback picture can be presented to the user, giving the user a real viewing experience.
- the terminal device can determine whether i is greater than or equal to the sixth threshold. If i is less than the sixth threshold, the terminal device preliminarily determines that the image processing function needs to be performed. threshold, the terminal device determines that the image processing function does not need to be performed.
- the frame number threshold that is, the sixth threshold
- the frame Image frames with numbers equal to or greater than the sixth threshold do not require image processing.
- the sixth threshold may be set to 2001 in advance. Therefore, when the terminal device acquires any image frame from the first image frame to the 2000th image frame, since the frame numbers of these image frames are all less than 2001, the terminal device acquires any image frame in this part of the image frame. After one, it is preliminarily determined that image processing is required. When the terminal device acquires the 2001st image frame to the 100000th image frame, since the frame numbers of these image frames are all greater than or equal to 2001, after the terminal device acquires any one of these image frames, it is determined not to Image processing is required.
- Step 303 Determine whether the proportion of black pixels from the first image frame to the i-1th image frame is smaller than the first threshold, and whether i-1 is the fourth threshold, if not, then perform step 305, if so, then Step 304 is performed.
- the terminal device After the terminal device preliminarily determines that the i-th image needs to be image-processed, it determines again whether the i-th image frame needs to be image-processed. Specifically, the terminal device may first obtain the processing conditions before the first image frame to the i-1th image frame, and determine whether the following conditions are met: the black pixels of the first image frame to the i-1th image frame The proportions are all smaller than the first threshold (the first threshold is a threshold for the proportion of black pixels set in advance according to actual requirements), and i-1 is the fourth threshold. If the aforementioned conditions are satisfied, the terminal device finally determines that the i-th image does not need image processing, and if the aforementioned conditions are not satisfied, the terminal device finally determines that the i-th image requires image processing.
- the first threshold is a threshold for the proportion of black pixels set in advance according to actual requirements
- set the fourth threshold to be 60 (the fourth threshold can be set according to actual requirements, which is not limited here).
- the terminal device can obtain the image processing conditions of the first image frame to the 60th image frame. If the terminal device determines that the proportion of black pixels in each image frame in this part of the image frames is less than the first threshold, then It can be finally determined that starting from the ith image frame, the application does not need to perform image processing on the ith image frame and subsequent image frames. If the terminal device determines that the proportion of black pixels in each image frame in this part of the image frames is not all less than the first threshold, it can determine that the application needs to perform image processing from the ith image frame.
- the proportion of black pixels in any image frame in the application refers to the ratio between the number of black pixels in the image frame and the number of pixels in the image frame.
- the RGB values of all pixels of the image frame may be obtained first, and the pixels with the RGB value of 0 are determined as black pixels. Then, the number of black pixels of the image frame and the number of pixels of the image frame are obtained. Finally, the proportion of black pixels in the image frame is determined according to the number of black pixels in the image frame and the number of pixels in the image frame.
- the proportion of black pixels in an image frame is greater than or equal to the first threshold, it means that there are large black areas and a small part of brighter areas in the image frame, and ghost images of such image frames are Obviously, image processing is usually required. If the proportion of black pixels in an image frame is less than the first threshold, it means that the gap between the size of the black area and the size of the brighter area in the image frame is small. Image-like frame ghosts are less obvious and usually do not require image processing. Therefore, if the terminal device determines that the proportion of black pixels in the first several image frames immediately after an application is started is smaller than the first threshold, it defaults that no image processing is required for the subsequent image frames.
- the startup screen of an application is usually the one most likely to have ghost images (the background in the startup screen is black and the screen only contains the logo of the application). If the percentage of points is less than the first threshold, it is assumed that the application starts from the 61st image frame, and subsequent image frames do not need to perform image processing, thereby reducing the workload of the terminal device and achieving energy saving.
- the terminal device determines in step 302 that image processing is not required for the i-th image frame, or if the terminal device determines in step 304 that image processing is not required for the i-th image frame, the terminal device directly sends the unprocessed i-th image frame to to the HMD, so that the HMD displays the unprocessed ith image frame (ie, the original ith image frame in the application) for viewing by the user.
- the terminal device After the terminal device finally determines that the ith image frame needs image processing, it first obtains the proportion of black pixels of the ith image frame, and the proportion of black pixels of the ith image frame is the black pixel of the ith image frame.
- the ratio between the number of points and the number of pixels in the ith image frame It should be understood that, for the calculation method of the proportion of black pixels, reference may be made to the relevant description in step 303, and details are not repeated here.
- step 306. Determine whether the proportion of black pixels in the i-th image frame is greater than or equal to the first threshold, and if so, execute step 307, and if not, execute step 308.
- the terminal device After obtaining the proportion of black pixels of the ith image frame, the terminal device determines whether the proportion of black pixels of the ith image frame is greater than or equal to the first threshold.
- the terminal device determines that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, it adjusts the parameters of the ith image frame. Specifically, the terminal device reduces the contrast of the ith image frame to a second threshold (the second threshold is a contrast threshold set according to actual requirements), and reduces the brightness of the ith image frame to a third threshold (the third threshold is the brightness threshold set according to the actual demand), and the adjusted i-th image frame is obtained.
- the second threshold is a contrast threshold set according to actual requirements
- the third threshold is the brightness threshold set according to the actual demand
- the terminal device may call the first smoothing function to gradually reduce the contrast of the ith image frame from the current value to the second threshold.
- the terminal device may call the second smoothing function to gradually reduce the brightness of the ith image frame from the current value to the third threshold and so on.
- the terminal device determines that the proportion of black pixels in the i-th image frame is less than the first threshold, the terminal device will process the i-th image frame that has been processed (that is, has been judged for the proportion of black pixels) but has not been adjusted (parameter adjustment is not required).
- the image frames are sent to the HMD (that is, the original i-th image frame in the application) for viewing by the user.
- the terminal device After obtaining the adjusted ith image frame, the terminal device sends the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller. Therefore, when the HMD displays the ith image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image appears dim or even disappears.
- step 311 Determine whether the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and whether j-1 is the fifth threshold, and if so, go to step 311.
- the terminal device After completing the adjustment of the i-th image frame, the terminal device will perform the execution on each image frame in the i+1-th image frame, the i+2-th image frame, ..., the i+j-1-th image frame Similar to the operations from steps 301 to 309, if the terminal device determines that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determines that j-1 is the fifth The threshold value is equivalent to determining that from the i+jth image frame, no image processing is required for subsequent image frames.
- the terminal device determines that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determines that j-1 is the fifth threshold, then determines that subsequent image frames no longer need to be used. Perform image processing. Therefore, after acquiring the i+jth image frame (without performing step 302), the terminal device directly sends the unprocessed i+jth image frame to the HMD, so that the HMD displays the original i+jth image frame .
- the terminal device has just completed the parameter adjustment of the 100th image frame, and this adjustment is taken as the latest adjustment operation of the terminal device. Taking the latest adjustment operation as the reference point, if the terminal device determines that the proportion of black pixels in the 101st image frame to the 300th image frame is smaller than the first threshold, it will default from the 301st image frame onwards.
- the image frames do not need to be processed, that is, the original subsequent image frames are directly sent to the HMD for display, thereby reducing the workload of the terminal device and further realizing energy saving.
- the brightness of the ith image frame is reduced to a third threshold to obtain the adjusted ith image frame. Then, the adjusted ith image frame is sent to the HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller.
- the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
- FIG. 4 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application. As shown in FIG. 4 , the apparatus includes:
- the first obtaining module 401 is used to obtain the proportion of black pixels of the ith image frame, and the proportion of black pixels is the sum of the number of black pixels of the ith image frame and the number of pixels of the ith image frame.
- the ratio between, i is an integer greater than or equal to 1.
- the adjustment module 402 is configured to reduce the contrast of the ith image frame to a second threshold if it is determined that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, and adjust the brightness of the ith image frame to a second threshold. Lower to the third threshold to get the adjusted ith image frame.
- the sending module 403 is configured to send the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame.
- the sending module 403 is further configured to send the ith image frame to the HMD if it is determined that the proportion of black pixels in the ith image frame is less than the first threshold, so that the HMD displays the ith image frame. image frames.
- the sending module 403 is further configured to determine that the proportion of black pixels from the first image frame to the i-1 th image frame is smaller than the first threshold, and determine that i-1 is the first image frame. If the threshold is four, the ith image frame is directly sent to the HMD, so that the HMD displays the ith image frame.
- the sending module 403 is further configured to determine that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determine j -1 is the fifth threshold, then after the i+j th image frame is acquired, the i+j th image frame is directly sent to the HMD, so that the HMD displays the i+j th image frame.
- the apparatus further includes: a second acquiring module 400, configured to acquire the i-th image frame.
- the sending module is further configured to directly send the ith image frame to the HMD if it is determined that i is greater than or equal to the sixth threshold, so that the HMD displays the ith image frame.
- the first obtaining module 401 is further configured to: obtain the RGB value of each pixel in the ith image frame, and determine the pixel with the RGB value of 0 as a black pixel. Get the number of black pixels in the ith image frame and the number of pixels in the ith image frame. According to the number of black pixels of the ith image frame and the number of pixels of the ith image frame, the proportion of black pixels of the ith image frame is determined.
- FIG. 5 is another schematic structural diagram of an apparatus for image processing provided by an embodiment of the present application.
- the apparatus may be a terminal device as shown in FIG. 3 , and the apparatus may include one or more processors 501 , a memory 502 , an input/output interface 503 , a wired or wireless network interface 504 , and a power supply 505 .
- the memory 502 may be ephemeral storage or persistent storage. Furthermore, the processor 501 may be configured to communicate with the memory 502 to execute a series of instruction operations in the memory 502 on the image processing apparatus.
- the processor 501 may execute the method steps in the foregoing embodiment shown in FIG. 3 , and details are not repeated here.
- the division of specific functional modules in the processor 501 may be similar to the division of functional modules of the first acquisition module, the second acquisition module, the adjustment module, the sending module and other modules described in FIG. 5 . Repeat.
- Embodiments of the present application further provide a computer-readable storage medium, including instructions, when the instructions are executed on a computer, the computer can execute the method shown in FIG. 3 .
- a fifth aspect of the embodiments of the present application provides a computer program product containing instructions, which, when executed on a computer, cause the computer to execute the method shown in FIG. 3 .
- the disclosed system, apparatus and method may be implemented in other manners.
- the apparatus embodiments described above are only illustrative.
- the division of the units is only a logical function division. In actual implementation, there may be other division methods.
- multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
- the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the above-mentioned integrated units can be realized in the form of hardware, and can also be realized in the form of software functional units.
- the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
- the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
- the aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Optics & Photonics (AREA)
- Control Of Indicators Other Than Cathode Ray Tubes (AREA)
Abstract
A method for image processing and a related device thereof, which may effectively weaken the influence of ghost images on visual effects, and improve the user experience. The method for image processing comprises: obtaining the proportion of black pixel points in an ith image frame (305), the proportion of black pixel points being the ratio of the number of black pixel points in the ith image frame to the number of pixel points in the ith image frame, wherein i is an integer greater than or equal to 1; if it is determined that the proportion of black pixel points in the ith image frame is greater than or equal to a first threshold (306), then reducing the contrast of the ith image frame to a second threshold and reducing the brightness of the ith image frame to a third threshold to obtain an adjusted ith image frame (307); and sending the adjusted ith image frame to a head-mounted display (HMD), so that the HMD displays the adjusted ith image frame (309).
Description
本申请要求于2020年8月26日提交中国专利局、申请号为202010874308.4、申请名称为“一种图像处理的方法及其相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on August 26, 2020 with the application number 202010874308.4 and titled "A method for image processing and related equipment", the entire contents of which are incorporated by reference in in this application.
本申请涉及虚拟现实(virtual reality,VR)技术领域,尤其涉及一种图像处理的方法及其相关设备。The present application relates to the technical field of virtual reality (VR), and in particular, to an image processing method and related equipment.
随着显示技术的进步,VR技术被越来越多的被应用于现实生活中,使用户能够享受到身临其境的视觉体验。在VR技术中,用户穿上头戴式显示器(head mount display,HMD)后,可通过终端设备向HMD发送想要观看的图像,以使得HMD显示该图像供用户观看。With the advancement of display technology, VR technology is more and more applied in real life, enabling users to enjoy an immersive visual experience. In VR technology, after a user puts on a head mount display (HMD), a terminal device can send an image to be viewed to the HMD, so that the HMD displays the image for the user to watch.
图1为本申请实施例提供的VR技术的一个示意图。如图1所示,HMD包括光源、镜片组和传感器。当HMD要显示图像时,先通过光源向镜片组发射光束。在光束进入镜片组后,其中一部分光束按照预先设置的路径达到传感器,这一部分光束可在传感器处形成目标图像(即图1中的实线部分)。然而,另一部分光束则不按照预先设置的路径进行传播,而是在各个镜片中经过多个反射和折射,最终在传感器处形成明显的鬼像(图1中的虚线部分)。此时,传感器给用户呈现的画面包含目标图像和鬼像,且鬼像在目标图像附近形成重影,影响用户的观感。FIG. 1 is a schematic diagram of a VR technology provided by an embodiment of the present application. As shown in Figure 1, an HMD includes a light source, a lens group, and a sensor. When the HMD wants to display an image, it first emits a light beam to the lens group through the light source. After the light beam enters the lens group, a part of the light beam reaches the sensor according to a preset path, and this part of the light beam can form a target image at the sensor (ie, the solid line part in Figure 1). However, the other part of the beam does not travel according to the preset path, but undergoes multiple reflections and refractions in various mirrors, and finally forms an obvious ghost image at the sensor (dotted line in Figure 1). At this time, the picture presented by the sensor to the user includes the target image and the ghost image, and the ghost image forms a ghost near the target image, which affects the user's perception.
因此,如何在VR技术中减小鬼像对视觉效果所造成的的影响,成为了亟待解决的问题。Therefore, how to reduce the impact of ghost images on visual effects in VR technology has become an urgent problem to be solved.
发明内容SUMMARY OF THE INVENTION
图像处理的方法及其相关设备,可有效削弱鬼像对视觉效果所造成的影响,提高用户体验。The image processing method and related equipment can effectively weaken the influence of ghost images on visual effects and improve user experience.
本申请实施例的第一方面提供了一种图像处理的方法,该方法包括:A first aspect of the embodiments of the present application provides an image processing method, the method comprising:
当用户需要在HMD上观看某个应用时,用户可在终端设备上启动该应用,使得终端设备对该应用的多个图像帧进行处理,再将图像帧发送至HMD进行显示。在图像帧处理过程中,终端设备可先获取该应用的第i个图像帧的黑像素点占比。其中,第i个图像帧的黑像素点占比为第i个图像帧的黑像素点的数量与第i个图像帧的像素点的数量之间的比值,i为大于或等于1的整数。When the user needs to watch an application on the HMD, the user can start the application on the terminal device, so that the terminal device processes multiple image frames of the application, and then sends the image frames to the HMD for display. In the process of image frame processing, the terminal device may first obtain the proportion of black pixels in the ith image frame of the application. The proportion of black pixels in the ith image frame is the ratio between the number of black pixels in the ith image frame and the number of pixels in the ith image frame, and i is an integer greater than or equal to 1.
然后,若终端设备确定第i个图像帧的黑像素点占比大于或等于第一阈值,则确定第i个图像帧中存在大面积黑色的区域以及一部分较亮的区域。若HMD直接显示第i个图像帧,较亮的区域所产生的鬼像投射在黑色的区域上,用户在视觉上会明显感受到鬼像的存在。此时,终端设备可将第i个图像帧的对比度降低至第二阈值,并将第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧。Then, if the terminal device determines that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, it is determined that there are large black areas and a part of brighter areas in the ith image frame. If the HMD directly displays the i-th image frame, the ghost image generated by the brighter area is projected on the black area, and the user will clearly feel the existence of the ghost image visually. At this time, the terminal device may reduce the contrast of the ith image frame to the second threshold, and reduce the brightness of the ith image frame to the third threshold, to obtain the adjusted ith image frame.
最后,终端设备将调整后的第i个图像帧发送至HMD,使得HMD显示调整后的第i个图像帧,以供用户观看。由于调整后的第i个图像帧相对于原始的第i个图像帧,降低了对比度和亮度,使得第i个图像帧中较亮的区域变得较为暗淡,且较亮的区域与黑色的区域之间的颜色差异变得较小。因此,当HMD显示调整后的第i个图像帧,较亮的区域所产生的鬼像即使投射在黑色的区域上,鬼像显得暗淡甚至消失,故可有效削弱鬼像对视觉效果所造成的影响,提高用户体验。Finally, the terminal device sends the adjusted ith image frame to the HMD, so that the HMD displays the adjusted ith image frame for the user to watch. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller. Therefore, when the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
在一种可能的实现方式中,获取第i个图像帧的黑像素点占比之后,方法还包括:若确定第i个图像帧的黑像素点占比小于第一阈值,则将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, after obtaining the proportion of black pixels in the ith image frame, the method further includes: if it is determined that the proportion of black pixels in the ith image frame is less than the first threshold, then The image frame is sent to the HMD, causing the HMD to display the ith image frame.
在一种可能的实现方式中,获取第i个图像帧的黑像素点占比之前,方法还包括:若确定第1个图像帧至第i-1个图像帧的黑像素点占比均小于第一阈值,且确定i-1为第四阈值,则在获取到第i个图像帧后,直接将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, before acquiring the proportion of black pixels of the ith image frame, the method further includes: if it is determined that the proportion of black pixels of the first image frame to the ith image frame is less than The first threshold is determined, and i-1 is determined to be the fourth threshold, after acquiring the ith image frame, the ith image frame is directly sent to the HMD, so that the HMD displays the ith image frame.
在一种可能的实现方式中,将调整后的第i个图像帧发送至头戴式显示器HMD之后,方法还包括:若确定第i+1个图像帧至第i+j-1个图像帧的黑像素点占比均小于第一阈值,且确定j-1为第五阈值,则在获取到第i+j个图像帧后,直接将第i+j个图像帧发送至HMD,使得HMD显示第i+j个图像帧。In a possible implementation manner, after sending the adjusted i-th image frame to the head-mounted display HMD, the method further includes: if determining the i+1-th image frame to the i+j-1-th image frame The proportion of black pixels is less than the first threshold, and it is determined that j-1 is the fifth threshold, then after the i+jth image frame is obtained, the i+jth image frame is directly sent to the HMD, so that the HMD Display the i+j th image frame.
在一种可能的实现方式中,获取第i个图像帧的黑像素点占比之前,方法还包括:获取第i个图像帧;若确定i大于或等于第六阈值,则直接将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, before acquiring the proportion of black pixels of the i-th image frame, the method further includes: acquiring the i-th image frame; if it is determined that i is greater than or equal to the sixth threshold, directly converting the i-th image frame The image frame is sent to the HMD, causing the HMD to display the ith image frame.
在一种可能的实现方式中,获取第i个图像帧的黑像素点占比包括:获取第i个图像帧中各个像素点的红绿蓝RGB值,并将RGB值为0的像素点确定为黑像素点;获取第i个图像帧的黑像素点的数量,以及第i个图像帧的像素点的数量;根据第i个图像帧的黑像素点的数量以及第i个图像帧的像素点的数量,确定第i个图像帧的黑像素点占比。In a possible implementation manner, acquiring the proportion of black pixels in the i-th image frame includes: acquiring the red, green, and blue RGB values of each pixel in the i-th image frame, and determining the pixels whose RGB value is 0. is a black pixel; obtain the number of black pixels of the ith image frame and the number of pixels of the ith image frame; according to the number of black pixels of the ith image frame and the pixels of the ith image frame The number of points to determine the proportion of black pixels in the i-th image frame.
本申请实施例的第二方面提供了一种图像处理的装置,该装置包括:A second aspect of the embodiments of the present application provides an apparatus for image processing, the apparatus comprising:
第一获取模块,用于获取第i个图像帧的黑像素点占比,黑像素点占比为第i个图像帧的黑像素点的数量与第i个图像帧的像素点的数量之间的比值,i为大于或等于1的整数。The first obtaining module is used to obtain the proportion of black pixels of the ith image frame, and the proportion of black pixels is between the number of black pixels of the ith image frame and the number of pixels of the ith image frame The ratio of , i is an integer greater than or equal to 1.
调整模块,用于若确定第i个图像帧的黑像素点占比大于或等于第一阈值,则将第i个图像帧的对比度降低至第二阈值,并将第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧。The adjustment module is configured to reduce the contrast of the ith image frame to the second threshold and reduce the brightness of the ith image frame if it is determined that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold To the third threshold, the adjusted i-th image frame is obtained.
发送模块,用于将调整后的第i个图像帧发送至头戴式显示器HMD,使得HMD显示调整后的第i个图像帧。The sending module is used for sending the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame.
从上述装置可以看出:若确定第i个图像帧的黑像素点占比大于或等于第一阈值,则将第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧。然后,将调整后的第i个图像帧发送至HMD,使得HMD显示调整后的第i个图像帧。由于调整后的第i个图像帧相对于原始的第i个图像帧,降低了对比度和亮度,使得第i个图像帧中较亮的区域 变得较为暗淡,且较亮的区域与黑色的区域之间的颜色差异变得较小。因此,当HMD显示调整后的第i个图像帧,较亮的区域所产生的鬼像即使投射在黑色的区域上,鬼像显得暗淡甚至消失,故可有效削弱鬼像对视觉效果所造成的影响,提高用户体验。It can be seen from the above device: if it is determined that the proportion of black pixels in the i-th image frame is greater than or equal to the first threshold, the brightness of the i-th image frame is reduced to the third threshold to obtain the adjusted i-th image frame. Then, the adjusted ith image frame is sent to the HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller. Therefore, when the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
在一种可能的实现方式中,发送模块,还用于若确定第i个图像帧的黑像素点占比小于第一阈值,则将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, the sending module is further configured to send the ith image frame to the HMD if it is determined that the proportion of black pixels in the ith image frame is less than the first threshold, so that the HMD displays the ith image frame. image frame.
在一种可能的实现方式中,发送模块,还用于若确定第1个图像帧至第i-1个图像帧的黑像素点占比均小于第一阈值,且确定i-1为第四阈值,则直接将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, the sending module is further configured to determine that the proportion of black pixels from the first image frame to the i-1 th image frame is smaller than the first threshold, and determine that i-1 is the fourth image frame. If the threshold is set, the ith image frame is directly sent to the HMD, so that the HMD displays the ith image frame.
在一种可能的实现方式中,发送模块,还用于若确定第i+1个图像帧至第i+j-1个图像帧的黑像素点占比均小于第一阈值,且确定j-1为第五阈值,则在获取到第i+j个图像帧后,直接将第i+j个图像帧发送至HMD,使得HMD显示第i+j个图像帧。In a possible implementation manner, the sending module is further configured to, if it is determined that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determine that the j- If 1 is the fifth threshold, after the i+j th image frame is acquired, the i+j th image frame is directly sent to the HMD, so that the HMD displays the i+j th image frame.
在一种可能的实现方式中,该装置还包括:第二获取模块,用于获取第i个图像帧。发送模块,还用于若确定i大于或等于第六阈值,则直接将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, the apparatus further includes: a second acquiring module, configured to acquire the i-th image frame. The sending module is further configured to directly send the ith image frame to the HMD if it is determined that i is greater than or equal to the sixth threshold, so that the HMD displays the ith image frame.
在一种可能的实现方式中,第一获取模块,还用于:获取第i个图像帧中各个像素点的RGB值,并将RGB值为0的像素点确定为黑像素点。获取第i个图像帧的黑像素点的数量,以及第i个图像帧的像素点的数量。根据第i个图像帧的黑像素点的数量以及第i个图像帧的像素点的数量,确定第i个图像帧的黑像素点占比。In a possible implementation manner, the first obtaining module is further configured to: obtain the RGB value of each pixel point in the ith image frame, and determine the pixel point with the RGB value of 0 as a black pixel point. Get the number of black pixels in the ith image frame and the number of pixels in the ith image frame. According to the number of black pixels of the ith image frame and the number of pixels of the ith image frame, the proportion of black pixels of the ith image frame is determined.
本申请实施例的第三方面提供了一种图像处理的装置,该装置包括:A third aspect of the embodiments of the present application provides an apparatus for image processing, the apparatus comprising:
一个或一个以***处理器,存储器,输入输出接口,有线或无线网络接口,电源;One or more central processing units, memory, input and output interface, wired or wireless network interface, power supply;
存储器为短暂存储存储器或持久存储存储器;The memory is either ephemeral storage storage or persistent storage storage;
中央处理器配置为与存储器通信,在图像处理的装置上执行存储器中的指令操作以执行第一方面或第一方面的任一种可能的实现方式中的方法。The central processing unit is configured to communicate with the memory, and execute the instruction operations in the memory on the image processing apparatus to perform the first aspect or the method of any possible implementation of the first aspect.
本申请实施例的第四方面提供了一种计算机可读存储介质,包括指令,当指令在计算机上运行时,使得计算机执行如第一方面或第一方面的任一种可能的实现方式中的方法。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, including instructions, when the instructions are executed on a computer, the computer is made to execute the first aspect or any possible implementation manner of the first aspect. method.
本申请实施例的第五方面提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如第一方面或第一方面的任一种可能的实现方式中的方法。A fifth aspect of the embodiments of the present application provides a computer program product containing instructions, which, when executed on a computer, cause the computer to execute the method in the first aspect or any possible implementation manner of the first aspect.
从以上技术方案可以看出,本申请实施例具有以下优点:As can be seen from the above technical solutions, the embodiments of the present application have the following advantages:
本申请实施例中,若终端设备确定第i个图像帧的黑像素点占比大于或等于第一阈值,则将第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧。然后,终端设备将调整后的第i个图像帧发送至HMD,使得HMD显示调整后的第i个图像帧。由于调整后的第i个图像帧相对于原始的第i个图像帧,降低了对比度和亮度,使得第i个图像帧中较亮的区域变得较为暗淡,且较亮的区域与黑色的区域之间的颜色差异变得较小。因此,当HMD显示调整后的第i个图像帧,较亮的区域所产生的鬼像即使投射在黑色的区域上,鬼像显得暗淡甚至消失,故可有效削弱鬼像对视觉效果所造成的影响,提高用户体验。In this embodiment of the present application, if the terminal device determines that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, it reduces the brightness of the ith image frame to the third threshold to obtain the adjusted ith image frame. image frame. Then, the terminal device sends the adjusted ith image frame to the HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller. Therefore, when the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
图1为本申请实施例提供的VR技术的一个示意图;FIG. 1 is a schematic diagram of a VR technology provided by an embodiment of the present application;
图2为本申请实施例提供的VR***的一个示意图;2 is a schematic diagram of a VR system provided by an embodiment of the present application;
图3为本申请实施例提供的图像处理的方法的一个流程示意图;3 is a schematic flowchart of an image processing method provided by an embodiment of the present application;
图4为本申请实施例提供的图像处理的装置的一个结构示意图;FIG. 4 is a schematic structural diagram of an apparatus for image processing provided by an embodiment of the present application;
图5为本申请实施例提供的图像处理的装置的另一结构示意图。FIG. 5 is another schematic structural diagram of an apparatus for image processing provided by an embodiment of the present application.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行详细描述。The technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings in the embodiments of the present application.
本申请实施例可应用于VR***中。图2为本申请实施例提供的VR***的一个示意图,如图2所示,该***包括:HMD和终端设备,其中,HMD和终端设备通信连接,二者可以进行信息交互。为了方便说明,下文以用户需要通过VR技术观看某个应用(例如,某个软件、某个视频等等)的场景进行介绍。用户在终端设备上启动想观看的应用后,终端设备可向HMD逐帧发送该应用的图像帧。用户所穿戴的HMD在接收到图像帧后,可显示图像帧供用户观看。因此,当HMD持续显示该应用的连续多个图像帧时,用户则可以观看流畅的应用播放画面,从而体验VR技术带来的真实体验。The embodiments of the present application can be applied to a VR system. FIG. 2 is a schematic diagram of a VR system provided by an embodiment of the present application. As shown in FIG. 2 , the system includes: an HMD and a terminal device, wherein the HMD and the terminal device are communicatively connected, and the two can exchange information. For the convenience of description, the following description is based on a scenario where a user needs to watch a certain application (eg, a certain software, a certain video, etc.) through the VR technology. After the user starts the application he wants to watch on the terminal device, the terminal device can send the image frame of the application to the HMD frame by frame. After receiving the image frame, the HMD worn by the user can display the image frame for the user to watch. Therefore, when the HMD continues to display multiple consecutive image frames of the application, the user can watch the smooth application playback screen, thereby experiencing the real experience brought by the VR technology.
然而,当HMD显示图像帧的时候,HMD的光源发射的光束可能不按预先设置的路径完成传播,导致最终呈现给用户的画面中存在鬼像,影响用户的观感。为了减小鬼像对视觉效果所造成的影响,本申请实施例提供了一种图像处理的方法。However, when the HMD displays the image frame, the light beam emitted by the light source of the HMD may not complete the propagation according to the preset path, resulting in ghost images in the picture finally presented to the user, which affects the user's perception. In order to reduce the impact of ghost images on visual effects, an embodiment of the present application provides an image processing method.
图3为本申请实施例提供的图像处理的方法的一个流程示意图。如图3所示,该方法包括:FIG. 3 is a schematic flowchart of an image processing method provided by an embodiment of the present application. As shown in Figure 3, the method includes:
301、获取第i个图像帧,i为大于或等于1的整数。301. Acquire the ith image frame, where i is an integer greater than or equal to 1.
本实施例中,当用户启动终端设备上的某个应用后,终端设备可获取该应用的第i个图像帧,i为大于或等于1的整数。具体地,终端设备可逐帧获取应用的每一个图像帧,例如,终端设备可依次获取到应用的第1个图像帧、第2个图像帧、第3个图像帧、…、第n个图像帧等等。需要说明的是,应用的连续多个图像帧在经过HMD显示后,可以给用户呈现动态的播放画面,给予用户真实的观看体验。In this embodiment, after the user starts an application on the terminal device, the terminal device can acquire the ith image frame of the application, where i is an integer greater than or equal to 1. Specifically, the terminal device may acquire each image frame of the application frame by frame, for example, the terminal device may sequentially acquire the first image frame, the second image frame, the third image frame, ..., the nth image of the application frame and so on. It should be noted that, after multiple consecutive image frames of the application are displayed by the HMD, a dynamic playback picture can be presented to the user, giving the user a real viewing experience.
302、判断i是否大于或等于第六阈值,若不是,则执行步骤303,若是,则执行步骤304。302. Determine whether i is greater than or equal to the sixth threshold, if not, execute step 303, and if so, execute step 304.
终端设备在获取到应用的第i个图像帧后,可判断i是否大于或等于第六阈值,若i小于第六阈值,则终端设备初步确定需执行图像处理功能,若i大于或等于第六阈值,则终端设备确定不需执行图像处理功能。具体地,可根据实际需求提前为终端设备设置图像帧的帧号阈值(即第六阈值),从而帧号小于第六阈值的图像帧则需要进行图像处理(即步骤305至步骤309),帧号等于或大于第六阈值的图像帧不需进行图像处理。After acquiring the i-th image frame of the application, the terminal device can determine whether i is greater than or equal to the sixth threshold. If i is less than the sixth threshold, the terminal device preliminarily determines that the image processing function needs to be performed. threshold, the terminal device determines that the image processing function does not need to be performed. Specifically, the frame number threshold (that is, the sixth threshold) of the image frame can be set for the terminal device in advance according to the actual requirements, so that the image frame whose frame number is less than the sixth threshold needs to be processed (that is, steps 305 to 309), and the frame Image frames with numbers equal to or greater than the sixth threshold do not require image processing.
例如,某个应用具有100000个图像帧,为了减少终端设备的工作量,可提前设置第六阈值为2001。因此,终端设备在获取到第1个图像帧至第2000个图像帧中的任意一个图像帧时,由于这部分图像帧的帧号均小于2001,终端设备在获取到这部分图像帧中的任 意一个后,则初步确定需要进行图像处理。终端设备在获取到第2001个图像帧至第100000个图像帧时,由于这部分图像帧的帧号均大于或等于2001,终端设备在获取到这部分图像帧中的任意一个后,则确定不需要进行图像处理。For example, if an application has 100,000 image frames, in order to reduce the workload of the terminal device, the sixth threshold may be set to 2001 in advance. Therefore, when the terminal device acquires any image frame from the first image frame to the 2000th image frame, since the frame numbers of these image frames are all less than 2001, the terminal device acquires any image frame in this part of the image frame. After one, it is preliminarily determined that image processing is required. When the terminal device acquires the 2001st image frame to the 100000th image frame, since the frame numbers of these image frames are all greater than or equal to 2001, after the terminal device acquires any one of these image frames, it is determined not to Image processing is required.
303、判断第1个图像帧至第i-1个图像帧的黑像素点占比是否均小于第一阈值,且i-1是否为第四阈值,若不是,则执行步骤305,若是,则执行步骤304。303. Determine whether the proportion of black pixels from the first image frame to the i-1th image frame is smaller than the first threshold, and whether i-1 is the fourth threshold, if not, then perform step 305, if so, then Step 304 is performed.
在终端设备初步确定第i个图像需要进行图像处理后,则再次判断第i个图像帧是否需要进行图像处理。具体地,终端设备可先获取第1个图像帧至第i-1个图像帧之前的处理情况,并判断是否满足以下条件:第1个图像帧至第i-1个图像帧的黑像素点占比均小于第一阈值(第一阈值为根据实际需求提前设置的黑像素点占比阈值),且i-1为第四阈值。若满足前述条件,则终端设备最终确定第i个图像不需要进行图像处理,若不满足前述条件,则终端设备最终确定第i个图像需要进行图像处理。After the terminal device preliminarily determines that the i-th image needs to be image-processed, it determines again whether the i-th image frame needs to be image-processed. Specifically, the terminal device may first obtain the processing conditions before the first image frame to the i-1th image frame, and determine whether the following conditions are met: the black pixels of the first image frame to the i-1th image frame The proportions are all smaller than the first threshold (the first threshold is a threshold for the proportion of black pixels set in advance according to actual requirements), and i-1 is the fourth threshold. If the aforementioned conditions are satisfied, the terminal device finally determines that the i-th image does not need image processing, and if the aforementioned conditions are not satisfied, the terminal device finally determines that the i-th image requires image processing.
例如,设第四阈值为60(第四阈值可根据实际需求进行设置,此处不做限定)。当获取到第i个图像帧时(i为61,且i小于第六阈值),说明终端设备已对第1个图像帧至第60个图像帧完成了图像处理。此时,终端设备可获取第1个图像帧至第60个图像帧的图像处理情况,若终端设备确定这部分图像帧中的每个图像帧的黑像素点占比均小于第一阈值,则可最终确定该应用从第i个图像帧起,第i个图像帧以及后续的图像帧均不再需要进行图像处理。若终端设备确定这部分图像帧中的每个图像帧的黑像素点占比并非均小于第一阈值,则可确定该应用从第i个图像帧需要进行图像处理。For example, set the fourth threshold to be 60 (the fourth threshold can be set according to actual requirements, which is not limited here). When the i-th image frame is acquired (i is 61, and i is less than the sixth threshold), it means that the terminal device has completed image processing on the first to 60th image frames. At this time, the terminal device can obtain the image processing conditions of the first image frame to the 60th image frame. If the terminal device determines that the proportion of black pixels in each image frame in this part of the image frames is less than the first threshold, then It can be finally determined that starting from the ith image frame, the application does not need to perform image processing on the ith image frame and subsequent image frames. If the terminal device determines that the proportion of black pixels in each image frame in this part of the image frames is not all less than the first threshold, it can determine that the application needs to perform image processing from the ith image frame.
值得注意的是,应用中任意一个图像帧的黑像素点占比指该图像帧的黑像素点的数量与该图像帧的像素点的数量之间的比值。具体地,可先获取该图像帧所有像素点的RGB值,并将RGB值为0的像素点确定为黑像素点。然后,获取该图像帧的黑像素点的数量,以及该图像帧的像素点的数量。最后,根据该图像帧的黑像素点的数量以及该图像帧的像素点的数量,确定该图像帧的黑像素点占比。It is worth noting that the proportion of black pixels in any image frame in the application refers to the ratio between the number of black pixels in the image frame and the number of pixels in the image frame. Specifically, the RGB values of all pixels of the image frame may be obtained first, and the pixels with the RGB value of 0 are determined as black pixels. Then, the number of black pixels of the image frame and the number of pixels of the image frame are obtained. Finally, the proportion of black pixels in the image frame is determined according to the number of black pixels in the image frame and the number of pixels in the image frame.
可以理解的是,若某个图像帧的黑像素点占比大于或等于第一阈值,说明该图像帧中存在大面积黑色的区域以及一小部分较亮的区域,此类图像帧的鬼像比较明显,通常需要进行图像处理,若某个图像帧的黑像素点占比小于第一阈值,说明该图像帧中黑色的区域的大小以及较亮的区域的大小之间的差距较小,此类图像帧的鬼像比较不明显,通常不需进行图像处理。因此,终端设备若判断某个应用刚启动后的前若干图像帧的黑像素点占比均小于第一阈值,则默认后续的图像帧均不需要进行图像处理。例如,应用的启动画面通常为最可能出现鬼像的画面(启动画面中的背景为黑色且画面仅包含应用的logo),若终端设备判断该应用刚启动后的连续60个图像帧的黑像素点占比均小于第一阈值,则默认该应用从第61个图像帧起,后续图像帧均不需要进行图像处理,从而减小终端设备的工作量,以实现节能。It is understandable that if the proportion of black pixels in an image frame is greater than or equal to the first threshold, it means that there are large black areas and a small part of brighter areas in the image frame, and ghost images of such image frames are Obviously, image processing is usually required. If the proportion of black pixels in an image frame is less than the first threshold, it means that the gap between the size of the black area and the size of the brighter area in the image frame is small. Image-like frame ghosts are less obvious and usually do not require image processing. Therefore, if the terminal device determines that the proportion of black pixels in the first several image frames immediately after an application is started is smaller than the first threshold, it defaults that no image processing is required for the subsequent image frames. For example, the startup screen of an application is usually the one most likely to have ghost images (the background in the startup screen is black and the screen only contains the logo of the application). If the percentage of points is less than the first threshold, it is assumed that the application starts from the 61st image frame, and subsequent image frames do not need to perform image processing, thereby reducing the workload of the terminal device and achieving energy saving.
304、直接将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。304. Directly send the ith image frame to the HMD, so that the HMD displays the ith image frame.
若步骤302中终端设备确定第i个图像帧不需进行图像处理,或步骤304中终端设备确定第i个图像帧不需进行图像处理,则终端设备直接将未处理的第i个图像帧发送至HMD,使得HMD显示未经过处理的第i个图像帧(即应用中原始的第i个图像帧),供用户 观看。If the terminal device determines in step 302 that image processing is not required for the i-th image frame, or if the terminal device determines in step 304 that image processing is not required for the i-th image frame, the terminal device directly sends the unprocessed i-th image frame to to the HMD, so that the HMD displays the unprocessed ith image frame (ie, the original ith image frame in the application) for viewing by the user.
305、获取第i个图像帧的黑像素点占比。305. Obtain the proportion of black pixels of the ith image frame.
终端设备最终确定第i个图像帧需要进行图像处理后,则先获取第i个图像帧的黑像素点占比,第i个图像帧的黑像素点占比为第i个图像帧的黑像素点的数量与第i个图像帧的像素点的数量之间的比值。应理解,黑色像素点占比的计算方法可参考步骤303中的相关说明,此处不再赘述。After the terminal device finally determines that the ith image frame needs image processing, it first obtains the proportion of black pixels of the ith image frame, and the proportion of black pixels of the ith image frame is the black pixel of the ith image frame. The ratio between the number of points and the number of pixels in the ith image frame. It should be understood that, for the calculation method of the proportion of black pixels, reference may be made to the relevant description in step 303, and details are not repeated here.
306、判断第i个图像帧的黑像素点占比是否大于或等于第一阈值,若是,则执行步骤307,若不是,则执行步骤308。306. Determine whether the proportion of black pixels in the i-th image frame is greater than or equal to the first threshold, and if so, execute step 307, and if not, execute step 308.
终端设备在得到第i个图像帧的黑像素点占比后,则判断第i个图像帧的黑像素点占比是否大于或等于第一阈值。After obtaining the proportion of black pixels of the ith image frame, the terminal device determines whether the proportion of black pixels of the ith image frame is greater than or equal to the first threshold.
307、将第i个图像帧的对比度降低至第二阈值,并将第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧。307. Reduce the contrast of the ith image frame to a second threshold, and reduce the brightness of the ith image frame to a third threshold, to obtain an adjusted ith image frame.
若终端设备确定第i个图像帧的黑像素点占比大于或等于第一阈值,则对第i个图像帧的参数进行调整。具体地,终端设备将第i个图像帧的对比度降低至第二阈值(第二阈值为根据实际需求设置的对比度阈值),并将第i个图像帧的亮度降低至第三阈值(第三阈值为根据实际需求设置的亮度阈值),得到调整后的第i个图像帧。If the terminal device determines that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, it adjusts the parameters of the ith image frame. Specifically, the terminal device reduces the contrast of the ith image frame to a second threshold (the second threshold is a contrast threshold set according to actual requirements), and reduces the brightness of the ith image frame to a third threshold (the third threshold is the brightness threshold set according to the actual demand), and the adjusted i-th image frame is obtained.
具体地,在调整第i个图像帧的对比度和亮度时,通常是动态调整的过程。例如,终端设备可调用第一平滑函数,将第i个图像帧的对比度从当前值逐渐降低至第二阈值。又如,终端设备可调用第二平滑函数,将第i个图像帧的亮度从当前值逐渐降低至第三阈值等等。Specifically, when adjusting the contrast and brightness of the ith image frame, it is usually a process of dynamic adjustment. For example, the terminal device may call the first smoothing function to gradually reduce the contrast of the ith image frame from the current value to the second threshold. For another example, the terminal device may call the second smoothing function to gradually reduce the brightness of the ith image frame from the current value to the third threshold and so on.
308、将第i个图像帧发送至HMD,使得HMD显示所述第i个图像帧。308. Send the ith image frame to the HMD, so that the HMD displays the ith image frame.
若终端设备确定第i个图像帧的黑像素点占比小于第一阈值,终端设备将已处理(即已经经过黑色像素点占比的判断)但未调整(不需进行参数调整)的第i个图像帧发送至HMD(即应用中原始的第i个图像帧),供用户观看。If the terminal device determines that the proportion of black pixels in the i-th image frame is less than the first threshold, the terminal device will process the i-th image frame that has been processed (that is, has been judged for the proportion of black pixels) but has not been adjusted (parameter adjustment is not required). The image frames are sent to the HMD (that is, the original i-th image frame in the application) for viewing by the user.
309、将调整后的第i个图像帧发送至头戴式显示器HMD,使得HMD显示调整后的第i个图像帧。309. Send the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame.
得到调整后的第i个图像帧后,终端设备将调整后的第i个图像帧发送至头戴式显示器HMD,使得HMD显示调整后的第i个图像帧。由于调整后的第i个图像帧相对于原始的第i个图像帧,降低了对比度和亮度,使得第i个图像帧中较亮的区域变得较为暗淡,且较亮的区域与黑色的区域之间的颜色差异变得较小。因此,当HMD显示调整后的第i个图像帧,较亮的区域所产生的鬼像即使投射在黑色的区域上,鬼像显得暗淡甚至消失。After obtaining the adjusted ith image frame, the terminal device sends the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller. Therefore, when the HMD displays the ith image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image appears dim or even disappears.
310、判断第i+1个图像帧至第i+j-1个图像帧的黑像素点占比是否均小于第一阈值,且j-1是否为第五阈值,若是,则执行步骤311。310. Determine whether the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and whether j-1 is the fifth threshold, and if so, go to step 311.
在完成第i个图像帧的调整后,则终端设备会对第i+1个图像帧、第i+2个图像帧、…、第i+j-1个图像帧中的每个图像帧执行如同步骤301至步骤309的操作,若终端设备确定第i+1个图像帧至第i+j-1个图像帧的黑像素点占比均小于第一阈值,且确定j-1为第五阈值,相当于确定从第i+j个图像帧起,后续图像帧均不再需进行图像处理。After completing the adjustment of the i-th image frame, the terminal device will perform the execution on each image frame in the i+1-th image frame, the i+2-th image frame, ..., the i+j-1-th image frame Similar to the operations from steps 301 to 309, if the terminal device determines that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determines that j-1 is the fifth The threshold value is equivalent to determining that from the i+jth image frame, no image processing is required for subsequent image frames.
311、在获取到第i+j个图像帧后,直接将第i+j个图像帧发送至HMD,使得HMD显示第i+j个图像帧。311. After acquiring the i+j th image frame, directly send the i+j th image frame to the HMD, so that the HMD displays the i+j th image frame.
终端设备确定第i+1个图像帧至第i+j-1个图像帧的黑像素点占比均小于第一阈值,且确定j-1为第五阈值,则确定后续图像帧不再需进行图像处理。因此,终端设备在获取到第i+j个图像帧后(不执行步骤302),直接将未处理的第i+j个图像帧发送至HMD,使得HMD显示原始的第i+j个图像帧。The terminal device determines that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determines that j-1 is the fifth threshold, then determines that subsequent image frames no longer need to be used. Perform image processing. Therefore, after acquiring the i+jth image frame (without performing step 302), the terminal device directly sends the unprocessed i+jth image frame to the HMD, so that the HMD displays the original i+jth image frame .
例如,设第五阈值为200,且i为100,且终端设备刚完成对第100个图像帧的参数调整,以该次调整作为终端设备最近一次的调整操作。以最近一次调整操作为参考点,若接下来终端设备确定第101个图像帧至第300个图像帧的黑像素点占比均小于第一阈值,则默认从第301个图像帧起,后续的图像帧均不需在进行图像处理,即直接发送原始的后续图像帧至HMD进行显示,从而减小终端设备的工作量,以进一步实现节能。For example, suppose that the fifth threshold is 200, i is 100, and the terminal device has just completed the parameter adjustment of the 100th image frame, and this adjustment is taken as the latest adjustment operation of the terminal device. Taking the latest adjustment operation as the reference point, if the terminal device determines that the proportion of black pixels in the 101st image frame to the 300th image frame is smaller than the first threshold, it will default from the 301st image frame onwards. The image frames do not need to be processed, that is, the original subsequent image frames are directly sent to the HMD for display, thereby reducing the workload of the terminal device and further realizing energy saving.
本实施例中,若确定第i个图像帧的黑像素点占比大于或等于第一阈值,则将第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧。然后,将调整后的第i个图像帧发送至HMD,使得HMD显示调整后的第i个图像帧。由于调整后的第i个图像帧相对于原始的第i个图像帧,降低了对比度和亮度,使得第i个图像帧中较亮的区域变得较为暗淡,且较亮的区域与黑色的区域之间的颜色差异变得较小。因此,当HMD显示调整后的第i个图像帧,较亮的区域所产生的鬼像即使投射在黑色的区域上,鬼像显得暗淡甚至消失,故可有效削弱鬼像对视觉效果所造成的影响,提高用户体验。In this embodiment, if it is determined that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, the brightness of the ith image frame is reduced to a third threshold to obtain the adjusted ith image frame. Then, the adjusted ith image frame is sent to the HMD, so that the HMD displays the adjusted ith image frame. Since the adjusted ith image frame reduces the contrast and brightness relative to the original ith image frame, the brighter area in the ith image frame becomes darker, and the brighter area and the black area become darker. The color difference between becomes smaller. Therefore, when the HMD displays the i-th image frame after adjustment, even if the ghost image generated by the brighter area is projected on the black area, the ghost image will appear dim or even disappear, which can effectively weaken the visual effect caused by the ghost image. impact and improve user experience.
以上是对本申请实施例提供的图像处理的方法所进行的详细说明,以下将对本申请实施例提供的图像处理的装置进行介绍。图4为本申请实施例提供的图像处理的装置的一个结构示意图,如图4所示,该装置包括:The above is a detailed description of the image processing method provided by the embodiment of the present application, and the image processing apparatus provided by the embodiment of the present application will be introduced below. FIG. 4 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application. As shown in FIG. 4 , the apparatus includes:
第一获取模块401,用于获取第i个图像帧的黑像素点占比,黑像素点占比为第i个图像帧的黑像素点的数量与第i个图像帧的像素点的数量之间的比值,i为大于或等于1的整数。The first obtaining module 401 is used to obtain the proportion of black pixels of the ith image frame, and the proportion of black pixels is the sum of the number of black pixels of the ith image frame and the number of pixels of the ith image frame. The ratio between, i is an integer greater than or equal to 1.
调整模块402,用于若确定第i个图像帧的黑像素点占比大于或等于第一阈值,则将第i个图像帧的对比度降低至第二阈值,并将第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧。The adjustment module 402 is configured to reduce the contrast of the ith image frame to a second threshold if it is determined that the proportion of black pixels in the ith image frame is greater than or equal to the first threshold, and adjust the brightness of the ith image frame to a second threshold. Lower to the third threshold to get the adjusted ith image frame.
发送模块403,用于将调整后的第i个图像帧发送至头戴式显示器HMD,使得HMD显示调整后的第i个图像帧。The sending module 403 is configured to send the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame.
在一种可能的实现方式中,发送模块403,还用于若确定第i个图像帧的黑像素点占比小于第一阈值,则将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, the sending module 403 is further configured to send the ith image frame to the HMD if it is determined that the proportion of black pixels in the ith image frame is less than the first threshold, so that the HMD displays the ith image frame. image frames.
在一种可能的实现方式中,发送模块403,还用于若确定第1个图像帧至第i-1个图像帧的黑像素点占比均小于第一阈值,且确定i-1为第四阈值,则直接将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, the sending module 403 is further configured to determine that the proportion of black pixels from the first image frame to the i-1 th image frame is smaller than the first threshold, and determine that i-1 is the first image frame. If the threshold is four, the ith image frame is directly sent to the HMD, so that the HMD displays the ith image frame.
在一种可能的实现方式中,发送模块403,还用于若确定第i+1个图像帧至第i+j-1个图像帧的黑像素点占比均小于第一阈值,且确定j-1为第五阈值,则在获取到第i+j个图像帧后,直接将第i+j个图像帧发送至HMD,使得HMD显示第i+j个图像帧。In a possible implementation manner, the sending module 403 is further configured to determine that the proportion of black pixels from the i+1 th image frame to the i+j-1 th image frame is smaller than the first threshold, and determine j -1 is the fifth threshold, then after the i+j th image frame is acquired, the i+j th image frame is directly sent to the HMD, so that the HMD displays the i+j th image frame.
在一种可能的实现方式中,该装置还包括:第二获取模块400,用于获取第i个图像帧。发送模块,还用于若确定i大于或等于第六阈值,则直接将第i个图像帧发送至HMD,使得HMD显示第i个图像帧。In a possible implementation manner, the apparatus further includes: a second acquiring module 400, configured to acquire the i-th image frame. The sending module is further configured to directly send the ith image frame to the HMD if it is determined that i is greater than or equal to the sixth threshold, so that the HMD displays the ith image frame.
在一种可能的实现方式中,第一获取模块401,还用于:获取第i个图像帧中各个像素点的RGB值,并将RGB值为0的像素点确定为黑像素点。获取第i个图像帧的黑像素点的数量,以及第i个图像帧的像素点的数量。根据第i个图像帧的黑像素点的数量以及第i个图像帧的像素点的数量,确定第i个图像帧的黑像素点占比。In a possible implementation manner, the first obtaining module 401 is further configured to: obtain the RGB value of each pixel in the ith image frame, and determine the pixel with the RGB value of 0 as a black pixel. Get the number of black pixels in the ith image frame and the number of pixels in the ith image frame. According to the number of black pixels of the ith image frame and the number of pixels of the ith image frame, the proportion of black pixels of the ith image frame is determined.
需要说明的是,上述装置各模块/单元之间的信息交互、执行过程等内容,由于与本申请方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information exchange, execution process and other contents among the modules/units of the above-mentioned apparatus are based on the same concept as the method embodiments of the present application, and the technical effects brought by them are the same as those of the method embodiments of the present application, and the specific contents can be Refer to the descriptions in the method embodiments shown above in this application, and details are not repeated here.
图5为本申请实施例提供的图像处理的装置的另一结构示意图。如图5所示,该装置可以是如图3中的终端设备,该装置可包括一个或一个以上处理器501,存储器502,输入输出接口503,有线或无线网络接口504,电源505。FIG. 5 is another schematic structural diagram of an apparatus for image processing provided by an embodiment of the present application. As shown in FIG. 5 , the apparatus may be a terminal device as shown in FIG. 3 , and the apparatus may include one or more processors 501 , a memory 502 , an input/output interface 503 , a wired or wireless network interface 504 , and a power supply 505 .
存储器502可以是短暂存储或持久存储。更进一步地,处理器501可以配置为与存储器502通信,在图像处理的装置上执行存储器502中的一系列指令操作。The memory 502 may be ephemeral storage or persistent storage. Furthermore, the processor 501 may be configured to communicate with the memory 502 to execute a series of instruction operations in the memory 502 on the image processing apparatus.
本实施例中,处理器501可以执行前述图3所示实施例中的方法步骤,具体此处不再赘述。In this embodiment, the processor 501 may execute the method steps in the foregoing embodiment shown in FIG. 3 , and details are not repeated here.
本实施例中,处理器501中的具体功能模块划分可以与前述图5中所描述的第一获取模块、第二获取模块、调整模块、发送模块等模块的功能模块划分方式类似,此处不再赘述。In this embodiment, the division of specific functional modules in the processor 501 may be similar to the division of functional modules of the first acquisition module, the second acquisition module, the adjustment module, the sending module and other modules described in FIG. 5 . Repeat.
本申请实施例还提供了一种计算机可读存储介质,包括指令,当指令在计算机上运行时,使得计算机执行如图3所示的方法。Embodiments of the present application further provide a computer-readable storage medium, including instructions, when the instructions are executed on a computer, the computer can execute the method shown in FIG. 3 .
本申请实施例的第五方面提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如图3所示的方法。A fifth aspect of the embodiments of the present application provides a computer program product containing instructions, which, when executed on a computer, cause the computer to execute the method shown in FIG. 3 .
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的***,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system, device and unit described above may refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的***,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个***,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既 可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be realized in the form of hardware, and can also be realized in the form of software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, Read-Only Memory (ROM, Read-Only Memory), Random Access Memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program codes .
Claims (10)
- 一种图像处理的方法,其特征在于,所述方法包括:A method for image processing, characterized in that the method comprises:获取第i个图像帧的黑像素点占比,所述黑像素点占比为所述第i个图像帧的黑像素点的数量与所述第i个图像帧的像素点的数量之间的比值,i为大于或等于1的整数;Obtain the proportion of black pixels of the ith image frame, where the proportion of black pixels is the difference between the number of black pixels of the ith image frame and the number of pixels of the ith image frame. Ratio, i is an integer greater than or equal to 1;若确定所述第i个图像帧的黑像素点占比大于或等于第一阈值,则将所述第i个图像帧的对比度降低至第二阈值,并将所述第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧;If it is determined that the proportion of black pixels in the i-th image frame is greater than or equal to the first threshold, reduce the contrast of the i-th image frame to the second threshold, and reduce the brightness of the i-th image frame Reduce to the third threshold to obtain the adjusted i-th image frame;将所述调整后的第i个图像帧发送至头戴式显示器HMD,使得所述HMD显示所述调整后的第i个图像帧。Sending the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame.
- 根据权利要求1所述的方法,其特征在于,所述获取第i个图像帧的黑像素点占比之后,所述方法还包括:The method according to claim 1, wherein after acquiring the black pixel ratio of the i-th image frame, the method further comprises:若确定所述第i个图像帧的黑像素点占比小于所述第一阈值,则将所述第i个图像帧发送至所述HMD,使得所述HMD显示所述第i个图像帧。If it is determined that the proportion of black pixels in the ith image frame is less than the first threshold, the ith image frame is sent to the HMD, so that the HMD displays the ith image frame.
- 根据权利要求1或2所述的方法,其特征在于,所述获取第i个图像帧的黑像素点占比之前,所述方法还包括:The method according to claim 1 or 2, wherein before acquiring the proportion of black pixels of the i-th image frame, the method further comprises:若确定第1个图像帧至第i-1个图像帧的黑像素点占比均小于所述第一阈值,且确定i-1为第四阈值,则直接将所述第i个图像帧发送至所述HMD,使得所述HMD显示所述第i个图像帧。If it is determined that the proportion of black pixels from the first image frame to the i-1th image frame is smaller than the first threshold, and i-1 is determined to be the fourth threshold, the i-th image frame is directly sent to the HMD so that the HMD displays the i-th image frame.
- 根据权利要求1所述的方法,其特征在于,所述将所述调整后的第i个图像帧发送至头戴式显示器HMD之后,所述方法还包括:The method according to claim 1, wherein after sending the adjusted i-th image frame to the head-mounted display HMD, the method further comprises:若确定第i+1个图像帧至第i+j-1个图像帧的黑像素点占比均小于所述第一阈值,且确定j-1为第五阈值,则在获取到第i+j个图像帧后,直接将第i+j个图像帧发送至所述HMD,使得所述HMD显示所述第i+j个图像帧。If it is determined that the proportions of black pixels from the i+1 th image frame to the i+j-1 th image frame are all smaller than the first threshold, and it is determined that j-1 is the fifth threshold, then after obtaining the i+ After j image frames, the i+j th image frame is directly sent to the HMD, so that the HMD displays the i+j th image frame.
- 根据权利要求1至4任意一项所述的方法,其特征在于,所述获取第i个图像帧的黑像素点占比之前,所述方法还包括:The method according to any one of claims 1 to 4, wherein before acquiring the proportion of black pixels of the i-th image frame, the method further comprises:获取第i个图像帧;Get the i-th image frame;若确定i大于或等于第六阈值,则直接将所述第i个图像帧发送至所述HMD,使得所述HMD显示所述第i个图像帧。If it is determined that i is greater than or equal to the sixth threshold, the ith image frame is directly sent to the HMD, so that the HMD displays the ith image frame.
- 根据权利要求1至5任意一项所述的方法,其特征在于,所述获取第i个图像帧的黑像素点占比包括:The method according to any one of claims 1 to 5, wherein the obtaining the proportion of black pixels of the i-th image frame comprises:获取第i个图像帧中各个像素点的红绿蓝RGB值,并将RGB值为0的像素点确定为黑像素点;Obtain the red, green, and blue RGB values of each pixel in the i-th image frame, and determine the pixel with an RGB value of 0 as a black pixel;获取所述第i个图像帧的黑像素点的数量,以及所述第i个图像帧的像素点的数量;Obtain the number of black pixels of the ith image frame, and the number of pixels of the ith image frame;根据所述第i个图像帧的黑像素点的数量以及所述第i个图像帧的像素点的数量,确定所述第i个图像帧的黑像素点占比。According to the number of black pixels of the ith image frame and the number of pixels of the ith image frame, the proportion of black pixels of the ith image frame is determined.
- 一种图像处理的装置,其特征在于,所述装置包括:An image processing device, characterized in that the device comprises:第一获取模块,用于获取第i个图像帧的黑像素点占比,所述黑像素点占比为所述第 i个图像帧的黑像素点的数量与所述第i个图像帧的像素点的数量之间的比值,i为大于或等于1的整数;The first acquisition module is used to acquire the proportion of black pixels of the ith image frame, and the proportion of black pixels is the number of black pixels of the ith image frame and the ratio of the ith image frame. The ratio between the number of pixels, i is an integer greater than or equal to 1;调整模块,用于若确定所述第i个图像帧的黑像素点占比大于或等于第一阈值,则将所述第i个图像帧的对比度降低至第二阈值,并将所述第i个图像帧的亮度降低至第三阈值,得到调整后的第i个图像帧;an adjustment module, configured to reduce the contrast of the i-th image frame to a second threshold if it is determined that the proportion of black pixels in the i-th image frame is greater than or equal to a first threshold, and adjust the i-th image frame to a second threshold The brightness of each image frame is reduced to the third threshold to obtain the adjusted ith image frame;发送模块,用于将所述调整后的第i个图像帧发送至头戴式显示器HMD,使得所述HMD显示所述调整后的第i个图像帧。A sending module, configured to send the adjusted ith image frame to the head mounted display HMD, so that the HMD displays the adjusted ith image frame.
- 一种图像处理的装置,其特征在于,包括:A device for image processing, comprising:一个或一个以***处理器,存储器,输入输出接口,有线或无线网络接口,电源;One or more central processing units, memory, input and output interface, wired or wireless network interface, power supply;所述存储器为短暂存储存储器或持久存储存储器;the memory is a short-term storage memory or a persistent storage memory;所述中央处理器配置为与所述存储器通信,在所述图像处理的装置上执行所述存储器中的指令操作以执行权利要求1至6中任意一项所述的方法。The central processing unit is configured to communicate with the memory, and execute the operations of the instructions in the memory on the image processing apparatus to perform the method of any one of claims 1 to 6.
- 一种计算机可读存储介质,包括指令,当所述指令在计算机上运行时,使得计算机执行如权利要求1至6中任意一项所述的方法。A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of any one of claims 1 to 6.
- 一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如权利要求1至6中任意一项所述的方法。A computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of any one of claims 1 to 6.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010874308.4 | 2020-08-26 | ||
CN202010874308.4A CN114125424B (en) | 2020-08-26 | 2020-08-26 | Image processing method and related equipment thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022042212A1 true WO2022042212A1 (en) | 2022-03-03 |
Family
ID=80352659
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/109966 WO2022042212A1 (en) | 2020-08-26 | 2021-08-02 | Method for image processing and related device thereof |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN114125424B (en) |
WO (1) | WO2022042212A1 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116709003A (en) * | 2022-10-09 | 2023-09-05 | 荣耀终端有限公司 | Image processing method and electronic equipment |
CN116152473B (en) * | 2022-12-26 | 2023-08-08 | 深圳市数聚能源科技有限公司 | Method for converting two-dimensional picture into AR image to reduce black pixel interference |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102628993A (en) * | 2011-02-04 | 2012-08-08 | 精工爱普生株式会社 | Virtual image display device |
US20150192777A1 (en) * | 2014-01-09 | 2015-07-09 | Samsung Electronics Co., Ltd. | Wearable display apparatus |
US20170176745A1 (en) * | 2015-12-17 | 2017-06-22 | Yarn Chee Poon | Reducing ghost images |
CN107076989A (en) * | 2014-09-30 | 2017-08-18 | 索尼互动娱乐股份有限公司 | Corrected according to the real-time lens aberration of eye tracks |
US20180172981A1 (en) * | 2016-12-16 | 2018-06-21 | Fusao Ishii | Wearable display |
CN110554500A (en) * | 2018-05-31 | 2019-12-10 | 中强光电股份有限公司 | Head-mounted display device |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8085217B2 (en) * | 2006-08-08 | 2011-12-27 | Nvidia Corporation | System, method, and computer program product for compensating for crosstalk during the display of stereo content |
WO2010019922A1 (en) * | 2008-08-15 | 2010-02-18 | Real D | Enhanced ghost compensation for stereoscopic imagery |
KR101279659B1 (en) * | 2010-05-14 | 2013-06-27 | 엘지디스플레이 주식회사 | Stereoscopic image display and driving method thereof |
-
2020
- 2020-08-26 CN CN202010874308.4A patent/CN114125424B/en active Active
-
2021
- 2021-08-02 WO PCT/CN2021/109966 patent/WO2022042212A1/en active Application Filing
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102628993A (en) * | 2011-02-04 | 2012-08-08 | 精工爱普生株式会社 | Virtual image display device |
US20150192777A1 (en) * | 2014-01-09 | 2015-07-09 | Samsung Electronics Co., Ltd. | Wearable display apparatus |
CN107076989A (en) * | 2014-09-30 | 2017-08-18 | 索尼互动娱乐股份有限公司 | Corrected according to the real-time lens aberration of eye tracks |
US20170176745A1 (en) * | 2015-12-17 | 2017-06-22 | Yarn Chee Poon | Reducing ghost images |
US20180172981A1 (en) * | 2016-12-16 | 2018-06-21 | Fusao Ishii | Wearable display |
CN110554500A (en) * | 2018-05-31 | 2019-12-10 | 中强光电股份有限公司 | Head-mounted display device |
Also Published As
Publication number | Publication date |
---|---|
CN114125424B (en) | 2022-10-04 |
CN114125424A (en) | 2022-03-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11321906B2 (en) | Asynchronous time and space warp with determination of region of interest | |
US9805501B2 (en) | Image rendering method and apparatus | |
WO2022042212A1 (en) | Method for image processing and related device thereof | |
WO2020259402A1 (en) | Method and device for image processing, terminal device, medium, and wearable system | |
WO2020140758A1 (en) | Image display method, image processing method, and related devices | |
JP7101269B2 (en) | Pose correction | |
KR20210147868A (en) | Video processing method and device | |
WO2021169583A1 (en) | Virtual reality display device and control method therefor | |
US10650507B2 (en) | Image display method and apparatus in VR device, and VR device | |
KR20120012858A (en) | Apparatus and method for rendering object in 3d graphic terminal | |
EP3454202B1 (en) | Frame drop processing method and system for played ppt | |
US11126001B2 (en) | Image generating apparatus, head-mounted display, content processing system and image displaying method | |
CN110691231A (en) | Virtual reality playing system and synchronous playing method thereof | |
WO2020244470A1 (en) | Head-mountable display device and display method thereof | |
US20200066234A1 (en) | VR Drawing Method, Device, and System | |
KR20200053879A (en) | Apparatus and method for simultaneous control of heterogeneous cameras, and camera control client | |
CN115185083A (en) | Self-adaptive refresh rate and resolution rendering method for AR head-mounted display | |
EP3806026A1 (en) | Method and apparatus for enhancing video image quality | |
CN111367604A (en) | Processing method and device for file display, storage medium and terminal | |
US20240137482A1 (en) | Image generation device, program, image generation method, and image displaying system | |
US20240220010A1 (en) | Terminal apparatus and method of operating terminal apparatus | |
WO2017120753A1 (en) | Display method for display apparatus, display apparatus and virtual reality (vr) system | |
WO2023276566A1 (en) | Image display system and image display method | |
CN114866753A (en) | Projector image quality adjusting method and device and projector | |
CN118020043A (en) | Augmented reality and screen image rendering coordination |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21860052 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21860052 Country of ref document: EP Kind code of ref document: A1 |