Camera module lens shadow correction management method, system, device and medium

CN117499616BActive Publication Date: 2026-10-30SPREADTRUM SEMICON (NANJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311428052.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2026-10-30
Estimated Expiration
2043-10-30

AI Technical Summary

Technical Problem

[0006]本公开要解决的技术问题是为了克服现有技术中无法判断出同批镜头或者相同型号镜头成像效果是否存在差异的缺陷,提供一种摄像头模组镜头阴影校正的管控方法、系统、设备及介质

Benefits of technology

[0064]在符合本领域常识的基础上,上述各优选条件,可任意组合,即得本公开各较佳实例。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117499616B_ABST
    Figure CN117499616B_ABST
Patent Text Reader

Abstract

The present disclosure provides a camera module lens shadow correction management method, system, device and medium, the management method comprising: acquiring a to-be-detected module and a reference module; acquiring initial lens shadow correction data corresponding to the to-be-detected module and reference lens shadow correction data corresponding to the reference module; correcting the initial lens shadow correction data based on the reference lens shadow correction data to obtain target lens shadow correction data; and managing the to-be-detected module based on the reference lens shadow correction data and the target lens shadow correction data. The present disclosure realizes the management of the consistency of the image effects of the same type of modules, can more accurately eliminate unqualified modules, ensures the accuracy of the qualified module after lens shadow correction, and improves the image effect consistency and image quality of the same type of modules.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of image processing technology, and in particular to a method, system, device and medium for controlling shadow correction of camera module lenses. Background Technology

[0002] Lens shading includes luma shading and color shading. Luma shading results in a brighter image center and darker edges, while color shading results in inconsistent colors between the image center and edges. Therefore, lens shading correction (LSC) algorithms are needed to process the image and compensate for shadows to ensure uniformity of brightness and color.

[0003] In lens-based products, image quality is paramount, encompassing metrics such as color, brightness, and uniformity. A high degree of consistency in image quality is desirable across lenses from the same batch or model. However, minor, subtle errors can occur during lens manufacturing on the production line, significantly impacting image quality. Several factors contribute to this, primarily lens assembly. It's impossible to achieve perfect consistency in the manufacturing process for every lens on the production line. These differences include variations in lens holder mounting, lens assembly, CRA (chief ray angle), and sensor characteristics. Furthermore, subtle variations exist between lens modules. Whether it's a standard lens or a wide-angle lens, these factors all affect the consistency of image quality within a batch of lenses.

[0004] Currently, OTP (One-Time Programmable) can solve the image consistency problem at the algorithm level. When the camera module leaves the factory, initial lens shading correction data is calculated for each module and burned into the module's storage medium. When the client displays an image, it only needs to read this data from the OTP, calculate the final gain, and apply it to the image, thus eliminating lens shading. However, the module's error level and control requirements can affect the effectiveness of lens shading correction.

[0005] Most existing technologies control the shading of individual lenses. They evaluate the module's shading performance by dividing the image captured by the module into blocks, obtaining the brightness ratio and color difference ratio of each block, and calculating the ratio of the center block to the edge blocks before and after image correction. However, these methods cannot determine whether there are differences in imaging effects between the same batch or different batches of the same model of module. Summary of the Invention

[0006] The technical problem to be solved by this disclosure is to overcome the defect in the prior art that it is impossible to determine whether there are differences in the imaging effects of lenses from the same batch or the same model, and to provide a method, system, device and medium for controlling the shadow correction of camera module lenses.

[0007] This disclosure solves the above-mentioned technical problems through the following technical solution:

[0008] Firstly, a method for controlling shadow correction in a camera module lens is provided, the method comprising:

[0009] Obtain the module to be tested and the reference module;

[0010] The module to be tested and the reference module have the same module model.

[0011] Obtain the initial lens shadow correction data corresponding to the module to be tested, and the reference lens shadow correction data corresponding to the reference module;

[0012] The initial lens shadow correction data is corrected based on the reference lens shadow correction data to obtain the target lens shadow correction data;

[0013] The module under test is controlled based on the reference lens shadow correction data and the target lens shadow correction data.

[0014] Preferably, the step of controlling the module under test based on the reference lens shadow correction data and the target lens shadow correction data includes:

[0015] Based on the reference lens shadow correction data and the target lens shadow correction data, lens shadow correction is performed on the module to be tested to screen out qualified and unqualified modules.

[0016] The qualified modules are retained and the unqualified modules are discarded.

[0017] Preferably, the step of performing lens shadow correction on the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data, and screening out qualified and unqualified modules, includes:

[0018] The original image captured by the reference module is corrected based on the reference lens shadow correction data to obtain the reference image;

[0019] Based on the reference lens shadow correction data and the target lens shadow correction data, the original image captured by the module to be detected is corrected to obtain the image before correction and the image after correction.

[0020] Based on the reference image, the image before correction, and the image after correction, qualified modules and unqualified modules are selected.

[0021] Preferably, the step of selecting the qualified modules and the unqualified modules based on the reference image, the image before correction, and the image after correction includes:

[0022] The reference image, the image before correction, and the image after correction are divided into several image blocks, and the brightness data and color difference data of each image block are calculated.

[0023] The difference between the luminance data and chromatic difference data of each image block in the image before correction and the luminance data and chromatic difference data of each image block in the reference image is calculated to obtain the error before correction.

[0024] The difference between the brightness data and color difference data of each image block in the corrected image and the brightness data and color difference data of each image block in the reference image is calculated to obtain the corrected error.

[0025] In response to the fact that the corrected error is less than the original error, and both the corrected error and the original error are less than a preset error threshold, the module to be tested is determined to be a qualified module.

[0026] Preferably, the step of calculating the difference between the luminance data and chromatic difference data of each image block in the corrected image and the luminance data and chromatic difference data of each image block in the reference image to obtain the corrected error includes:

[0027] The brightness ratio of the corrected image is calculated based on the brightness data of each image block of the corrected image;

[0028] The color difference ratio of the corrected image is calculated based on the color difference data of each image block of the corrected image;

[0029] In response to the luminance ratio of the corrected image being less than a first preset luminance ratio threshold and the chrominance ratio of the corrected image being less than a first preset chrominance ratio threshold, the luminance data and chrominance data of each image block of the corrected image are calculated, and the difference between the luminance data and chrominance data of each image block of the reference image is obtained, to obtain the corrected error.

[0030] Preferably, after the step of retaining the qualified modules and discarding the unqualified modules, the method further includes:

[0031] The initial lens shadow correction data corresponding to the qualified module is stored in the qualified module.

[0032] Preferably, the step of obtaining the module to be tested and the reference module includes:

[0033] Acquire the initial image captured by the initial module;

[0034] Based on the initial image, a reference module is selected from several initial modules, and the remaining modules in the several initial modules other than the reference module are selected as the modules to be detected.

[0035] Preferably, the initial module is a module in the initial image where the brightness ratio of each image block is less than a second preset brightness ratio threshold;

[0036] And / or, the initial module is a module in which the color difference ratio of each image block in the initial image is less than a second preset color difference ratio threshold.

[0037] Preferably, the step of selecting a reference module from the initial modules based on the initial image includes:

[0038] Calculate the average brightness and average color difference of the initial module based on the initial image;

[0039] The initial module closest to the distance value of the average brightness and / or the average color difference is selected as the reference module.

[0040] Secondly, a control system for shading correction of a camera module lens is also provided, the control system comprising:

[0041] The module acquisition module is used to acquire the module to be tested and the reference module;

[0042] The module to be tested and the reference module have the same module model.

[0043] The first data acquisition module is used to acquire the initial lens shadow correction data corresponding to the module to be tested, and the reference lens shadow correction data corresponding to the reference module.

[0044] The second data acquisition module corrects the initial lens shadow correction data based on the reference lens shadow correction data to obtain the target lens shadow correction data;

[0045] The control module is used to control the module under test based on the reference lens shadow correction data and the target lens shadow correction data.

[0046] Preferably, the control module includes:

[0047] The correction unit is used to perform lens shadow correction on the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data, and to filter out qualified modules and unqualified modules.

[0048] A screening unit is used to retain the qualified modules and discard the unqualified modules.

[0049] Preferably, the correction unit is further configured to correct the original image captured by the reference module based on the reference lens shadow correction data to obtain a reference image; correct the original image captured by the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data respectively to obtain an image before correction and an image after correction; and select the qualified module and the unqualified module based on the reference image, the image before correction and the image after correction.

[0050] Preferably, the correction unit is further configured to divide the reference image, the image before correction, and the image after correction into several image blocks respectively, calculate the brightness data and color difference data of each image block; calculate the difference between the brightness data and color difference data of each image block of the image before correction and the brightness data and color difference data of each image block of the reference image to obtain the error before correction; calculate the difference between the brightness data and color difference data of each image block of the image after correction and the brightness data and color difference data of each image block of the reference image to obtain the error after correction; and determine the module to be tested as the qualified module if the error after correction is less than the error before correction and both the error after correction and the error before correction are less than a preset error threshold.

[0051] Preferably, the correction unit is further configured to calculate the luminance ratio of the corrected image based on the luminance data of each image block of the corrected image; calculate the chrominance ratio of the corrected image based on the chrominance data of each image block of the corrected image; and, in response to the luminance ratio of the corrected image being less than a first preset luminance ratio threshold and the chrominance ratio of the corrected image being less than a first preset chrominance ratio threshold, calculate the difference between the luminance data and chrominance data of each image block of the corrected image and the luminance data and chrominance data of each image block of the reference image to obtain the corrected error.

[0052] Preferably, the control system further includes:

[0053] The storage module is used to store the initial lens shadow correction data corresponding to the qualified module into the qualified module.

[0054] Preferably, the module acquisition module includes:

[0055] The image acquisition unit is used to acquire the initial image captured by the initial module;

[0056] The module grouping unit is used to select a reference module from several initial modules based on the initial image, and to take the remaining modules in the several initial modules other than the reference module as the modules to be detected.

[0057] Preferably, the initial module is a module in the initial image where the brightness ratio of each image block is less than a second preset brightness ratio threshold;

[0058] And / or, the initial module is a module in which the color difference ratio of each image block in the initial image is less than a second preset color difference ratio threshold.

[0059] Preferably, the module grouping unit is further configured to calculate the average brightness and average color difference of the initial module based on the initial image; and select the initial module that is closest to the average brightness and / or the average color difference as the reference module.

[0060] Thirdly, a chip is also provided for use in an electronic device, the chip being used to execute the aforementioned control method for lens shading correction of a camera module.

[0061] Fourthly, a chip module is also provided for use in electronic devices, including transceiver components and a chip, wherein the chip is used to perform the control method for lens shading correction of the camera module described above.

[0062] Fifthly, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein the processor executes the computer program to implement the above-described control method for lens shadow correction of a camera module.

[0063] Sixthly, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the above-described control method for lens shadow correction of a camera module.

[0064] Based on common knowledge in the field, the above-mentioned preferred conditions can be combined arbitrarily to obtain various preferred embodiments of this disclosure.

[0065] The positive and progressive effects of this disclosure are as follows:

[0066] The disclosed method, system, equipment, and medium for controlling lens shadow correction of camera modules achieve consistent control over the image effect of modules of the same model by comparing the lens shadows of the modules to be tested and the reference modules before and after correction. This can more accurately eliminate unqualified modules, ensure the accuracy of lens shadow correction for qualified modules, and improve the consistency of image effect and image quality of modules of the same model. Attached Figure Description

[0067] Figure 1 This is a first flowchart illustrating the control method for lens shadow correction of a camera module provided in Embodiment 1 of this disclosure;

[0068] Figure 2 This is a second flowchart illustrating the control method for lens shadow correction of a camera module provided in Embodiment 1 of this disclosure;

[0069] Figure 3 This is a schematic diagram of the third process of the control method for lens shadow correction of a camera module provided in Embodiment 1 of this disclosure;

[0070] Figure 4 This is a schematic diagram of the fourth process of the control method for lens shadow correction of a camera module provided in Embodiment 1 of this disclosure;

[0071] Figure 5 This is a schematic diagram of the image blocks divided from the reference image in the control method for lens shadow correction of a camera module provided in Embodiment 1 of this disclosure.

[0072] Figure 6 This is a fifth flowchart illustrating the control method for lens shadow correction of a camera module provided in Embodiment 1 of this disclosure;

[0073] Figure 7 This is a schematic diagram of the sixth process of the control method for lens shadow correction of a camera module provided in Embodiment 1 of this disclosure;

[0074] Figure 8 This is a schematic diagram of the control system for lens shadow correction of a camera module provided in Embodiment 2 of this disclosure;

[0075] Figure 9 This is a schematic diagram of the structure of the electronic device provided in Embodiment 3 of this disclosure. Detailed Implementation

[0076] The present disclosure is further illustrated below by way of embodiments, but the present disclosure is not limited to the scope of the embodiments described herein.

[0077] Example 1

[0078] This embodiment provides a method for controlling the shadow correction of a camera module lens, such as... Figure 1 As shown, the control method includes:

[0079] S1. Obtain the module to be tested and the reference module.

[0080] The module to be tested is the camera module to be tested, and the reference module is the reference camera module.

[0081] The module to be tested and the reference module have the same module model. Specifically, the module to be tested and the reference module are modules from the same batch or different batches with the same module model.

[0082] S2. Obtain the initial lens shadow correction data corresponding to the module to be tested, and the reference lens shadow correction data corresponding to the reference module.

[0083] The initial lens shadow correction data is the lens shadow correction data corresponding to the module under test, and the reference lens shadow correction data is the lens shadow correction data corresponding to the reference module.

[0084] S3. Correct the initial lens shadow correction data based on the reference lens shadow correction data to obtain the target lens shadow correction data.

[0085] S4. The module to be inspected is controlled based on the reference lens shadow correction data and the target lens shadow correction data.

[0086] Specifically, the process involves acquiring the original images captured by the module under test and the original images captured by the reference module, and calculating the corresponding lens shading correction data based on the image information and preset parameters. The preset parameters include BLC (Black Level Correction), LSC table size, and LSC table type (mesh shading correct; radial shading correct, etc.), which can be modified according to actual application requirements. Calculating the module's lens shading correction data based on the original images is existing technology in this field, and its details will not be elaborated here.

[0087] A benchmark module, also known as a typical module, represents the average performance level of modules of the same model.

[0088] The camera module lens shadow correction control method of this embodiment corrects the initial lens shadow correction data of the module to be tested using the reference lens shadow correction data of the reference module to obtain the target lens shadow correction data. Then, the module to be tested is controlled by the reference lens shadow correction data and the target lens shadow correction data. It can determine the degree of similarity between the image effect of the module to be tested and the reference module after lens shadow correction, realize the control of the consistency of image effect of the same model of module, more accurately remove unqualified modules, ensure the accuracy of lens shadow correction of qualified modules, and improve the consistency of image effect and image quality of the same model of module.

[0089] In an alternative implementation, such as Figure 2 As shown, step S4 above includes:

[0090] S41. Based on the reference lens shadow correction data and the target lens shadow correction data, perform lens shadow correction on the module to be tested, and screen out qualified and unqualified modules.

[0091] S42. Retain qualified modules and discard unqualified modules.

[0092] A qualified module is one whose image quality after lens shading correction closely matches the preset requirements. A substandard module is one whose image quality after lens shading correction does not closely match the preset requirements.

[0093] In an alternative implementation, such as Figure 3 As shown, step S41 above includes:

[0094] S411. Correct the original image captured by the reference module based on the reference lens shadow correction data to obtain the reference image.

[0095] S412. Based on the reference lens shadow correction data and the target lens shadow correction data, the original image captured by the module to be detected is corrected to obtain the image before correction and the image after correction.

[0096] S413. Based on the reference image, the image before correction, and the image after correction, select qualified modules and unqualified modules.

[0097] A benchmark module is selected as the control benchmark for lens shadow correction. After lens shadow correction, the color difference and brightness characteristics of the module to be tested are better than before correction. Therefore, the data before and after lens shadow correction are compared to determine whether the module is qualified.

[0098] The original image captured by the module under test is corrected based on the reference lens shadow correction data to obtain the image before correction. The original image captured by the module under test is then corrected based on the target lens shadow correction data to obtain the image after correction.

[0099] Specifically, the reference lens shadow correction data is denoted as cali_gain. The lens shadow compensation of the module under test is based on cali_gain. Then, the OTP of the reference module and the OTP of the module under test are used to correct cali_gain to obtain the target lens shadow correction data cali_gain_otp of the module under test.

[0100] Apply cali_gain to the original image captured by the reference module as the reference image I_ref for control; then use cali_gain and cali_gain_otp to perform lens shading correction on the original image I captured by the module to be detected, to obtain the image I_cali before lens shading correction and the image I_cali_otp after lens shading correction.

[0101] Based on the reference image I_ref, the pre-calibration image I_cali, and the post-calibration image I_cali_otp, qualified and unqualified modules are selected.

[0102] In an alternative implementation, such as Figure 4 As shown, step S413 above includes:

[0103] S4131. Divide the reference image, the image before correction, and the image after correction into several image blocks respectively, and calculate the brightness data and color difference data of each image block.

[0104] S4132. Calculate the brightness and color difference data of each image block in the image before correction, and the difference between the brightness and color difference data of each image block in the reference image, to obtain the error before correction.

[0105] S4133. Calculate the brightness and color difference data of each image block in the corrected image and the difference between the brightness and color difference data of each image block in the reference image to obtain the corrected error.

[0106] S4134. In response to the fact that the error after correction is less than the error before correction, and both the error after correction and the error before correction are less than the preset error threshold, the module to be tested is determined to be a qualified module.

[0107] That is, the error after calibration of a qualified module is less than the error before calibration, and both the error after calibration and the error before calibration are less than the preset error threshold. The error after calibration of an unqualified module is not less than the error before calibration, and both the error after calibration and the error before calibration are not less than the preset error threshold.

[0108] The following example, using the calculation of brightness and color difference data for each image block in the reference image, further illustrates this implementation method:

[0109] 1) such as Figure 5 As shown, the reference image is evenly divided into m*n blocks according to the preset block parameters m and n, where m and n are both positive integers.

