Image contrast enhancement method and device, computer equipment and storage medium

By acquiring the initial image using a polarization camera, dividing the grayscale range based on light intensity information, and performing enhancement processing, the problem of low image contrast caused by overexposure in high-brightness areas in MR headsets is solved, thus improving image clarity and quality.

CN121660947APending Publication Date: 2026-03-13GRAVITYXR ELECTRONICS & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

When recording video, MR headsets may overexpose bright areas, causing underexposure in surrounding areas, resulting in low image contrast and poor image quality.

Method used

An initial image is acquired using a polarization camera. Based on the light intensity information under the polarization angle, alternative pixel values ​​for high grayscale and mid-to-low grayscale pixels are determined, grayscale ranges are divided, and the initial image is enhanced using the target pixel values.

Benefits of technology

It improves image contrast, making objects in the image more clearly visible and enhancing image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121660947A_ABST
    Figure CN121660947A_ABST
Patent Text Reader

Abstract

The invention provides an image contrast enhancement method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining an initial image through a polarization camera, and enabling pixels in the initial image to be divided into high-gray-scale pixels and medium-low-gray-scale pixels; determining an alternative pixel value of the high-gray-scale pixel based on the light intensity information under the polarization angle of the polarization camera; determining a first gray scale range of the high gray scale pixels and a second gray scale range of the middle and low gray scale pixels based on the replacement pixel values of the high gray scale pixels; and determining a target pixel value based on the replacement pixel value, the medium and low gray scale pixels, the first gray scale range and the second gray scale range, and performing enhancement processing on the initial image through the target pixel value to obtain a target image. According to the technical scheme provided by the embodiment of the invention, the effects of improving the contrast of the image and further improving the quality of the image can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of image processing technology, and in particular relates to an image contrast enhancement method, apparatus, computer equipment, and storage medium. Background Technology

[0002] In related technologies, imaging devices such as MR headsets typically require a frame rate of 90Hz or higher during video recording. This limits the exposure time of their built-in cameras. When the Video See-Through (VST) function is enabled, bright areas (such as windows during the day or displays in use) are easily overexposed, negatively impacting the user experience. If automatic exposure adjustment is used to correct these areas, the surrounding areas may be underexposed. This can result in a less dynamic range in the final image, leading to lower contrast and poorer image quality. Summary of the Invention

[0003] This application provides an implementation scheme that differs from related technologies, in order to solve the technical problem in related technologies that it is difficult for the imaging image to have a good dynamic range, resulting in low image contrast and poor image quality.

[0004] In a first aspect, this application provides an image contrast enhancement method, comprising:

[0005] An initial image is acquired using a polarization camera, where the pixels in the initial image can be divided into high grayscale pixels and medium-low grayscale pixels;

[0006] Based on the light intensity information under the polarization angle of the polarization camera, the alternative pixel values ​​of high grayscale pixels are determined.

[0007] Based on the alternative pixel values ​​of high grayscale pixels, the first grayscale range of high grayscale pixels and the second grayscale range of medium and low grayscale pixels are determined.

[0008] Based on the alternative pixel value, the low and medium grayscale pixels, the first grayscale range, and the second grayscale range, the target pixel value is determined so as to enhance the initial image with the target pixel value to obtain the target image.

[0009] In one embodiment, the method further includes:

[0010] Obtain the grayscale information of the initial image;

[0011] Based on grayscale information and a first preset threshold, the pixels in the initial image are divided into high grayscale pixels and medium-low grayscale pixels.

[0012] In one embodiment, the method further includes:

[0013] Sort the pixels in the initial image according to their pixel values ​​to obtain the first sorting result;

[0014] Obtain the first value, and use the grayscale information as the second value;

[0015] Determine whether the first value is less than the preset value. If so, take the sum of the pixel value at the position indicated by the second value in the first sorting result and the first value as the new first value, and take the result of subtracting 1 from the second value as the new second value. Return to the step of determining whether the first value is less than the preset value, until it is determined that the first value is not less than the preset value. Then, take the pixel value at the position indicated by the second value in the first sorting result as the first preset threshold.

[0016] In one embodiment, determining alternative pixel values ​​for high grayscale pixels based on light intensity information at the polarization angle of a polarization camera includes:

[0017] The light intensity information of high grayscale pixels under different polarization angles is sorted to obtain a second sorting result;

[0018] The light intensity information at the preset position is obtained from the second sorting result and used as the replacement pixel value for the high grayscale pixel.

[0019] In one embodiment, determining a first grayscale range for high-grayscale pixels and a second grayscale range for mid-to-low-grayscale pixels based on alternative pixel values ​​of high-grayscale pixels includes:

[0020] Determine the first difference between the largest and smallest alternative pixel values ​​among the alternative pixel values;

[0021] Determine the sum of the first difference and the first preset threshold;

[0022] Determine the ratio of grayscale information to the sum of the values;

[0023] Determine the product of the ratio and the difference;

[0024] The first grayscale range corresponding to high grayscale pixels and the second grayscale range corresponding to medium and low grayscale pixels are determined based on grayscale information and product.

