Adaptive Image Shadow Correction Method and Image Shadow Correction System

By filtering and calculating specific statistics of block pairs in the image processing circuit, calculating shadow compensation values ​​and adjusting the picture, the image shadow correction problem between different lenses and sensors is solved, achieving better balance and error avoidance.

CN115914864BActive Publication Date: 2025-05-27REALTEK SEMICON CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110889947.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-04
Publication Date
2025-05-27
Estimated Expiration
2041-08-04

AI Technical Summary

Technical Problem

The prior art is difficult to achieve effective image shading correction between different lenses and sensors, resulting in "metagenesis" phenomena and shadow compensation errors.

Method used

By configuring an image capture device and an image processing circuit, the current screen is divided into multiple blocks, the block pairs that meet specific conditions are selected, their hue statistics and brightness and saturation differences are calculated, and the sum similarity threshold is calculated to calculate the shadow compensation value and adjust the screen.

Benefits of technology

A better balance between different modules is achieved, the shadow compensation error caused by "metaphors" is avoided, and shadow compensation is performed through statistics of automatic white balance and automatic exposure without increasing the calculation amount and hardware support.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115914864B_ABST
    Figure CN115914864B_ABST
Patent Text Reader

Abstract

The present disclosure relates to an adaptive image shadow correction method and an image shadow correction system. An adaptive image shadow correction method and system are provided. The method includes: configuring an image capture device to obtain a current frame; configuring an image processing circuit to receive the current frame, and configuring a processing unit to perform the following steps: dividing the current frame into a plurality of blocks; selecting a plurality of block pairs from these blocks, wherein each of these block pairs includes an internal block and an external block; performing a screening process on these block pairs to determine whether brightness conditions, saturation conditions, hue similarity conditions, and sharpness similarity conditions are met; in response to obtaining a plurality of screened block pairs, calculating a total similarity threshold based on hue statistical data, saturation difference, and brightness difference; using these screened blocks with individual thresholds less than the total similarity threshold to calculate a shadow compensation value to adjust the current frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a calibration method and a calibration system, and particularly to an adaptive image shadow calibration method and an image shadow calibration system. Background Art

[0002] In an imaging module, there is an inevitable physical phenomenon called lens shading, which can be generally classified into two causes:

[0003] One is luminance shading. Since the lens can be regarded as a convex lens and most of the light is concentrated in the central area, it will cause insufficient light in the edge corners. Also, due to the attenuation of natural light caused by the incident angle (approximate with cos 4 θ), luminance shading is caused.

[0004] The other is called color shading. There is an infrared light filter (IR-Cut Filter) in the lens module between the lens and the image sensor, aiming to prevent the invisible infrared light to the human eye from interfering with the sensor. The infrared light filter is mainly divided into an absorption type and a reflection type.

[0005] Specifically, the advantage of the reflection type infrared light filter is that the cut-off region is relatively steep and can cut off more infrared light, but the requirement for the incident light angle is its biggest problem and one of the main causes of color shading. The advantage of the absorption type infrared light filter is that it is stable and the cut-off wavelength will not shift due to the change of the incident light angle, and the cost consideration is the shortcoming of the absorption type filter.

[0006] For the differences between different lenses and different sensors, the same image shadow compensation setting cannot have the same performance for each module. Secondly, in the shadow compensation, the phenomenon of "metamerism" will occur. The image shadow compensation required under similar color temperatures is actually different, but if implemented by the current method, misjudgment often occurs. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to provide an adaptive image shadow calibration method and an image shadow calibration system in view of the deficiencies of the prior art.