[0110] 2) Calculate the corresponding luminance data and color difference data for each block. The luminance data includes the luminance value y, and the color difference data includes the red-green difference r / g and the blue-green difference b / g, where r is the R (red) channel value in the RGB (red, green, blue) color channels, g is the G (green) channel value in the RGB (red, green, blue) color channels, and b is the B (blue) channel value in the RGB (red, green, blue) color channels.

[0111] Calculate y and r / g, b / g for each block:

[0112] y i =0.299*r i +0.587*g i +0.114*b i ;

[0113] rg i =r i / g i ;

[0114] bg i =b i / g i ;

[0115] Where i is the image patch number, i <= m*n, y i The brightness value of the i-th pixel block, r i The R channel value of the i-th image patch, g i The G channel value of the i-th pixel block, b i The B channel value of the i-th image patch, rg i The red-green difference of the i-th image patch, bg i The blue-green difference of the i-th image patch.

[0116] The calculation methods for the luminance and chromatic difference data of each image block in the pre-correction and post-correction images are the same as those for the luminance and chromatic difference data of each image block in the aforementioned reference image, and will not be repeated here.

[0117] The similarity data of the reference image, the uncorrected image, and the corrected image can be directly calculated and compared using Euclidean distance and cosine similarity. Alternatively, the difference between corresponding image patches in the reference image, the uncorrected image, and the corrected image can be calculated separately, and then the difference between the corrected image and the reference image can be measured by methods such as maximum / minimum difference and mean error.

