Dynamic range compression method, device and medium for improving image flicker
By using a dual-threshold judgment method and a weighted histogram equalization method, the problem of brightness abrupt changes in image dynamic range compression was solved, improving the local contrast and visual effect of the image and enhancing its anti-flicker capability.
Patent Information
- Application Number
- CN202511063147.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-12-23
- Estimated Expiration
- 2045-07-31
AI Technical Summary
Existing image dynamic range compression methods are prone to causing drastic changes in brightness between frames when brightness changes abruptly, and they fail to effectively consider the continuity between frames, resulting in abrupt changes in background brightness.
By employing a dual-threshold judgment method and a weighted histogram equalization method, linear and nonlinear mappings are performed by setting flicker thresholds and full-image thresholds to reduce brightness abrupt changes and improve the image's anti-flicker capability.
It effectively reduces sudden changes in overall background brightness caused by the entry of bright objects, improves local contrast and visual effects, and enhances the image's anti-flicker capability when brightness changes.
Smart Images

Figure CN120583327B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image compression technology, and more specifically, to a dynamic range compression method, apparatus, and medium for improving image flicker. Background Technology
[0002] Commonly used image dynamic range compression methods can be categorized into linear mapping, nonlinear mapping, or a combination thereof.
[0003] Existing linear mapping methods can lead to a reduction in effective gray levels and severe loss of image information when the dynamic range is large.
[0004] While existing nonlinear mapping methods can display background region layers well, they can make targets with low grayscale lack detail and generally have different effects on the brightness of different regions of the image, resulting in significant changes in the brightness order of different regions after dynamic range compression.
[0005] While methods combining existing linear and nonlinear mapping can improve local contrast and detail in images, they do not consider the continuity between frames. As a result, when a bright object enters or exits the image, the brightness of the background still changes significantly. This can easily lead to abrupt changes in the brightness of the background after dynamic range compression due to changes in the dynamic range of the original data. Summary of the Invention
[0006] In response to at least one defect or improvement requirement of the prior art, this application provides a dynamic range compression method, device and medium to improve image flicker, which is used to overcome the technical defect in the prior art that the brightness of the screen frame is prone to drastic changes when the scene brightness changes suddenly, and improves the anti-flicker capability of the screen when the environment changes suddenly.
[0007] To achieve the above objectives, in a first aspect, this application provides a dynamic range compression method for improving image flicker, comprising:
[0008] Perform histogram statistics, set flicker threshold and full image threshold, and obtain the dynamic range, anti-flicker dynamic range and horizontal axis median of the preset high display bit width image histogram;
[0009] Set the dynamic range of the histogram of the preset low display bit width image after it is compressed from the preset high display bit width image to the preset low display bit width image, and compare it with the dynamic range and anti-flicker dynamic range of the histogram of the preset high display bit width image, respectively, to obtain the actual dynamic range and anti-flicker dynamic range of the histogram compressed to the preset low display bit width image.
[0010] Based on the anti-flicker dynamic range of the image histogram compressed to the preset low display bit width, the anti-flicker dynamic range of the image histogram compressed to the preset high display bit width, and the median value on the horizontal axis, the dynamic range of the portion of brightness less than the median value in the image histogram compressed to the preset low display bit width is obtained after mapping to the image histogram.
[0011] Threshold judgment is made based on the comparison terms of the target brightness of the preset low display bit width image and the dynamic range of the portion of the preset high display bit width image histogram that is less than the median brightness after being mapped to the preset low display bit width image histogram. Values are assigned to the dynamic range of the portion of the preset low display bit width image histogram that is less than and / or greater than the median brightness.
[0012] The pixel values of the preset high display bit width image are compared with the median of the horizontal axis of the preset high display bit width image histogram and / or the anti-flicker dynamic range compressed to the preset low display bit width image histogram. Based on the dynamic range value assigned above, the output result of the preset low display bit width image after linear mapping adjustment is obtained.
[0013] Furthermore, a weighted adaptive histogram equalization method is adopted to perform nonlinear mapping on the output result of the preset low display bit width image after linear mapping adjustment, so as to obtain the output result of the preset low display bit width image after nonlinear mapping adjustment.
[0014] Furthermore, histogram statistics are performed, flicker threshold and full-image threshold are set, and the dynamic range, anti-flicker dynamic range and horizontal axis median of the preset high display bit width image histogram are obtained, including:
[0015] Create a histogram to count the number of pixels corresponding to each pixel value, and obtain the total number of pixels in the image; based on the histogram, obtain the median value of the horizontal axis of the histogram of the image with the preset display bit width;
[0016] The flicker threshold is obtained by multiplying the set anti-flicker ratio by the total number of pixels in the image; the full image threshold is obtained by multiplying the set throw ratio by the total number of pixels in the image.
[0017] Obtain the left horizontal boundary, anti-flicker threshold, and right horizontal boundary of a preset high display bit width image histogram; the left horizontal boundary of the preset high display bit width image histogram is the pixel value corresponding to the accumulated number of pixels starting from the minimum value of the horizontal axis of the histogram when it reaches the full image threshold; the anti-flicker threshold of the preset high display bit width image histogram is the pixel value corresponding to the accumulated number of pixels starting from the maximum value of the horizontal axis of the histogram when it reaches the flicker threshold; the right horizontal boundary of the preset high display bit width image histogram is the pixel value corresponding to the accumulated number of pixels starting from the maximum value of the horizontal axis of the histogram when it reaches the full image threshold;
[0018] The expression for the dynamic range R of the preset high display bit width image histogram is:
[0019] R = histmax - histmin;
[0020] The expression for the anti-flicker dynamic range R_flash of the preset high display bit width image histogram is:
[0021] R_flash=histflash-histmin;
[0022] Histmin, histflash, and histmax represent the left horizontal boundary, anti-flicker threshold, and right horizontal boundary of the preset high display bit width image histogram, respectively.
[0023] Furthermore, the dynamic range of the histogram of the preset low display bit-width image after compression from the preset high display bit-width image is set, and its magnitude is compared with the dynamic range of the histogram of the preset high display bit-width image and the anti-flicker dynamic range, respectively, to obtain the actual dynamic range and anti-flicker dynamic range of the histogram compressed to the preset low display bit-width image, including:
[0024] Set the lower limit D_l and upper limit D_u of the image grayscale of the preset low display bit width image after it is compressed from the preset high display bit width image to the preset low display bit width image, and set the dynamic range D of the histogram of the preset low display bit width image to D_u - D_l;
[0025] The actual dynamic range of the image histogram compressed to the preset low display bit width is R_d = min(R, D);
[0026] The anti-flicker dynamic range R_d_flash = min(R_flash, D) is compressed to the preset low display bit width image histogram.
[0027] Furthermore, based on the flicker-resistant dynamic range of the image compressed to a preset low display bitwidth image histogram, the flicker-resistant dynamic range of the image compressed to a preset high display bitwidth image histogram, and the median value on the horizontal axis, the dynamic range of the portion of brightness less than the median value in the preset high display bitwidth image histogram after mapping to the preset low display bitwidth image histogram is obtained as follows:
[0028] S=R_d_flash*(GrayMed-histmin) / R_flash;
[0029] Where S represents the dynamic range of the portion of the preset high display bit width image histogram that is less than the median brightness after being mapped to the preset low display bit width image histogram; GrayMed represents the median of the horizontal axis of the preset high display bit width image histogram.
[0030] Furthermore, based on a comparison term including the target brightness of the preset low display bit width image and the dynamic range of the portion of brightness less than the median brightness in the histogram of the preset high display bit width image after mapping to the histogram of the preset low display bit width image, a threshold judgment is made, and the dynamic range of the portion of brightness less than and / or greater than the median brightness in the histogram of the preset low display bit width image is assigned a value, including:
[0031] Set the target brightness D_s of the preset low display bit width image, and the dynamic range A_l of the portion of the low display bit width image histogram that is smaller than the median brightness;
[0032] When D_l < D_s - S, A_l = S;
[0033] When D_l≥D_s-S, A_l=D_s-D_l;
[0034] The dynamic range of the portion of brightness above the median in the preset low display bit-width image histogram is set as A_u, A_u_flash, and D_u_flash; where A_u represents the range above the target brightness D_s in the actual dynamic range R_d compressed into the preset low display bit-width image histogram; A_u_flash represents the range above the target brightness D_s in the anti-flicker dynamic range R_d_flash compressed into the preset low display bit-width image histogram; D_u_flash = D_s + A_u_flash;
[0035] When D_s-S<D_u-R_d_flash
[0036] A_u_flash = R_d_flash - S;
[0037] A_u = R_d - S;
[0038] D_u_flash=D_s+A_u_flash;
[0039] When D_s-S≥D_u-R_d_flash
[0040] A_u_flash = D_u - D_s;
[0041] A_u = D_u - D_s;
[0042] D_u_flash=D_u.
[0043] Furthermore, a threshold judgment is made by comparing the pixel values of the preset high display bit width image with the median of the horizontal axis of the preset high display bit width image histogram and / or with the anti-flicker dynamic range compressed to the preset low display bit width image histogram. Based on the aforementioned assigned dynamic range, the output result of the preset low display bit width image after linear mapping adjustment is obtained, including:
[0044] When the pixel value Src of the preset high display bit width image is less than GrayMed,
[0045] Dst=(Src-histmin) / (GrayMed-histmin)*A_l+(D_s-A_l);
[0046] When Src ≥ GrayMed and Src < R_d_flash
[0047] Dst=(Src-GrayMed) / (R_flash-GrayMed)*A_u_flash+D_s;
[0048] When Src ≥ R_d_flash
[0049] Dst=(Src-R_d_flash) / (R-R_d_flash)*(A_u-A_u_flash)+D_u_flash;
[0050] Where Dst represents the output result of the preset low display bit width image after linear mapping adjustment.
[0051] Furthermore, the default high display bit width is 14 bits, and the default low display bit width is 8 bits.
[0052] Secondly, this application provides an electronic device including at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program that, when executed by the processing unit, enables the processing unit to perform the steps of the dynamic range compression method described in any of the preceding claims.
[0053] Thirdly, this application provides a storage medium storing a computer program executable by an access authentication device, which, when run on the access authentication device, enables the access authentication device to perform the steps of the dynamic range compression method described in any of the preceding claims.
[0054] In summary, compared with the prior art, the above-described technical solutions conceived in this application can achieve the following beneficial effects:
[0055] (1) This application discloses a dynamic range compression method to improve image flicker. This dynamic range compression method proposes a dual threshold judgment method, which adds a flicker threshold compared to the conventional linear method. It can utilize the continuity between frames to prevent abrupt changes in the image mapping curve during the linear mapping process. By using the dual threshold judgment method, this application can reduce the drastic changes in brightness between frames when scene brightness changes abruptly, thereby improving the image's anti-flicker capability during environmental changes by reducing the changes in the mapping center and range.
[0056] (2) Based on the linear dynamic compression algorithm, this application combines the weighted histogram equalization algorithm, which can perform two-level compression processing on infrared images. It also introduces a dual threshold judgment method, which can improve the local contrast and visual effect of the image while reducing the phenomenon of sudden changes in the overall brightness of the background caused by the entry of bright objects. Attached Figure Description
[0057] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0058] Figure 1 The core flowchart of a dynamic range compression method for improving image flicker provided in the embodiments of this application;
[0059] Figure 2 This is a schematic diagram illustrating the evolution of compression methods for compressing 14-bit image data to 8-bit, as provided in an embodiment of this application.
[0060] Figure 3 A schematic diagram of the piecewise linear mapping method provided in this application embodiment; wherein, the gray line represents the original linear mapping when no bright object enters; the blue line represents the original linear mapping when a bright object enters; and the green line represents the anti-flicker piecewise linear mapping when a bright object enters.
[0061] Figure 4 The following figures present the results of dynamic range compression with and without anti-flicker provided in the embodiments of this application; wherein... Figure 4 (a): When dynamic range compression is performed without anti-flicker, the bright object enters before ( Figure 4 (a) Left half of the diagram) and after entering ( Figure 4 (a) The results of the right half of the figure are presented in a comparison figure. The yellow line only serves to mark the key points of the local area of the figure, that is, to focus on the changes in light intensity at the yellow line. The same applies below. Figure 4 (b): When anti-flicker is applied to compress the dynamic range, the bright object enters before ( Figure 4 (b) Left half of the diagram) and after entering ( Figure 4 (b) The results of the right half of the figure are presented in a comparison chart;
[0062] Figure 5 The corresponding embodiment provided in this application Figure 4 A series of graphs showing the difference in brightness values between two frames during flicker-free and flicker-resistant operations; among them... Figure 5 (a) A graph showing the difference in brightness values between two frames without anti-flicker provided in an embodiment of this application; Figure 5 (b) A graph showing the difference in brightness values between two frames with flicker resistance, provided in an embodiment of this application;
[0063] Figure 6 A block diagram illustrating an electronic device suitable for implementing the dynamic range compression method described above, provided in an embodiment of this application. Detailed Implementation
[0064] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. Furthermore, the technical features involved in the various embodiments described below can be combined with each other as long as they do not conflict with each other.
[0065] The terms "comprising" or "having," and any variations thereof, in the specification, claims, or drawings of this application are intended to cover a non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0066] As described in the background section of the specification, while existing methods combining linear and nonlinear mappings can improve local contrast and detail in images, they do not consider the continuity between frames. Consequently, when a bright object enters or exits the image, the brightness abruptly changes in the background, easily leading to abrupt changes in the brightness of the background after dynamic range compression due to abrupt changes in the dynamic range of the original data. Therefore, this application provides a dynamic range compression method, apparatus, and medium to improve image flicker, overcoming the technical deficiency in existing technologies where the brightness of frames easily changes drastically when scene brightness changes abruptly, and improving the image's anti-flicker capability during environmental changes.
[0067] refer to Figure 1One embodiment of this application provides a dynamic range compression method for improving image flicker, which may specifically include the following steps.
[0068] Step 1: Perform histogram statistics to count the number of pixels corresponding to each pixel value, and obtain the total number of pixels in the image.
[0069] Step 2: Set the anti-flicker ratio per_flash. Multiply the total number of pixels in the image by per_flash to get the flicker threshold num_flash. Set the flicker ratio per_full. Multiply the total number of pixels in the image by per_full to get the total image threshold num_full.
[0070] The left horizontal boundary histmin, the anti-flicker threshold histflash, and the right horizontal boundary histmax of the image histogram with a preset high display bit width (i.e., the original bit width of the image before compression, which is 14 bits in this embodiment) are calculated.
[0071] histmin represents the pixel value at which the accumulated number of pixels, starting from the minimum value on the horizontal axis of the histogram, reaches the full image threshold num_full.
[0072] histflash represents the pixel value corresponding to the point when the accumulated number of pixels, starting from the maximum value of the horizontal axis of the histogram, reaches the blinking threshold num_flash.
[0073] histmax represents the pixel value at which the accumulated number of pixels, starting from the maximum value on the horizontal axis of the histogram, reaches the full image threshold num_full.
[0074] Step 3: Based on histogram statistics, obtain the horizontal axis median GrayMed of the histogram for the preset high display bit width (14 bits) image.
[0075] The dynamic range of the histogram of the original image (i.e., the 14-bit preset high display bit width image) is R = histmax - histmin.
[0076] The anti-flicker dynamic range of the original image histogram is R_flash = histflash - histmin.
[0077] Step 4: Set the lower limit D_l and upper limit D_u of the image grayscale of the preset low display bit width image after compressing the image from a preset high display bit width (14 bits) image to a preset low display bit width (i.e., the bit width after image compression, which is 8 bits in this embodiment). Then, the dynamic range D of the histogram of the 8-bit image is D = D_u - D_l; the actual dynamic range R_d of the histogram when compressed from a high bit (14 bits) image to 8 bits is min(R, D); and the anti-flicker dynamic range R_d_flash of the histogram when compressed from a high bit image to 8 bits is min(R_flash, D).
[0078] Step 5: The expression for the dynamic range S of the portion of the image with a brightness less than the median value in the preset high display bit width image histogram, after being mapped to the preset low display bit width image histogram, is:
[0079] S=R_d_flash*(GrayMed-histmin) / R_flash.
[0080] Step 6: Set the target brightness of the 8-bit image to D_s, and the dynamic range of the portion of brightness less than the median in the histogram of the 8-bit image to A_l. Then, the following threshold judgment conditions apply.
[0081] When D_l < D_s - S, A_l = S;
[0082] When D_l≥D_s-S, A_l=D_s-D_l.
[0083] Step 7: Let the dynamic range of the portion of brightness above the median in the 8-bit image histogram be A_u, A_u_flash, and D_u_flash. Where A_u represents the range above the target brightness D_s in the actual dynamic range R_d of the image histogram compressed to the preset low display bit width (8 bits); A_u_flash represents the range above the target brightness D_s in the anti-flicker dynamic range R_d_flash of the image histogram compressed to the preset low display bit width; D_u_flash = D_s + A_u_flash. Then the following threshold judgment conditions apply.
[0084] When D_s-S<D_u-R_d_flash
[0085] A_u_flash = R_d_flash - S;
[0086] A_u = R_d - S;
[0087] D_u_flash=D_s+A_u_flash;
[0088] When D_s-S≥D_u-R_d_flash
[0089] A_u_flash = D_u - D_s;
[0090] A_u = D_u - D_s;
[0091] D_u_flash=D_u.
[0092] A schematic diagram illustrating the evolution of compression methods when compressing 14-bit image data to 8-bit is provided. Figure 2 A schematic diagram of the piecewise linear mapping method is shown in the reference diagram. Figure 3 .
[0093] Step 8: Perform threshold judgment to obtain the output result Dst of the 8-bit image.
[0094] When the pixel value Src of the original 14-bit image is less than GrayMed,
[0095] Dst=(Src-histmin) / (GrayMed-histmin)*A_l+(D_s-A_l);
[0096] When Src ≥ GrayMed and Src < R_d_flash
[0097] Dst=(Src-GrayMed) / (R_flash-GrayMed)*A_u_flash+D_s;
[0098] When Src ≥ R_d_flash
[0099] Dst=(Src-R_d_flash) / (R-R_d_flash)*(A_u-A_u_flash)+D_u_flash;
[0100] At this point, the linear mapping is complete, and the output result Dst of the 8-bit image after linear mapping adjustment is obtained.
[0101] The results of dynamic range compression with and without anti-flicker are presented in a series of figures for reference. Figure 4 It can be seen intuitively that when the new method has anti-flicker capability, the brightness change in the two frames of the screen, such as the table, is significantly reduced.
[0102] Reference chart of brightness value difference curves between two frames with and without flicker resistance. Figure 5 It can be seen intuitively that the maximum difference in brightness between the two frames at the location of the yellow line decreases from 70 when there is no anti-flicker to no more than 20 when there is anti-flicker.
[0103] This application discloses a dynamic range compression method to improve image flicker. This method proposes a dual-threshold judgment method, with the two thresholds corresponding to a full-image threshold and a flicker threshold. Compared to conventional linear methods, this dual-threshold judgment method adds a flicker threshold, which utilizes the continuity between frames to prevent abrupt changes in the image mapping curve during the linear mapping process. By using the dual-threshold judgment method and reducing changes in the mapping center and range, this application can reduce drastic changes in brightness between frames when scene brightness changes abruptly, thus improving the image's anti-flicker capability during environmental changes.
[0104] Preferably, an embodiment of this application provides a dynamic range compression method for improving image flicker, which may further include the following step 9.
[0105] Step 9: For the output result Dst of the 8-bit image after linear mapping adjustment obtained in step 8, continue to perform nonlinear mapping.
[0106] The final output of the preset low display bit width image after nonlinear mapping adjustment is Dst2 = WAHE(Dst).
[0107] This application combines a weighted histogram equalization algorithm with a linear dynamic compression algorithm, which can perform two-stage compression processing on infrared images. It also introduces a dual threshold judgment method, which can improve the local contrast and visual effect of the image while reducing the phenomenon of sudden changes in the overall brightness of the background caused by the entry of bright objects.
[0108] Figure 6 A block diagram schematically illustrates an electronic device suitable for implementing the dynamic range compression method described above, according to an embodiment of this application. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this application.
[0109] like Figure 6 As shown, the electronic device 1000 described in this embodiment includes a processor 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage portion 1008 into a random access memory (RAM) 1003. The processor 1001 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 1001 may also include onboard memory for caching purposes. The processor 1001 may include a single processing unit or multiple processing units for performing different actions of the dynamic range compression method flow according to embodiments of this application.
[0110] RAM 1003 stores various programs and data required for the operation of electronic device 1000. Processor 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. Processor 1001 executes various operations of the dynamic range compression method flow according to embodiments of this application by executing programs in ROM 1002 and / or RAM 1003. It should be noted that the programs may also be stored in one or more memories other than ROM 1002 and RAM 1003. Processor 1001 may also execute various operations of the dynamic range compression method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0111] According to embodiments of this application, the electronic device 1000 may further include an input / output (I / O) interface 1005, which is also connected to a bus 1004. The electronic device 1000 may also include one or more of the following components connected to the I / O interface 1005: an input section 1006 including a keyboard, mouse, etc.; an output section 1007 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as needed. A removable medium 1011, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 1010 as needed so that computer programs read from it can be installed into the storage section 1008 as needed.
[0112] The dynamic range compression method flow according to embodiments of this application can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable storage medium, the computer program containing program code for performing the dynamic range compression method shown in the flowchart. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1009, and / or installed from removable medium 1011. When the computer program is executed by processor 1001, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, and / or units described above can be implemented using computer program modules.
[0113] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments, or it may exist independently without being assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the steps of the dynamic range compression method according to embodiments of this application.
[0114] According to embodiments of this application, the computer-readable storage medium may be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include one or more memories other than the ROM 1002 and / or RAM 1003 described above.
[0115] It should be noted that the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product.
[0116] The flowcharts and / or block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in the flowcharts and / or block diagrams may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. Furthermore, it should be noted that each block in the block diagram or flowchart, and combinations of blocks in the block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0117] Those skilled in the art will understand that the features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, without departing from the spirit and teachings of this application, the technical features described in the various embodiments and / or claims of this application can be combined and / or combined in various ways, and all such combinations and / or combinations fall within the scope of this application.
[0118] Although this application has been shown and described with reference to specific exemplary embodiments thereof, those skilled in the art will understand that various changes in form and detail may be made to this application without departing from the spirit and scope of the application as defined by the appended claims and their equivalents. Therefore, the scope of this application should not be limited to the above embodiments, but should be determined not only by the appended claims, but also by their equivalents.
Claims
1. A dynamic range compression method for improving image flicker, characterized in that, include: Perform histogram statistics, set flicker threshold and full image threshold, and obtain the dynamic range, anti-flicker dynamic range and horizontal axis median of the preset high display bit width image histogram; The dynamic range of the histogram of the preset low display bit width image (compressed from a preset high display bit width image to a preset low display bit width image) is set, and compared with the dynamic range and anti-flicker dynamic range of the histogram of the preset high display bit width image, respectively, to obtain the actual dynamic range and anti-flicker dynamic range of the histogram compressed to the preset low display bit width image. Specifically, this includes: Set the lower limit D_l and upper limit D_u of the image grayscale of the preset low display bit width image after it is compressed from the preset high display bit width image to the preset low display bit width image, and set the dynamic range D of the histogram of the preset low display bit width image to D_u - D_l; The actual dynamic range of the image histogram compressed to the preset low display bit width is R_d = min(R, D); The anti-flicker dynamic range R_d_flash = min(R_flash, D) is compressed to the preset low display bit width image histogram; where R represents the dynamic range of the preset high display bit width image histogram; and R_flash represents the anti-flicker dynamic range of the preset high display bit width image histogram. Based on the flicker-resistant dynamic range of the image compressed to a preset low display bitwidth image histogram, the flicker-resistant dynamic range of the image compressed to a preset high display bitwidth image histogram, and the median value on the horizontal axis, the dynamic range of the portion of brightness less than the median value in the preset high display bitwidth image histogram after mapping to the preset low display bitwidth image histogram is obtained, specifically including: S=R_d_flash*(GrayMed-histmin) / R_flash; Where S represents the dynamic range of the portion of the preset high display bit width image histogram that is less than the median brightness after being mapped to the preset low display bit width image histogram; GrayMed represents the median of the horizontal axis of the preset high display bit width image histogram; and histmin represents the left boundary of the horizontal axis of the preset high display bit width image histogram. A threshold judgment is made based on a comparison term that includes the target brightness of the preset low display bit width image and the dynamic range of the portion of brightness less than the median in the histogram of the preset high display bit width image, after being mapped to the histogram of the preset low display bit width image. Values are assigned to the dynamic range of the portion of brightness less than and / or greater than the median in the histogram of the preset low display bit width image, specifically including: Set the target brightness D_s of the preset low display bit width image, and the dynamic range A_l of the portion of the low display bit width image histogram that is smaller than the median brightness; When D_l < D_s - S, A_l = S; When D_l≥D_s-S, A_l=D_s-D_l; The dynamic range of the portion of brightness above the median in the preset low display bit-width image histogram is set as A_u, A_u_flash, and D_u_flash; where A_u represents the range above the target brightness D_s in the actual dynamic range R_d compressed into the preset low display bit-width image histogram; A_u_flash represents the range above the target brightness D_s in the anti-flicker dynamic range R_d_flash compressed into the preset low display bit-width image histogram; D_u_flash = D_s + A_u_flash; When D_s-S<D_u-R_d_flash A_u_flash = R_d_flash - S; A_u = R_d - S; D_u_flash=D_s+A_u_flash; When D_s-S≥D_u-R_d_flash A_u_flash = D_u - D_s; A_u = D_u - D_s; D_u_flash = D_u; The pixel values of the preset high display bit width image are compared with the median of the horizontal axis of the preset high display bit width image histogram and / or the anti-flicker dynamic range compressed to the preset low display bit width image histogram. Based on the dynamic range value assigned above, the output result of the preset low display bit width image after linear mapping adjustment is obtained.
2. The dynamic range compression method as described in claim 1, characterized in that, A weighted adaptive histogram equalization method is used to perform nonlinear mapping on the output of the preset low display bit width image after linear mapping adjustment, so as to obtain the output of the preset low display bit width image after nonlinear mapping adjustment.
3. The dynamic range compression method as described in claim 1, characterized in that, Perform histogram statistics, set flicker threshold and full-image threshold, and obtain the dynamic range, anti-flicker dynamic range, and horizontal axis median of the histogram for a preset high display bitwidth image, including: Create a histogram to count the number of pixels corresponding to each pixel value, and obtain the total number of pixels in the image; based on the histogram, obtain the median value of the horizontal axis of the histogram of the image with the preset display bit width; The flicker threshold is obtained by multiplying the set anti-flicker ratio by the total number of pixels in the image; the full image threshold is obtained by multiplying the set throw ratio by the total number of pixels in the image. Obtain the left horizontal boundary, anti-flicker threshold, and right horizontal boundary of a preset high display bit width image histogram; the left horizontal boundary of the preset high display bit width image histogram is the pixel value corresponding to the accumulated number of pixels starting from the minimum value of the horizontal axis of the histogram when it reaches the full image threshold; the anti-flicker threshold of the preset high display bit width image histogram is the pixel value corresponding to the accumulated number of pixels starting from the maximum value of the horizontal axis of the histogram when it reaches the flicker threshold; the right horizontal boundary of the preset high display bit width image histogram is the pixel value corresponding to the accumulated number of pixels starting from the maximum value of the horizontal axis of the histogram when it reaches the full image threshold; The expression for the dynamic range R of the preset high display bit width image histogram is: R = histmax - histmin; The expression for the anti-flicker dynamic range R_flash of the preset high display bit width image histogram is: R_flash=histflash-histmin; Histmin, histflash, and histmax represent the left horizontal boundary, anti-flicker threshold, and right horizontal boundary of the preset high display bit width image histogram, respectively.
4. The dynamic range compression method as described in claim 1, characterized in that, The pixel values of the preset high display bit width image are compared with the median of the horizontal axis of the preset high display bit width image histogram and / or with the anti-flicker dynamic range compressed to the preset low display bit width image histogram. Based on the aforementioned dynamic range, the output result of the preset low display bit width image after linear mapping adjustment is obtained, including: When the pixel value Src of the preset high display bit width image is less than GrayMed, Dst=(Src-histmin) / (GrayMed-histmin)*A_l+(D_s-A_l); When Src ≥ GrayMed and Src < R_d_flash Dst=(Src-GrayMed) / (R_flash-GrayMed)*A_u_flash+D_s; When Src ≥ R_d_flash Dst=(Src-R_d_flash) / (R-R_d_flash)*(A_u-A_u_flash)+D_u_flash; Where Dst represents the output result of the preset low display bit width image after linear mapping adjustment.
5. The dynamic range compression method according to any one of claims 1-4, characterized in that, The default high display bit width is 14 bits, and the default low display bit width is 8 bits.
6. An electronic device, characterized in that, It includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program that, when executed by the processing unit, enables the processing unit to perform the steps of the dynamic range compression method according to any one of claims 1-5.
7. A storage medium, characterized in that, It stores a computer program executable by an access authentication device, which, when run on the access authentication device, enables the access authentication device to perform the steps of the dynamic range compression method according to any one of claims 1-5.
Citation Information
Patent Citations
Image processing method and device, image processing equipment and storage medium
CN115052111A
Methods, apparatus, and systems for extended high dynamic range ("HDR") HDR to HDR tone mapping
EP3220349A1