[0008] To solve the above technical problems, one of the technical solutions adopted by the present invention is to provide an adaptive image shadow correction method, which includes: configuring an image capture device to obtain a current frame; configuring an image processing circuit to receive the current frame, and configuring a processing unit to perform the following steps: dividing the current frame into a plurality of blocks; selecting a plurality of block pairs from these blocks, wherein each of these block pairs includes an inner block and an outer block, the inner block is one of the blocks in the inner area of the current frame, and the outer block is one of the blocks in the outer area of the current frame; performing a screening process for each of these block pairs, including the following steps: obtaining the brightness difference and saturation difference of the current block pair; determining whether the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition; in response to determining that the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition, further obtaining the hue statistical data of the current block pair; determining whether the hue statistical data meets the hue similarity condition; in response to determining that the hue statistical data meets the hue similarity condition, further comparing the sharpness of the current block pair to determine whether it meets the sharpness similarity condition; and in response to determining that the sharpness similarity condition is met, regarding the current block pair as a screened block pair; in response to obtaining a plurality of these screened block pairs, calculating a total similarity threshold based on the hue statistical data, the saturation difference, and the brightness difference of each of these screened blocks; for each of these screened blocks, whether there is an individual threshold smaller than the total similarity threshold; using the screened blocks having an individual threshold smaller than the total similarity threshold to calculate a shadow compensation value; and adjusting the current frame with the shadow compensation value.

[0009] To solve the above technical problems, another technical solution adopted by the present invention is to provide an adaptive image shadow correction system, which includes an image capture device and an image processing circuit. The image capture device is configured to obtain a current frame. The image processing circuit receives the current frame and includes a processing unit configured to: divide the current frame into a plurality of blocks; select a plurality of block pairs from the blocks, where each of the block pairs includes an inner block and an outer block, the inner block being one of the blocks in the inner area of the current frame, and the outer block being one of the blocks in the outer area of the current frame; perform a screening process for each of the block pairs, including the following steps: obtain the brightness difference and saturation difference of the current block pair; determine whether the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition; in response to determining that the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition, further obtain the hue statistical data of the current block pair; determine whether the hue statistical data meets the hue similarity condition; in response to determining that the hue statistical data meets the hue similarity condition, further compare the sharpness of the current block pair to determine whether the sharpness similarity condition is met; and in response to determining that the sharpness similarity condition is met, regard the current block pair as a screened block pair; in response to obtaining a plurality of the screened block pairs, calculate a total similarity threshold based on the hue statistical data, the saturation difference, and the brightness difference of each of the screened blocks; for each of the screened blocks, determine whether there is an individual threshold smaller than the total similarity threshold; use the screened blocks having an individual threshold smaller than the total similarity threshold to calculate a shadow compensation value; and adjust the current frame with the shadow compensation value to generate an adjusted frame.

[0010] One of the beneficial effects of the present invention is that the adaptive image shadow correction method and the image shadow correction system provided by the present invention can achieve a better balance between different modules, and at the same time can avoid the shadow compensation error caused by "metamerism". Without consuming additional computational power and hardware support, shadow compensation is achieved by using the existing statistics of automatic white balance and automatic exposure.

[0011] In addition, the adaptive image shadow correction method and the image shadow correction system provided by the present invention can obtain the most suitable pairing result for shadow compensation operation by filtering and calculating the similarity of the selected paired blocks. And among all the paired blocks after screening, moving average is respectively implemented to achieve the elimination of extreme deviation, which can avoid the excessive offset caused by a single paired block and ensure the stability of the image shadow correction method and the image shadow correction system of the present invention.

[0012] To further understand the features and technical content of the present invention, please refer to the following detailed description and diagrams of the present invention. However, the provided diagrams are only for reference and illustration, and are not used to limit the present invention. Description of the Drawings

[0013] Figure 1 It is a functional block diagram of the image shadow correction system according to an embodiment of the present invention.

[0014] Figure 2 It is a flowchart of the image shadow correction method according to an embodiment of the present invention.

[0015] Figure 3 It is a schematic diagram of the current screen divided into multiple blocks according to an embodiment of the present invention.

[0016] Figure 4 It is a schematic diagram of selecting an internal block and an external block from the current screen as a block pair according to an embodiment of the present invention. Detailed Embodiment

[0017] The following is to illustrate the implementation manner of the "adaptive image shadow correction method and image shadow correction system" disclosed in the present invention through specific specific embodiments. Those skilled in the art can understand the advantages and effects of the present invention from the content disclosed in this specification. The present invention can be implemented or applied through other different specific embodiments, and various details in this specification can also be modified and changed based on different viewpoints and applications without departing from the concept of the present invention. Additionally, the drawings of the present invention are only simple schematic illustrations and are not drawn according to actual dimensions, hereby stating in advance. The following embodiments will further detail the related technical content of the present invention, but the disclosed content is not used to limit the protection scope of the present invention. In addition, the term "or" used herein should be understood to possibly include any one or a combination of more of the associated listed items according to the actual situation.