[0118] Specifically, the mean error can be used to measure how closely the corrected lens shading matches the reference image:

[0119]

[0120]

[0121]

[0122]

[0123]

[0124]

[0125] Among them, rg error bg error y error To correct for the error beforehand, rg_otp error bg_otp error y_otp error denoted as the error after correction; i is the image patch number in the image; rg_i, bg_i, and y_i are the brightness and color difference data of each image patch in the image before correction, and the difference between them and the brightness and color difference data of each image patch in the reference image; rg_otp_i, bg_otp_i, and y_otp_i are the brightness and color difference data of each image patch in the image after correction, and the difference between them and the brightness and color difference data of each image patch in the reference image.

[0126] The corrected image after lens shading correction is closer to the reference image. Therefore, the error after correction must be smaller than the error before correction, and both the error after correction and the error before correction must be smaller than the preset error threshold. That is, the error after correction is smaller than the preset error after correction threshold, and the error before correction is smaller than the preset error before correction threshold. The purpose of setting the above threshold is mainly to avoid a large difference in consistency between the module under test and the reference module, so that the effect of consistent results cannot be achieved through lens shading correction control.

[0127] In an optional implementation, step S4133 includes:

[0128] The brightness ratio of the corrected image is calculated based on the brightness data of each image block in the corrected image.