[0025] In one embodiment, determining a first grayscale range corresponding to high grayscale pixels and a second grayscale range corresponding to mid-to-low grayscale pixels based on grayscale information and their product includes:

[0026] The first grayscale range corresponding to high grayscale pixels is determined by taking the second difference between the grayscale information and the product as the first starting point and the grayscale information as the first ending point.

[0027] Using the second preset threshold as the second starting point and the second difference as the second ending point, the second grayscale range corresponding to the low and medium grayscale pixels is determined.

[0028] In one embodiment, the target pixel value includes a first target pixel value and a second target pixel value;

[0029] The target pixel value is determined based on the substitute pixel value, mid-to-low grayscale pixels, the first grayscale range, and the second grayscale range, including:

[0030] Based on a preset mapping algorithm, the substitute pixel value is mapped to the first grayscale range to obtain the first target pixel value corresponding to the substitute pixel value in the first grayscale range;

[0031] Based on a preset mapping algorithm, the mid-to-low grayscale pixel values ​​corresponding to the mid-to-low grayscale pixels are mapped to the second grayscale range to obtain the second target pixel values ​​corresponding to the mid-to-low grayscale pixel values ​​in the second grayscale range.

[0032] In one embodiment, obtaining a target image by enhancing an initial image using target pixel values ​​includes:

[0033] The pixel values ​​of high grayscale pixels in the initial image are adjusted to the first target pixel values ​​corresponding to the high grayscale pixels, and the pixel values ​​of medium and low grayscale pixels in the initial image are adjusted to the second target pixel values ​​corresponding to the medium and low grayscale pixels, thus obtaining the target image.

[0034] Secondly, this application provides an image contrast enhancement device, comprising:

[0035] The acquisition module is used to acquire an initial image using a polarization camera, wherein the pixels in the initial image can be divided into high grayscale pixels and medium-low grayscale pixels;

[0036] The pixel value determination module is used to determine the alternative pixel value of high grayscale pixels based on the light intensity information under the polarization angle of the polarization camera.

[0037] The grayscale range determination module is used to determine the first grayscale range of high grayscale pixels and the second grayscale range of medium and low grayscale pixels based on the alternative pixel values ​​of high grayscale pixels.

[0038] The enhancement processing module is used to determine the target pixel value based on the substitute pixel value, the low and medium grayscale pixels, the first grayscale range, and the second grayscale range, so as to enhance the initial image with the target pixel value to obtain the target image.

[0039] Thirdly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the methods described above.

[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0041] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the methods described above.

[0042] The image contrast enhancement method, apparatus, computer equipment, and storage medium provided in this application include: firstly, acquiring an initial image using a polarization camera, wherein the pixels in the initial image can be divided into high grayscale pixels and mid-to-low grayscale pixels; then, determining alternative pixel values ​​for the high grayscale pixels based on the light intensity information under the polarization angle of the polarization camera; then, determining a first grayscale range for the high grayscale pixels and a second grayscale range for the mid-to-low grayscale pixels based on the alternative pixel values; and finally, determining target pixel values ​​based on the alternative pixel values, the mid-to-low grayscale pixels, the first grayscale range, and the second grayscale range. This scheme, which enhances the initial image using the target pixel values ​​to obtain a target image, can more accurately determine the alternative values ​​for the high grayscale pixels by considering light intensity information under multiple polarization angles. Furthermore, based on these alternative values, the pixel values ​​corresponding to the initial image are mapped to a larger range of pixel values, thereby increasing the range of pixel values ​​in the initial image, improving image contrast, making objects in the image more clearly visible, and enhancing image quality. Attached Figure Description

[0043] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:

[0044] Figure 1 A schematic flowchart of an image contrast enhancement method provided for an exemplary embodiment of this application;

[0045] Figure 2 A schematic diagram of the structure of a sensor for a polarization camera provided as an exemplary embodiment of this application;

[0046] Figure 3 A schematic flowchart of an image contrast enhancement method provided for an exemplary embodiment of this application;

[0047] Figure 4 A schematic diagram of the structure of an image contrast enhancement device provided for an exemplary embodiment of this application;

[0048] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0049] The embodiments of this application are described in detail below, with examples of these embodiments illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0050] The terms "first" and "second," etc., used in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the present application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0051] First, some terms used in the embodiments of this application will be explained below to facilitate understanding by those skilled in the art.

[0052] Mixed Reality (MR) enhances the realism of the user experience by presenting virtual scene information in a real scene, creating an interactive feedback loop between the real world, the virtual world, and the user.

[0053] Hertz (Hz) is the unit of frequency in the International System of Units (SI). It is a measure of the number of repetitions of a periodic variation per second.

[0054] Video See Through (VST) technology refers to the process of a camera capturing a real-world scene and then combining it with computational and computer graphics technology to display it on an opaque display.

[0055] Raw file image format (RAW) contains data processed from the image sensors of digital cameras, scanners, or film scanners.

[0056] Complementary metal-oxide-semiconductor (CMOS) is an image sensor used in digital photography.