[0018] Refer to Figure 1As shown in the figure, the first embodiment of the present invention provides an adaptive image shadow correction system 1, which includes an image capture device 10 and an image processing circuit 12. The image capture device 10 can be, for example, a camera or a video camera, and is configured to obtain the current frame FM. The image shadow correction system 1 can be a handheld device or a similar device (such as a desktop computer or a laptop computer with similar imaging capabilities). It should be noted that the image processing circuit 12, the processing unit 120, the memory 122, and / or other processing circuits can generally be referred to as "image processing circuit" herein. This image processing circuit can be embodied in software, firmware, hardware, or any combination thereof, in whole or in part. In addition, the image processing circuit can be a single processing module contained therein, or can be incorporated into any one of the other elements within the image shadow correction system 1, in whole or in part. Alternatively, the image processing circuit 12 can be partially embodied within the image shadow correction system 1.

[0019] In Figure 1 the image processing circuit 12, the processing unit 120 and / or other data processing circuits are operatively coupled to the memory 122 to execute various algorithms for implementing the technologies disclosed in the present invention. These algorithms can be executed by the processing unit 120 and / or other processing circuits, the associated firmware or software based on certain instructions executable by the processing unit 120 and / or other processing circuits. Any suitable article (including one or more tangible computer-readable media) can be used to store these instructions to store the instructions at least centrally. The article(s) can include, for example, the memory 122. The memory 122 can include any suitable article for storing data and executable instructions, such as random access memory, read-only memory, rewritable flash memory, hard disk drive, and optical disc.

[0020] Reference can further be made to Figure 2 、 Figure 3 and Figure 4 , Figure 2 which are flowcharts of an image shadow correction method according to an embodiment of the present invention, Figure 3 which is a schematic diagram of the current frame divided into multiple blocks according to an embodiment of the present invention, Figure 4 which is a schematic diagram of selecting internal blocks and external blocks from the current frame as a block pair according to an embodiment of the present invention.

[0021] As Figure 2 shown, the image shadow correction method can include the following steps:

[0022] Step S200: Divide the current frame FM into multiple blocks BLK. For example, Figure 3 shows that the current frame FM is divided into multiple 10 by 10 blocks BLK, and the sizes of the blocks BLK are equal, but the present invention is not limited thereto, and the size and quantity configuration can be changed according to requirements.

[0023] Step S201: Select multiple block pairs from these blocks BLK.

[0024] Specifically, each block pair includes an internal block IB and an external block OB. The internal block IB is one of the multiple blocks BLK in the internal area IA of the current screen FM, and the external block OB is one of the multiple blocks BLK in the external area OA of the current screen. Among them, the number of block pairs can reach at most the total number of these blocks BLK, and the selection method can be repeated or non-repeated.

[0025] In order to accurately restore the image error caused by the lens shadow of the image capture device 10, block pairs with reference value must be screened out first. Therefore, execute Step S202: Perform a screening process for each of these block pairs, including the following steps:

[0026] Step S203: Obtain the brightness difference and saturation difference of the current block pair.

[0027] Specifically, if only the brightness difference of the block pair is considered, it is easy to cause misjudgment. Therefore, the saturation difference needs to be considered at the same time. In some embodiments, the average brightness of multiple pixels in the internal block IB and the average brightness of multiple pixels in the external block OB can be calculated first, and then the difference between the two is used as the brightness difference. In this way, operations at the pixel level can be avoided to save the system operation amount.

[0028] In addition, in this step, the average brightness of the internal block IB or the external block OB is calculated after excluding those pixels whose pixel brightness is higher than the brightness threshold among the corresponding pixels. In other words, by setting the brightness threshold, overexposed pixels can be excluded, and then the effective pixel brightness within the block can be statistically calculated.

[0029] On the other hand, the saturation difference of the block pair is the difference between the saturation of the internal block IB and the saturation of the external block OB.

[0030] The saturation of the internal block IB or the external block OB can be represented by the following formula (1):

[0031]