[0129] The color difference ratio of the corrected image is calculated based on the color difference data of each image block in the corrected image;

[0130] In response to the fact that the luminance ratio of the corrected image is less than a first preset luminance ratio threshold and the chrominance ratio of the corresponding corrected image is less than a first preset chrominance ratio threshold, the luminance data and chrominance data of each image block of the corrected image are calculated, and the difference between the luminance data and chrominance data of each image block of the reference image is obtained to obtain the corrected error.

[0131] Specifically, and

[0132]

[0133]

[0134]

[0135] Among them, y corner_i y represents the edge brightness of the i-th image patch in the corrected image. center rg represents the center brightness of the corrected image. corner_i rg represents the red-green difference at the edge of the i-th image patch after correction. center bg represents the central red-green difference in the corrected image. corner_i bg represents the blue-green difference at the edge of the i-th image patch in the corrected image. center Y_EVEN_AFTER represents the center blue-green difference of the corrected image; C_E_AFTER is the first preset color difference ratio threshold.

[0136] If the brightness ratio of the corrected image is less than the first preset brightness ratio threshold, and the color difference ratio of the corrected image is less than the first preset color difference ratio threshold, it means that the lens shadow problem of the module under test has been improved after the correction by the reference module. The brightness uniformity, attenuation degree and color uniformity of the four corners of the module under test all meet the control requirements. This process can eliminate some modules under test that do not meet the control requirements, laying the foundation for subsequent calculation of the corrected error.