[0057] Tone mapping is a computer graphics technique for approximating high dynamic range images on a medium with a limited dynamic range.

[0058] High Dynamic Range Imaging (HDRI or HDR) is a set of techniques used in computer graphics and cinematography to achieve a greater dynamic range of exposure (i.e., a greater difference between light and dark areas) than ordinary digital imaging techniques.

[0059] Low Dynamic Range (LDR) images refer to standard, ordinary images with limited dynamic range.

[0060] In related technologies, imaging devices such as MR headsets typically require a frame rate of 90Hz or higher during video recording. This limits the exposure time of their embedded cameras. When the Video See-Through (VST) function is enabled, bright areas (such as windows during the day or displays in use) are easily overexposed, negatively impacting the user experience. If automatic exposure adjustment is used to bring these areas to a normal state, the surrounding areas may be underexposed. This can result in a poor dynamic range in the final image, leading to low contrast and poor image quality. Therefore, this application provides an image processing method, apparatus, computer device, and computer medium to address the technical problem of poor dynamic range in imaging, resulting in low contrast and poor image quality.

[0061] The technical solution of this application and how it solves the above-mentioned technical problems will be described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0062] Figure 1 A flowchart illustrating an exemplary embodiment of this application provides an image processing method applicable to computer devices such as personal computers, tablets, and smartphones. The method includes at least the following steps S11-S14:

[0063] S11. Acquire the initial image obtained by the polarization camera.

[0064] The initial image can be a RAW image output from a polarization camera sensor, processed through an image processing pipeline. This initial image typically has a low dynamic range, meaning it contains a small range of brightness values. In images with low dynamic range, the range of brightness values ​​is limited, usually resulting in a lack of significant highlight and shadow details and an overall relatively flat brightness distribution.

[0065] In some embodiments, the computer device may be a device equipped with a polarization camera, that is, the computer device uses its own polarization camera to acquire initial images and perform image processing.

[0066] In other embodiments, the computer device may also be a device without a polarization camera, that is, the computer device can use the network to acquire an initial image from an external polarization camera, and then perform image processing on the initial image.

[0067] In some embodiments, the method further includes: acquiring grayscale information of an initial image; and dividing the pixels in the initial image into high grayscale pixels and medium-low grayscale pixels according to the grayscale information and a first preset threshold.

[0068] Specifically, the grayscale information of the initial image can be used to indicate the range of pixel values ​​in the initial image. For example, in an 8-bit grayscale image (meaning each pixel is represented by an 8-bit binary number), each pixel value is in the range of 0-255, representing a brightness level from the darkest (or blackest) to the brightest (or whitest). In other words, an 8-bit grayscale image is a digital image used to represent brightness, and the grayscale level of each pixel can be regarded as a number ranging from 0 to 255, where 0 represents the darkest (or blackest) and 255 represents the brightest (or whitest).

[0069] Based on the grayscale information and a preset threshold, the multiple pixels contained in the initial image are divided into multiple high grayscale pixels and multiple medium and low grayscale pixels;

[0070] Wherein, the plurality of high grayscale pixels are the plurality of pixels in the initial image whose pixel values ​​are higher than a preset threshold, and the plurality of medium and low grayscale pixels are the plurality of pixels in the initial image whose pixel values ​​are not higher than the preset threshold;

[0071] In some optional embodiments provided in this application, the method for determining the first preset threshold further includes the following steps S01-S04:

[0072] S01. Sort the pixels in the initial image according to their pixel values ​​to obtain the first sorting result;

[0073] The sorting methods include, but are not limited to, sorting by pixel value from largest to smallest and sorting by pixel value from smallest to largest.

[0074] In some embodiments, a grayscale histogram (Hist) can be calculated based on an initial image. The grayscale histogram Hist represents the distribution of each gray level (pixel value) in the initial image, and the calculated grayscale histogram Hist can be used as the sorting result. Specifically, the horizontal axis of the grayscale histogram Hist represents the grayscale level (e.g., the grayscale level can range from 0 to 255, corresponding to the pixel value range of an 8-bit grayscale image), and the vertical axis represents the frequency or number of pixels of each grayscale level in the initial image.

[0075] S02. Obtain the first value and use the grayscale information as the second value, wherein the first value can be selected as 0;

[0076] S03. Determine whether the first value is less than a preset value. If so, take the sum of the pixel value at the position indicated by the second value in the first sorting result and the first value as the new first value, and take the result of subtracting 1 from the second value as the new second value. Return to the step of determining whether the first value is less than the preset value until it is determined that the first value is not less than the preset value. Then, take the pixel value at the position indicated by the second value in the first sorting result as the first preset threshold.

[0077] The method for determining the first preset threshold in this embodiment considers the distribution of pixel values ​​in the image. By sorting the pixel values ​​and calculating their cumulative frequency, it can better reflect the characteristics of the image. Therefore, the determined preset threshold has a certain degree of adaptability and can adapt to changes in brightness, contrast, etc., of different images. At the same time, since the overall pixel distribution is considered, this method is relatively robust and has little impact on abnormal pixel values ​​in the image.