[0032] Where, Δ = C max - C min , S is the saturation, C max is the RGB maximum value, C min is the RGB minimum value, which can be represented by the following formulas (2) and (3) respectively:

[0033] C max = max(R′, G′, B′)... Formula (2);

[0034] C min = min(R′, G′, B′)... Equation (3);

[0035] Wherein, and

[0036] R is the red coordinate value, G is the green coordinate value, and B is the blue coordinate value.

[0037] Step S204: Determine whether the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition. The brightness condition and the saturation condition can be, for example: when the internal and external saturations are both low, it means that both the internal block and the external block are close to gray. Based on the judgment of shadow compensation, even if the brightness difference between the internal block and the external block is large, they should still be regarded as having a high similarity and can be used as a block pair for judging shadow compensation.

[0038] In response to determining that the brightness difference does not meet the brightness condition, or the saturation difference does not meet the saturation condition, go to step S213: End the screening process for the current block pair, and the screening of the remaining un-screened block pairs can be continued.

[0039] In response to determining that the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition, go to step S205: Obtain the hue statistical data of the current block pair.

[0040] Specifically, the hue statistical data can include the red gain and the green gain, which can be used as conditions for judging whether the block pair has a similar hue.

[0041] The red gain (R Gain) is the ratio of the average value of the red coordinate values of all pixels and the average value of the green coordinate values of all pixels in the external block or the internal block. That is, it is the ratio of the average block red coordinate value and the average block green coordinate value (R / G). It should be noted that the R Gain of the internal block is labeled as R / G, and the R Gain of the external block is labeled as R’ / G’.

[0042] The blue gain (B Gain) is the ratio of the average value of the blue coordinate values of all pixels and the average value of the green coordinate values of all pixels in the external block or the internal block. That is, it is the ratio of the average block blue coordinate value and the average block green coordinate value (B / G). It should be noted that the B Gain of the internal block is labeled as B / G, and the B Gain of the external block is labeled as B’ / G’.

[0043] In addition, although the red gain and the blue gain can be used as conditions for judging whether a block pair has a similar hue, since the green coordinate value of the block pair is a key factor, the hue statistical data further includes the ratio of the average green coordinate value of the internal block to the average green coordinate value of the external block of the current block pair. This ratio is used as a green channel ratio to judge and avoid the hue channel error caused by the green coordinate value.

[0044] Step S206: Determine whether the hue statistical data meets the hue similarity condition.

[0045] In this step, the hue similarity condition can be, for example, to determine whether the following formula (4) is satisfied:

[0046] 0.9 < Hue Diff’ / Hue Diff < 1.1... Formula (4);

[0047] Among them, Hue Diff represents the difference value between R / G and B / G in the internal block, and Hue Diff’ represents the difference value between R’ / G’ and B’ / G’ in the external block. The significance is that when converting from RGB coordinates to HSV coordinates, the X-axis is R / G and the Y-axis is B / G. On the HSV coordinate, the values of R / G and B / G can be used as reference values for hue and can be used to replace H in HSV.

[0048] Therefore, the step of determining whether the hue statistical data meets the hue similarity condition may include first determining whether the green channel ratio is within a predetermined hue range, and then comparing the red gain and the blue gain of the internal block and the external block.

[0049] In response to determining that the hue statistical data meets the hue similarity condition, enter step S207: Compare the sharpness of the current block pair to determine whether the sharpness similarity condition is met.

[0050] Specifically, calculating the sharpness of the block pair is to judge its picture complexity. And in the case of a complex picture, calculating the average value of the gray scale actually has reference value for shadow compensation. Therefore, the present invention can give corresponding thresholds for scenes with different complexities through the sharpness statistic (AF) as the weight for block extraction.

[0051] Specifically, the ratio of the internal sharpness to the external sharpness can be used as a parameter for setting weights, and the ratio is the smaller value divided by the larger value. For example, if the ratio of the sharpness of the internal block to the sharpness of the external block is in the range of 0.9 to 1, the set weight is 1; if the sharpness ratio falls within the range of 0.75 to 0.9, the average value of this range is taken as the weight, that is, the weight is (0.75 + 0.9) / 2, which is 0.825, and the weights of all block pairs can be calculated by analogy.

