A sensor local image calibration method based on black-white-gray background
By employing a local image calibration method based on a black, white, and gray background, dead pixels and bad lines in capacitive sensors can be detected and repaired, solving the problem of high defect rates in production. This method achieves efficient and accurate image calibration and repair, and is applicable to image calibration of different sensors.
Patent Information
- Application Number
- CN202210888449.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-27
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2042-07-27
AI Technical Summary
In mass production, existing capacitive sensors suffer from high defect rates due to localized faulty lines caused by design or manufacturing process issues, which affects production efficiency.
A sensor local image calibration method based on black, white and gray backgrounds is adopted. By acquiring images with white, gray and black backgrounds, bad spots or bad lines are detected, local image calibration and repair are performed, and the parameters of the sensor gain register and voltage discharge register are adjusted to repair the fingerprint image.
It improves the accuracy and speed of image calibration, reduces the defect rate in sensor production, ensures the integrity and adaptability of images, and is suitable for image calibration of different sensors.
Smart Images

Figure CN115171171B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of capacitive fingerprint sensor, in particular to a sensor local image calibration method based on black and white and gray background. BACKGROUND
[0002] At present, the capacitive sensor on the market will have local bad lines caused by design or production process when mass produced. According to different manufacturing processes, sometimes the bad line product failure rate can be as high as 5%, resulting in a decrease in production efficiency. SUMMARY
[0003] In order to remove the bad lines or bad points existing in the fingerprint image, the present application adopts the following technical scheme:
[0004] A sensor local image calibration method based on black and white and gray background, comprising the following steps:
[0005] Step S1: Set the background register parameters, and collect three background images without fingerprints in white, gray and black respectively by the sensor;
[0006] Step S2: Detect whether there are bad points or bad lines in the white, gray and black background pictures, if there are, record the positions of the bad lines and bad points and store them in the flash, and then enter step S3, otherwise, directly enter step S3;
[0007] Step S3: Collect another background picture, and perform background recalibration on the background picture by image small area background level judgment method;
[0008] Step S4: The sensor collects a fingerprint image, reads the positions of the bad lines and bad points in the flash, if there are no bad lines, directly collects the image and uploads and displays it to the window, if there are bad lines, uses a bad point and bad line repair algorithm to repair the fingerprint picture and then uploads and displays it to the window.
[0009] Specifically, in step S2, the process of detecting whether there are bad points or bad lines in the white, gray and black background pictures is as follows:
[0010] Step S21: Establish a coordinate system of the background image: take the pixel points of each background image as coordinate points, and take the lower left corner of the background image as the coordinate origin,
[0011] Step S22: Traverse all pixel points of each background image to find bad points or bad lines:
[0012] If in the white background image, the pixel points with gray scale less than 40, or in the black background image, the pixel points with gray scale greater than 220, or in the gray background image, the pixel points with gray scale less than 40 or greater than 220, are all bad points;
[0013] If the abovementioned bad dot has the same horizontal coordinate or vertical coordinate, a continuous bad line is formed.
[0014] If the absolute coordinates of the bad dot or bad line are repeated, only the last one is recorded.
[0015] Specifically, in step S3, the process of recalibrating the background of the background picture by the image small area background level judgment method comprises the following steps:
[0016] Step S31: divide the background picture into a plurality of image capturing areas;
[0017] Step S32: read the absolute position of the bad dot or bad line from the flash and count the bad dot or bad line area, which is the image capturing area where the bad dot or bad line exists;
[0018] Step S33: calibrate the gray scale image of the bad dot or bad line area;
[0019] Specifically, in step S33, the process of calibrating the image of the bad line area is as follows: calculate the average gray scale of the pixel points of the bad dot or bad line area, denoted as agc1, then calculate the average gray scale of the pixel points of the remaining area of the background picture after deducting the bad line or bad dot, denoted as agc2, calculate the value of ans, ans=(agc2-agc1) / agc1, judge the background gray scale level according to the value of ans, then adjust the parameters of the sensor gain register and voltage discharge register under the background gray scale level according to the corresponding parameter table of the sensor background gray scale and gain register, and further calibrate the image background.
[0020] Specifically, in step S4, the process of repairing the fingerprint picture by the bad dot or bad line repair algorithm is as follows:
[0021] For the fingerprint image, establish the same coordinate system as the background image;
[0022] For the bad dot, calculate the average gray scale value of the 8 pixel points around the bad dot position in the fingerprint image, and replace the original gray scale value of the bad dot with the average gray scale value;
[0023] For the bad line: calculate the average gray scale value of the gray scales of the adjacent two lines at the bad line position in the fingerprint image, and replace the original gray scale value of the bad line with the average gray scale value.
[0024] The method has the following advantages: the method can effectively find white bad points and bad lines, black bad points and bad lines, and gray bad points and bad lines in the image by collecting black and white and gray background images, greatly improves the accuracy of image calibration, and adjusts the image background gain of the region according to the position of the bad line through register configuration after repairing the bad points and bad lines through image compensation, compared with the method of full image calibration on the market, the local calibration method based on black and white and gray background can quickly and effectively perform image calibration on the basis of ensuring calibration accuracy, and can also adapt to different images corresponding to different sensors, and ensure high accuracy and universality. In addition, the image calibration method also has the function of repairing bad lines and bad lines, which ensures the integrity of the output image after calibration, and greatly reduces the defective rate of the sensor production. BRIEF DESCRIPTION OF DRAWINGS
[0025] Figure 1 A flowchart of a sensor local image calibration method based on black and white and gray background;
[0026] Figure 2 A fingerprint image before running the bad point and bad line repair algorithm;
[0027] Figure 3 A fingerprint image after running the bad point and bad line repair algorithm;
[0028] Figure 4 A background image before running the bad point and bad line repair algorithm;
[0029] Figure 5 A background image after running the bad point and bad line repair algorithm; DETAILED DESCRIPTION
[0030] The application will be further described below. Figures 1 to 5
[0031] A sensor local image calibration method based on black and white and gray background, comprising the following steps:
[0032] Step S1: Set the background register parameter, and collect three background images without fingerprints in white, gray and black respectively by the sensor;
[0033] Step S2: Detect whether there are bad points or bad lines in the white, gray and black background pictures,
[0034] Step S21: Establish a coordinate system of the background image: take the pixel points of each background image as coordinate points, and take the lower left corner of the background image as the coordinate origin;
[0035] Step S22: Traverse all pixel points of each background image to find bad points or bad lines:
[0036] If the pixel point with the gray scale less than 40 in the white background image, or the pixel point with the gray scale greater than 220 in the black background image, or the pixel point with the gray scale less than 40 or the pixel point with the gray scale greater than 220 in the gray background image are all the bad points;
[0037] If the abscissa or the ordinate of the above bad points are the same, the continuous bad line is formed.
[0038] Step S23: If the position of the bad line and the bad point is found, it is stored in the flash, and then it enters step S3, and if the absolute coordinates of the bad points or the bad line in the three background pictures are repeated, only the absolute coordinates of the last bad point or the bad line are recorded, and if it is not found, it directly enters step S3;
[0039] From step 2, it can be determined whether there are bad points or bad lines in the background picture, and in addition, the absolute position of all the bad points and the bad lines is recorded in the non-volatile area of the control chip flash to prevent data loss.
[0040] Step S3: The sensor is collected again to collect a background picture;
[0041] Step S31: The background picture is divided into 5x5, a total of 25 grids, and the area in each grid can be independently calibrated for the image gray scale;
[0042] Step S32: The absolute position of the existing bad points or bad lines is read from the flash and the bad point or bad line area is counted, and the bad point or bad line area is the area of the collected picture where the bad points or the bad lines exist;
[0043] Step S33: The average gray scale of the pixel points in the bad point or bad line area is calculated, which is agc1, and the average gray scale of the pixel points in the remaining area of the background picture excluding the bad line or the bad point is calculated, which is agc2, the value of ans is calculated, ans=(agc2-agc1) / agc1, and the background gray scale is judged according to the value of ans:
[0044] If -5%≤ans≤-1%, the background gray scale is black level 1;
[0045] If ans<-5%, the background gray scale is black level 2;
[0046] If -1%<ans<1%, the background gray scale is the moderate level;
[0047] If 1%≤ans≤5%, the background gray scale is gray level 1;
[0048] If ans>5%, the background gray scale is gray level 2;
[0049] Then according to the sensor background gray and gain register corresponding parameter table, the parameters of the sensor gain register and voltage discharge register under the corresponding background gray level are adjusted, and then the image background is calibrated.
[0050] Table 1 sensor background gray and gain register corresponding parameter table
[0051] Background gray scale Gray 2 level Gray 1 level Medium level Black 1 level Black 2 level Gain parameter 0x02 0x04 0x05 0x06 0x07 Voltage parameter 0x07 0x06 0x04 0x04 0x03
[0052] Due to the existence of bad points or bad lines, the gray scale of the background picture is different, so the gray scale of the bad point or bad line area is calibrated by the image background gain. The image gain is achieved by adjusting the parameters of the sensor with respect to the internal signal amplification gain and capacitance charging voltage control register of the capacitive fingerprint sensor, so that the image background gray scale returns to the normal range or close to the normal range, thereby improving the image background quality.
[0053] Step S4: the sensor collects the fingerprint image, reads the position of the bad line and the bad point in the flash, if there is no bad line, directly collects the image and uploads and displays to the window, if there is a bad line, the fingerprint picture is repaired by using the bad point and bad line repair algorithm and then uploaded and displayed to the window.
[0054] Specifically, the process of repairing the fingerprint picture by using the bad point and bad line repair algorithm is as follows:
[0055] For the fingerprint image, the same coordinate system as the background image is established;
[0056] For the bad point, the average gray scale value of the 8 pixel points around the pixel point at the position of the bad point of the fingerprint image is calculated, and the average gray scale value is replaced by the original gray scale value of the bad point;
[0057] For the bad line: the average gray scale value of the gray scale of the adjacent two lines of the bad line of the fingerprint image is calculated, and the average gray scale value is replaced by the original gray scale value of the bad line. The adjacent two lines refer to the normal image pixel lines on the left and right or on the top and bottom of the bad line.
[0058] From the above description, the method has the following advantages: the black and white gray background image collected by the method can effectively find white bad points and bad lines, black bad points and bad lines, and gray bad points and bad lines, greatly improving the accuracy of image calibration. First, the bad points and bad lines are repaired by image compensation, and then the image background gain of the region is adjusted according to the position of the bad line by register configuration. Compared with the current market method of full image calibration, this local calibration method based on black, white and gray background can quickly and effectively calibrate the image on the basis of ensuring the accuracy of calibration, and can also adapt to different images corresponding to different sensors, ensuring high accuracy and universality. In addition, the image calibration method also has the function of repairing bad lines and bad lines, ensuring the integrity of the output image after calibration, and greatly reducing the defective rate of the sensor production.
[0059] It can be understood that the above specific description of the present application is only for illustrating the present application and is not limited to the technical solutions described in the embodiments of the present application. It should be understood by those skilled in the art that the present application can still be modified or replaced equivalently to achieve the same technical effects; as long as the use needs are met, it is within the protection scope of the present application.
Claims
1. A sensor local image calibration method based on black, white and gray background, characterized in that: The following steps are involved: Step S1: Setting background register parameters, and collecting three fingerprint-free background images of white, gray, and black respectively by the acquisition sensor; Step S2: Detect whether there are bad pixels or bad lines in the white, gray, and black background images. If so, record the locations of the bad lines and bad pixels and store them in the flash memory before proceeding to step S3. Otherwise, directly proceed to step S3. Step S3: collecting another background image, and performing background recalibration on the background image using the image small area background level judgment method; Step S4: The sensor collects the fingerprint image and reads the position of the bad lines and bad dots in the flash. If there are no bad lines, the image is directly collected and uploaded to the window for display. If there are bad lines, the bad dot and bad line repair algorithm is used to repair the fingerprint image and then upload it to the window for display.
2. The method for calibrating a local image of a sensor based on a black, white and gray background according to claim 1, characterized in that: In step S2, the process of detecting whether there are bad pixels or bad lines in the white, gray, or black background images is as follows: Step S21: Establish a background image coordinate system: take the pixel points of each background image as coordinate points, and the lower left corner of the background image as the coordinate origin. Step S22: Traverse all pixels of each background image to find bad pixels or bad lines: If a pixel has a grayscale less than 40 in a white background image, or a pixel has a grayscale greater than 220 in a black background image; or a pixel has a grayscale less than 40 or a grayscale greater than 220 in a gray background image, they are all bad pixels. If the horizontal or vertical coordinates of the above bad points are the same, a continuous bad line is formed; If the absolute position of a bad point or bad line is repeated, only the last one is recorded.
3. The method for calibrating a local image of a sensor based on a black, white and gray background according to claim 1, characterized in that: In step S3, the process of performing background recalibration on the background image by using the image small area background level judgment method includes the following steps: Step S31: Divide the background image into a plurality of image collection areas; Step S32: reading the absolute position of the bad pixel or bad line from the flash memory and counting the bad pixel and bad line area, wherein the bad pixel and bad line area is the image collection area where the bad pixel or bad line exists; Step S33: performing grayscale image calibration on the bad pixel and bad line area.
4. The method for calibrating a local image of a sensor based on a black, white and gray background according to claim 3, characterized in that: In step S33, the process of image calibration for the bad line area is as follows: calculate the average grayscale of the pixels in the bad point and bad line area, recorded as agc1, then calculate the average grayscale of the pixels in the remaining area of the background image after deducting the bad lines and bad points, recorded as agc2, calculate the value of ans, ans = (agc2-agc1) / agc1, judge the background grayscale level according to the ans value, and then adjust the parameters of the sensor gain register and the voltage discharge register under the background grayscale level according to the corresponding parameter table of the sensor background grayscale and gain register, and then calibrate the image background.
5. The method for calibrating a sensor local image based on a black, white, and gray background according to claim 2, characterized in that: In step S4, the process of repairing the fingerprint image using the bad pixel and bad line repair algorithm is as follows: For the fingerprint image, establish the same coordinate system as that of the background image; For bad pixels, calculate the average grayscale value of the eight pixels around the bad pixel in the fingerprint image, and replace the original grayscale value of the bad pixel with the average grayscale value; For bad lines: calculate the average grayscale value of the two adjacent lines at the bad line position in the fingerprint image, and replace the original grayscale value of the bad line with the average grayscale value.