[0137] In an alternative implementation, such as Figure 6 As shown, after step S42 above, the following is also included:

[0138] S5. Store the initial lens shadow correction data corresponding to the qualified module into the qualified module.

[0139] The initial lens shadow correction data corresponding to a qualified module, that is, the lens shadow correction data corresponding to the qualified module itself.

[0140] The initial lens shading correction data corresponding to the qualified module is stored in the qualified module. So that when the qualified module is used to shoot images later, the client only needs to read the initial lens shading correction data corresponding to the qualified module from the OTP when displaying the image, calculate the final gain, and apply them to the captured image, and there will be no lens shading phenomenon.

[0141] In an alternative implementation, such as Figure 7 As shown, step S1 above includes:

[0142] S11. Obtain the initial image captured by the initial module.

[0143] S12. Based on the initial image, select the benchmark module from several initial modules, and take the remaining modules other than the benchmark module from several initial modules as the modules to be detected.

[0144] The initial module refers to the initial camera module, which includes modules of the same model and from the same or different batches, including the module to be tested and the remaining modules.

[0145] Specifically:

[0146] 1) Divide the initial image into m*n blocks according to preset partitioning parameters m and n, where m and n are both positive integers. See details for further information. Figure 5 .

[0147] 2) Calculate y and r / g, b / g for each block:

[0148] y i =0.299*r i +0.587*g i +0.114*b i ;

[0149] rg i =r i / g i ;

[0150] bg i =b i / g i ;

[0151] Where i is the block number, i <= m*n, y represents the brightness value, r / g represents the red-green difference, b / g represents the blue-green difference, r is the R (red) channel value of the RGB (red, green, blue) color channels, g is the G (green) channel value of the RGB (red, green, blue) color channels, and b is the B (blue) channel value of the RGB (red, green, blue) color channels; y i The brightness value of the i-th pixel block, r i The R channel value of the i-th image patch, g i The G channel value of the i-th pixel block, b i The B channel value of the i-th image patch, rg i The red-green difference of the i-th image patch, bg i The blue-green difference of the i-th image patch.

[0152] 3) Brightness control:

[0153] The brightness ratio of the edge region to the center of the initial image reflects the degree of module attenuation; an attenuation threshold Y_DEC is set.

[0154]

[0155] y corner y represents the edge brightness of the initial image. center This indicates the center brightness of the initial image.

[0156] Obtain the brightness of the four corner block regions of the initial image, calculate the difference ratio between the maximum and minimum brightness, which mainly reflects the brightness uniformity of the module itself, and set the uniformity threshold Y_EVEN.

[0157]

[0158] y corner_max y represents the maximum edge brightness of the initial image. corner_min y represents the minimum edge brightness of the initial image. center_max This represents the maximum center brightness of the initial image.

[0159] Brightness control mainly involves whether the characteristics of the module, such as the uniformity of brightness at the four corners and the degree of attenuation, meet the control requirements. Similar indicators can be used to represent the above characteristics in order to control the brightness of the module.

[0160] 4) Color difference control

[0161] Color difference control mainly reflects the color uniformity of the module, and sets the color difference ratio threshold C_E;

[0162]

[0163]

[0164] rg corner The red-green difference at the edges of the initial image, rg center bg represents the central red-green difference of the initial image. corner bg represents the blue-green color difference at the edges of the initial image. center This represents the central blue-green color difference of the initial image.