[0052] The step of comparing the sharpness of the current block pair may include performing edge detection Sobel filters on the external block OB and the internal block IB respectively to generate internal block sharpness and external block sharpness and compare them.

[0053] The sharpness can be expressed by the following formula (5):

[0054]

[0055] The edge detection Sobel filters can be expressed by the following formulas (6) and (7):

[0056]

[0057]

[0058] Among them, Image can be the image corresponding to the external block OB and the internal block IB.

[0059] Furthermore, the internal block sharpness can be compared with the external block sharpness to determine whether the sharpness similarity condition is satisfied. For example, the difference between the internal block sharpness and the external block sharpness can be calculated, and it is determined whether this difference is within the sharpness range. Or, the ratio of the internal block sharpness to the external block sharpness can be calculated, and it is determined whether this ratio is within the ratio set in the sharpness range. For example, the sharpness range can be set between 0.95 and 1.05.

[0060] For example, when the ratio of the internal block sharpness to the external block sharpness is 1, it means that the internal block sharpness is equal to the external block sharpness and is within the sharpness range, so the sharpness similarity condition is satisfied. For different intervals in the sharpness range, different confidence weights can be given. For example, in the interval of 1 to 1.03, 100% confidence is given, and the confidence weight is 1. When in the interval of 1.03 to 1.05, 80% confidence is given, and the confidence weight is 0.8, and so on.

[0061] In response to determining that the sharpness similarity condition is satisfied, enter step S208: regard the current block pair as a screened block pair, indicating that it has passed the screening process.

[0062] After obtaining multiple pairs of filtered blocks, the red gain and green gain of each can be separately counted first, and a moving average filter is performed to eliminate the extreme deviation values. In this way, the excessive offset caused by a single paired block can be avoided, ensuring the stability of the algorithm of the present invention.

[0063] Next, after obtaining multiple pairs of filtered blocks by performing a screening process for each pair of blocks, step S209 is entered: Calculate the total similarity threshold based on the hue statistical data, saturation difference, and brightness difference of each of the filtered blocks.

[0064] Specifically, the total similarity threshold can be set by calculating the Euclidean norm of the pairs of filtered blocks, which can be represented by the following formula (8):

[0065]

[0066] where RBGain_Diff is the difference in hue (HUE) between the inner block and the outer block in the pair of filtered blocks, Saturation_Diff is the saturation difference between the inner block and the outer block in the pair of filtered blocks, and Brightness_Diff is the brightness difference between the inner block and the outer block in the pair of filtered blocks.

[0067] For each of the pairs of filtered blocks, step S210 is entered: Determine whether there is an individual threshold less than the total similarity threshold. If so, step S211 is entered; otherwise, step S214 is entered to eliminate the pairs of filtered blocks that do not have an individual threshold less than the total similarity threshold.

[0068] In addition, in step S210, it can be further determined whether the weight of this pair of blocks is greater than a predetermined weight value, that is, according to what is described above, the weight determined according to the ratio of the inner and outer sharpness. In some embodiments, if the weight is less than 0.5, this pair of blocks is discarded.

[0069] In response to having an individual threshold less than the total similarity threshold, step S211 is entered: Use the filtered blocks having the individual threshold less than the total similarity threshold to calculate the shadow compensation value.

[0070] More specifically, calculating the shadow compensation value mainly involves calculating the R / G ratio of the inner block and the R’ / G’ ratio of the outer block in the pairs of filtered blocks. If the red gain (R Gain) of the outer block is larger, it is considered that the outer block requires more R values.

[0071] For example, if the value of R’ / G’ divided by R / G (i.e., the ratio of the R Gain of the internal block to the R Gain of the external block) is greater than 1, it means that the red coordinate value R of the external block is insufficient. Therefore, the shadow compensation of the R channel will be increased until this ratio is between 0.99 and 1.01.

[0072] It should be noted that when obtaining the final reference block pair, ideally, a sufficient number of block pairs should be maintained. However, in actual applications, sometimes the number of obtained block pairs may be too small.

[0073] Therefore, in order to avoid the situation where the number of obtained block pairs is too small, resulting in incorrect compensation, another threshold (percentage) can be used to determine the weight, and a buffer is set up to try to perform shadow compensation. When no more block pairs are found after a certain number of times, the shadow compensation is stopped and used as the final result.