[0078] S12. Based on the light intensity information under the polarization angle of the polarization camera, determine the alternative pixel value for high grayscale pixels.

[0079] Specifically, multiple alternative pixel values ​​corresponding to the multiple high grayscale pixels can be determined based on the multiple light intensity information of each high grayscale pixel under multiple polarization angles corresponding to the polarization camera.

[0080] In some embodiments, the polarization angle and the light intensity information correspond one-to-one.

[0081] Figure 2 A schematic diagram of the structure of a polarization camera sensor is provided as an exemplary embodiment of this application, as shown below. Figure 2As shown, for the sensor of a polarization camera, the internal structure consists of a micro-polarization array and a microlens array added above the photodiode of the CMOS sensor. Each four pixels can be considered a computational unit, on which polarizers with four different polarization angles (0°, 45°, 90°, and 135°) are placed. Optionally, the polarization Stokes vector S = [I, Q, U, V] can be used. T The pixel value component I related to light intensity represents light intensity information, specifically I0, I... 45 I 90 I 135 These represent light intensity information at four different polarization angles.

[0082] In some embodiments, in S12, determining the alternative pixel value for a high grayscale pixel based on the light intensity information at the polarization angle of the polarization camera includes the following steps S121-S122:

[0083] S121. Sort the light intensity information of high grayscale pixels under different polarization angles to obtain a second sorting result; wherein, the sorting method includes, but is not limited to, from largest to smallest and from smallest to largest.

[0084] S122. Obtain the light intensity information located at the preset position from the second sorting result as the replacement pixel value corresponding to the high grayscale pixel.

[0085] The preset position can be the second position in the second sorting result. That is, for each high grayscale pixel, the second largest light intensity information among multiple light intensity information can be taken as the replacement pixel value corresponding to that high grayscale pixel. Specifically, it can be calculated using the following formula: P'=max(min(I0+I 45 ),min(I 90 +I 135 )), where P' is the substitute pixel value corresponding to the high grayscale pixel.

[0086] In polarization cameras, due to the presence of unexposed sub-pixels, light intensity information in certain polarization directions may not be fully acquired. Therefore, in order to retain as much light intensity information as possible during processing, choosing the second largest number makes the surrogate value P' closer to the actual light intensity, effectively improving the stability and accuracy of the calculation results.

[0087] In other embodiments, in S12, determining the alternative pixel value of a high grayscale pixel based on the light intensity information under the polarization angle of the polarization camera includes: for each high grayscale pixel among the plurality of high grayscale pixels, taking the average value of the plurality of light intensity information corresponding to the high grayscale pixel as the alternative pixel value corresponding to the high grayscale pixel, so as to obtain a plurality of alternative pixel values ​​corresponding to the plurality of high grayscale pixels.

[0088] S13. Based on the alternative pixel values ​​of high grayscale pixels, determine the first grayscale range of high grayscale pixels and the second grayscale range of medium and low grayscale pixels.

[0089] In some embodiments, the first grayscale range corresponding to the plurality of high grayscale pixels refers to a new grayscale range allocated to the plurality of high grayscale pixels, and the second grayscale range corresponding to the plurality of medium and low grayscale pixels refers to a new grayscale range allocated to the plurality of medium and low grayscale pixels.

[0090] In some optional embodiments provided in this application, in S13, determining the first grayscale range of high grayscale pixels and the second grayscale range of medium and low grayscale pixels based on the alternative pixel values ​​of high grayscale pixels includes the following steps S131-S135:

[0091] S131. Determine the first difference between the largest and smallest alternative pixel values ​​among a plurality of alternative pixel values;

[0092] S132. Determine the sum of the first difference and the first preset threshold;

[0093] S133. Determine the ratio of the grayscale information to the sum;

[0094] S134. Determine the product of the ratio and the difference;

[0095] In some embodiments, taking an 8-bit grayscale initial image as an example, the sum of the difference and the preset threshold can be expressed as M+P. th Where M represents the difference between the largest and smallest alternative pixel values ​​among multiple alternative pixel values, and P... th If a preset threshold is given, then the ratio of the grayscale information to the sum can be expressed as 255 / (M+P). th Further, the product of the ratio and the difference is expressed as G. th =255 / (M+P) th )*M.

[0096] S135. Based on the grayscale information and the product, determine the first grayscale range corresponding to the plurality of high grayscale pixels and the second grayscale range corresponding to the plurality of medium and low grayscale pixels.

[0097] In some optional embodiments provided in this application, in S135, determining the first grayscale range corresponding to high grayscale pixels and the second grayscale range corresponding to medium and low grayscale pixels based on grayscale information and product includes the following steps S1351-S1352:

[0098] S1351. Using the second difference between the grayscale information and the product as the first starting point and the grayscale information as the first ending point, determine the first grayscale range corresponding to the high grayscale pixel.

[0099] The first grayscale range can be a left-open, right-closed interval.