[0165] Color difference control reflects the uniformity of color in the module and can better control the imaging quality of the module.

[0166] Based on the initial image captured by the initial module under a specific light source, the initial image is divided into blocks, and the brightness ratio and color difference ratio of each block are calculated to determine whether the initial camera module meets the lens shadow control standards before OTP application. Pre-application control can identify defects in the initial module itself, eliminating some modules that do not meet the control requirements and improving the efficiency of subsequent OTP programming.

[0167] In an optional implementation, the initial module is a module in which the brightness ratio of each image block in the initial image is less than a second preset brightness ratio threshold; the initial module is a module in which the color difference ratio of each image block in the initial image is less than a second preset color difference ratio threshold.

[0168] If the brightness ratio of each image block in the initial image of the initial module is less than the second preset brightness ratio threshold, and the color difference ratio of each image block in the initial image is less than the second preset color difference ratio threshold, then the lens shadow index of the initial module meets the lens shadow control standard, the brightness uniformity and color difference uniformity of the initial module meet the requirements, and the imaging quality of the module is high.

[0169] In an optional implementation, step S12 includes:

[0170] Calculate the average brightness and average color difference of the initial module based on the initial image;

[0171] Select the initial module that is closest to the average brightness and / or average color difference as the reference module;

[0172] The remaining modules in a number of initial modules, excluding the baseline module, are selected as the modules to be tested.

[0173] A benchmark module is selected based on specific rules. The lens shadow index of the benchmark module is close to the average level of the batch of modules, representing the performance level of the batch of modules. The benchmark module can be selected by specific rules, such as calculating the average brightness and color difference of the modules in the batch. For example, the initial module that is closest to the average brightness and / or average color difference can be used as the benchmark module.

[0174] The disclosed method for controlling lens shading correction in camera modules can be applied to terminal products such as mobile phones, tablets, and cameras, as well as equipment such as industrial cameras, security cameras, and in-vehicle systems that use camera modules for shooting and previewing. All of these products collect scene image data through camera modules. In batch production, lens shading errors in individual camera modules significantly affect the inconsistency of image quality. Therefore, a high degree of consistency in the final image quality is desired among modules in the same batch or of the same model. There are many specific factors influencing lens shading errors, primarily module assembly and lens-related factors on the production line. To address this issue, an OTP (Optical Point Protocol) for lens shading correction is programmed during module production. The algorithm uses the OTP to perform consistency correction on modules within the same batch.

[0175] This disclosure addresses the control of the OTP programming process for lens shading correction, selecting camera modules that meet OTP control standards. Furthermore, this disclosure can be applied to the OTP programming control of lens shading correction for both monochrome and multi-color temperatures.

[0176] Example 2

[0177] This embodiment provides a control system for shading correction of a camera module lens, such as... Figure 8 As shown, the control system includes:

[0178] Module acquisition module 1 is used to acquire the module to be tested and the reference module;

[0179] The module to be tested and the reference module have the same module model;

[0180] The first data acquisition module 2 is used to acquire the initial lens shadow correction data corresponding to the module to be tested, and the reference lens shadow correction data corresponding to the reference module.

[0181] The second data acquisition module 3 corrects the initial lens shadow correction data based on the reference lens shadow correction data to obtain the target lens shadow correction data;

[0182] The control module 4 is used to control the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data.

[0183] In an optional implementation, the control module 4 includes:

[0184] The correction unit 41 is used to perform lens shadow correction on the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data, and to screen out qualified modules and unqualified modules.

[0185] The filtering unit 42 is used to retain qualified modules and remove unqualified modules.

[0186] In an optional embodiment, the correction unit 41 is further configured to correct the original image captured by the reference module based on the reference lens shadow correction data to obtain a reference image; correct the original image captured by the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data respectively to obtain an image before correction and an image after correction; and screen out qualified modules and unqualified modules based on the reference image, the image before correction and the image after correction.

[0187] In an optional embodiment, the correction unit 41 is further configured to divide the reference image, the image before correction, and the image after correction into several image blocks respectively, calculate the brightness data and color difference data of each image block; calculate the difference between the brightness data and color difference data of each image block of the image before correction and the brightness data and color difference data of each image block of the reference image to obtain the error before correction; calculate the difference between the brightness data and color difference data of each image block of the image after correction and the brightness data and color difference data of each image block of the reference image to obtain the error after correction; and determine the module to be tested as a qualified module in response to the fact that the error after correction is less than the error before correction, and both the error after correction and the error before correction are less than a preset error threshold.

[0188] In an optional embodiment, the correction unit 41 is further configured to calculate the luminance ratio of the corrected image based on the luminance data of each image block of the corrected image; calculate the chromatic difference ratio of the corrected image based on the chromatic difference data of each image block of the corrected image; and, in response to the luminance ratio of the corrected image being less than a first preset luminance ratio threshold and the chromatic difference ratio of the corrected image being less than a first preset chromatic difference ratio threshold, calculate the difference between the luminance data and chromatic difference data of each image block of the corrected image and the luminance data and chromatic difference data of each image block of the reference image to obtain the corrected error.

[0189] In an optional implementation, the control system further includes:

