A memory-saving image sensor calibration algorithm
By calculating the row, column and background mean and storing it in nonvolatile memory, the problem of excessive storage space in the image sensor under the single point compensation method is solved, and the storage space saving and cost reduction are achieved.
Patent Information
- Application Number
- CN202411267853.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2044-09-11
AI Technical Summary
The single point compensation method of image sensors in the prior art requires a large amount of storage space, resulting in an increase in system costs.
By calculating row mean, column mean, and background overall mean, these data are stored in nonvolatile memory and calculated with the original data to generate final image data, reducing storage requirements.
It significantly reduces the storage space requirement, reduces the demand for MCU and chip costs.
Smart Images

Figure CN120343423B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image sensors, and in particular to an image sensor correction algorithm that saves storage space. Background Art
[0002] In array sensors, such as fingerprint sensors, CIS sensors, and infrared focusing plane sensors, there is a problem of inconsistent background noise for each pixel in the array, which leads to Figure 1 There are differences in consistency. This difference is inevitable. Commonly used supplementary methods use complex filtering algorithms or compensate each point separately, but there are problems with large computational complexity, time consumption, and storage resource consumption. In the most direct single-point compensation method, for an M*N array, if a single point is 8-bit data, a background matrix needs to be stored, and the required storage space is M*N bytes. In the case of larger arrays, the storage space will be very large. For example, in a fingerprint sensor with a 256*360 array, the storage space required is 92.16KB. This storage space, whether on the MCU side of the system or on the chip side that collects the image, will increase the demand for the MCU or the cost of the chip itself. Summary of the Invention
[0003] The object of the present invention is to provide an image sensor correction algorithm that saves storage space and solves the problem that conventional single-point compensation methods require too much storage space.
[0004] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0005] An image sensor correction algorithm that saves storage space includes the following steps:
[0006] S1, the image sensor sends a command to collect the background image and obtain the background data DATA_BG(i, j);
[0007] S2, calculate the row mean H_AVG(j), column mean V_AVG(i) and overall background mean AVG_BG of the background data DATA_BG(i, j) using software or hardware tools. The total data storage capacity is: ,
[0008] Among them, N*Mstore2 is the required storage space size, M is the row in the image, N is the column in the image, and P is the unit
[0009] Pixel width;
[0010] S3, putting the data obtained after calculation in S2 into non-volatile memory to complete the background collection work;
[0011] S4, after the background acquisition work of the image sensor is completed, the image acquisition work is performed again to obtain the raw data RAW_D(i, j);
[0012] S5. Calculate the obtained raw data RAW_D(i, j) with the stored row mean H_AVG(j), column mean V_AVG(i), and background overall mean AVG_BG as follows to obtain the final data DATA(i, j):
[0013] ;
[0014] S6, then convert the final data DATA(i, j) into 8-bit output to obtain the final image.
[0015] A further technical solution is that, in step S2, the row average H_AVG(j) is calculated as follows: .
[0016] A further technical solution is that the amount of data obtained after calculating the row average H_AVG(j) is M*P.
[0017] A further technical solution is that in step S2, the column mean V_AVG (i) is calculated as follows:
[0018] .
[0019] A further technical solution is that the amount of data obtained after calculating the column mean V_AVG(i) is N*P.
[0020] A further technical solution is that in step S2, the calculation formula of the overall background average AVG_BG is as follows: .
[0021] A further technical solution is that the amount of data obtained after calculating the overall background average AVG_BG is P.
[0022] A further technical solution is that in step S2, the value range of the single pixel bit width P is 8-bit~
[0023] 24-bit.
[0024] A further technical solution is that, in step S3, the non-volatile memory adopts MTP, OTP or EEPROM memory.
[0025] Compared with the prior art, the present invention has the following beneficial effects:
[0026] When calculating the amount of data that needs to be stored, the present invention first calculates the row mean H_AVG(j), column mean V_AVG(i) and background overall mean AVG_BG of the background data DATA_BG(i, j) through software or hardware tools, and then calculates them with the original data RAW_D(i, j) to finally obtain the final image. Compared with the single-point compensation method used in the prior art, the algorithm in the present invention can be used to calculate that the amount of data that needs to be stored is very small, which places very low demands on the MCU or the chip itself. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 This is a diagram showing the steps of a conventional image correction method in the prior art;
[0028] Figure 2 is a step diagram of the present invention;
[0029] Figure 3 Schematic diagram of the structure of the array in the present invention;
[0030] Figure 4 This is a comparison diagram before and after correction in the present invention.
[0031] Reference numerals: 31 - array, 32 - pixel point, 41 - original background image, 42 - original background histogram, 43 - corrected background image, 44 - corrected background histogram. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0033] Example 1
[0034] An image sensor correction algorithm that saves storage space includes the following steps:
[0035] S1, the image sensor sends a command to collect background data and obtains background data DATA_BG(i, j);
[0036] S2, calculate the row mean H_AVG(j), column mean V_AVG(i) and overall background mean AVG_BG of the background data DATA_BG(i, j) using software or hardware tools. The total data storage capacity is:
[0037] ,
[0038] Among them, N*Mstore2 is the required storage space size, M is the row in the image, N is the column in the image, and P is the width of a single pixel.
[0039] S3, puts the data obtained after calculation in S2 into non-volatile memory such as MTP, OTP or EEPROM to complete the background collection work;
[0040] S4, after the background acquisition work of the image sensor is completed, the image acquisition work is performed to obtain the raw data RAW_D
[0041] (i, j);
[0042] S5, compare the obtained raw data RAW_D(i, j) with the stored row mean H_AVG(j), column mean V_AVG(i) and
[0043] The overall background mean AVG_BG is calculated as follows to obtain the final data DATA(i, j):
[0044] ;
[0045] S6, then convert the final data DATA(i, j) into 8-bit output to obtain the final image, ending the entire image acquisition process.
[0046] Example 2
[0047] Based on Example 1, the calculation formula of the row average H_AVG(j) is as follows:
[0048] .
[0049] Furthermore, the amount of data obtained after calculating the row mean H_AVG(j) is M*P.
[0050] Example 3
[0051] Based on Example 2, the calculation formula of the column mean V_AVG(i) is as follows:
[0052] .
[0053] Furthermore, the amount of data obtained after calculating the column mean V_AVG(i) is N*P.
[0054] Example 4
[0055] Based on Example 3, the calculation formula of the background overall mean AVG_BG is as follows:
[0056] .
[0057] Furthermore, the amount of data obtained after calculating the overall background mean AVG_BG is P.
[0058] Example 5
[0059] Based on Example 4, the value range of the single pixel bit width P is 8-bit to 24-bit.
[0060] Example 6
[0061] On the basis of embodiment 5, the non-volatile memory adopts a conventional device in the prior art, preferably an MTP, OTP or EEPROM memory.
[0062] Taking MTP memory as an example, when the array size is 256*360 and the single pixel value is 12 bits:
[0063] When using conventional background correction methods, such as Figure 1 As shown, the following steps are performed: first, background acquisition is started, a command is issued to start acquiring the background image, and then background data DATA_BG(i, j) is obtained. The storage capacity of this background data DATA_BG(i, j) is: , then the background data DATA_BG(i, j) is stored in the non-volatile memory MTP, and then image acquisition is started to obtain the raw data RAW_D(i, j), and the obtained raw data RAW_D(i, j) is calculated with the stored background data DATA_BG(i, j) to obtain the final data DATA(i, j): , and then convert the final data DATA(i, j) into 8-bit output to obtain the final image.
[0064] When the algorithm of the present invention is used, Figure 2 As shown, the following steps are performed: first, background acquisition is started, a command is issued to start acquiring the background image, and then background data DATA_BG(i, j) is obtained. Then, the obtained background data DATA_BG(i, j) is used to calculate the row mean H_AVG(j), column mean V_AVG(i) and background overall mean AVG_BG through software or hardware tools. The total amount of data that needs to be stored can be obtained by the formula in the above embodiment:
[0065] ,
[0066] These data are then stored in the non-volatile memory MTP, and image acquisition is started to obtain the raw data RAW_D(i, j). The obtained raw data RAW_D(i, j) is combined with the stored row mean H_AVG(j), column mean V_AVG(i), and background overall mean AVG_BG to obtain the final data DA TA (i, j):
[0067] ;
[0068] The final data DATA(i, j) is then converted to 8-bit output to obtain the final image.
[0069] Therefore, the storage space size comparison between the algorithm proposed in the present invention and the conventional method is as follows:
[0070] ,
[0071] Because M, N, and P are all positive integers, Δ MTPstore ≤ 0 if and only if M + N ≤ 5. In all other cases, Δ MTPstore > 0. In particular, when M and N are relatively large, Δ MTPstore is significantly greater than zero. Therefore, conventional single-point compensation methods require far more data to store than the algorithm proposed in this invention. Using the algorithm proposed in this invention for data storage significantly saves storage space.
[0072] Figure 3 This is a structural diagram of an array that must be used when an array sensor collects images. Both the existing technology and the technical solution of the present invention require the use of an array.
[0073] Figure 4 The following are comparison images of the original background image captured at 256x360 pixels before and after correction using the algorithm. Figure 41 shows the original background image, 42 shows the original background histogram, 43 shows the corrected background image, and 44 shows the corrected background histogram. Comparing the background histograms reveals that the background is essentially one-third the width of the original image after correction, improving background uniformity. This method achieves background correction and can also be used to correct actual images.
[0074] Although the present invention has been described herein with reference to a number of illustrative embodiments thereof, it will be understood that numerous other modifications and implementations may be devised by those skilled in the art that fall within the scope and spirit of the principles disclosed herein. More specifically, within the scope of the drawings and claims disclosed herein, numerous variations and modifications may be made to the components and / or layout of the subject combination arrangement. In addition to variations and modifications to the components and / or layout, other uses will also be apparent to those skilled in the art.
Claims
1. A memory-saving image sensor calibration algorithm, characterized by: The following steps are involved: S1, the image sensor issues a command to collect background data and obtains background data DATA_BG(i, j); S2, calculate the row mean H_AVG(j), column mean V_AVG(i) and overall background mean AVG_BG of the obtained background data DATA_BG(i, j) through software or hardware tools. The total data storage capacity is: , Where N*Mstore2 is the required storage space size, M is the row in the image, N is the column in the image, and P is the width of a single pixel; S3, putting the data obtained after calculation in S2 into non-volatile memory to complete the background collection work; S4, after the background acquisition work of the image sensor is completed, image acquisition is performed again to obtain raw data RAW_D(i, j); S5, compare the obtained raw data RAW_D(i, j) with the stored row mean H_AVG(j), column mean V_AVG(i) and back The overall mean value AVG_BG of the scene is calculated as follows to obtain the final data DATA(i, j): ; S6, then convert the final data DATA(i, j) into 8-bit output to obtain the final image.
2. The image sensor correction algorithm for saving storage space according to claim 1, characterized in that: In step S2, the calculation formula of the row mean H_AVG(j) is as follows: 。 3. The image sensor correction algorithm for saving storage space according to claim 2, characterized in that: The amount of data obtained after calculating the row mean H_AVG(j) is M*P.
4. The image sensor correction algorithm for saving storage space according to claim 1, characterized in that: In step S2, the column mean V_AVG(i) is calculated as follows: .
5. The image sensor correction algorithm for saving storage space according to claim 4, characterized in that: The amount of data obtained after calculating the column mean V_AVG(i) is N*P.
6. The image sensor correction algorithm for saving storage space according to claim 1, characterized in that: In step S2, the calculation formula of the overall background mean AVG_BG is as follows: .
7. The image sensor correction algorithm for saving storage space according to claim 6, characterized in that: The amount of data obtained after calculating the overall background mean AVG_BG is P.
8. The image sensor correction algorithm for saving storage space according to claim 1, characterized in that: In step S2, the bit width P of a single pixel ranges from 8-bit to 24-bit.
9. The image sensor correction algorithm for saving storage space according to claim 1, characterized in that: In step S3, the non-volatile memory is an MTP, OTP or EEPROM memory.
Citation Information
Patent Citations
Image processing apparatus, image forming apparatus and image processing method
CN102480581A
Nonuniformity correction method and system of infrared image
CN107255521A