[0100] S1352. Using a second preset threshold as the second starting point and the second difference as the second ending point, determine the second grayscale range corresponding to the plurality of low and medium grayscale pixels. The second preset threshold is preferably 0.

[0101] The second grayscale range can be a closed interval.

[0102] Taking an initial 8-bit grayscale image as an example, with a grayscale information of 255, the first starting point can be represented as 255-G. th Among them, G th = 255 / (M+Pth)*M, where the first endpoint is 255. This means that the first grayscale range corresponding to multiple high-grayscale pixels can be represented as (255-G). th The second starting point is 0, and the second ending point can be represented as 255-G. th Where Gth = 255 / (M+Pth)*M, the second grayscale range corresponding to multiple low-to-medium grayscale pixels can be represented as [0, 255-G]. th ].

[0103] S14. Based on the substitute pixel value, the low and medium grayscale pixels, the first grayscale range and the second grayscale range, determine the target pixel value, so as to obtain the target image by performing enhancement processing on the initial image through the target pixel value;

[0104] The target pixel value includes the first target pixel value and the second target pixel value.

[0105] In some embodiments, the plurality of first target pixel values ​​represent new pixel values ​​of the plurality of high grayscale pixels mapped to the first grayscale range; the plurality of second target pixel values ​​represent new pixel values ​​of the plurality of medium and low grayscale pixels mapped to the second grayscale range.

[0106] In some optional embodiments provided in this application, in S14, determining a plurality of first target pixel values ​​and a plurality of second target pixel values ​​based on the plurality of alternative pixel values, the plurality of low-to-medium grayscale pixels, the first grayscale range, and the second grayscale range includes the following steps S141-S142:

[0107] S141. Based on a preset mapping algorithm, the plurality of alternative pixel values ​​are mapped to the first grayscale range to obtain the plurality of first target pixel values ​​corresponding to the plurality of alternative pixel values ​​in the first grayscale range.

[0108] In some embodiments, the preset mapping algorithm can be a tone-mapping algorithm. Specifically, the tone-mapping algorithm can be any of the following algorithms in the related art:

[0109] (1) Simple linear compression algorithm: The algorithm maps each of the multiple alternative pixel values ​​to the first gray level range according to a preset ratio using a linear function.

[0110] (2) Curve-based algorithm: Use curve functions (such as logarithmic curves, S-curves, etc.) to adjust the contrast and hue of different brightness areas in the initial image.

[0111] (3) Physical model-based algorithms: These algorithms are based on models of optics, physiology, or the human visual system to better simulate changes in lighting and color in the real world.

[0112] (4) Deep learning-based algorithms: By training a neural network model, the mapping relationship between the initial image and the target image is learned, so as to achieve a more accurate and natural tone-mapping effect.

[0113] For example, suppose multiple alternative pixel values, from largest to smallest, are [222, 220, 194, 191, 155, 132, 123, 119, 108], i.e., the dynamic range M = 222 - 108 = 114, and the threshold pixel value P... th =200, then G th =92, then the first grayscale range after mapping is (163,255]. One possible set of first target pixel values ​​from largest to smallest is: [255,253,199,195,194,186,155,152,163].

[0114] S142. Based on the preset mapping algorithm, the multiple low-grayscale pixel values ​​corresponding to the multiple low-grayscale pixels are mapped to the second grayscale range to obtain multiple second target pixel values ​​corresponding to the multiple low-grayscale pixel values ​​in the second grayscale range.

[0115] For example, suppose multiple low-to-medium grayscale pixel values ​​are [2, 11, 45, 45, 61, 150, 155, 191, 200] from smallest to largest, where G... th=92, the range of the mapped pixel value is [0,163]. One possible set of multiple second target pixel values ​​from smallest to largest can be represented as: [2,9,35,38,50,122,126,156,163].

[0116] After obtaining multiple first target pixel values ​​and multiple second target pixel values, the initial image can be enhanced based on the multiple first target pixel values ​​and multiple second target pixel values ​​to obtain the target image corresponding to the initial image.

[0117] In some optional embodiments provided in this application, the step of enhancing the initial image based on the plurality of first target pixel values ​​and the plurality of second target pixel values ​​to obtain the target image corresponding to the initial image includes the following steps S151-S153:

[0118] S151. For each high grayscale pixel in the plurality of high grayscale pixels contained in the initial image, adjust the pixel value of the high grayscale pixel to the first target pixel value corresponding to the high grayscale pixel, and then adjust the plurality of pixel values ​​of the plurality of high grayscale pixels to the plurality of first target pixel values.

[0119] For high grayscale pixels, their pixel values ​​are mapped to the first target pixel value, which means that details and contrast in bright areas may be preserved, but the display is within the brightness range that adapts to the LDR range.

[0120] S152. For each low-grayscale pixel in the plurality of low-grayscale pixels contained in the initial image, adjust the pixel value of the low-grayscale pixel to the second target pixel value corresponding to the low-grayscale pixel, and then adjust the plurality of pixel values ​​of the plurality of low-grayscale pixels to the plurality of second target pixel values.