[0190] Storage module 5 is used to store the initial lens shadow correction data corresponding to the qualified module into the qualified module.

[0191] In an optional implementation, the module acquisition module 1 includes:

[0192] Image acquisition unit 11 is used to acquire the initial image captured by the initial module;

[0193] The module grouping unit 12 is used to select a reference module from several initial modules based on the initial image, and to take the remaining modules from several initial modules other than the reference module as the modules to be detected.

[0194] In an optional implementation, the initial module is a module in which the brightness ratio of each image block in the initial image is less than a second preset brightness ratio threshold.

[0195] In an optional implementation, the initial module is a module in which the color difference ratio of each image block in the initial image is less than a second preset color difference ratio threshold.

[0196] In an optional implementation, the module grouping unit 12 is further configured to calculate the average brightness and average color difference of the initial modules based on the initial image; and select the initial module that is closest to the average brightness and / or average color difference as the reference module.

[0197] The control system for camera module lens shadow correction in this embodiment corresponds to the control method for camera module lens shadow correction in Embodiment 1. The working principle of the control system is the same as that of the control method, so it will not be described again here.

[0198] The camera module lens shadow correction control system of this embodiment corrects the initial lens shadow correction data of the module to be tested using the reference lens shadow correction data of the reference module to obtain the target lens shadow correction data. Then, by using the reference lens shadow correction data and the target lens shadow correction data, the system controls the module to be tested and can determine the degree of similarity between the image effect of the module to be tested and the reference module after lens shadow correction. This achieves the control of the consistency of image effect of modules of the same model, can more accurately eliminate unqualified modules, ensure the accuracy of lens shadow correction of qualified modules, and improve the consistency of image effect and image quality of modules of the same model.

[0199] The control system for lens shadow correction of the camera module provided in this embodiment can be a separate chip, chip module or electronic device, or it can be a chip or chip module integrated into an electronic device.

[0200] The various modules / units included in the camera module lens shadow correction control system described in this embodiment can be software modules / units, hardware modules / units, or a combination of both.

[0201] The camera module lens shadow correction control system in this embodiment can run on an Android device. In addition to the camera module lens shadow correction control system in this embodiment, the Android device may also include components such as buttons, a display screen, and a casing.

[0202] Example 3

[0203] This embodiment provides an electronic device. Figure 9 This is a schematic diagram of the structure of an electronic device provided in this embodiment. The electronic device includes a memory, a processor, and a computer program stored in the memory and executed on the processor. When the processor executes the program, it implements the control method for lens shadow correction of the camera module as described in Embodiment 1 above. Figure 9 The electronic device 80 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0204] like Figure 9As shown, the electronic device 80 can be manifested as a general-purpose computing device, such as a server device. The components of the electronic device 80 may include, but are not limited to: at least one processor 81, at least one memory 82, and a bus 83 connecting different system components (including memory 82 and processor 81).

[0205] Bus 83 includes a data bus, an address bus, and a control bus.

[0206] The memory 82 may include volatile memory, such as random access memory (RAM) 821 and / or cache memory 822, and may further include read-only memory (ROM) 823.

[0207] The memory 82 may also include a program / utility 825 having a set (at least one) of program modules 824, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.

[0208] The processor 81 executes various functional applications and data processing by executing computer programs stored in the memory 82, such as the control method for camera module lens shadow correction in Embodiment 1 of this disclosure.

[0209] The electronic device 80 can also communicate with one or more external devices 84 (e.g., keyboard, pointing device, etc.). This communication can be performed via input / output (I / O) interface 85. Furthermore, the model-generating device 80 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 86. Figure 9 As shown, network adapter 86 communicates with other modules of the model-generated device 80 via bus 83. It should be understood that, although not shown in the figure, other hardware and / or software modules can be used in conjunction with the model-generated device 80, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems.

[0210] It should be noted that although several units / modules or sub-units / modules of the electronic device have been mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided and embodied by multiple units / modules.

[0211] Example 4

[0212] This embodiment provides a computer-readable storage medium storing a computer program thereon. When the program is executed by a processor, it implements the steps in the control method for lens shadow correction of the camera module in Embodiment 1 above.

[0213] The readable storage medium may be more specifically adopted, including but not limited to: portable disk, hard disk, random access memory, read-only memory, erasable programmable read-only memory, optical storage device, magnetic storage device, or any suitable combination thereof.

[0214] In a possible implementation, this disclosure can also be implemented as a program product comprising program code, which, when executed on a terminal device, causes the terminal device to perform steps in the control method for camera module lens shadow correction as described in Embodiment 1 above.

[0215] The program code for executing this disclosure can be written in any combination of one or more programming languages. The program code can be executed entirely on a user device, partially on a user device, as a standalone software package, partially on a user device and partially on a remote device, or entirely on a remote device.

[0216] While specific embodiments of this disclosure have been described above, those skilled in the art should understand that these are merely illustrative examples, and the scope of protection of this disclosure is defined by the appended claims. Those skilled in the art can make various changes or modifications to these embodiments without departing from the principles and essence of this disclosure, but all such changes and modifications fall within the scope of protection of this disclosure.

Claims

