A palm print ROI extraction method, a terminal and a storage medium
By constructing a ball motion model to locate key points in palmprint images, the problem of cumbersome palmprint ROI acquisition in existing technologies is solved. This enables fast and robust ROI localization and extraction on low-computing-power platforms, and is suitable for non-contact palmprint recognition systems.
Patent Information
- Application Number
- CN202211152308.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-09-21
AI Technical Summary
Existing technologies for obtaining palmprint key points are cumbersome and cannot achieve real-time positioning and extraction of palm ROI on low-computing-power hardware platforms. In particular, in non-contact palmprint recognition systems, factors such as palm posture and lighting make accurate ROI positioning difficult.
By constructing a target ball motion model, key points are located using the ball's motion in the palm print image. This includes preprocessing steps such as scaling, filtering, binarization, morphological processing, and connected component detection. The target key point locations are found by combining the ball motion model, and the ROI image is extracted based on this.
It achieves fast and robust localization and extraction of palmprint ROI on low-computing-power hardware platforms, and is suitable for non-contact palmprint recognition systems. It can locate and extract target ROI images in real time in videos with a success rate of up to 98.5%.
Smart Images

Figure CN115457603B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a palmprint ROI extraction method, a terminal and a storage medium. BACKGROUND
[0002] With the rapid development of information society, the technology of identifying individual identity through biological characteristics has been widely used because of its characteristics difficult to forge. Face, fingerprint, iris, gait, voiceprint, etc. have been widely used in mobile phone unlocking, mobile payment, access control and other scenarios. Palmprint recognition has been increasingly concerned by researchers in recent years. Compared with other biological modalities, palmprint recognition has the characteristics of high precision and high anti-forgery. Non-contact palmprint recognition technology has been studied in recent years because of its outstanding advantage of low risk of disease transmission. In practical application, the non-contact method not only improves the user friendliness, but also protects the user privacy, and has good interactive experience.
[0003] The line and texture features of palmprint have high discriminability, and a low-resolution camera can obtain a palmprint image with high recognition ability. In a palmprint recognition system, the segmentation result of the palm region in the image directly affects the accuracy of ROI positioning, and the accuracy of ROI positioning directly affects the extraction of subsequent features. In particular, in a non-contact palmprint recognition system, the palmprint image is collected in an open space, and factors such as the posture and position of the palm, environmental light, etc. make the task of palm region segmentation and accurate ROI positioning extremely challenging.
[0004] The currently proposed ROI positioning and extraction method is based on positioning key points, which refers to the finger valley points between the index finger and the middle finger and the finger valley points between the little finger and the ring finger. Accurate positioning of the key points can accurately extract the ROI. However, in the prior art, the way to obtain the key points is cumbersome, requires a large amount of memory, and has high requirements for the running environment.
[0005] Therefore, the prior art still needs to be improved and improved. SUMMARY
[0006] In view of the above defects of the prior art, the present application provides a palmprint ROI extraction method, a terminal and a storage medium, which aims to solve the problem that the way to obtain the key points in the prior art is cumbersome, and the real-time ROI positioning and extraction of the palm in the video cannot be realized on a low-power hardware platform.
[0007] In order to solve the above technical problems, the technical scheme adopted by the present application is as follows:
[0008] The first aspect of the present application provides a palmprint ROI extraction method, which comprises:
[0009] acquire an original palmprint image;
[0010] preprocess the original palmprint image to obtain a target palmprint image;
[0011] construct a target ball movement model, take the target palmprint image as a map of ball movement, take the palm contour in the target palmprint image as an obstacle, take the initial position of the ball above the target palmprint image, the ball is a plurality of balls, when the ball is subjected to a first force towards the bottom of the target palmprint image, the ball starts to move, when the ball encounters the palm contour, the moving direction changes, and the ball stops after moving a preset step length according to the changed direction, and then moves again when the ball is subjected to the first force again until the ball reaches a preset condition and stops moving;
[0012] acquire the position of a target key point in the target palmprint image according to the position of the ball after movement;
[0013] extract a target ROI image from the original palmprint image according to the position of the target key point.
[0014] The method for extracting a palmprint ROI, wherein the preprocessing of the original palmprint image to obtain a target palmprint image comprises:
[0015] scaling the original palmprint image to a preset size to obtain a first palmprint image;
[0016] performing Gaussian filtering on the first palmprint image to obtain a second palmprint image;
[0017] performing binaryzation processing on the second palmprint image to obtain a third palmprint image;
[0018] performing morphological erosion and morphological dilation on the third palmprint image to obtain a fourth palmprint image;
[0019] performing connected domain detection on the fourth palmprint image, and obtaining the target palmprint image through a contour detection algorithm.
[0020] The method for extracting a palmprint ROI, wherein in the target ball movement model:
[0021] the ball comprises at least one first ball, at least one second ball and at least one third ball;
[0022] each of the first balls moves one by one, each of the second balls moves one by one, and each of the third balls moves one by one;
[0023] The first first ball has a starting position at the upper right corner of the target palmprint image, the n+1th first ball has a starting position at the upper edge of the target palmprint image and left of the leftmost point of the n th first ball trajectory, and no more first balls are added when the starting position of the first ball is outside the range of the target palmprint image;
[0024] The first second ball has a starting position at the upper right corner of the target palmprint image, the n+1th second ball has a starting position at the intersection of a straight line passing through the lowest point of the n th second ball trajectory and parallel to the direction of force and the right edge of the target palmprint image, and no more second balls are added when the starting position of the second ball is outside the range of the target palmprint image;
[0025] The first third ball has a starting position at the upper left corner of the target palmprint image, the n+1th third ball has a starting position at the intersection of a straight line passing through the lowest point of the n th third ball trajectory and parallel to the direction of force and the left edge of the target palmprint image, and no more third balls are added when the starting position of the third ball is outside the range of the target palmprint image.
[0026] The palmprint ROI extraction method, wherein the first force acting on the first ball is a vertical downward force; the first force acting on the second ball is a left oblique downward force; and the first force acting on the third ball is a right oblique downward force.
[0027] The palmprint ROI extraction method, wherein when the ball encounters the palm contour, the direction of movement changes, including:
[0028] Each ball has three sensing points, namely a front sensing point, a left sensing point and a right sensing point.
[0029] When none of the three sensing points senses the palm contour, the ball continues to move forward.
[0030] When the left sensing point senses the palm contour, the ball moves to the right.
[0031] When the right sensing point senses the palm contour, the ball moves to the left.
[0032] When the front sensing point senses the palm contour, the ball moves to the left or to the right.
[0033] When the left sensing point and the right sensing point simultaneously sense the palm contour, the ball moves downward.
[0034] When the left sensing point, the right sensing point and the front sensing point simultaneously sense the palm outline, the ball retreats two pixel points.
[0035] The palmprint ROI extraction method, wherein the preset condition is:
[0036] The ball moves beyond the image range of the target palmprint image, or the ball reaches a finger valley point in the target palmprint image.
[0037] When the ball reaches the finger valley point, the finger valley point position is recorded, and the determination mode of the ball reaching the finger valley point in the target palmprint image is that the left and right movement directions of the ball change more than twice or the ball moves to a preset range of the recorded finger valley point position.
[0038] The palmprint ROI extraction method, wherein the target key point position in the target palmprint image is obtained according to the position of the ball after movement, and the method comprises:
[0039] Four finger valley point positions in the target palmprint image are obtained according to the position of the ball after movement.
[0040] The lowest finger valley point in the image is deleted, and the positions of two finger valley points with a relatively far distance among the remaining three finger valley points are taken as the target key point positions.
[0041] The palmprint ROI extraction method, wherein the target ROI image is extracted from the original palmprint image according to the target key point positions, and the method comprises:
[0042] After the two target key point positions are connected to obtain a target line segment, a key region is obtained according to the target line segment, and the target ROI image is obtained according to the key region.
[0043] In a second aspect of the present application, a terminal is provided, which comprises a processor and a computer readable storage medium connected with the processor in communication, the computer readable storage medium is adapted to store a plurality of instructions, and the processor is adapted to invoke the instructions in the computer readable storage medium to execute the steps of the palmprint ROI extraction method.
[0044] In a third aspect of the present application, a computer readable storage medium is provided, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the palmprint ROI extraction method.
[0045] Compared with existing technologies, this invention provides a method for extracting palmprint ROIs. The method involves acquiring an original palmprint image, preprocessing the original palmprint image to obtain a target palmprint image, constructing a target ball motion model based on the target palmprint image (using the target palmprint image as a map for the ball's motion and the hand outline in the target palmprint image as an obstacle), and initially positioning the balls above the target palmprint image. Multiple balls begin to move when subjected to a first force directed downwards towards the target palmprint image. When a ball encounters the hand outline, its direction of movement changes, and it moves a preset step length in the changed direction before stopping. It then moves again after being subjected to the first force until it reaches a preset condition and stops. The method then obtains the target key point positions in the target palmprint image based on the ball's position after movement. Finally, the target ROI image is extracted from the original palmprint image based on the target key point positions. This invention finds the target key points by constructing the target ball motion model, and then extracts the target ROI image based on the target key points, enabling the system to extract the target ROI image more quickly. It is also applicable to non-contact palmprint recognition systems and can realize real-time ROI positioning and extraction of the palm in video on low-computing-power hardware platforms. Attached Figure Description
[0046] Figure 1 A flowchart illustrating an embodiment of the palmprint ROI extraction method provided by the present invention;
[0047] Figure 2 From left to right, the diagram shows the preprocessing of the original palm print image in an embodiment of the palm print ROI extraction method provided by the present invention.
[0048] Figure 3 Force analysis diagram of an embodiment of the palmprint ROI extraction method provided by the present invention;
[0049] Figure 4 From left to right, the diagram shows the obstacle avoidance process of a small ball in an embodiment of the palmprint ROI extraction method provided by the present invention.
[0050] Figure 5 Optimization of small ball sensing points in an embodiment of the palmprint ROI extraction method provided by the present invention Figure 1 ;
[0051] Figure 6 Optimization of small ball sensing points in an embodiment of the palmprint ROI extraction method provided by the present invention Figure 2 ;
[0052] Figure 7 Finger closure recognition, an embodiment of the palmprint ROI extraction method provided by the present invention. Figure 1;
[0053] Figure 8 Finger close recognition of the embodiment of the palmprint ROI extraction method provided by the present application Figure 2 ;
[0054] Figure 9 Finger close recognition of the embodiment of the palmprint ROI extraction method provided by the present application Figure 3 ;
[0055] Figure 10 The ROI positioning extraction schematic diagram of the embodiment of the palmprint ROI extraction method provided by the present application
[0056] Figure 11 The principle schematic diagram of the embodiment of the terminal provided by the present application DETAILED DESCRIPTION
[0057] For the purpose, technical solutions and effects of the present application to be clearer and more explicit, the present application is further described in detail below with reference to the drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application and do not limit the present application.
[0058] Those skilled in the art can understand that, unless specifically stated otherwise, the singular form "a", "an", "said" and "the" used herein can also include the plural form. It should be further understood that the phrase "comprising" used in the specification of the present application means that the features, integers, steps, operations, elements and / or components exist, but does not exclude the existence or addition of one or more other features, integers, steps, operations, elements, components and / or their groups. It should be understood that when we say that an element is "connected" or "coupled" to another element, it can be directly connected or coupled to the other element, or there can be intermediate elements. In addition, "connected" or "coupled" used herein can include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any single unit and all combinations of the associated listed items.
[0059] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as that generally understood by those skilled in the art to which the present application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have meanings consistent with those in the context of the prior art, and should not be interpreted with idealized or overly formal meanings unless specifically defined as such.
[0060] The palmprint ROI extraction method provided by the application can be applied to a terminal with computing capability, and the terminal can perform the palmprint ROI extraction method provided by the application to segment a target in a to-be-processed image.
[0061] Embodiment one
[0062] As shown in the palmprint ROI extraction method, one embodiment includes the following steps: Figure 1
[0063] S100, acquiring an original palmprint image.
[0064] The line and texture features of the palmprint have high identification, and a palmprint image with high recognition capability can be acquired by using a low-resolution camera. In this embodiment, an original palmprint image containing a palm is acquired by an image sensor.
[0065] S200, preprocessing the original palmprint image to obtain a target palmprint image.
[0066] The preprocessing of the original palmprint image to obtain the target palmprint image includes the following steps.
[0067] S210, scaling the original palmprint image to a preset size to obtain a first palmprint image.
[0068] S220, performing Gaussian filtering on the first palmprint image to obtain a second palmprint image.
[0069] S230, performing binarization processing on the second palmprint image to obtain a third palmprint image.
[0070] S240, performing morphological erosion and morphological dilation on the third palmprint image to obtain a fourth palmprint image.
[0071] S250, performing connected domain detection on the fourth palmprint image, and obtaining the target palmprint image by a contour detection algorithm.
[0072] Specifically, after the original palmprint image is acquired, the original palmprint image is preprocessed to obtain a target palmprint image. The target palmprint image is used for target key point positioning in the next step. The image preprocessing process is as shown in the following figure. Figure 2
[0073] The preprocessing process of the original palmprint image in this embodiment is as follows.
[0074] In a first step, the size of the original palmprint image is scaled to a preset size to obtain a first palmprint image. Since the lines and texture features of a palmprint have high discriminability, a palmprint image with low resolution can also achieve high-precision palmprint recognition. However, a large image size increases the calculation time and occupies a large amount of memory. Therefore, after obtaining the original palmprint image, the size of the image is compressed to 640*480 pixels to obtain the first palmprint image with a fixed size.
[0075] In a second step, the first palmprint image is subjected to Gaussian filtering to obtain a second palmprint image. Some noise points may exist in the first palmprint image due to environmental factors such as light. A 19*19 kernel size Gaussian filter can eliminate part of the noise points in the first palmprint image, so that the first palmprint image becomes smooth, thereby obtaining the second palmprint image.
[0076] In a third step, the second palmprint image is subjected to binarization processing to obtain a third palmprint image. That is, the second palmprint image is subjected to threshold segmentation: the second palmprint image is binarized using the Otsu method, the best global threshold is determined from the image histogram, the pixel point gray value higher than the threshold is set to 255, and the pixel point gray value lower than the threshold is set to 0, thereby obtaining the third palmprint image.
[0077] In a fourth step, the third palmprint image is subjected to morphological erosion and morphological dilation to obtain a fourth palmprint image. Morphological erosion and morphological dilation of the third palmprint image can eliminate white noise in the third palmprint image, thereby obtaining the fourth palmprint image after removing noise.
[0078] In a fifth step, the fourth palmprint image is subjected to connected domain detection, and the target palmprint image is obtained through a contour detection algorithm. The maximum connected domain in the fourth palmprint image is detected. In this embodiment, the maximum non-zero pixel connected domain in the fourth palmprint image is determined as the palm region, and the remaining connected domains are other noise blocks in the background and are not determined as the palm region. The maximum connected domain in the fourth palmprint image is subjected to contour detection, and all continuous contour points of the palm region are found through the contour detection algorithm, thereby obtaining the target palmprint image containing the palm contour image. The target palmprint image is shown in the rightmost image of Figure 2
[0079] S300. Construct a target ball motion model, using the target palm print image as the map for the ball's motion, and the palm outline in the target palm print image as an obstacle. The ball's initial position is above the target palm print image. There are multiple balls. When the ball is subjected to a first force directed downwards from the target palm print image, it begins to move. When the ball encounters the palm outline, its direction of motion changes, and it moves a preset step length in the changed direction before stopping. It then moves again after being subjected to the first force until the ball reaches a preset condition and stops moving.
[0080] In this embodiment, after obtaining the target palmprint image, it is necessary to locate the target key points within the palmprint image. The target key point localization algorithm is based on the concept of motion obstacle avoidance, constructing a target ball motion model. The target palmprint image serves as the map for the ball's motion, and the hand outline in the target palmprint image represents the obstacle. The fingers in the target palmprint image point upwards, and the hand outline in the target palmprint image is allowed to have a certain degree of tilt and some missing fingertips. The initial position of the balls is above the target palmprint image. There are multiple balls. When a ball is subjected to a first force directed downwards from the target palmprint image, it begins to move. When the ball encounters the hand outline, its direction of movement changes, and it moves a preset step length in the changed direction before stopping. It then moves again after being subjected to the first force, until the ball reaches a preset condition and stops moving.
[0081] The target ball motion model was derived through multiple experiments. Specifically, in this embodiment, four optimization steps were performed before the final target ball motion model was constructed.
[0082] Specifically, in this embodiment, the initial target ball motion model is constructed as follows:
[0083] Using the target palm print image as a map for the ball's motion, and the palm outline within the target palm print image as an obstacle, the ball is placed on the upper edge of the target palm print image, on the side facing the fingers. The ball experiences a constant force, a downward force G, directed towards the edge of the image image towards the wrist. When the ball does not encounter an obstacle, it moves towards the image image towards the wrist. When the ball gets too close to the palm outline obstacle during its motion, the obstacle exerts a repulsive force F1 in the opposite direction on the ball, causing it to move towards the net force F1. 合 Directional movement. The magnitude of F1 is constant, and its direction is from the center point of all hand obstacle contour points within a certain distance from the ball towards the center of the ball, such as... Figure 3 As shown, F 合 This is the combined force of G and F1.
[0084] The specific steps of the initial localization algorithm for the target key points based on the initial ball motion model are as follows:
[0085] Step 1: The target palm print image, after preprocessing the original palm print image, serves as the motion map for the ball, with the hand outline in the target palm print image representing obstacles on the map.
[0086] Step 2: Initialize the ball's acceleration a0, velocity v0, and position p0.
[0087] Step 3: Set the step time t of the movement. The acceleration of the ball changes according to the forces G and F1 it is subjected to. The current velocity of the ball plus the product of the acceleration and the step time gives the next velocity of the ball. The current position of the ball plus the product of the velocity and the step time gives the next position of the ball. The state of the ball is updated every step time t.
[0088] Step 4: After the ball has moved a fixed number of steps, stop moving and record the coordinates of all balls within the target palm print image. Use a clustering algorithm to find the cluster points of the balls, which are the four valley points of the palm in the target palm print image. The four valley points are named as follows: the valley point between the thumb and index finger is named valley_point1, the valley point between the index and middle fingers is named valley_point2, the valley point between the middle and ring fingers is named valley_point3, and the valley point between the ring and little fingers is named valley_point4.
[0089] Step 5: Determine the key points for ROI localization (two finger points, valley_point2 and valley_point4) by the relative positions of the four finger points in the image. The finger point with the lowest height in the image is valley_point1. After excluding this point, three finger points remain. Among these three finger points, valley_point2 is the closest to valley_point1 in terms of horizontal coordinate, and valley_point4 is the farthest. This determines the location of the key points.
[0090] Figure 4 The result is shown in the running effect of the initial positioning algorithm for the target key points based on the initial ball motion model.
[0091] Based on the initial ball motion model, the initial localization algorithm for the target key points achieves accurate localization of the key points in the target palm print image. However, the initial localization algorithm for the target key points is computationally complex and needs to be optimized and simplified to obtain a more robust target localization algorithm with shorter computation time.
[0092] Specifically, the process and interim results of multiple optimizations are as follows:
[0093] First optimization:
[0094] 1: Optimize the target ball movement model, simplify the original movement model based on acceleration, speed and position to a step model, that is, the ball can only move one step in one of the three directions of left, right and down each time, and move down when there is no obstacle, move right when the obstacle is on the left, and move left when the obstacle is on the right.
[0095] 2: Optimize the ball's perception of obstacles, as shown in Figure 5 , only keep the outer circle pixel points in the lower half of the ball as perception points, that is, only calculate whether the outer circle pixel points in the lower half of the ball's perception range have obstacles.
[0096] After the first optimization, the same key point accuracy as the initial positioning algorithm of the target key point is achieved, and the calculation time is reduced to about one sixty-sixth of the original.
[0097] Second optimization:
[0098] 1: Optimize the ball's perception of obstacles, as shown in Figure 6 , reduce the perception range of the ball to reduce the calculation points.
[0099] Due to the reduction of the perception range, the step length of each movement also needs to be reduced accordingly, resulting in an increase in the number of calculations. However, through multiple experiments, it has been verified that even if the step length is reduced accordingly, the calculation speed can be faster under the condition of reduced calculation points. After multiple experimental verifications, the target ball movement model is finally reduced to only three obstacle perception points for each ball, and the movement step length is one pixel each time.
[0100] 2: Optimize the target ball movement model, because each ball has only three perception points, there are eight perception states in total, and according to the eight perception states, there are eight possible movement ways of the ball: no obstacle is perceived by the three perception points, the ball moves down; only the left perception point perceives the obstacle, the ball moves right; only the right perception point perceives the obstacle, the ball moves left; only the front perception point perceives the obstacle, the ball moves left or right, left or right is determined by the flag; the left and front perception points perceive the obstacle, the ball moves right; the right and front perception points perceive the obstacle, the ball moves left; the left and right perception points perceive the obstacle, the ball moves down; both the left and right sides and the front perception points perceive the obstacle, the ball moves back two steps.
[0101] Second optimization result: the ball can accurately find the key points, and the calculation time is reduced to about one thirty-first of the original.
[0102] Third optimization:
[0103] 1: Optimize the invalid movement of the ball. After the ball moves to the valley point, the movement direction will change. If the number of changes in the movement direction of the ball exceeds twice, it means that the ball has reached the valley point, and the position of the valley point is recorded, and the ball stops moving. The ball moves to the vicinity of the recorded valley point position and stops moving. The ball moves beyond the target palm print map range and stops moving.
[0104] 2: Optimize the movement of the ball one by one. In addition to the initial position of the first moving ball, the starting point of the subsequent ball is determined according to the movement result of the previous ball.
[0105] Third optimization result: The ball can find the key point faster, and the calculation time is reduced to about one half of the optimization time.
[0106] Fourth optimization:
[0107] 1: Optimize the movement direction of the ball. Increase the number of balls moving diagonally from both sides of the target palm print map to the target palm print map, so that the ball can move to the valley point of some palms with large rotation angles.
[0108] 2: According to the relative position between the valley points, the opening and closing state of the fingers in the target palm print map is judged. When the height difference of the four valley points is within a certain range, it is judged that the thumb is closed, that is, when the height difference between the valley point between the thumb and the index finger and the other valley points is less than a certain range, it is determined that the thumb is closed, at this time, the user is prompted to open the thumb, as shown in Figure 7 When the height difference between valley_point2 and valley_point3 and valley_point4 exceeds a certain range, it is determined that the index finger and the middle finger are closed, at this time, the user is prompted to open the index finger, as shown in Figure 8 When the height difference between valley_point4 and valley_point3 and valley_point2 exceeds a certain range, it is determined that the middle finger and the little finger are closed, at this time, the user is prompted to open the little finger, as shown in Figure 9 .
[0109] Fourth optimization result: The ball can find the key point more accurately, especially for images with certain rotation of the palm and incomplete palm, and has robust positioning ability. The calculation time almost does not increase.
[0110] The complete flow of the target positioning algorithm based on the target ball movement model after four optimizations is as follows:
[0111] Step 1: Take the target palm print map as the movement map of the ball, and the palm contour in the target palm print map as the obstacle.
[0112] Step2: The initial position of the first ball is set at the right upper corner of the map. The ball senses whether there are obstacles under and on the left and right sides of the ball before each movement. The ball moves according to the movement model in the second optimization process.
[0113] Step3: When a ball moves beyond the range of the target palmprint map, reaches a new valley point or reaches the vicinity of a recorded valley point, the ball stops moving. The starting movement point of the next ball is set at the top of the target palmprint map based on the left 10 pixel points of the leftmost point of the trajectory of the ball that has moved. This process continues until the starting movement point of the next ball is outside the range of the target palmprint map.
[0114] Step4: Two balls are set on the left and right sides of the target palmprint map, respectively, and move at a 45-degree angle towards the inside of the target palmprint map. When the balls sense obstacles, they change to the movement mode in Step2. The starting point of the next ball is the intersection of the 45-degree angle line of the lowest point of the trajectory of the ball that has moved and the edge of the image.
[0115] Step5: The valley points found by the balls during the movement are recorded. The specific positions of the key points are determined based on the relative positional relationship of the four valley points, and the opening and closing states of the index finger, thumb and little finger are determined.
[0116] Compared with the initial positioning algorithm of the target key points based on the initial ball movement model without any optimization and the target positioning algorithm after four optimizations, the target positioning algorithm after optimization has better robustness in positioning the palmprint ROI key points, and the calculation time is reduced to about 1 / 40000 of the original. Due to the fast calculation speed, the target positioning algorithm can be used for real-time positioning of the target key points in online non-contact palmprint recognition videos.
[0117] Specifically, in the target ball movement model after four optimizations, the target palmprint map is used as the map for ball movement, the palm contour in the target palmprint map is used as an obstacle, the initial position of the ball is above the target palmprint map, and there are multiple balls. When the ball is subjected to a first force towards the bottom of the target palmprint map, the ball starts to move. When the ball encounters the palm contour, the direction of movement changes, and the ball stops moving after moving a preset step length in the changed direction and is subjected to the first force again. The ball stops moving until it reaches a preset condition.
[0118] The preset condition is:
[0119] The ball moves beyond the image range of the target palmprint map, or the ball reaches a valley point in the target palmprint map.
[0120] When the ball reaches a finger valley point, the finger valley point position is recorded, and the determination that the ball reaches a finger valley point in the target palmprint image is that the moving direction of the ball changes more than twice or the ball moves to a position within a preset range of the recorded finger valley point.
[0121] Further, in the target ball movement model:
[0122] S310, the balls include at least one first ball, at least one second ball, and at least one third ball;
[0123] Each of the first balls moves in turn, each of the second balls moves in turn, and each of the third balls moves in turn;
[0124] The starting position of the first first ball is the upper right corner of the target palmprint image, the starting position of the n+1th first ball is on the upper edge of the target palmprint image and to the left of the leftmost point of the nth first ball movement trajectory, and when the starting position of the first ball is outside the range of the target palmprint image, the first ball is no longer added;
[0125] The starting position of the first second ball is the upper right corner of the target palmprint image, the starting position of the n+1th second ball is the intersection point of a straight line passing through the lowest point of the nth second ball movement trajectory and parallel to the force direction and the right edge of the target palmprint image, and when the starting position of the second ball is outside the range of the target palmprint image, the second ball is no longer added;
[0126] The starting position of the first third ball is the upper left corner of the target palmprint image, the starting position of the n+1th third ball is the intersection point of a straight line passing through the lowest point of the nth third ball movement trajectory and parallel to the force direction and the left edge of the target palmprint image, and when the starting position of the third ball is outside the range of the target palmprint image, the third ball is no longer added.
[0127] S320, the first force received by the first ball is a vertical downward force; the first force received by the second ball is a left oblique downward force; and the first force received by the third ball is a right oblique downward force.
[0128] S330, each of the balls has three sensing points, namely a front sensing point, a left sensing point, and a right sensing point;
[0129] When none of the three sensing points senses the palm contour, the ball continues to move forward;
[0130] When the left sensing point senses the palm contour, the ball moves to the right;
[0131] When the right sensing point senses the palm profile, the ball moves left;
[0132] When the front sensing point senses the palm profile, the ball moves left or right;
[0133] When the left sensing point and the right sensing point simultaneously sense the palm profile, the ball moves down;
[0134] When the left sensing point, the right sensing point and the front sensing point simultaneously sense the palm profile, the ball retreats two pixel points.
[0135] Further, the target ball movement model can determine the finger opening and closing state in the target palm print image according to the relative positions between the finger valley points. When the heights of the four finger valley points differ within a certain range, it is determined that the thumb is closed, and a first prompt window is popped up to prompt the user to open the thumb. When the height of the finger valley point closest to the finger valley point with the lowest height among the four finger valley points differs from the height of the adjacent finger valley point by more than a certain range, it is determined that the index finger and the middle finger are closed, and a second prompt window is popped up to prompt the user to open the index finger. When the height of the finger valley point farthest from the finger valley point with the lowest height among the four finger valley points differs from the height of the adjacent finger valley point by more than a certain range, it is determined that the middle finger and the little finger are closed, and a third prompt window is popped up to prompt the user to open the little finger.
[0136] By determining the finger opening and closing state in the target palm print image, the problem of inaccurate positioning of the target key points caused by the closed fingers in the original palm print image can be effectively avoided, so that the subsequent target ROI image extracted is more accurate.
[0137] Referring again to Figure 1 In this embodiment, the palm print ROI extraction method further includes the following steps:
[0138] S400, obtaining the target key point positions in the target palm print image according to the positions of the balls after movement.
[0139] The obtaining of the target key point positions in the target palm print image according to the positions of the balls after movement includes:
[0140] S410, obtaining the positions of the four finger valley points in the target palm print image according to the positions of the balls after movement.
[0141] S420, deleting the finger valley point with the lowest height in the image, and taking the positions of the two finger valley points farthest apart among the remaining three finger valley points as the target key point positions.
[0142] In the embodiment, the four finger valley points are named as follows: the finger valley point between the thumb and the index finger is named as valley_point1, the finger valley point between the index finger and the middle finger is named as valley_point2, the finger valley point between the middle finger and the ring finger is named as valley_point3, and the finger valley point between the ring finger and the little finger is named as valley_point4.
[0143] Two of the finger valley points, valley_point2 and valley_point4, are the target key points. In the case that the fingers are not closed, the finger valley point with the lowest height in the target palmprint is valley_point1, and after excluding this point, there are three finger valley points left. Among the three finger valley points, the one with the closest horizontal coordinate to valley_point1 is valley_point2, and the one with the farthest horizontal coordinate to valley_point1 is valley_point4. The positions of valley_point2 and valley_point4 are the positions of the target key points.
[0144] S500, extracting a target ROI image from the original palmprint according to the positions of the target key points.
[0145] The extracting of the target ROI image from the original palmprint according to the positions of the target key points includes:
[0146] After connecting the positions of the two target key points, a target line segment is obtained, a key region is obtained according to the target line segment, and the target ROI image is obtained according to the key region.
[0147] In the embodiment, the key region is a square region in the palm center region of the palm image. Figure 10 The distance between the two target key points is d, the side length of the key region is 7d / 6, the center point of the key region is located on the perpendicular bisector of the line segment connecting the two target key points, and the distance between the center point and the perpendicular bisector is 3d / 4. The two sides of the key region are parallel to the line segment connecting the two target key points. According to the positional relationship between the key region and the key points, the key region is cut from the original palm image collected by the image sensor according to the coordinates of the target key points, and the target ROI image is obtained according to the key region.
[0148] The method in the embodiment has the characteristics of rapidness and high robustness, and is suitable for a non-contact palmprint recognition system. In the case that the collected original palmprint image is rotated by a certain angle or the palm is partially missing in the image, the target key points can be quickly and accurately positioned, the key region can be extracted, and the target ROI image can be obtained.
[0149] Through experiments, in a data set of 6000 non-contact palm images, the positioning and extraction success rate of the ROI is more than 98.5%, and the calculation time of a single picture is only 2ms when the method provided in the embodiment is run in a personal computer (CPU i7-11800h). And in the non-contact palmprint recognition system using a USB camera to collect the original palmprint image, real-time positioning and extraction of target key points in the video can be realized, and the time verification effect is good.
[0150] In summary, the embodiment provides a palmprint ROI extraction method, which obtains an original palmprint image, pre-processes the original palmprint image to obtain a target palmprint image; after obtaining the target palmprint image, a target ball motion model is constructed based on the target palmprint image, the target palmprint image is taken as a map of ball motion, the palm contour in the target palmprint image is taken as an obstacle, the initial position of the ball is above the target palmprint image, the ball is a plurality of balls, when the ball is subjected to a first force towards the bottom of the target palmprint image, the ball starts to move, when the ball encounters the palm contour, the moving direction changes, and the ball stops after moving a preset step length according to the changed direction, and then moves again after being subjected to the first force again, until the ball reaches a preset condition and stops moving; then the position of the target key point in the target palmprint image is obtained according to the position of the ball after moving; finally, a target ROI image is extracted in the original palmprint image according to the position of the target key point. The present application finds the target key point by constructing the target ball motion model, and extracts the target ROI image based on the target key point, so that the system can extract the target ROI image more quickly, and is suitable for a non-contact palmprint recognition system, and can realize real-time ROI positioning and extraction of a palm in a video on a low-power hardware platform.
[0151] It should be understood that, although each step in the flowchart shown in the drawings of the present application specification is shown in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these sub-steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or sub-steps or stages of other steps.
[0152] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0153] Example 2
[0154] Based on the above embodiments, the present invention also provides a terminal, such as... Figure 11 As shown, the terminal includes a processor 10 and a memory 20. Figure 11 Only some of the terminal components are shown; however, it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0155] The memory 20 can be an internal storage unit of the terminal in some embodiments, such as a hard disk or a memory of the terminal. The memory 20 can also be an external storage device of the terminal in other embodiments, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the terminal. Further, the memory 20 can include both the internal storage unit and the external storage device of the terminal. The memory 20 is used to store application software installed on the terminal and various data. The memory 20 can also be used to temporarily store data that has been output or will be output. In an embodiment, the memory 20 stores a palmprint ROI extraction program 30, which can be executed by the processor 10 to implement the palmprint ROI extraction method.
[0156] The processor 10 can be a central processing unit (CPU), a microprocessor or other chip in some embodiments, used to run program codes or process data stored in the memory 20, such as to execute the palmprint ROI extraction method, etc.
[0157] In an embodiment, the following steps are implemented when the processor 10 executes the palmprint ROI extraction program 30 in the memory 20:
[0158] Obtain an original palmprint image;
[0159] Preprocess the original palmprint image to obtain a target palmprint image;
[0160] Construct a target ball motion model, take the target palmprint image as a map of ball motion, take the palm contour in the target palmprint image as an obstacle, and take the initial position of the ball above the target palmprint image. The ball is a plurality of balls. When the ball is subjected to a first force towards the bottom of the target palmprint image, the ball starts to move. When the ball encounters the palm contour, the moving direction changes, and the ball stops after moving a preset step length according to the changed direction, and then moves again after being subjected to the first force again until the ball reaches a preset condition and stops moving;
[0161] Obtain the position of a target key point in the target palmprint image according to the position of the ball after the ball moves;
[0162] Extract a target ROI image from the original palmprint image according to the position of the target key point.
[0163] The preprocessing of the original palmprint image to obtain a target palmprint image includes:
[0164] scaling the original palmprint image to a preset size, to obtain a first palmprint image;
[0165] performing Gaussian filtering on the first palmprint image, to obtain a second palmprint image;
[0166] performing binarization processing on the second palmprint image, to obtain a third palmprint image;
[0167] performing morphological erosion and morphological dilation on the third palmprint image, to obtain a fourth palmprint image;
[0168] performing connected domain detection on the fourth palmprint image, and obtaining the target palmprint image through a contour detection algorithm.
[0169] In the target ball movement model:
[0170] The balls include at least one first ball, at least one second ball, and at least one third ball;
[0171] Each of the first balls moves in turn, each of the second balls moves in turn, and each of the third balls moves in turn;
[0172] The starting position of the first first ball is the upper right corner of the target palmprint image, the starting position of the n+1th first ball is on the upper edge of the target palmprint image and to the left of the leftmost point of the nth first ball movement trajectory, and no new first ball is added when the starting position of the first ball is outside the range of the target palmprint image;
[0173] The starting position of the first second ball is the upper right corner of the target palmprint image, the starting position of the n+1th second ball is the intersection point of a straight line passing through the lowest point of the nth second ball movement trajectory and parallel to the force direction and the right edge of the target palmprint image, and no new second ball is added when the starting position of the second ball is outside the range of the target palmprint image;
[0174] The starting position of the first third ball is the upper left corner of the target palmprint image, the starting position of the n+1th third ball is the intersection point of a straight line passing through the lowest point of the nth third ball movement trajectory and parallel to the force direction and the left edge of the target palmprint image, and no new third ball is added when the starting position of the third ball is outside the range of the target palmprint image.
[0175] The first force received by the first ball is a vertical downward force, the first force received by the second ball is a left oblique downward force, and the first force received by the third ball is a right oblique downward force.
[0176] wherein the change of the moving direction when the ball meets the palm profile comprises:
[0177] each of the balls has three sensing points, which are a front sensing point, a left sensing point and a right sensing point respectively;
[0178] when none of the three sensing points senses the palm profile, the ball continues to move forward;
[0179] when the left sensing point senses the palm profile, the ball moves rightward;
[0180] when the right sensing point senses the palm profile, the ball moves leftward;
[0181] when the front sensing point senses the palm profile, the ball moves leftward or rightward;
[0182] when the left sensing point and the right sensing point simultaneously sense the palm profile, the ball moves downward;
[0183] when the left sensing point, the right sensing point and the front sensing point simultaneously sense the palm profile, the ball retreats two pixel points.
[0184] wherein the preset condition is:
[0185] the ball moves beyond the image range of the target palmprint image, or the ball reaches a finger valley point in the target palmprint image;
[0186] when the ball reaches the finger valley point, the position of the finger valley point is recorded, and the determination mode that the ball reaches the finger valley point in the target palmprint image is that the moving direction of the ball changes more than twice or the ball moves to a position of a finger valley point that has been recorded within a preset range.
[0187] wherein the target key point position in the target palmprint image is obtained according to the position of the ball after moving, comprising:
[0188] four finger valley point positions in the target palmprint image are obtained according to the position of the ball after moving;
[0189] the lowest finger valley point in the image is deleted, and the positions of two of the remaining three finger valley points that are far apart are taken as the target key point positions.
[0190] wherein the target ROI image is extracted from the original palmprint image according to the target key point positions, comprising:
[0191] The target line segment is obtained by connecting the two target key point positions, the key region is obtained according to the target line segment, and the target ROI image is obtained according to the key region.
[0192] Embodiment three
[0193] The application further provides a computer readable storage medium, wherein one or more programs are stored, and the one or more programs can be executed by one or more processors to implement the steps of the palmprint ROI extraction method.
[0194] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for extracting a palmprint ROI, characterized in that, The method comprises: acquiring an original palmprint image; preprocessing the original palmprint image to obtain a target palmprint image; constructing a target ball movement model, taking the target palmprint image as a map of ball movement, taking the palm contour in the target palmprint image as an obstacle, taking the initial position of the ball above the target palmprint image, taking the ball as a plurality of balls, and when the ball is subjected to a first force towards the bottom of the target palmprint image, the ball starts to move, when the ball encounters the palm contour, the moving direction changes, and the ball stops after moving a preset step length in the changed direction, and then moves again when the ball is subjected to the first force again, until the ball reaches a preset condition and stops moving; acquiring the position of a target key point in the target palmprint image according to the position of the ball after movement; extracting a target ROI image in the original palmprint image according to the position of the target key point.
2. The method of claim 1, wherein, The preprocessing of the original palmprint image to obtain a target palmprint image comprises: scaling the original palmprint image to a preset size to obtain a first palmprint image; performing Gaussian filtering on the first palmprint image to obtain a second palmprint image; performing binaryzation processing on the second palmprint image to obtain a third palmprint image; performing morphological erosion and morphological dilation on the third palmprint image to obtain a fourth palmprint image; performing connected domain detection on the fourth palmprint image, and obtaining the target palmprint image through a contour detection algorithm.
3. The method of claim 1, wherein, In the target ball movement model: the ball comprises at least one first ball, at least one second ball and at least one third ball; each first ball moves in turn, each second ball moves in turn, and each third ball moves in turn; the starting position of the first first ball is the upper right corner of the target palmprint image, the starting position of the n+1th first ball is on the upper edge of the target palmprint image and on the left side of the leftmost point of the movement trajectory of the nth first ball, and when the starting position of the first ball is outside the range of the target palmprint image, the first ball is no longer added; the starting position of the first second ball is the upper right corner of the target palmprint image, the starting position of the n+1th second ball is the intersection point of the straight line passing through the lowest point of the movement trajectory of the nth second ball and parallel to the direction of force and the right edge of the target palmprint image, and when the starting position of the second ball is outside the range of the target palmprint image, the second ball is no longer added; the starting position of the first third ball is the upper left corner of the target palmprint image, the starting position of the n+1th third ball is the intersection point of the straight line passing through the lowest point of the movement trajectory of the nth third ball and parallel to the direction of force and the left edge of the target palmprint image, and when the starting position of the third ball is outside the range of the target palmprint image, the third ball is no longer added.
4. The method of claim 3, wherein, The first force received by the first ball is a vertical downward force, the first force received by the second ball is a left oblique downward force, and the first force received by the third ball is a right oblique downward force.
5. The method of claim 1, wherein, The direction of movement is changed when the ball meets the palm profile, including: Each ball has three sensing points, namely a front sensing point, a left sensing point and a right sensing point; When none of the three sensing points senses the palm profile, the ball continues to move forward; When the left sensing point senses the palm profile, the ball moves to the right; When the right sensing point senses the palm profile, the ball moves to the left; When the front sensing point senses the palm profile, the ball moves to the left or to the right; When the left sensing point and the right sensing point simultaneously sense the palm profile, the ball moves downward; When the left sensing point, the right sensing point and the front sensing point simultaneously sense the palm profile, the ball retreats two pixel points.
6. The method of claim 1, wherein, The preset condition is: The ball moves beyond the image range of the target palmprint image, or the ball reaches a finger valley point in the target palmprint image; When the ball reaches a finger valley point, the position of the finger valley point is recorded, and the determination method that the ball reaches a finger valley point in the target palmprint image is that the moving direction of the ball changes more than twice or the ball moves to a position within a preset range of a recorded finger valley point.
7. The method of claim 6, wherein, The target key point position in the target palmprint image is obtained according to the position of the ball after movement, including: Four finger valley point positions in the target palmprint image are obtained according to the position of the ball after movement; The lowest finger valley point in the image is deleted, and the positions of two of the remaining three finger valley points that are far apart are taken as the target key point positions.
8. The method of claim 7, wherein, The target ROI image is extracted from the original palmprint image according to the target key point positions, including: After connecting two target key point positions to obtain a target line segment, a key region is obtained according to the target line segment, and the target ROI image is obtained according to the key region.
9. A terminal, characterized by comprising: The terminal includes a processor, a computer readable storage medium in communication connection with the processor, the computer readable storage medium is adapted to store a plurality of instructions, the processor is adapted to call the instructions in the computer readable storage medium, to perform the steps of the palmprint ROI extraction method of any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer readable storage medium stores one or more programs, which can be executed by one or more processors to implement the steps of the palmprint ROI extraction method of any one of claims 1-8.