[0121] For low-to-medium grayscale pixels, their pixel values ​​are mapped to the second target pixel values, which ensures that dark details remain visible in the LDR image.

[0122] S153. Use the adjusted initial image as the target image corresponding to the initial image.

[0123] In this embodiment, the processed high grayscale pixels and mid-to-low grayscale pixels are fused into the original image according to their corresponding mapping relationships (replacing the pixels in the low dynamic range image I) to generate the final target image. This target image is generated by mapping the initial image to the first and second grayscale ranges, preserving a wider brightness range in display. Furthermore, the processing retains the details and contrast of the mid-to-low grayscale pixel areas, allowing the target image to display more detail in both dark and bright areas. This results in a more balanced and natural color and contrast, effectively improving image quality.

[0124] In some embodiments, the processed target image can be further subjected to spatial domain filtering to obtain a clearer target image. Spatial domain filtering is an image processing technique that smooths the pixels of an image to reduce noise or abrupt pixels, thereby making the image clearer and smoother.

[0125] The following combination Figure 3 This plan will be further explained. Figure 3 A schematic flowchart of an image processing method provided for an exemplary embodiment of this application is shown below. Figure 3 As shown, firstly, a RAW image acquired by a color polarization camera is obtained, and this RAW image is processed through an image processing pipeline to obtain an initial image. Then, a grayscale histogram (Hist) is calculated based on the initial image, and a preset threshold is calculated to classify the multiple pixels in the initial image into high grayscale pixels and mid-to-low grayscale pixels. Based on the multiple light intensity information of the high grayscale pixels at multiple polarization angles, the corresponding replacement pixel values ​​are determined to restore details in overexposed areas. Finally, based on the grayscale information, multiple replacement pixel values, and the preset threshold, the first grayscale range (255-G) corresponding to the multiple high grayscale pixels is determined. th [0, 255] and the second grayscale range [0, 255-G] corresponding to multiple low and medium grayscale pixels. th Based on multiple substitute pixel values, multiple low-grayscale pixel values ​​corresponding to multiple low-grayscale pixels, a first grayscale range, and a second grayscale range, the Tone-Mapping algorithm is used to determine multiple first target pixel values ​​corresponding to the multiple substitute pixel values ​​in the first grayscale range, and multiple second target pixel values ​​corresponding to the multiple low-grayscale pixel values ​​in the second grayscale range. Finally, the initial image is fused and spatially filtered based on the multiple first target pixel values ​​and the multiple second target pixel values ​​to obtain the target image corresponding to the initial image.

[0126] In this scheme, a high dynamic range image can be output from a single frame of the initial image, which can avoid problems such as motion blur caused by multi-frame fusion schemes.

[0127] The solution provided in this application can more accurately determine the replacement value of high grayscale pixels by considering light intensity information under multiple polarization angles. Then, based on the replacement value, the pixel value corresponding to the initial image is mapped to a larger range of pixel values ​​to increase the range of pixel values ​​in the initial image, thereby improving the contrast of the image, making the objects in the image more clearly visible, and enhancing the image quality.

[0128] Figure 4 A schematic diagram of the structure of an image contrast enhancement device provided for an exemplary embodiment of this application;

[0129] The device includes:

[0130] The acquisition module 41 is used to acquire an initial image using a polarization camera, wherein the pixels in the initial image can be divided into high grayscale pixels and medium-low grayscale pixels.

[0131] The pixel value determination module 42 is used to determine the alternative pixel value of high grayscale pixels based on the light intensity information under the polarization angle of the polarization camera.

[0132] The grayscale range determination module 43 is used to determine the first grayscale range of high grayscale pixels and the second grayscale range of medium and low grayscale pixels based on the alternative pixel values ​​of high grayscale pixels.

[0133] The enhancement processing module 44 is used to determine the target pixel value based on the substitute pixel value, the low and medium gray level pixels, the first gray level range and the second gray level range, so as to perform enhancement processing on the initial image through the target pixel value to obtain the target image.

[0134] In one embodiment, the apparatus further includes a pixel classification module for acquiring grayscale information of the initial image;

[0135] Based on grayscale information and a first preset threshold, the pixels in the initial image are divided into high grayscale pixels and medium-low grayscale pixels.

[0136] In one embodiment, the apparatus further includes a pixel sorting module, which sorts the pixels in the initial image according to their pixel values ​​to obtain a first sorting result;

[0137] Obtain the first value, and use the grayscale information as the second value;

[0138] Determine whether the first value is less than the preset value. If so, take the sum of the pixel value at the position indicated by the second value in the first sorting result and the first value as the new first value, and take the result of subtracting 1 from the second value as the new second value. Return to the step of determining whether the first value is less than the preset value, until it is determined that the first value is not less than the preset value. Then, take the pixel value at the position indicated by the second value in the first sorting result as the first preset threshold.

[0139] In one embodiment, the pixel value determination module 42 is further used to sort the light intensity information of high grayscale pixels under different polarization angles to obtain a second sorting result;

[0140] The light intensity information at the preset position is obtained from the second sorting result and used as the replacement pixel value for the high grayscale pixel.