[0074] When calculating the final shadow ratio, the following formulas are used for the R channel and the B channel respectively according to the formula:

[0075] R channel: (Internal red gain / External red gain - 1) * corresponding weight;

[0076] B channel: (Internal blue gain / External blue gain - 1) * corresponding weight;

[0077] The corresponding weights in the above two formulas are determined by the finally selected block pair.

[0078] For example, if n is the number of obtained block pairs and N is the total number of block pairs, if n is less than or equal to N * 1 / 4, the corresponding weight is 1, otherwise the corresponding weight is 4 * n / N. The above is only an example, and the present invention is not limited to this condition.

[0079] Enter step S212: Adjust the current screen with the shadow compensation value to generate an adjusted screen.

[0080] For example, after determining the shadow compensation value, the current screen can be adjusted according to a predetermined correction factor. For example, the adjustment values at the center and edges of the screen may be different due to multiplying by the predetermined correction factor. The predetermined correction factor can be shown by the following formula (9), where x represents the horizontal coordinate of the screen and y represents the correction factor corresponding to the x coordinate:

[0081]

[0082] In addition, it should be noted that, in the above process, the statistical data of brightness, saturation, sharpness, and hue used can all be obtained from the inherent hardware statistical data of existing image capture devices. Therefore, the adaptive image shadow correction method and image shadow correction system provided by the present invention do not require additional computational effort and do not require dedicated hardware support.

[0083] [Advantages of the Embodiment]

[0084] One of the advantages of the present invention is that the adaptive image shadow correction method and image shadow correction system provided by the present invention can achieve a better balance between different modules and can also avoid the shadow compensation error caused by "metamerism". Without consuming additional computational effort and hardware support, shadow compensation is achieved using the existing statistical data of automatic white balance and automatic exposure.

[0085] In addition, the adaptive image shadow correction method and image shadow correction system provided by the present invention can obtain the most suitable pairing result for shadow compensation operations by filtering and calculating the similarity of the selected paired blocks. Moreover, among all the filtered paired blocks, moving averages are respectively implemented to achieve the elimination of extreme deviation values, which can avoid excessive offset caused by a single paired block and ensure the stability of the image shadow correction method and image shadow correction system of the present invention.

[0086] The content disclosed above is only the preferred feasible embodiment of the present invention and does not limit the scope of the patent application of the present invention. Therefore, all equivalent technical changes made by using the content of the specification and drawings of the present invention are included in the scope of the patent application of the present invention.

[0087] Symbol Explanation

[0088] 1: Image shadow correction system

[0089] 12: Image processing circuit

[0090] 120: Processing unit

[0091] 122: Memory

[0092] 10: Image capture device

[0093] BLK: Block

[0094] FM: Current screen

[0095] OA: External area

[0096] IA: Internal area

[0097] OB: External block

[0098] IB: Internal Block

Claims

1. An adaptive image shadow correction method, which includes: Configuring an image capture device to obtain a current screen; Configuring an image processing circuit to receive the current screen, and configuring a processing unit to perform the following steps: Dividing the current screen into a plurality of blocks; Selecting a plurality of block pairs from these blocks, where each of these block pairs includes an inner block and an outer block, the inner block being one of the blocks in the inner area of the current screen, and the outer block being one of the blocks in the outer area of the current screen; Performing a screening process for each of these block pairs, including the following steps: Obtaining the brightness difference and saturation difference of the current block pair; Judging whether the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition; In response to judging that the brightness difference and the saturation difference respectively meet the brightness condition and the saturation condition, further obtaining the hue statistical data of the current block pair; Judging whether the hue statistical data meets the hue similarity condition; In response to judging that the hue statistical data meets the hue similarity condition, further comparing the sharpness of the current block pair to judge whether the sharpness similarity condition is met; and In response to judging that the sharpness similarity condition is met, regarding the current block pair as a screened block pair; In response to obtaining a plurality of these screened block pairs, calculating a total similarity threshold according to the hue statistical data, the saturation difference, and the brightness difference of each of these screened blocks; For each of these screened blocks, judging whether there is an individual threshold smaller than the total similarity threshold; Using the screened blocks having an individual threshold smaller than the total similarity threshold to calculate a shadow compensation value; and Adjusting the current screen with the shadow compensation value to generate a compensated screen.