1. A method for controlling lens shadow correction in a camera module, characterized in that, The control methods include: Obtain the module to be tested and the reference module; The module to be tested and the reference module have the same module model. Obtain the initial lens shadow correction data corresponding to the module to be tested, and the reference lens shadow correction data corresponding to the reference module; The initial lens shadow correction data is corrected based on the reference lens shadow correction data to obtain the target lens shadow correction data; The module to be tested is controlled based on the reference lens shadow correction data and the target lens shadow correction data; The step of controlling the module under test based on the reference lens shadow correction data and the target lens shadow correction data includes: Based on the reference lens shadow correction data and the target lens shadow correction data, lens shadow correction is performed on the module to be tested to screen out qualified and unqualified modules. The qualified modules are retained and the unqualified modules are discarded; The step of performing lens shadow correction on the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data, and screening out qualified and unqualified modules, includes: The original image captured by the reference module is corrected based on the reference lens shadow correction data to obtain the reference image; Based on the reference lens shadow correction data and the target lens shadow correction data, the original image captured by the module to be detected is corrected to obtain the image before correction and the image after correction. Based on the reference image, the image before correction, and the image after correction, qualified modules and unqualified modules are selected.

2. The control method according to claim 1, characterized in that, The step of filtering out the qualified modules and the unqualified modules based on the reference image, the image before correction, and the image after correction includes: The reference image, the image before correction, and the image after correction are divided into several image blocks, and the brightness data and color difference data of each image block are calculated. The difference between the luminance data and chromatic difference data of each image block in the image before correction and the luminance data and chromatic difference data of each image block in the reference image is calculated to obtain the error before correction. The difference between the brightness data and color difference data of each image block in the corrected image and the brightness data and color difference data of each image block in the reference image is calculated to obtain the corrected error. In response to the fact that the corrected error is less than the original error, and both the corrected error and the original error are less than a preset error threshold, the module to be tested is determined to be a qualified module.

3. The control method according to claim 2, characterized in that, The step of calculating the difference between the luminance data and color difference data of each image block in the corrected image and the luminance data and color difference data of each image block in the reference image to obtain the corrected error includes: The brightness ratio of the corrected image is calculated based on the brightness data of each image block of the corrected image; The color difference ratio of the corrected image is calculated based on the color difference data of each image block of the corrected image; In response to the luminance ratio of the corrected image being less than a first preset luminance ratio threshold and the chrominance ratio of the corrected image being less than a first preset chrominance ratio threshold, the luminance data and chrominance data of each image block of the corrected image are calculated, and the difference between the luminance data and chrominance data of each image block of the reference image is obtained, to obtain the corrected error.

4. The control method according to claim 1, characterized in that, The step of retaining the qualified modules and discarding the unqualified modules further includes: The initial lens shadow correction data corresponding to the qualified module is stored in the qualified module.

5. The control method according to claim 1, characterized in that, The steps for obtaining the module to be tested and the reference module include: Acquire the initial image captured by the initial module; Based on the initial image, a reference module is selected from several initial modules, and the remaining modules in the several initial modules other than the reference module are selected as the modules to be detected.

6. The control method according to claim 5, characterized in that, The initial module is a module in which the brightness ratio of each image block in the initial image is less than a second preset brightness ratio threshold; And / or, the initial module is a module in which the color difference ratio of each image block in the initial image is less than a second preset color difference ratio threshold.

7. The control method according to claim 5, characterized in that, The step of selecting a benchmark module from several initial modules based on the initial image includes: Calculate the average brightness and average color difference of the initial module based on the initial image; The initial module closest to the distance value of the average brightness and / or the average color difference is selected as the reference module.

8. A control system for lens shadow correction in a camera module, characterized in that, The control system includes: The module acquisition module is used to acquire the module to be tested and the reference module; The module to be tested and the reference module have the same module model. The first data acquisition module is used to acquire the initial lens shadow correction data corresponding to the module to be tested, and the reference lens shadow correction data corresponding to the reference module. The second data acquisition module corrects the initial lens shadow correction data based on the reference lens shadow correction data to obtain the target lens shadow correction data; The control module is used to control the module under test based on the reference lens shadow correction data and the target lens shadow correction data; The control module includes: The correction unit is used to perform lens shadow correction on the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data, and to filter out qualified modules and unqualified modules. A filtering unit is used to retain the qualified modules and discard the unqualified modules; The correction unit is used to correct the original image captured by the reference module based on the reference lens shadow correction data to obtain a reference image; to correct the original image captured by the module to be tested based on the reference lens shadow correction data and the target lens shadow correction data respectively to obtain an image before correction and an image after correction; and to select the qualified module and the unqualified module based on the reference image, the image before correction and the image after correction.

9. A chip used in electronic devices, characterized in that, The chip is used to perform the control method for lens shadow correction of the camera module as described in any one of claims 1-7.

10. A chip module, used in electronic devices, characterized in that, It includes a transceiver component and a chip, the chip being used to perform a control method for lens shading correction of a camera module as described in any one of claims 1-7.

11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and for running on the processor, characterized in that, When the processor executes a computer program, it implements a control method for lens shadow correction of a camera module as described in any one of 1-7.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the control method for lens shadow correction of the camera module as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method for improving effect consistency of camera on terminal

    CN113542615A

  • Method for uniformly burning camera module parameters

    CN116320725A