[0141] In one embodiment, the grayscale range determination module 43 is further configured to determine a first difference between the largest and smallest alternative pixel values ​​among the alternative pixel values;

[0142] Determine the sum of the first difference and the first preset threshold;

[0143] Determine the ratio of grayscale information to the sum of the values;

[0144] Determine the product of the ratio and the difference;

[0145] The first grayscale range corresponding to high grayscale pixels and the second grayscale range corresponding to medium and low grayscale pixels are determined based on grayscale information and product.

[0146] In one embodiment, the grayscale range determination module 43 is further configured to determine the first grayscale range corresponding to the high grayscale pixel by taking the second difference between the grayscale information and the product as the first starting point and the grayscale information as the first ending point.

[0147] Using the second preset threshold as the second starting point and the second difference as the second ending point, the second grayscale range corresponding to the low and medium grayscale pixels is determined.

[0148] In one embodiment, the target pixel value includes a first target pixel value and a second target pixel value;

[0149] The enhancement processing module 44 is also used to map the substitute pixel value to the first grayscale range based on a preset mapping algorithm, so as to obtain the first target pixel value corresponding to the substitute pixel value in the first grayscale range;

[0150] Based on a preset mapping algorithm, the mid-to-low grayscale pixel values ​​corresponding to the mid-to-low grayscale pixels are mapped to the second grayscale range to obtain the second target pixel values ​​corresponding to the mid-to-low grayscale pixel values ​​in the second grayscale range.

[0151] In one embodiment, the enhancement processing module 44 is further configured to adjust the pixel values ​​of high grayscale pixels in the initial image to the first target pixel values ​​corresponding to the high grayscale pixels, and to adjust the pixel values ​​of medium and low grayscale pixels in the initial image to the second target pixel values ​​corresponding to the medium and low grayscale pixels, thereby obtaining a target image.

[0152] It should be understood that the device embodiments and method embodiments can correspond to each other, and similar descriptions can be referred to the method embodiments. To avoid repetition, they will not be repeated here. Specifically, the device can execute the above method embodiments, and the foregoing and other operations and / or functions of each module in the device correspond to the corresponding processes in the various methods in the above method embodiments, which will not be repeated here for the sake of brevity.

[0153] The apparatus of this application embodiment has been described above from the perspective of functional modules in conjunction with the accompanying drawings. It should be understood that this functional module can be implemented in hardware, in software instructions, or in a combination of hardware and software modules. Specifically, the steps of the method embodiments in this application can be completed by integrated logic circuits in the processor's hardware and / or by software instructions. The steps of the method disclosed in this application embodiment can be directly embodied as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. Optionally, the software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps in the above method embodiments.

[0154] Figure 5 This is a schematic block diagram of a computer device provided in an embodiment of this application. The computer device may include:

[0155] The system includes a memory 501 and a processor 502. The memory 501 stores computer programs and transfers the program code to the processor 502. In other words, the processor 502 can retrieve and run the computer programs from the memory 501 to implement the methods described in the embodiments of this application.

[0156] For example, the processor 502 can be used to execute the above-described method embodiments according to instructions in the computer program.

[0157] In some embodiments of this application, the processor 502 may include, but is not limited to:

[0158] General-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0159] In some embodiments of this application, the memory 501 includes, but is not limited to:

[0160] Volatile memory and / or non-volatile memory. Non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DR RAM).

[0161] In some embodiments of this application, the computer program may be divided into one or more modules, which are stored in the memory 501 and executed by the processor 502 to perform the method provided in this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the computer device.

[0162] like Figure 5 As shown, the computer device may further include:

[0163] Transceiver 503, which may be connected to processor 502 or memory 501.

[0164] The processor 502 can control the transceiver 503 to communicate with other devices; specifically, it can send information or data to other devices or receive information or data sent by other devices. The transceiver 503 may include a transmitter and a receiver. The transceiver 503 may further include antennas, and the number of antennas may be one or more.

[0165] It should be understood that the various components in the computer device are connected through a bus system, which includes, in addition to the data bus, a power bus, a control bus, and a status signal bus.

[0166] This application also provides a computer storage medium storing a computer program thereon, which, when executed by a computer, enables the computer to perform the methods of the above-described method embodiments. Alternatively, embodiments of this application also provide a computer program product containing instructions that, when executed by a computer, cause the computer to perform the methods of the above-described method embodiments.

[0167] When implemented using software, it can be implemented entirely or partially as a computer program product. This computer program product includes one or more computer instructions. When these computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., digital video disc (DVD)), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0168] This application also provides a computer program product including executable instructions stored in a readable storage medium. At least one processor of the device can read the executable instructions from the readable storage medium, and executing the executable instructions causes the device to implement the image enhancement processing methods provided in the various embodiments described above.

[0169] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0170] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0171] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. For example, the functional modules in the various embodiments of this application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.

