Image processing device and method with lens color cast correction mechanism
By using a lens color shift correction mechanism in the image processing device and adjusting parameters using multiple circuits and statistical circuits, the color shift problem caused by the mismatch between the lens and the image sensor configuration is solved, and the continuity and consistency of the output image are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- REALTEK SEMICON CORP
- Filing Date
- 2022-09-06
- Publication Date
- 2026-07-10
Smart Images

Figure CN117729440B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to image processing technology, and more particularly to an image processing apparatus and method with a lens color shift correction mechanism. Background Technology
[0002] In image capturing devices, the configuration of the lens and sensor often results in color shading due to issues such as the influence of filters, mismatch between the principal angle of the lens and the principal angle of the sensor, and different refraction angles between the lens and the sensor. This color shading changes with variations in ambient light and the angle of incidence. As the image processing mechanism adjusts for color shading, the output image also changes. If multiple adjustments are required under continuously changing external conditions, the resulting continuous changes in the output image will create a discontinuous viewing experience for the user. Summary of the Invention
[0003] In view of the problems of the prior art, one object of the present invention is to provide an image processing apparatus and method with a lens color shift correction mechanism to improve the prior art.
[0004] This invention includes an image processing apparatus with a lens color cast correction mechanism, comprising: a first correction circuit, a second correction circuit, a first statistical circuit, a second statistical circuit, and a correction calculation circuit. The first correction circuit is configured to perform lens color cast correction on an input image according to a first correction parameter to generate a first corrected image. The second correction circuit is configured to perform lens color cast correction on the input image according to a second correction parameter to generate a second corrected image. The first statistical circuit is configured to perform color cast parameter statistics on the first corrected image to generate a first statistical result. The second statistical circuit is configured to perform color cast parameter statistics on the second corrected image to generate a second statistical result. The correction calculation circuit is configured to determine whether the second corrected image meets the color cast correction conditions based on the second statistical result when the first corrected image is determined to have a color cast based on the first statistical result. When the second corrected image does not meet the color cast correction conditions, the correction calculation circuit adjusts the second correction parameter, and when the second corrected image meets the color cast correction conditions, sets the second correction parameter as the first correction parameter of the first correction circuit, thereby making the first corrected image generated by the first correction circuit the output corrected image.
[0005] The present invention further includes an image processing method with a lens color cast correction mechanism, comprising: a first correction circuit performing lens color cast correction on an input image according to a first correction parameter to generate a first corrected image; a second correction circuit performing lens color cast correction on the input image according to a second correction parameter to generate a second corrected image; a first statistical circuit performing color cast parameter statistics on the first corrected image to generate a first statistical result; a second statistical circuit performing color cast parameter statistics on the second corrected image to generate a second statistical result; a correction calculation circuit determining whether the second corrected image meets the color cast correction conditions based on the second statistical result when the first corrected image is determined to have a color cast phenomenon based on the first statistical result; and a correction calculation circuit adjusting the second correction parameter when the second corrected image does not meet the color cast correction conditions, and setting the second correction parameter as the first correction parameter of the first correction circuit when the second corrected image meets the color cast correction conditions, thereby making the first corrected image generated by the first correction circuit the output corrected image. Attached Figure Description
[0006] Regarding the features, implementation, and effects of this case, the preferred embodiments are described in detail below with reference to the accompanying drawings.
[0007] Figure 1 This diagram shows a block diagram of a computer system according to one embodiment of the present invention;
[0008] Figure 2 This shows a block diagram of an image processing device with a lens chromatic aberration correction mechanism according to an embodiment of the present invention.
[0009] Figure 3 This diagram illustrates a first corrected image, serving as the image to be statistically analyzed, in one embodiment of the present invention.
[0010] Figure 4 This shows a block diagram of an image processing circuit according to one embodiment of the present invention;
[0011] Figure 5 A block diagram of an image processing apparatus is shown in another embodiment of the present invention;
[0012] Figure 6A This diagram illustrates the color parameter distribution of an image without lens color shift correction, according to one embodiment of the present invention.
[0013] Figure 6B This invention displays a schematic diagram of the color parameter distribution of an image after lens color shift correction, according to one embodiment of the invention; and
[0014] Figure 7 This invention presents a flowchart of an image processing method with a lens chromatic aberration correction mechanism, according to one embodiment of the present invention. Detailed Implementation
[0015] One objective of this invention is to provide an image processing apparatus and method with a lens color cast correction mechanism. This method allows a second correction circuit to verify the adjustment of correction parameters while a first correction circuit outputs a corrected image for display. Once optimal correction parameters are found, the first correction circuit adjusts these parameters to generate the corrected image. Color cast correction can then be completed without affecting the output of the corrected image.
[0016] Please refer to Figure 1 . Figure 1 This diagram shows a block diagram of a computer system 100 according to an embodiment of the present invention. The computer system 100 can be any electronic device capable of capturing and displaying images, such as, but not limited to, smartphones, tablet computers, laptop computers, or digital camera devices. The computer system 100 includes an image capturing device 110, an image processing device 120, a display device 130, and a processor 140.
[0017] The image capturing device 110 includes a lens 150 and a photosensitive element 160, so that the photosensitive element 160 receives light L1 through the lens 150 to generate an input image IM. Due to its own structure and the difference of the light source, the lens 150 is prone to causing the photosensitive element 160 to receive light at an uneven incident angle, which in turn causes the generated input image IM to have color cast.
[0018] Image processing device 120 has a lens color shift correction mechanism, configured to process the input image IM to eliminate color shift, and then generate an output corrected image OM for display on display device 130. Processor 140 is electrically coupled to image capturing device 110, image processing device 120, and display device 130 via a bus to control the operation of each component. Processor 140 is configured to execute driver program 170 of image processing device 120 to control image processing device 120 to execute the aforementioned lens color shift correction mechanism.
[0019] Please refer to Figure 2 . Figure 2 This diagram shows a block diagram of an image processing apparatus 120 with a lens color shift correction mechanism according to an embodiment of the present invention. The image processing apparatus 120 includes: a first correction circuit 200A, a second correction circuit 200B, a first statistical circuit 210A, a second statistical circuit 210B, a correction calculation circuit 220, and an image processing circuit 230.
[0020] The first correction circuit 200A is configured to perform lens color shift correction on the input image IM according to a set of first correction parameters CP1 to generate a first corrected image IC1. The second correction circuit 200B is configured to perform lens color shift correction on the input image IM according to a set of second correction parameters CP2 to generate a second corrected image IC2.
[0021] In one embodiment, the first correction parameter CP1 and the second correction parameter CP2 each include a set of color parameter base values and a set of color parameter adjustment ratios corresponding to the color parameters. The color parameters include red, green, and blue parameters.
[0022] In one embodiment, color cast often appears in a circle around the center of the input image IM. Therefore, a set of base values for color parameters actually includes multiple sets of values, each corresponding to one of the red, green, and blue parameters, and includes multiple base values at different positions from the inner center region to the outermost edge region of the input image IM.
[0023] In one numerical example, there are 28 regions from the center to the outermost edge. The base values for the color parameters corresponding to the red parameter are 1, 2.3, 3.2, 4.8, and 6.7 for the center, first, third, and sixth regions, respectively, and for the outermost edge region. Similarly, the blue and green parameters also have their own sets of base values.
[0024] The color parameter adjustment ratio is a set of proportional values multiplied by the aforementioned color parameters. In a numerical example, the color parameter adjustment ratio corresponds to a set of values of 1.3, 0.95, and 0.98 for the red, green, and blue parameters.
[0025] The first correction circuit 200A multiplies the pixels of each region in the input image IM by the corresponding base value of the aforementioned color parameters and the color parameter adjustment ratio. Taking the red parameter as an example, the first correction circuit 200A multiplies the red parameter of the pixels in the input image IM located in the center region, the first region, the third region, the sixth region, and the outermost edge region by values of 1×1.3, 2.3×1.3, 3.2×1.3, 4.8×1.3, and 6.7×1.3, respectively, to generate the red parameter values of the pixels in the first corrected image IC1. The first correction circuit 200A can also process the green and blue parameters of the pixels in the input image IM in the same way to generate the green and blue parameter values of the pixels in the first corrected image IC1.
[0026] The second correction circuit 200B can generate a second corrected image IC2 by processing the input image IM according to the second correction parameter CP2 through the same operation method as the first correction circuit 200A, which will not be described in detail here. However, it should be noted that in one embodiment, the base value of the color parameters included in the second correction parameter CP2 is preset to be the same as the base value of the color parameters included in the first correction parameter CP1, while the adjustment ratio of the color parameters included in the second correction parameter CP2 is set to be different from the adjustment ratio of the color parameters included in the first correction parameter CP1.
[0027] The first statistical circuit 210A is configured to perform color cast parameter statistics on the first corrected image IC1 to generate a first statistical result SS1. The second statistical circuit 210B is configured to perform color cast parameter statistics on the second corrected image IC2 to generate a second statistical result SS2.
[0028] When performing color shift parameter statistics, the first statistical circuit 210A and the second statistical circuit 210B respectively use the first corrected image IC1 and the second corrected image IC2 as images to be counted.
[0029] Please refer to Figure 3 . Figure 3 This diagram shows a first corrected image IC1, which is the image to be statistically analyzed, according to an embodiment of the present invention. The following will use the calculation of the first corrected image IC1 by the first statistical circuit 210A as an example to illustrate how the color cast parameter statistics are performed.
[0030] The first statistical circuit 210A extracts the optimal sampling path with the most even color distribution from the complex sampling paths P1 to P8 of the first corrected image IC1. Each sampling path P1 to P8 extends from an image edge pixel E1 to E8 to the image center pixel CX.
[0031] Taking sampling path P1 as an example, the first statistical circuit 210A calculates the color parameters of each of the complex sampling regions R1 to R5 distributed sequentially along sampling path P1, and calculates the color parameter ratio between the color parameters.
[0032] For example, the first statistical circuit 210A calculates the average of the red, green, and blue parameters for all pixels in the sampling region R1 as the red, green, and blue parameters for this region.
[0033] When the first calibrated image IC1 is converted into a color image through white balance calculation, the color parameter ratios are the red-green parameter ratio, the blue-green parameter ratio, the red-blue parameter ratio, the luminance parameter ratio, or a combination thereof. The luminance parameter ratio is the Y parameter in the YUV color space, and can be calculated using, for example but not limited to, the formula 0.299R + 0.587G + 0.114B, when the red, green, and blue parameters are R, G, and B, respectively.
[0034] When the first calibrated image IC1 is converted to a black and white image through white balance calculation, the color parameter ratios are the red-green parameter ratio, the blue-green parameter ratio, the red-blue parameter ratio, the saturation parameter ratio, or a combination thereof. Among them, the saturation parameter ratio is the S parameter in the HSV color space, and can be calculated based on the red, green, and blue parameters through a predefined formula.
[0035] After the color parameter ratios of all sampling regions R1 to R5 are calculated, the first statistical circuit 210A increments the cumulative value when the difference between the color parameter ratios of any two adjacent sampling regions R1 to R5 is less than a difference threshold. In different embodiments, the first statistical circuit 210A may increment a cumulative value when the difference between all or some of the color parameter ratios is less than a difference threshold.
[0036] More specifically, when two adjacent sampling areas have similar colors, resulting in an even color distribution, the first statistical circuit 210A records the cumulative value. The more adjacent sampling areas with similar colors, the larger the cumulative value will be, indicating a more evenly distributed color distribution in this sampling path. The first statistical circuit 210A then selects one of the sampling paths P1 to P8 with the largest cumulative value as the optimal sampling path.
[0037] The first statistical circuit 210A calculates the color offset of the optimal sampling path as the first statistical result SS1. In one embodiment, for the optimal sampling path, the first statistical circuit 210A calculates the difference between the color parameter ratios of the first pixel closest to the image center pixel CX and the second pixel closest to the image edge pixel E1 in the corresponding sampling area as the color offset.
[0038] For example, when the sampling path P1 is the optimal sampling path, the first statistical circuit 210A calculates the difference between the color parameter ratios of the sampling region R1 closest to the image center pixel CX and the sampling region R5 closest to the image edge pixel E1 as the color offset.
[0039] In different embodiments, the first statistical circuit 210A can calculate the difference between one or more color parameter ratios to generate one or more color offsets as a first statistical result SS1.
[0040] The second statistical circuit 210B can perform color shift parameter statistics on the second corrected image IC2 and generate a second statistical result SS2 through the same operation method as the first statistical circuit 210A, which will not be described in detail here.
[0041] The correction calculation circuit 220 is electrically coupled to the first statistical circuit 210A and the second statistical circuit 210B to receive the first statistical result SS1 and the second statistical result SS2 for calculation. In one embodiment, the correction calculation circuit 220 executes firmware to perform the relevant calculations. In one embodiment, Figure 1 The driver 170 of the image processing device 120 executed by the processor 140 is configured to handle a portion of the computational workload of the correction arithmetic circuit 220. This invention is not limited to a specific method of allocating computing resources.
[0042] The correction operation circuit 220 is electrically coupled to the first correction circuit 200A, the second correction circuit 200B and the image processing circuit 230, so as to determine whether to perform color cast correction based on the calculation results and thereby control the operation of the first correction circuit 200A, the second correction circuit 200B and the image processing circuit 230.
[0043] The operation of the correction operation circuit 220 will be explained below.
[0044] The correction calculation circuit 220 is configured to determine whether the first corrected image IC1 has a color cast based on the first statistical result SS1. More specifically, the correction calculation circuit 220 determines that the first corrected image IC1 does not have a color cast when the color offset amount, which is the first statistical result SS1, is not greater than an offset threshold (e.g., a ratio of 2%). Conversely, the correction calculation circuit 220 determines that the first corrected image IC1 has a color cast when the color offset amount, which is the first statistical result SS1, is greater than the offset threshold. The offset threshold can be set according to actual needs, serving as a standard for the correction calculation circuit 220 to determine whether a color cast has occurred.
[0045] In one embodiment, when there are multiple color offsets as the first statistical result SS1, the correction calculation circuit 220 can set multiple offset thresholds for judgment, so that when at least a specific number of color offsets are greater than the corresponding offset thresholds, it is determined that the first corrected image IC1 has a color shift phenomenon. The present invention is not limited thereto.
[0046] When the correction operation circuit 220 determines that the first correction image IC1 does not have a color shift phenomenon based on the first statistical result SS1, it directly uses the first correction image IC1 generated by the first correction circuit 200A as the output correction image OM.
[0047] When the correction operation circuit 220 determines that the first corrected image IC1 has a color shift phenomenon based on the first statistical result SS1, it determines whether the second corrected image IC2 meets the color shift correction conditions based on the second statistical result SS2.
[0048] In one embodiment, when the color shift generated by the second statistical circuit 210B is not greater than the shift threshold, the correction operation circuit 220 determines that the second corrected image IC2 meets the color shift correction condition. The correction operation circuit 220 further sets the second correction parameter CP2 to the first correction parameter CP1 of the first correction circuit 210A, thereby making the first corrected image IC1 generated by the first correction circuit 210A the output corrected image OM.
[0049] On the other hand, when the color shift generated by the second statistical circuit 210B is greater than the shift threshold, the correction operation circuit 220 determines that the second corrected image IC2 does not meet the color shift correction condition. The correction operation circuit 220 then controls the second correction circuit 200B to adjust the second correction parameter CP2.
[0050] The adjustment mechanism of the second correction parameter CP2 will be explained in detail below.
[0051] When the correction operation circuit 220 controls the second correction circuit 200B to adjust the second correction parameter CP2, it first adjusts the color parameter adjustment ratio so that the second statistical result SS2 generated by the second statistical circuit 210B can be used to determine whether the second corrected image IC2 meets the color deviation correction conditions. If the color deviation correction conditions are not met, the color parameter adjustment ratio is adjusted again.
[0052] Once the second corrected image IC2 meets the color shift correction conditions, the correction operation circuit 220 sets the color parameter adjustment ratio of the second correction parameter CP2 to the color parameter adjustment ratio of the first correction parameter CP1 of the first correction circuit 210A, thereby making the first corrected image IC1 generated by the first correction circuit 210A the output corrected image OM.
[0053] When the correction operation circuit 220 has reached an adjustment threshold for, for example, but not limited to, the number of times the color parameter adjustment ratio has been adjusted, and the second correction image IC2 still does not meet the color deviation correction condition, it will determine that the adjustment of the color parameter adjustment ratio cannot make the second correction image IC2 meet the color deviation correction condition.
[0054] At this time, the correction operation circuit 220 controls the second correction circuit 200B to replace the base value of the color parameter of the second correction parameter CP2, so as to determine again whether the second correction image IC2 meets the color deviation correction condition through the second statistical result SS2 generated by the second statistical circuit 210B, and replace the base value of the color parameter again if the color deviation correction condition is not met.
[0055] Once the second corrected image IC2 meets the color shift correction conditions, the correction operation circuit 220 sets the base value of the color parameter of the second correction parameter CP2 to the base value of the color parameter of the first correction parameter CP1, thereby making the first corrected image IC1 generated by the first correction circuit 210A the output corrected image OM.
[0056] Please refer to Figure 4 . Figure 4 This diagram shows a block diagram of an image processing circuit 230 according to one embodiment of the present invention. The image processing circuit 230 includes a first weight processing circuit 400, a second weight processing circuit 410, and a mixing circuit 420.
[0057] The first weight processing circuit 400 is configured to receive the first corrected image IC1 and output the original image OI according to the first weight W1.
[0058] The second weight processing circuit 410 is configured to receive the second corrected image IC2 and output an updated image UI according to the second weight W2.
[0059] The mixing circuit 420 is configured to mix the original image OI and the updated image UI to produce an output corrected image OM.
[0060] When the base values of the color parameters included in the first correction parameter CP1 are not replaced (i.e., when the first correction parameter CP1 is not adjusted at all or only the color parameter adjustment ratio of the first correction parameter CP1 is adjusted), the image processing circuit 230 sets the first weight W1 to the maximum value and sets the second weight W2 to the minimum value. At this time, the second weight processing circuit 410 is bypassed, which is equivalent to the image processing circuit 230 directly receiving the first corrected image IC1 and outputting it as the output corrected image OM.
[0061] On the other hand, since replacing the base value of the color parameter of the first correction parameter CP1 significantly alters the output corrected image OM, it can easily affect the user's vision. Therefore, before setting the base value of the color parameter of the second correction parameter CP2 to the base value of the color parameter of the first correction parameter CP1, the image processing circuit 230 gradually decreases the first weight W1 from its maximum value and gradually increases the second weight W2 from its minimum value within a preset time period. Then, at the end of the preset time, the base value of the color parameter of the second correction parameter CP2 is set to the base value of the color parameter of the first correction parameter CP1, and the first weight W1 is set to its maximum value and the second weight W2 is set to its minimum value.
[0062] Therefore, within the aforementioned preset time period, the image processing device 120 continuously receives different frames of the input image IM and blends the original image OI and updates the image UI by combining the old and new color parameter base values and gradually adjusting them, achieving the purpose of gradual switching. At the end of the preset time, the image processing device 120 effectively enables the image processing circuit 230 to directly receive the first corrected image IC1 and output it as the output corrected image OM. This method can avoid the user experiencing discontinuity when viewing the image.
[0063] Please refer to Figure 5 . Figure 5 This shows a block diagram of an image processing apparatus 500 according to another embodiment of the present invention. Similar to... Figure 2 The image processing apparatus 120 and image processing apparatus 500 include: a first correction circuit 200A, a second correction circuit 200B, a first statistical circuit 210A, a second statistical circuit 210B, a correction calculation circuit 220, and an image processing circuit 230. However, in this embodiment, the image processing apparatus 500 further includes a grid color shift correction circuit 510.
[0064] The aforementioned image processing device 120 primarily addresses the ring-shaped color shift phenomenon. However, in some application scenarios, Figure 1 The lens 150 may cause the captured input image IM to have an image capture result such as red on the left and green on the right, resulting in the input image IM having not only a ring color shift but also a grid color shift. Therefore, the image processing device 500 can pre-eliminate the grid color shift of the input image IM by setting the grid color shift correction circuit 510, and then connect the processed input image IM' to the first correction circuit 200A and the second correction circuit 200B to correct the ring color shift.
[0065] The image processing device of this invention, which has a lens color cast correction mechanism, allows the second correction circuit to verify the adjustment of correction parameters while the first correction circuit outputs a corrected image for display. Once optimal correction parameters are found, the first correction circuit adjusts these parameters to generate the corrected output image. Color cast correction can then be completed without affecting the output of the corrected image.
[0066] Please refer to the following at the same time Figure 6A as well as Figure 6B . Figure 6A This diagram illustrates the color parameter distribution of an image (e.g., an input image IM) that has not undergone lens color shift correction, according to one embodiment of the present invention. Figure 6B This diagram illustrates the color parameter distribution of an image (e.g., the first corrected image IC1) after lens color shift correction, according to one embodiment of the present invention.
[0067] exist Figure 6A as well as Figure 6B In the diagram, the horizontal axis represents a sampling path (e.g., ...). Figure 3 The position on the sampling path P1 is shown, and the vertical axis represents the numerical value of the color parameter. R represents the red parameter distribution, G represents the green parameter distribution, and B represents the blue parameter distribution.
[0068] Compared to Figure 6A , Figure 6B After lens color cast correction using the methods described above, the color parameter distribution will ensure that the ratio of different color parameters has the same proportion at different locations along the sampling path. For example, for Figure 6A as well as Figure 6B For the corresponding segments SE1, SE2, and SE3, Figure 6A The color parameter ratios vary due to the uneven distribution of each color, and Figure 6B The color parameter ratios are now more evenly distributed and proportional due to the correction, thus eliminating lens color cast.
[0069] Please refer to Figure 7 . Figure 7 This diagram shows a flowchart of an image processing method 700 with a lens chromatic aberration correction mechanism, according to an embodiment of the present invention.
[0070] In addition to the aforementioned apparatus, the present invention also provides an image processing method 700, applicable to, for example, but not limited to, [other applications]. Figure 2 In the image processing apparatus 120. An embodiment of the image processing method 700, for example... Figure 7 As shown, it includes the following steps.
[0071] In step S710, the first correction circuit 200A performs lens color shift correction on the input image IM according to a set of first correction parameters CP1 to generate a first correction image IC1.
[0072] In step S720, the second correction circuit 200B performs lens color shift correction on the input image IM according to a set of second correction parameters CP2 to generate a second corrected image IC2.
[0073] In step S730, the first statistical circuit 210A performs color shift parameter statistics on the first corrected image IC1 to generate the first statistical result SS1.
[0074] In step S740, the second statistical circuit 210B performs color shift parameter statistics on the second corrected image IC2 to generate the second statistical result SS2.
[0075] In step S750, the correction operation circuit 220 determines whether the first corrected image IC1 has a color shift phenomenon based on the first statistical result SS1.
[0076] In step S760, when color shift exists, the correction operation circuit 220 determines whether the second corrected image IC2 meets the color shift correction conditions based on the second statistical result SS2.
[0077] In step S770, the correction operation circuit 220 adjusts the second correction parameter CP2 when the second corrected image IC2 does not meet the color shift correction conditions. The process returns to step S740, where the second statistical circuit 210B performs color shift parameter statistics on the second corrected image IC2 to generate a second statistical result SS2, and then proceeds to the judgment in steps S750 and S760.
[0078] In step S780, when the second corrected image IC2 meets the color shift correction condition, the correction operation circuit 220 sets the second correction parameter CP2 to the first correction parameter CP1 of the first correction circuit 200A.
[0079] In step S790, when it is determined in step S750 that the color shift phenomenon does not exist, or after step S780 is completed, the correction operation circuit 220 makes the first correction image IC1 generated by the first correction circuit 200A as the output correction image OM.
[0080] It should be noted that the above-described implementation is merely an example. In other embodiments, those skilled in the art can make modifications without departing from the spirit of the invention.
[0081] In summary, the image processing apparatus and method with lens color cast correction mechanism of the present invention can simultaneously verify the adjustment of correction parameters by the second correction circuit while the first correction circuit outputs the output corrected image for display. Once a better correction parameter is found, the first correction circuit adjusts the correction parameter accordingly to generate the output corrected image. Color cast correction can be completed without affecting the output of the corrected image.
[0082] Although the embodiments of this case are described above, these embodiments are not intended to limit this case. Those skilled in the art can make changes to the technical features of this case based on the explicit or implicit content of this case. All such changes may fall within the scope of patent protection sought in this case. In other words, the scope of patent protection in this case shall be determined by the claims of this specification.
[0083] [Symbol Explanation]
[0084] 100: Computer System
[0085] 110: Image capturing device
[0086] 120 Image Processing Device
[0087] 130: Display device
[0088] 140: Processor
[0089] 150: Lens
[0090] 160: Photosensitive element
[0091] 170: Driver
[0092] 200A: First correction circuit
[0093] 200B: Second Correction Circuit
[0094] 210A: First Statistical Circuit
[0095] 210B: Second Statistical Circuit
[0096] 220: Correction Operational Circuit
[0097] 230: Image processing circuit
[0098] 400: First weight processing circuit
[0099] 410: Second weight processing circuit
[0100] 420: Hybrid Circuit
[0101] 500: Image processing device
[0102] 510: Grid Color Deviation Correction Circuit
[0103] 700: Image Processing Methods
[0104] S710~S790: Steps
[0105] B: Blue parameter distribution
[0106] CP1: First calibration parameter
[0107] CP2: Second calibration parameter
[0108] CX: Center pixel of the image
[0109] E1~E8: Image edge pixels
[0110] G: Green parameter distribution
[0111] IC1: First calibration image
[0112] IC2: Second calibration image
[0113] IM, IM': Input image
[0114] LI: Light
[0115] OI: Original Image
[0116] OM: Output corrected image
[0117] P1~P8: Sampling Path
[0118] R: Red parameter distribution
[0119] R1~R5: Sampling area
[0120] SS1: First Statistical Results
[0121] SS2: Second Statistical Results
[0122] UI: Update Image
[0123] W1: First Weight
[0124] W2: Second Weight
Claims
1. An image processing device with a lens chromatic aberration correction mechanism, comprising: A first correction circuit is configured to perform lens chromatic aberration correction on an input image according to a first correction parameter to generate a first corrected image; A second correction circuit is configured to perform lens chromatic aberration correction on the input image according to a second correction parameter to generate a second corrected image; A first statistical circuit is configured to perform color cast parameter statistics on the first corrected image to generate a first statistical result; A second statistical circuit, configured to perform color cast parameter statistics on the second corrected image to generate a second statistical result; and A correction operation circuit is configured to determine whether the second corrected image meets the color shift correction condition based on the second statistical result when it is determined that the first corrected image has a color shift phenomenon based on the first statistical result. When the second corrected image does not meet the color shift correction conditions, the correction operation circuit controls the second correction circuit to adjust the second correction parameter, and when the second corrected image meets the color shift correction conditions, the correction circuit controls the first correction circuit to set the second correction parameter to the first correction parameter, thereby making the first corrected image generated by the first correction circuit an output corrected image.
2. The image processing apparatus according to claim 1, wherein when the first statistical circuit and the second statistical circuit perform color cast parameter statistics, the first corrected image and the second corrected image are respectively used as images to be statistically analyzed, so as to extract a sampling path from the images to be statistically analyzed. Each of the first statistical circuit and the second statistical circuit calculates a color offset of the sampling path as the first statistical result and the second statistical result, respectively. When the color offset is greater than an offset threshold, the correction calculation circuit determines that the first corrected image has the color shift phenomenon. When the color offset generated by the second statistical circuit is not greater than the offset threshold, the correction calculation circuit determines that the second corrected image meets the color shift correction condition.
3. The image processing apparatus according to claim 2, wherein the sampling path is the optimal sampling path with the most even color distribution among a plurality of candidate sampling paths extracted from the image to be statistically analyzed by the first statistical circuit and the second statistical circuit, wherein each of the plurality of candidate sampling paths extends from an image edge pixel to an image center pixel.
4. The image processing apparatus according to claim 3, wherein the first statistical circuit and the second statistical circuit respectively calculate complex color parameters for each of the complex sampling regions sequentially distributed along each of the plurality of candidate sampling paths on the image to be statistically analyzed, and calculate a color parameter ratio between the plurality of color parameters, so that when the difference between the color parameter ratios of any two adjacent plurality of sampling regions is less than a difference threshold, a cumulative value is increased, and then one of the plurality of candidate sampling paths with the largest cumulative value is selected as the optimal sampling path; The first statistical circuit and the second statistical circuit calculate the difference between the color parameter ratios of the first sampled region closest to the center pixel of the image and the second sampled region closest to the edge pixel of the image as the color offset.
5. The image processing apparatus according to claim 4, wherein the plurality of color parameters includes a red parameter, a green parameter, and a blue parameter; When the image to be statistically analyzed is converted into a color image through white balance calculation, the color parameter ratio is a red-green parameter ratio, a blue-green parameter ratio, a red-blue parameter ratio, a luminance parameter ratio, or a combination thereof; and When the image to be statistically analyzed is converted into a black and white image through white balance calculation, the color parameter ratio is the red-green parameter ratio, the blue-green parameter ratio, the red-blue parameter ratio, a saturation parameter ratio, or a combination thereof.
6. The image processing apparatus according to claim 4, wherein the first correction parameter and the second correction parameter each include a set of color parameter base values and a set of color parameter adjustment ratios corresponding to the plurality of color parameters, wherein the set of color parameter base values of the first correction parameter and the second correction parameter remain the same; When the correction operation circuit controls the second correction circuit to adjust the second correction parameter, it first adjusts the adjustment ratio of the group color parameter so that when the second corrected image meets the color deviation correction condition, the adjustment ratio of the group color parameter of the second correction parameter is set to the adjustment ratio of the group color parameter of the first correction parameter. When the correction circuit cannot make the second corrected image meet the color shift correction condition by adjusting the adjustment ratio of the group of color parameters, it controls the second correction circuit to replace the base value of the group of color parameters of the second correction parameter, and when the second corrected image meets the color shift correction condition, it sets the base value of the group of color parameters of the second correction parameter to the base value of the group of color parameters of the first correction parameter.
7. The image processing apparatus according to claim 6, further comprising an image processing circuit, the image processing circuit comprising: A first weighting processing circuit is configured to receive the first corrected image and output an original image according to a first weight. A second weighting processing circuit, configured to receive the second corrected image and output an updated image according to a second weight; and A mixing circuit configured to mix the original image and the updated image to produce an output corrected image; The image processing circuit sets the first weight to a maximum value and the second weight to a minimum value when the base values of the set of color parameters included in the first correction parameter are not replaced. Before setting the base value of the group color parameters of the second correction parameter to the base value of the group color parameters of the first correction parameter, the image processing circuit gradually decreases the first weight from the maximum value and gradually increases the second weight from the minimum value within a preset time period. Then, at the end of the preset time period, the image processing circuit sets the base value of the group color parameters of the second correction parameter to the base value of the group color parameters of the first correction parameter, sets the first weight to the maximum value, and sets the second weight to the minimum value.
8. The image processing apparatus according to claim 1 further includes a grid color shift correction circuit, configured to first perform grid color shift correction on the input image, and then connect it to the first correction circuit and the second correction circuit.
9. The image processing apparatus according to claim 1, wherein when the correction operation circuit determines, based on the first statistical result, that the first corrected image does not have the color cast phenomenon, it directly uses the first corrected image generated by the first correction circuit as the output corrected image.
10. An image processing method with a lens chromatic aberration correction mechanism, comprising: A first correction image is generated by a first correction circuit performing lens color shift correction on an input image according to a first correction parameter. A second correction image is generated by a second correction circuit performing lens color shift correction on the input image according to a second correction parameter. A first statistical circuit performs color cast parameter statistics on the first corrected image to generate a first statistical result; A second statistical circuit performs color cast parameter statistics on the second corrected image to generate a second statistical result; When a correction circuit determines, based on the first statistical result, that the first corrected image exhibits a color cast, it then determines, based on the second statistical result, whether the second corrected image meets the color cast correction condition; and When the second corrected image does not meet the color shift correction conditions, the correction operation circuit controls the second correction circuit to adjust the second correction parameter, and when the second corrected image meets the color shift correction conditions, the first correction circuit controls the first correction circuit to set the second correction parameter to the first correction parameter of the first correction circuit, thereby making the first corrected image generated by the first correction circuit an output corrected image.