Method and device for detecting definition of fingerprint image
By blocking, screening and inverting the fingerprint image, the problem of fingerprint image clarity detection in the fingerprint recognition system is solved, and the accuracy and efficiency of detection are improved.
Patent Information
- Application Number
- CN202411560744.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-02-18
AI Technical Summary
The prior art is difficult to effectively detect the clarity of fingerprint images in fingerprint recognition systems, resulting in an increase in the rate of misidentification and waste of resources.
By collecting the original fingerprint image, it is divided into multiple image blocks, filtering out abnormal blocks. If the number of abnormal blocks is insufficient, inverting the color processing will be performed, blocking and filtering will be repeated, and finally selecting the center block from the inverted image to determine the clarity type.
Improve the accuracy of fingerprint image detection, reduce misidentification rate and resource waste, and save time and resources.
Smart Images

Figure CN119477847A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of image clarity detection, and in particular to a method and device for detecting the clarity of a fingerprint image. Background Art
[0002] As an important information carrier, images are widely used in various fields. The quality of images is crucial to the accurate communication and effective use of information. For example, fingerprint images are often used in identity recognition, security verification and other fields, and the clarity of fingerprint images is directly related to the accuracy and reliability of fingerprint recognition. Clear fingerprint images can accurately present the detailed features of fingerprints, enabling the recognition system to extract feature information more effectively; conversely, blurred fingerprint images may make feature extraction difficult and increase the misrecognition rate. Therefore, it is very important to detect the clarity of fingerprint images.
[0003] However, the fingerprint pressing surface of the fingerprint recognition system is often dirty, or the user's fingers are not clean, which will affect the accuracy of the verification process after fingerprint collection. Therefore, it is necessary to detect the clarity before verification. If verification is performed directly without paying attention to the clarity, it will waste time and resources. Summary of the invention
[0004] In view of this, the present application provides a method and device for detecting the clarity of a fingerprint image, which can perform clarity detection before the fingerprint verification process, thereby saving time and resources.
[0005] To achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, a method for detecting the clarity of a fingerprint image comprises:
[0007] Collecting original fingerprint images;
[0008] Dividing the original fingerprint image into a plurality of first image blocks, determining each first abnormal block from each of the first image blocks, and counting the number of the first abnormal blocks;
[0009] If the number of the first abnormal blocks is less than a first preset number, the original fingerprint image is subjected to inversion processing to obtain an inverted image;
[0010] Dividing the inverted image into a plurality of second image blocks, and determining each second abnormal block from each of the second image blocks, and determining the number of the second abnormal blocks;
[0011] If the number of the second abnormal blocks is less than a second preset number, selecting each central block from each of the second image blocks according to the preset number;
[0012] The definition type of each of the central blocks is determined, and the definition type of the original fingerprint image is determined based on the definition of each of the image blocks.
[0013] Preferably, the determining each first abnormal block from each first image block comprises:
[0014] Calculating a histogram value and a modulation transfer function value of each of the first image blocks;
[0015] For each of the first image blocks, determining whether a histogram value of the first image block is greater than a preset first threshold, and whether a tone transfer function value of the first image block is greater than a preset second threshold;
[0016] If yes, the first image block is determined as a first abnormal block.
[0017] Preferably, the process of calculating the histogram value of the first image block includes:
[0018] Traversing each pixel of the first image block, determining the number of pixels of the first image block and the grayscale value of each pixel;
[0019] Adding the grayscale values of each pixel to obtain a total grayscale value;
[0020] Divide the total grayscale value by the number of pixels of the first image block to obtain an average grayscale value;
[0021] The square root of the average gray value is calculated as the histogram value of the first image block.
[0022] Preferably, the process of calculating the modulation transfer function value of the first image block includes:
[0023] Determining a maximum pixel value and a minimum pixel value of the first image block;
[0024] Summing the maximum pixel value and the minimum pixel value of the first image block to obtain a first calculated value;
[0025] Calculate the difference between the maximum pixel value and the minimum pixel value of the first image block to obtain a second calculated value;
[0026] The second calculated value is divided by the first calculated value and converted into a percentage to obtain a modulation transfer function value of the first image block.
[0027] Preferably, selecting each central block from each second image block according to a preset number includes:
[0028] Determining the width and height of the inverted image;
[0029] If the height is greater than the width, determining a middle column in the rows and columns formed by each of the second image blocks in the inverted image;
[0030] Determining the number of second image blocks in the middle column;
[0031] Selecting each central block from each second image block in the middle column according to the number of the second image blocks in the middle column and the preset number;
[0032] If the width is greater than the height, determining a middle row in the rows and columns formed by each of the second image blocks in the inverted image;
[0033] Determining the number of second image blocks in the middle row;
[0034] Each central block is selected from each second image block in the middle row according to the number of the second image blocks in the middle row and the preset number.
[0035] Preferably, the determining the definition type of each of the central blocks comprises:
[0036] For each of the central blocks, calculating a modulation transfer function value of the central block;
[0037] Calculate the brightness value of the central block;
[0038] Calculate the vertical pixel value of the central block;
[0039] The definition type of the central block is determined by the modulation transfer function value, the brightness value and the vertical pixel value.
[0040] Preferably, the calculating the modulation transfer function value of the central block comprises:
[0041] Determine the number of pixels in the central block and the pixel value of each pixel;
[0042] Calculating an average pixel value of the central block according to the number of pixels and the pixel value of each pixel, and determining a maximum pixel value and a minimum pixel value of the central block from the pixel values of the individual pixels;
[0043] A third threshold and a fourth threshold are set based on the average pixel value, the maximum pixel value and the minimum pixel value of the central block, a fifth threshold is set according to the maximum pixel value of the central block, and a sixth threshold is set according to the minimum pixel value of the central block;
[0044] Determine, from the central block, pixels whose pixel values are greater than the third threshold and less than the fifth threshold as first valid pixels;
[0045] Determine the number of the first effective pixels, and accumulate pixel values of each of the first effective pixels to obtain a first pixel sum;
[0046] Dividing the first pixel sum by the number of the first valid pixels to obtain a target maximum value;
[0047] Determine, from the central block, pixels whose pixel values are less than the fourth threshold and greater than the sixth threshold as second valid pixels;
[0048] Determine the number of the second effective pixels, and accumulate pixel values of each of the second effective pixels to obtain a second pixel sum;
[0049] Dividing the second pixel sum by the number of the second valid pixels to obtain a target minimum value;
[0050] A modulation transfer function value of the center block is calculated based on the target maximum value and the target minimum value.
[0051] Preferably, the calculating of the vertical pixel value of the central block includes:
[0052] Determine the pixel value of each pixel of the central block, the block height and block width of the central block, and the width and height of the inverted image;
[0053] Using pixels in the central block whose pixel values are greater than a preset seventh threshold as third pixels;
[0054] Calculate an average pixel value of each of the third pixels as a first average value;
[0055] Using pixels in the central block whose pixel values are less than a preset eighth threshold as fourth pixels;
[0056] Calculate an average pixel value of each of the fourth pixels as a second average value;
[0057] Performing difference calculation and sum calculation on the first average value and the second average value respectively, and dividing them, to obtain the bright and dark pixel values of the central block;
[0058] Calculate a first vertical pixel value and a second vertical pixel value of the central block based on a block height and a block width of the central block and a width and a height of the inverted image;
[0059] The vertical pixel value of the central block is calculated based on the bright and dark pixel values, the first vertical pixel value and the second vertical pixel value.
[0060] Preferably, the determining the definition type of the central block by the modulation transfer function value, the brightness value and the vertical pixel value comprises:
[0061] respectively setting a first comparison threshold, a second comparison threshold, and a third comparison threshold;
[0062] Determine whether the modulation transfer function value is greater than the first comparison threshold, the brightness value is greater than the second comparison threshold, and the vertical pixel value is greater than the third comparison threshold;
[0063] If so, the clarity type of the central block is determined to be high clarity;
[0064] If not, the clarity of the central block is determined to be unclear.
[0065] In a second aspect, a fingerprint image clarity detection device includes:
[0066] A collection module, used for collecting original fingerprint images;
[0067] A first abnormal block determination module, used for dividing the original fingerprint image into a plurality of first image blocks, determining each first abnormal block from each of the first image blocks, and counting the number of the first abnormal blocks;
[0068] an inverse color processing module, configured to perform inverse color processing on the original fingerprint image to obtain an inverse color image if the number of the first abnormal blocks is less than a first preset number;
[0069] A second abnormal block determination module, used for dividing the inverted image into a plurality of second image blocks, and determining each second abnormal block from each of the second image blocks, and determining the number of the second abnormal blocks;
[0070] A center block selection module, configured to select each center block from each of the second image blocks according to a preset number if the number of the second abnormal blocks is less than a second preset number;
[0071] The definition type determination module is used to determine the definition type of each of the central blocks, and determine the definition type of the original fingerprint image based on the definition of each of the image blocks.
[0072] It can be seen from the above technical solution that the present application collects an original fingerprint image; divides the original fingerprint image into a plurality of first image blocks, and determines each first abnormal block from each of the first image blocks, and counts the number of the first abnormal blocks; if the number of the first abnormal blocks is less than a first preset number, the original fingerprint image is inverted to obtain an inverted image; divides the inverted image into a plurality of second image blocks, and determines each second abnormal block from each of the second image blocks, and determines the number of the second abnormal blocks; if the number of the second abnormal blocks is less than a second preset number, selects each center block from each of the second image blocks according to the preset number; determines the clarity type of each center block, and determines the clarity type of the original fingerprint image based on the clarity of each image block. The present application first collects the original fingerprint image and divides it into multiple first image blocks, from which the abnormal first image blocks are screened, so that the problematic part of the original fingerprint image can be determined in the original fingerprint image. If the abnormality is relatively small, then continue to detect, and then invert the original fingerprint image to obtain an inverted image. Similarly, the problematic part is determined in the inverted image. The inverted image has a stronger contrast than the original fingerprint image, and the abnormal part that is not screened out by the original fingerprint image can be screened out to improve the accuracy of the detection. If the abnormality is still relatively small, it means that the original fingerprint image is likely to be clear. Next, the final clarity detection is performed, and several central blocks are selected from the inverted image to determine the clarity type of these central blocks, thereby determining the clarity type of the original fingerprint image. Then, it can be determined whether to perform subsequent fingerprint verification links according to the clarity type. For example, if the clarity type is relatively clear, then verification can be performed. If it is unclear, then the subsequent verification links are terminated, and the user is reminded to re-collect the fingerprint or clean up the fingerprint collection system / fingerprint collector to save time and resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0074] Figure 1 An optional flow chart of a fingerprint image clarity detection method provided in an embodiment of the present application;
[0075] Figure 2 A schematic diagram of the comparison of an original fingerprint image before and after cropping provided in an embodiment of the present application;
[0076] Figure 3A schematic diagram of a first abnormal block provided in an embodiment of the present application;
[0077] Figure 4 A schematic diagram of a comparison of an inverted image before and after cropping provided in an embodiment of the present application;
[0078] Figure 5 A schematic diagram of a second abnormal block provided in an embodiment of the present application;
[0079] Figure 6 A schematic diagram of a central block selection method provided in an embodiment of the present application;
[0080] Figure 7 A schematic diagram of the structure of a fingerprint image clarity detection device provided in an embodiment of the present application;
[0081] Figure 8 A schematic diagram of the structure of a fingerprint image clarity detection device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0082] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0083] The present application can be applied to any fingerprint collection system or fingerprint collector, such as an optical fingerprint collector, a capacitive fingerprint collector, an ultrasonic fingerprint collector, etc., and can form a fingerprint image.
[0084] The embodiment of the present invention provides a method for detecting the clarity of a fingerprint image. The method can be applied to various computer terminals or smart terminals. The execution subject can be a processor or a server of the computer terminal or the smart terminal. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0085] S1: Collect the original fingerprint image.
[0086] In one example, the user places a finger on the fingerprint collector, and the fingerprint collector can collect the user's fingerprint to obtain an original fingerprint image. In this step, only the original fingerprint image needs to be collected, and no other operations are required.
[0087] S2: Divide the original fingerprint image into a plurality of first image blocks, determine first abnormal blocks from each of the first image blocks, and count the number of the first abnormal blocks.
[0088] After the original fingerprint image is acquired, it can be cropped as required, and then divided into image blocks, which are then used as first image blocks.
[0089] In one example, the original fingerprint image is an image with a height of 480 and a width of 640. The original fingerprint image is cropped into an image with a height of 400 and a width of 480 by the automatic correction frame, and the cropped original fingerprint image is divided into 480 first image blocks, i.e., 20 rows and 24 columns, as shown in FIG. Figure 2 shown.
[0090] Then, an abnormal first image block is determined from each first image block as a first abnormal block, such as a first image block where a stain, a dirty spot, a dirty spot, a white edge or other abnormal position is located. Figure 3 As shown, Figure 3 The area containing fingerprints and dirty spots will be Figure 3 By performing cropping and block division, the dirty spots can be divided into the first image block, and the first image block where the dirty spots are located is the first abnormal block.
[0091] S3: If the number of the first abnormal blocks is less than a first preset number, the original fingerprint image is subjected to color inversion processing to obtain an inverted image.
[0092] The first preset number needs to be determined according to the number of the first image blocks. For example, a percentage can be set, and the number of the first image blocks is multiplied by the percentage. The obtained value is the first preset number. That is to say, if the first abnormal blocks account for a higher proportion of the first image blocks, it means that the original fingerprint image has more abnormal phenomena. If the first abnormal blocks account for a lower proportion of the first image blocks, it means that the original fingerprint image has fewer abnormal phenomena. Then the possibility of higher clarity is relatively high, so subsequent detection can be continued.
[0093] If the original fingerprint image is an optical fingerprint image, it is a black image, and a relatively clear and effective fingerprint image cannot be extracted from it. In order to be able to directly apply the fingerprint verification after the final clarity detection is passed, and for more accurate detection, if the number of the first abnormal blocks is less than the first preset number, the original fingerprint image is inverted to obtain an inverted image. The inverted image is a white image, which can effectively collect the features of the fingerprint, and the inverted image has a much stronger contrast than the original fingerprint image, and can also highlight specific features. It can determine the image blocks in the original fingerprint image that are not determined as the first abnormal blocks but actually have abnormalities, thereby improving the detection accuracy and preventing the omission of abnormal image blocks.
[0094] S4: Divide the inverted image into a plurality of second image blocks, and determine each second abnormal block from each of the second image blocks, and determine the number of the second abnormal blocks.
[0095] The inverted image is divided into blocks to obtain respective second image blocks. Following the example of step S1, the cropped original fingerprint image can be inverted and then divided into a plurality of second image blocks, such as Figure 4 As shown, Figure 4 The original fingerprint image after cropping is an image with a height of 400 and a width of 480. It is subjected to inversion processing to obtain an inverted image, and then cropped again to obtain an inverted image with a height of 380 and a width of 280, and divided into blocks to obtain 266 second image blocks, i.e., 19 rows and 14 columns. In addition, cropping can also be performed according to requirements, and the multiple second image blocks obtained by division are all ROI image blocks.
[0096] Similarly, it is also necessary to determine each abnormal second image block in each second image block, as each second abnormal block, such as a second image block where a stain, a dirty spot, a dirty spot, a white edge, a line or other abnormal position is located, such as Figure 5 As shown, Figure 5 contains fingerprint areas, dirty spots and lines. Figure 5 By cutting and dividing the image into blocks, the dirty spots can be divided into the first image block, and the second image block where the dirty spots and lines are located is the second abnormal block.
[0097] The present application starts from the original fingerprint image and the inverted color image, and performs abnormality detection respectively, so that the image blocks with abnormalities can be detected more effectively and accurately.
[0098] S5: If the number of the second abnormal blocks is less than a second preset number, selecting each central block from each of the second image blocks according to the preset number.
[0099] Similarly, the second preset number also needs to be determined based on the number of second image blocks. A percentage is set, and the number of second image blocks is multiplied by the percentage. The value obtained is the second preset number. That is to say, if the second abnormal blocks account for a higher proportion of the second image blocks, it means that there are more abnormal phenomena in the inverted image, and it also means that there are more abnormal phenomena in the original fingerprint image. If the second abnormal blocks account for a lower proportion of the second image blocks, it means that there are fewer abnormal phenomena in the inverted image, so the possibility of higher clarity is relatively large. After two rounds of abnormal image block detection, if the number of second abnormal blocks is less than the second preset number, the final step of determining the clarity type is performed.
[0100] Among them, the center block can be selected from each second image block according to the preset number. The center block refers to the second image block with a relatively central position in the inverted image. At the same time, the preset number needs to be set in a moderate range, not too much or too little, for example, the preset number can be selected from 5 to 10. In addition, for finger fingerprints, the second image block with a relatively central position can more accurately express the fingerprint characteristics than the second image block at the edge position, so the clarity type determined by this is more accurate, and the clarity type of the original fingerprint image finally determined will also be more accurate; it is also possible to extract a more effective fingerprint from the inverted image after the clarity detection is completed, saving time.
[0101] S6: Determine the definition type of each of the central blocks, and determine the definition type of the original fingerprint image based on the definition of each of the image blocks.
[0102] There are many types of clarity that can be set, such as high clarity, medium clarity, low clarity, unclear, etc. The clarity type of each center block is determined, and then the clarity type of the original fingerprint image is determined based on the clarity type of each center block.
[0103] In an example:
[0104] There are 6 center blocks. If the clarity type of these 6 center blocks is all high clarity, then the clarity type of the original fingerprint image can be considered to be highly clear. In other words, the clarity of these 6 center blocks can represent the clarity of the entire original fingerprint image. If the clarity type of these 6 center blocks is all unclear, then the clarity type of the original fingerprint image can also be considered to be unclear. If 3 are highly clear and 3 are unclear, then the clarity type of the original fingerprint image can be considered to be medium clarity. For example, you can set a weight for each clarity type, and set it in order from high to low clarity, and the weights are also from large to small. High clarity is set to 0.8, medium clarity is set to 0.6, low clarity is set to 0.4, and unclear is set to 0.2. The number of center blocks belonging to the same clarity type in each center block is multiplied by the weight of the clarity type, and then the products corresponding to each clarity type are added. It is also necessary to set the contrast threshold according to the number of center blocks, and set the number of contrast thresholds according to the number of clarity types. If the number of center blocks is 6 and the number of clarity types is 4, then the number of contrast thresholds is 4, and the weight of high clarity is 6×0.8=4.8, and the weight of medium clarity is 6×0.6=3.6, the weight of low clarity is 6×0.4=2.4, the weight of unclear is 6×0.2=1.2, then calculate the product of the weight and the number, and then sum them to get the calculation result. If the calculation result is not less than 4.8, the clarity type of the original fingerprint image is determined to be high clarity. If the calculation result is less than 4.8 and not less than 3.6, the clarity type of the original fingerprint image is determined to be medium clarity. If the calculation result is less than 3.6 and not less than 2.4, the clarity type of the original fingerprint image is determined to be low clarity. If the calculation result is less than 2.4 and not less than 1.2, the clarity type of the original fingerprint image is determined to be unclear. If the calculation result is less than 1.2, the clarity type of the original fingerprint image is also determined to be unclear.
[0105] On the other hand, if the number of the first abnormal blocks is not less than the first preset number, there is no need to perform subsequent steps, and the user can be informed to reposition the finger for collection, or the fingerprint collector can be cleaned; if the number of the second abnormal blocks is not less than the second preset number, there is no need to perform subsequent steps. That is to say, only when the degree of abnormality of the original fingerprint image is relatively light, that is, the number of the first abnormal blocks is less than the first preset number, and the number of the second abnormal blocks is less than the second preset number, will the final clarity type determination stage be entered. This can save the detection process of the original fingerprint image with insufficient clarity. At the same time, multiple detection steps can also ensure that the image entering the final detection link is more likely to have a high degree of clarity.
[0106] It can be seen from the above technical solution that the present application first collects the original fingerprint image and divides it into multiple first image blocks, from which the abnormal first image blocks are screened, so that the problematic part of the original fingerprint image can be determined in the original fingerprint image. If the abnormality is relatively small, then continue to detect, and then perform inversion processing on the original fingerprint image to obtain an inverted image. Similarly, the problematic part is determined in the inverted image. The inverted image has a stronger contrast than the original fingerprint image, and the abnormal part that is not screened out by the original fingerprint image can be screened out to improve the accuracy of the detection. If the abnormality is still relatively small, it means that the original fingerprint image is likely to be clear. Next, the final clarity detection is performed, and several central blocks are selected from the inverted image to determine the clarity type of these central blocks, thereby determining the clarity type of the original fingerprint image. Then, it can be determined whether to perform subsequent fingerprint verification links according to the clarity type. For example, if the clarity type is relatively clear, then verification can be performed. If it is unclear, then the subsequent verification link is terminated, and the user is reminded to re-collect the fingerprint or clean up the fingerprint collection system / fingerprint collector to save time and resources.
[0107] In the method provided in the embodiment of the present invention, the process of determining each first abnormal block from each first image block is specifically described as follows:
[0108] Calculating a histogram value and a modulation transfer function value of each of the first image blocks;
[0109] For each of the first image blocks, determining whether a histogram value of the first image block is greater than a preset first threshold, and whether a tone transfer function value of the first image block is greater than a preset second threshold;
[0110] If yes, the first image block is determined as a first abnormal block.
[0111] Specifically, the histogram value is the Histogram value, and the modulation transfer function value is the MTF (Modulation Transfer Function) value. In this step, the histogram value and the modulation transfer function of each first image block are first calculated, and then these two values are used to determine whether the first image block is abnormal. The Histogram value can clearly reflect the brightness and contrast of the first image block, and the MTF value can measure the transmission ability of the optical system, imaging system, etc. to the modulation signals of different spatial frequencies. Therefore, these two values can be used to efficiently and accurately determine the abnormal first image block.
[0112] Generally, the abnormal first image block may have dirty spots, white spots, white edges, etc. White edges are black and white edges, and white spots may be white or black dots or irregular dots. These different abnormality types can be determined by histogram values and modulation transfer function values.
[0113] For example, the histogram value of the first image block where the white dots and white edges are located is relatively large, and the modulation transfer function value is not as large as the histogram value, but relatively large; the histogram value and modulation transfer function value of the first image block where the dirty spots are located are both relatively large; the histogram value and modulation transfer function value of the normal first image block are both relatively small; it should be noted that there may be fingerprints of other users in the original fingerprint image, or other fingerprints that are not connected with the user's fingerprint, which is also an abnormal phenomenon and will also exist in the abnormal first image block. The modulation transfer function value of this first abnormal block is relatively large, and the histogram value is not as large as the modulation transfer function value, but relatively large. Therefore, the histogram value and the modulation transfer function value are separated and compared with the first threshold and the second threshold respectively. When the histogram value of a first image block is greater than the first threshold, and the modulation transfer function value is greater than the second threshold, it means that the first image block is a first abnormal block, so that the abnormal first image block can be screened out from each first image block.
[0114] The following is an explanation of the calculation process of the histogram value of the first image block in the present application.
[0115] Traversing each pixel of the first image block, determining the number of pixels of the first image block and the grayscale value of each pixel;
[0116] Adding the grayscale values of each pixel to obtain a total grayscale value;
[0117] Divide the total grayscale value by the number of pixels of the first image block to obtain an average grayscale value;
[0118] The square root of the average gray value is calculated as the histogram value of the first image block.
[0119] Specifically, the first image block contains multiple pixels, and the method for calculating the grayscale value of the pixel is to first obtain the color value of the pixel. If the first image block is in color, it is converted into a grayscale image, such as using the weighted average method. For an RGB color image, R, G, and B are the color values of the red, green, and blue channels, respectively. A weighted value is set, and the color values of the three channels are multiplied by their corresponding weighted values, and then the three products are added to obtain the grayscale value of the pixel.
[0120] The following is an explanation of the calculation process of the modulation transfer function value of the first image block in the present application.
[0121] Determining a maximum pixel value and a minimum pixel value of the first image block;
[0122] Summing the maximum pixel value and the minimum pixel value of the first image block to obtain a first calculated value;
[0123] Calculate the difference between the maximum pixel value and the minimum pixel value of the first image block to obtain a second calculated value;
[0124] The second calculated value is divided by the first calculated value and converted into a percentage to obtain a modulation transfer function value of the first image block.
[0125] Specifically, the calculation of the modulation transfer function value is related to the pixel value of the image. When calculating the modulation transfer function value, it is firstly clarified that an image block is an area composed of a group of pixels. A pixel is the smallest component unit of an image block. Pixels are usually arranged in the form of a two-dimensional matrix. The pixel value is a numerical value used to describe the characteristics of the pixel. The pixel value of each pixel in the first image block is determined, and the maximum pixel value and the minimum pixel value are determined. The two are summed and the difference is calculated respectively. The difference is the maximum pixel value minus the minimum pixel value. The modulation transfer function value finally obtained is in the form of a percentage, that is, after dividing the second calculated value by the first calculated value, the quotient obtained is multiplied by 100%.
[0126] Similarly, the histogram value and the modulation transfer function value of the second image block are calculated in the same manner, which will not be described in detail here.
[0127] The histogram values and modulation transfer function values are calculated for the first image block and the second image block in the original fingerprint image and the inverted image, respectively, to determine whether to enter the final clarity type detection link. If so, from the perspective of the inverted image, each central block is selected from each second image block, and the clarity type of each central block is analyzed. Therefore, how to select the central block from multiple second image blocks and how to determine the clarity type of the central block are crucial.
[0128] Then the process of selecting each central block from each second image block according to a preset number in the present application may include:
[0129] Determining the width and height of the inverted image;
[0130] If the height is greater than the width, determining a middle column in the rows and columns formed by each of the second image blocks in the inverted image;
[0131] Determining the number of second image blocks in the middle column;
[0132] Selecting each central block from each second image block in the middle column according to the number of the second image blocks in the middle column and the preset number;
[0133] If the width is greater than the height, determining a middle row in the rows and columns formed by each of the second image blocks in the inverted image;
[0134] Determining the number of second image blocks in the middle row;
[0135] Each central block is selected from each second image block in the middle row according to the number of the second image blocks in the middle row and the preset number.
[0136] Specifically, which second image blocks in the inverted image are in the middle position is determined by the height and width of the inverted image. For example, according to custom, the screen of a general fingerprint collector is rectangular, which fits the shape of the finger more closely. Therefore, the height of the obtained inverted image is also larger than the width. Then, selecting several second image blocks in a column can cover the center of the fingerprint with a higher probability. Therefore, in this step, the height and width are compared. If the height is greater than the width, the column in the middle position is determined, and the second image block in the middle position is determined according to the total number of second image blocks in the middle column, and then selected according to the preset number, such as Figure 6 As shown in the figure, the irregular outline is the finger outline, the middle shaded part is the 6 center blocks, and the area composed of the dotted part is the middle column; if the width is greater than the height, the middle row is determined, and the center block is selected in the same way.
[0137] Furthermore, after the center block is determined, the clarity type of each center block is determined, including:
[0138] S61: For each of the central blocks, calculate the modulation transfer function value of the central block.
[0139] S62: Calculate the brightness value of the central block;
[0140] S63: Calculate the vertical pixel value of the central block;
[0141] S64: Determine the definition type of the central block according to the modulation transfer function value, the brightness value and the vertical pixel value.
[0142] When calculating the sharpness type of the center block, several influencing factors are taken into account, namely, the modulation transfer function value, the brightness value and the vertical pixel value.
[0143] Wherein, for step S61, for each of the central blocks, the process of calculating the modulation transfer function value of the central block may include:
[0144] Determine the number of pixels in the central block and the pixel value of each pixel;
[0145] Calculating an average pixel value of the central block according to the number of pixels and the pixel value of each pixel, and determining a maximum pixel value and a minimum pixel value of the central block from the pixel values of the individual pixels;
[0146] A third threshold and a fourth threshold are set based on the average pixel value, the maximum pixel value and the minimum pixel value of the central block, a fifth threshold is set according to the maximum pixel value of the central block, and a sixth threshold is set according to the minimum pixel value of the central block;
[0147] Determine, from the central block, pixels whose pixel values are greater than the third threshold and less than the fifth threshold as first valid pixels;
[0148] Determine the number of the first effective pixels, and accumulate pixel values of each of the first effective pixels to obtain a first pixel sum;
[0149] Dividing the first pixel sum by the number of the first valid pixels to obtain a target maximum value;
[0150] Determine, from the central block, pixels whose pixel values are less than the fourth threshold and greater than the sixth threshold as second valid pixels;
[0151] Determine the number of the second effective pixels, and accumulate pixel values of each of the second effective pixels to obtain a second pixel sum;
[0152] Dividing the second pixel sum by the number of the second valid pixels to obtain a target minimum value;
[0153] A modulation transfer function value of the center block is calculated based on the target maximum value and the target minimum value.
[0154] Specifically, each central block also contains multiple pixels, and each pixel also has a corresponding pixel value. Therefore, for each central block, the pixel values of each pixel of the central block are added together and then divided by the number of pixels to obtain the average pixel value of the central block. The pixel value of each pixel has been determined, so the maximum and minimum values therein can also be determined, that is, the maximum pixel value and the minimum pixel value of the central block.
[0155] In order to improve the determination of the definition type and prevent the influence of abnormal pixels in the center block, the abnormal points such as bright pixels and dark pixels in each pixel of the center block are avoided. Therefore, after determining the average pixel value, maximum pixel value and minimum pixel value of the center block, a threshold is set according to the three values, and each pixel in the center block is compared with the set threshold value to determine the abnormal points. For example:
[0156] The third threshold = average pixel value + (maximum pixel value - average pixel value) / 3;
[0157] The fourth threshold = average pixel value + (average pixel value - minimum pixel value) / 3;
[0158] The fifth threshold = maximum pixel value - 3;
[0159] The sixth threshold = minimum pixel value + 2;
[0160] In setting the third and fourth thresholds, considering that the distribution of bright pixels and dark pixels of the photosensitive chip is usually around 3 times, setting it to other multiples will result in large errors, which is not consistent with the data distribution of bright pixels and dark pixels of the photosensitive chip. Therefore, in the calculation process, the difference is divided by 3 after it is obtained; in setting the fifth threshold, since the difference between the pixel value of the bright pixel of the photosensitive chip and the pixel value of the ordinary / normal pixel is usually in the range of 3 to 20, 3 is selected here, and the maximum pixel value is subtracted by 3; in setting the sixth threshold, since the difference between the pixel value of the dark (or dirty) pixel of the photosensitive chip is usually in the range of 2 to 10, 2 is selected here, and the minimum pixel value is added by 2.
[0161] Then analyze each pixel in the central block separately and select valid pixels from them. The specific method is to remove bright pixels and dark pixels, and then calculate the modulation transfer function value of the central block based on the valid pixels. Then, the pixel whose pixel value satisfies the following formula is set to be the first valid pixel:
[0162] The third threshold value < pixel value < fifth threshold value;
[0163] After determining each first effective pixel, the average pixel value of each first effective pixel is calculated, that is, the sum of the first pixels is divided by the number of the first effective pixels, and the average pixel value is taken as the target maximum value.
[0164] Then set the pixel whose pixel value satisfies the following formula as the second effective pixel:
[0165] The fourth threshold value < pixel value < sixth threshold value;
[0166] The average pixel value of each second effective pixel is calculated in the same way and is used as the target minimum value.
[0167] Finally, the modulation transfer function value of the central block is calculated according to the target maximum value and the target minimum value:
[0168] The modulation transfer function value of the center block = (target maximum value - target minimum value) / (target maximum value + target minimum value) × 100%.
[0169] In step S62, the brightness value of the central block can be regarded as the average pixel value of the central block.
[0170] For step S63, the process of calculating the vertical pixel value of the central block may specifically include:
[0171] Determine the pixel value of each pixel of the central block, the block height and block width of the central block, and the width and height of the inverted image;
[0172] Using pixels in the central block whose pixel values are greater than a preset seventh threshold as third pixels;
[0173] Calculate an average pixel value of each of the third pixels as a first average value;
[0174] Using pixels in the central block whose pixel values are less than a preset eighth threshold as fourth pixels;
[0175] Calculate an average pixel value of each of the fourth pixels as a second average value;
[0176] Performing difference calculation and sum calculation on the first average value and the second average value respectively, and dividing them, to obtain the bright and dark pixel values of the central block;
[0177] Calculate a first vertical pixel value and a second vertical pixel value of the central block based on a block height and a block width of the central block and a width and a height of the inverted image;
[0178] The vertical pixel value of the central block is calculated based on the bright and dark pixel values, the first vertical pixel value and the second vertical pixel value.
[0179] Specifically, the first vertical pixel value refers to the vertical direction X value, and the calculation process is: traverse the X-axis coordinate values of all pixels in all rows of the central block, accumulate them, and the result is the vertical direction X value.
[0180] The second vertical pixel value refers to the vertical Y value, and the calculation process is: traverse the Y-axis coordinate values of all pixels in all columns of the central block, accumulate them, and the result is the vertical Y value.
[0181] The vertical pixel value calculation formula of the center block is:
[0182] Bright and dark pixel value × vertical Y value / (vertical X value + vertical Y value).
[0183] Furthermore, in step S64, the process of determining the definition type of the central block according to the modulation transfer function value, the brightness value and the vertical pixel value includes:
[0184] respectively setting a first comparison threshold, a second comparison threshold, and a third comparison threshold;
[0185] Determine whether the modulation transfer function value is greater than the first comparison threshold, the brightness value is greater than the second comparison threshold, and the vertical pixel value is greater than the third comparison threshold;
[0186] If so, the clarity type of the central block is determined to be high clarity;
[0187] If not, the clarity of the central block is determined to be unclear.
[0188] Specifically, determining the clarity type based on the values of these three aspects is more comprehensive and can make the type determination more accurate. It can be understood that if these three values are all greater than their corresponding thresholds, it can be said that the clarity of the central block is high and the type is high definition.
[0189] and Figure 1 Corresponding to the method described above, the embodiment of the present invention also provides a fingerprint image clarity detection device for detecting Figure 1 In the specific implementation of the method, the fingerprint image clarity detection device provided by the embodiment of the present invention can be used in a computer terminal or various mobile devices, combined with Figure 7 , the detection device of fingerprint image clarity is introduced, such as Figure 7 As shown, the device may include:
[0190] The acquisition module 10 is used to acquire the original fingerprint image;
[0191] A first abnormal block determination module 20, configured to divide the original fingerprint image into a plurality of first image blocks, determine each first abnormal block from each of the first image blocks, and count the number of the first abnormal blocks;
[0192] The inversion processing module 30 is used for performing inversion processing on the original fingerprint image to obtain an inversion image if the number of the first abnormal blocks is less than a first preset number;
[0193] A second abnormal block determination module 40, configured to divide the inverted image into a plurality of second image blocks, and determine each second abnormal block from each of the second image blocks, and determine the number of the second abnormal blocks;
[0194] A center block selection module 50, configured to select each center block from each of the second image blocks according to a preset number if the number of the second abnormal blocks is less than a second preset number;
[0195] The definition type determination module 60 is used to determine the definition type of each of the central blocks, and determine the definition type of the original fingerprint image based on the definition of each of the image blocks.
[0196] It can be seen from the above technical solution that the present application first collects the original fingerprint image and divides it into multiple first image blocks, from which the abnormal first image blocks are screened, so that the problematic part of the original fingerprint image can be determined in the original fingerprint image. If the abnormality is relatively small, then continue to detect, and then perform inversion processing on the original fingerprint image to obtain an inverted image. Similarly, the problematic part is determined in the inverted image. The inverted image has a stronger contrast than the original fingerprint image, and the abnormal part that is not screened out by the original fingerprint image can be screened out to improve the accuracy of the detection. If the abnormality is still relatively small, it means that the original fingerprint image is likely to be clear. Next, the final clarity detection is performed, and several central blocks are selected from the inverted image to determine the clarity type of these central blocks, thereby determining the clarity type of the original fingerprint image. Then, it can be determined whether to perform subsequent fingerprint verification links according to the clarity type. For example, if the clarity type is relatively clear, then verification can be performed. If it is unclear, then the subsequent verification link is terminated, and the user is reminded to re-collect the fingerprint or clean up the fingerprint collection system / fingerprint collector to save time and resources.
[0197] Furthermore, the embodiment of the present application provides a fingerprint image clarity detection device. Optionally, Figure 8 The hardware structure diagram of the fingerprint image clarity detection device is shown in FIG. Figure 8 The hardware structure of the fingerprint image clarity detection device may include: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.
[0198] In the embodiment of the present application, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .
[0199] The processor 01 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0200] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0201] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following fingerprint image clarity detection method, including:
[0202] Collecting original fingerprint images;
[0203] Dividing the original fingerprint image into a plurality of first image blocks, determining each first abnormal block from each of the first image blocks, and counting the number of the first abnormal blocks;
[0204] If the number of the first abnormal blocks is less than a first preset number, the original fingerprint image is subjected to inversion processing to obtain an inverted image;
[0205] Dividing the inverted image into a plurality of second image blocks, and determining each second abnormal block from each of the second image blocks, and determining the number of the second abnormal blocks;
[0206] If the number of the second abnormal blocks is less than a second preset number, selecting each central block from each of the second image blocks according to the preset number;
[0207] The definition type of each of the central blocks is determined, and the definition type of the original fingerprint image is determined based on the definition of each of the image blocks.
[0208] Optionally, the detailed functions and extended functions of the program may refer to the description of the method for detecting the clarity of a fingerprint image in the method embodiment.
[0209] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, and when the program is executed, controls the device where the storage medium is located to execute the following fingerprint image clarity detection method, including:
[0210] Collecting original fingerprint images;
[0211] Dividing the original fingerprint image into a plurality of first image blocks, determining each first abnormal block from each of the first image blocks, and counting the number of the first abnormal blocks;
[0212] If the number of the first abnormal blocks is less than a first preset number, the original fingerprint image is subjected to inversion processing to obtain an inverted image;
[0213] Dividing the inverted image into a plurality of second image blocks, and determining each second abnormal block from each of the second image blocks, and determining the number of the second abnormal blocks;
[0214] If the number of the second abnormal blocks is less than a second preset number, selecting each central block from each of the second image blocks according to the preset number;
[0215] The definition type of each of the central blocks is determined, and the definition type of the original fingerprint image is determined based on the definition of each of the image blocks.
[0216] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0217] Optionally, the detailed functions and extended functions of the program may refer to the description of the method for detecting the clarity of a fingerprint image in the method embodiment.
[0218] In addition, the functional modules in the various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure.
[0219] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0220] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0221] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for detecting the clarity of a fingerprint image, characterized in that: include: Collecting original fingerprint images; Dividing the original fingerprint image into a plurality of first image blocks, determining each first abnormal block from each of the first image blocks, and counting the number of the first abnormal blocks; If the number of the first abnormal blocks is less than a first preset number, the original fingerprint image is subjected to inversion processing to obtain an inverted image; Dividing the inverted image into a plurality of second image blocks, and determining each second abnormal block from each of the second image blocks, and determining the number of the second abnormal blocks; If the number of the second abnormal blocks is less than a second preset number, selecting each central block from each of the second image blocks according to the preset number; The definition type of each of the central blocks is determined, and the definition type of the original fingerprint image is determined based on the definition of each of the image blocks.
2. The method according to claim 1, characterized in that The determining each first abnormal block from each first image block comprises: Calculating a histogram value and a modulation transfer function value of each of the first image blocks; For each of the first image blocks, determining whether a histogram value of the first image block is greater than a preset first threshold, and whether a tone transfer function value of the first image block is greater than a preset second threshold; If yes, the first image block is determined as a first abnormal block.
3. The method according to claim 2, characterized in that The process of calculating the histogram value of the first image block includes: Traversing each pixel of the first image block, determining the number of pixels of the first image block and the grayscale value of each pixel; Adding the grayscale values of each pixel to obtain a total grayscale value; Divide the total grayscale value by the number of pixels of the first image block to obtain an average grayscale value; The square root of the average gray value is calculated as the histogram value of the first image block.
4. The method according to claim 2, characterized in that: The calculation process of the modulation transfer function value of the first image block includes: Determining a maximum pixel value and a minimum pixel value of the first image block; Summing the maximum pixel value and the minimum pixel value of the first image block to obtain a first calculated value; Calculate the difference between the maximum pixel value and the minimum pixel value of the first image block to obtain a second calculated value; The second calculated value is divided by the first calculated value and converted into a percentage to obtain a modulation transfer function value of the first image block.
5. The method according to claim 1, characterized in that The selecting each central block from each second image block according to a preset number includes: Determining the width and height of the inverted image; If the height is greater than the width, determining a middle column in the rows and columns formed by each of the second image blocks in the inverted image; Determining the number of second image blocks in the middle column; Selecting each central block from each second image block in the middle column according to the number of the second image blocks in the middle column and the preset number; If the width is greater than the height, determining a middle row in the rows and columns formed by each of the second image blocks in the inverted image; Determining the number of second image blocks in the middle row; Each central block is selected from each second image block in the middle row according to the number of the second image blocks in the middle row and the preset number.
6. The method according to any one of claims 1 to 5, characterized in that The determining of the definition type of each of the central blocks comprises: For each of the central blocks, calculating a modulation transfer function value of the central block; Calculate the brightness value of the central block; Calculate the vertical pixel value of the central block; The definition type of the central block is determined by the modulation transfer function value, the brightness value and the vertical pixel value.
7. The method according to claim 6, characterized in that The step of calculating the modulation transfer function value of the central block comprises: Determine the number of pixels in the central block and the pixel value of each pixel; Calculating an average pixel value of the central block according to the number of pixels and the pixel value of each pixel, and determining a maximum pixel value and a minimum pixel value of the central block from the pixel values of the individual pixels; A third threshold and a fourth threshold are set based on the average pixel value, the maximum pixel value and the minimum pixel value of the central block, a fifth threshold is set according to the maximum pixel value of the central block, and a sixth threshold is set according to the minimum pixel value of the central block; Determine, from the central block, pixels whose pixel values are greater than the third threshold and less than the fifth threshold as first valid pixels; Determine the number of the first effective pixels, and accumulate pixel values of each of the first effective pixels to obtain a first pixel sum; Dividing the first pixel sum by the number of the first valid pixels to obtain a target maximum value; Determine, from the central block, pixels whose pixel values are less than the fourth threshold and greater than the sixth threshold as second valid pixels; Determine the number of the second effective pixels, and accumulate pixel values of each of the second effective pixels to obtain a second pixel sum; Dividing the second pixel sum by the number of the second valid pixels to obtain a target minimum value; A modulation transfer function value of the center block is calculated based on the target maximum value and the target minimum value.
8. The method according to claim 6, characterized in that The calculating of the vertical pixel value of the central block includes: Determine the pixel value of each pixel of the central block, the block height and block width of the central block, and the width and height of the inverted image; Using pixels in the central block whose pixel values are greater than a preset seventh threshold as third pixels; Calculate an average pixel value of each of the third pixels as a first average value; Using pixels in the central block whose pixel values are less than a preset eighth threshold as fourth pixels; Calculate an average pixel value of each of the fourth pixels as a second average value; Performing difference calculation and sum calculation on the first average value and the second average value respectively, and dividing them, to obtain the bright and dark pixel values of the central block; Calculate a first vertical pixel value and a second vertical pixel value of the central block based on a block height and a block width of the central block and a width and a height of the inverted image; The vertical pixel value of the central block is calculated based on the bright and dark pixel values, the first vertical pixel value and the second vertical pixel value.
9. The method according to claim 6, characterized in that The method of determining the definition type of the central block by using the modulation transfer function value, the brightness value and the vertical pixel value comprises: respectively setting a first comparison threshold, a second comparison threshold, and a third comparison threshold; Determine whether the modulation transfer function value is greater than the first comparison threshold, the brightness value is greater than the second comparison threshold, and the vertical pixel value is greater than the third comparison threshold; If so, the clarity type of the central block is determined to be high clarity; If not, it is determined that the clarity of the central block is unclear.
10. A fingerprint image clarity detection device, characterized in that: include: A collection module, used for collecting original fingerprint images; A first abnormal block determination module, used for dividing the original fingerprint image into a plurality of first image blocks, determining each first abnormal block from each of the first image blocks, and counting the number of the first abnormal blocks; a color inversion processing module, configured to perform color inversion processing on the original fingerprint image to obtain a color inversion image if the number of the first abnormal blocks is less than a first preset number; A second abnormal block determination module, used for dividing the inverted image into a plurality of second image blocks, and determining each second abnormal block from each of the second image blocks, and determining the number of the second abnormal blocks; A central block selection module, configured to select central blocks from each of the second image blocks according to a preset number if the number of the second abnormal blocks is less than a second preset number; The definition type determination module is used to determine the definition type of each of the central blocks, and determine the definition type of the original fingerprint image based on the definition of each of the image blocks.
Citation Information
Cited By
Ultrasonic fingerprint recognition method, chip, system, electronic device, and storage medium
WO2026183764A1