[0172] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. An image contrast enhancement method, characterized in that, include: An initial image is acquired using a polarization camera, wherein the pixels in the initial image can be divided into high grayscale pixels and medium-low grayscale pixels; Based on the light intensity information at the polarization angle of the polarization camera, the alternative pixel value of the high grayscale pixel is determined; Based on the alternative pixel values ​​of the high grayscale pixels, a first grayscale range of the high grayscale pixels and a second grayscale range of the medium and low grayscale pixels are determined. Based on the alternative pixel value, the low and medium grayscale pixels, the first grayscale range, and the second grayscale range, a target pixel value is determined so as to enhance the initial image using the target pixel value to obtain a target image.

2. The method according to claim 1, characterized in that, The method also includes: Obtain the grayscale information of the initial image; Based on the grayscale information and the first preset threshold, the pixels in the initial image are divided into high grayscale pixels and medium-low grayscale pixels.

3. The method according to claim 2, characterized in that, The method also includes: The pixels in the initial image are sorted according to their pixel values ​​to obtain a first sorting result; Obtain the first value, and use the grayscale information as the second value; Determine whether the first value is less than a preset value. If so, take the sum of the pixel value at the position indicated by the second value in the first sorting result and the first value as the new first value, and take the result of subtracting 1 from the second value as the new second value. Return to the step of determining whether the first value is less than the preset value until it is determined that the first value is not less than the preset value. Then, take the pixel value at the position indicated by the second value in the first sorting result as the first preset threshold.

4. The method according to claim 1, characterized in that, The step of determining the replacement pixel value for the high grayscale pixel based on the light intensity information at the polarization angle of the polarization camera includes: The light intensity information of the high grayscale pixels under different polarization angles is sorted to obtain a second sorting result; The light intensity information located at a preset position is obtained from the second sorting result and used as the replacement pixel value corresponding to the high grayscale pixel.

5. The method according to claim 2, characterized in that, Determining the first grayscale range of the high grayscale pixels and the second grayscale range of the mid-to-low grayscale pixels based on the substitute pixel values ​​of the high grayscale pixels includes: Determine a first difference between the largest and smallest alternative pixel values ​​among the alternative pixel values; Determine the sum of the first difference and the first preset threshold; Determine the ratio of the grayscale information to the sum; Determine the product of the ratio and the difference; Based on the grayscale information and the product, the first grayscale range corresponding to the high grayscale pixel and the second grayscale range corresponding to the medium and low grayscale pixel are determined.

6. The method according to claim 5, characterized in that, Determining the first grayscale range corresponding to the high grayscale pixel and the second grayscale range corresponding to the medium and low grayscale pixels based on the grayscale information and the product includes: Using the second difference between the grayscale information and the product as the first starting point and the grayscale information as the first ending point, the first grayscale range corresponding to the high grayscale pixel is determined. The second grayscale range corresponding to the low and medium grayscale pixels is determined by taking the second preset threshold as the second starting point and the second difference as the second ending point.

7. The method according to claim 1, characterized in that, The target pixel value includes a first target pixel value and a second target pixel value; Determining the target pixel value based on the substitute pixel value, the low-to-medium grayscale pixels, the first grayscale range, and the second grayscale range includes: Based on a preset mapping algorithm, the substitute pixel value is mapped to the first grayscale range to obtain the first target pixel value corresponding to the substitute pixel value in the first grayscale range; Based on the preset mapping algorithm, the low-grayscale pixel values ​​corresponding to the low-grayscale pixels are mapped to the second grayscale range to obtain the second target pixel values ​​corresponding to the low-grayscale pixel values ​​in the second grayscale range.

8. The method according to claim 7, characterized in that, The step of enhancing the initial image using the target pixel values ​​to obtain the target image includes: The pixel values ​​of high grayscale pixels in the initial image are adjusted to the first target pixel values ​​corresponding to the high grayscale pixels, and the pixel values ​​of medium and low grayscale pixels in the initial image are adjusted to the second target pixel values ​​corresponding to the medium and low grayscale pixels, to obtain the target image.

9. An image contrast enhancement device, characterized in that, include: An acquisition module is used to acquire an initial image using a polarization camera, wherein the pixels in the initial image can be divided into high grayscale pixels and medium-low grayscale pixels; The pixel value determination module is used to determine the alternative pixel value of the high grayscale pixel based on the light intensity information under the polarization angle of the polarization camera. The grayscale range determination module is used to determine a first grayscale range of the high grayscale pixel and a second grayscale range of the medium and low grayscale pixel based on the alternative pixel value of the high grayscale pixel. An enhancement processing module is used to determine a target pixel value based on the alternative pixel value, the low-to-medium grayscale pixels, the first grayscale range, and the second grayscale range, so as to perform enhancement processing on the initial image using the target pixel value to obtain a target image.

10. A computer device, characterized in that, Includes a memory, and one or more processors communicatively connected to the memory; The memory stores instructions that can be executed by the one or more processors to cause the one or more processors to implement the image contrast enhancement method as described in any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that, Includes a program or instructions that, when run on a computer, implement the image contrast enhancement method of any one of claims 1 to 8.

12. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements the image contrast enhancement method according to any one of claims 1 to 8.