2. The image shadow correction method according to claim 1, wherein, in the screening process, the brightness difference of the block pair is the difference between the average brightness of a plurality of pixels in the inner block and the average brightness of a plurality of pixels in the outer block.

3. The image shadow correction method according to claim 2, wherein the average brightness of the inner block or the outer block is calculated after excluding the pixels whose pixel brightness is higher than the brightness threshold among the corresponding pixels.

4. The image shadow correction method according to claim 1, wherein, in the screening process, the saturation difference of the block pair is the difference between the saturation of the inner block and the saturation of the outer block.

5. The image shadow correction method according to claim 4, wherein the saturation is represented by the following formula: wherein, Δ = C max -C min , where S is the saturation, C max is the RGB maximum value, and C min is the RGB minimum value, which can be expressed by the following equations respectively: C min = max(R′, G′, B′); C min = min(R′, G′, B′); Among them, and where R is the red coordinate value, G is the green coordinate value, and B is the blue coordinate value.

6. The image shadow correction method according to claim 1, wherein, obtaining the hue statistical data of the current block pair includes: Calculating the red gain and green gain of the inner block and the outer block of the current block pair respectively, where the red gain is the ratio of the average red coordinate value of the block to the average green coordinate value of the block, and the blue gain is the ratio of the average blue coordinate value of the block to the average green coordinate value of the block; and Calculate the ratio of the block average green coordinate value of the internal block of the current block pair to the block average green coordinate value of the external block, and use it as the green channel ratio.

7. The image shadow correction method according to claim 6, wherein, Determining whether the hue statistical data satisfies the hue similarity condition includes: Determining whether the green channel ratio is within a predetermined hue range; and In response to the green channel ratio being within the predetermined hue range, comparing the red gain and green gain of the internal block and the external block.

8. The image shadow correction method according to claim 6, further including: In response to obtaining a plurality of the selected block pairs, respectively statistically calculating their red gain and green gain, and performing a moving average filter to eliminate the extreme deviation values.

9. The image shadow correction method according to claim 1, wherein, The step of comparing the sharpness of the current block pair further includes respectively performing an edge detection Sobel filter on the external block and the internal block of the current block pair to generate an inner block sharpness and an outer block sharpness and compare them.

10. An adaptive image shadow correction system, which includes: An image capture device configured to obtain a current screen; An image processing circuit that receives the current screen and includes a processing unit configured to perform the following steps: Dividing the current screen into a plurality of blocks; Selecting a plurality of block pairs from the blocks, wherein each of the block pairs includes an internal block and an external block, the internal block being one of the blocks in the internal area of the current screen, and the external block being one of the blocks in the external area of the current screen; Performing a screening process for each of the block pairs, including the following steps: Obtaining the brightness difference and saturation difference of the current block pair; Determining whether the brightness difference and the saturation difference respectively satisfy the brightness condition and the saturation condition; In response to determining that the brightness difference and the saturation difference respectively satisfy the brightness condition and the saturation condition, further obtaining the hue statistical data of the current block pair; Determining whether the hue statistical data satisfies the hue similarity condition; In response to determining that the hue statistical data satisfies the hue similarity condition, further comparing the sharpness of the current block pair to determine whether the sharpness similarity condition is satisfied; and In response to determining that the sharpness similarity condition is satisfied, regarding the current block pair as a selected block pair; In response to obtaining a plurality of the selected block pairs, calculating a total similarity threshold according to the hue statistical data, the saturation difference, and the brightness difference of each of the selected blocks; For each of the selected blocks, determining whether there is an individual threshold smaller than the total similarity threshold; Using the selected blocks having an individual threshold smaller than the total similarity threshold to calculate a shadow compensation value; and Adjusting the current screen with the shadow compensation value to generate an adjusted screen.

Citation Information

Patent Citations

  • Digital image visualized management and retrieval for communication network

    CN101930461A

  • Shadow correction detection parameter determining and correction detecting method and device, storage medium and fisheye camera

    CN108234824A