Palm ROI extraction method, rotating palm ROI detection method, system and equipment
Through the combination of key point detection and YOLOv5 model, the rotating ROI area of the palm image is extracted, which solves the scene applicability and complexity of the palm ROI extraction method in the prior art, and improves the accuracy and user experience of biometrics.
Patent Information
- Application Number
- CN202411034210.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-29
- Estimated Expiration
- 2044-07-30
AI Technical Summary
The existing palm ROI extraction method has little scenario applicability in contactless palm recognition, and the ROI positioning is complex, which affects the accuracy and user experience of biometrics.
The key point detection model is used to detect the key points of the palm. By calculating the score points and symmetric points, a geometric shape is formed as the ROI output, and the rotation target detection is used using the YOLOv5 model to extract the rotating ROI area of the palm image.
It improves the scenario applicability and detection efficiency of palm ROI detection, reduces detection complexity, and achieves higher biometric accuracy and user experience.
Smart Images

Figure CN119048729A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of image enhancement and segmentation, and in particular relates to a palm ROI extraction method, a rotation palm ROI detection method, a system and a device. Background Art
[0002] Biometrics is a technology that relies on human biological characteristics for identity authentication. It is widely used in attendance, access control, forensic identification, medical care, education, finance, consumption and other fields because of its advantages such as not easy to forget or lose, good anti-counterfeiting performance, easy to carry, and convenient to use. Palm print recognition and palm vein recognition (hereinafter collectively referred to as palm recognition) have the characteristics of not being easy to counterfeit and liveness detection that general body surface characteristics do not have, and have higher security and recognition rate advantages. In particular, non-contact palm recognition is increasingly being applied to various fields for the sake of public health and safety. The palm recognition process is generally divided into four stages: image acquisition, image preprocessing, feature extraction, and feature matching. Among them, palm ROI (Region of Interest) extraction is the first step in the image preprocessing process and a very important step in the palm recognition process. It refers to extracting a region with rich features from the collected palm image for subsequent feature extraction and feature matching, which is generally distributed in the palm area.
[0003] Existing technical solutions are mainly divided into traditional image processing methods and deep learning methods. The palm recognition method based on traditional image processing, such as the Chinese invention patent with the authorization announcement number CN111160290B, discloses a method for extracting the effective area of palm veins, including image preprocessing, image grayscale conversion, image reduction ratio, and image binarization; image feature search, searching for corner points of the image after image preprocessing, matching the matrix containing the corner points with the finger concave point model, and repeatedly filtering the feature points to obtain the concave point feature points where the fingers intersect each other; image area calibration, intercepting the area image containing the middle finger according to the concave point feature points found by the image feature, calculating the middle finger straight line formula and the average width of the middle finger of the area image, calculating the starting coordinates and length and width of the effective area of palm veins in the palm according to the middle finger straight line formula, and rotating the effective area of palm veins based on the middle finger line; intercepting the image.
[0004] A palm recognition method based on deep learning, such as a Chinese invention patent application with publication number CN113963158A, discloses a method and device for extracting a region of interest of a palm vein image, the method comprising the following steps: obtaining palm key points in the image to be extracted through a trained palm key point detection model, the palm key points including the palm-wrist, thumb joint, index finger joint, middle finger joint, ring finger joint and little finger joint; determining the palm type and palm tilt information of the image to be extracted according to the palm key points, the palm type including the left palm and the right palm; performing rotation calibration on the image to be extracted according to the palm type and the palm tilt information; determining the region of interest in the image to be extracted according to the palm key points, and extracting a palm vein image from the region of interest of the image to be extracted.
[0005] However, contactless palm recognition has certain requirements for the placement of the palm. During the acquisition process, due to changes in the position and posture of the palm, the area, angle, and pattern (including wrinkles, main lines, ridges, etc.) of the vein image collected each time are quite different, affecting the quality of the palm vein image, thereby affecting the accuracy of biometric recognition and user experience. The existing technology for locating the palm ROI area is not highly applicable to scenarios, and the deep learning method does not detect the ROI area end-to-end, relying on other feature information of the palm to assist in positioning, which makes ROI positioning complex. Summary of the invention
[0006] The present invention provides a palm ROI extraction method, a rotation palm ROI detection method, a system and a device, aiming to solve the problems of low scene applicability and complex ROI positioning of existing extraction methods.
[0007] In order to solve the above technical problem, a first aspect of the present invention provides a palm ROI extraction method, comprising the following steps:
[0008] Using a key point detection model to detect key points of the palm, the key points include a base joint P1 of the index finger, a base joint P2 of the middle finger, a base joint P3 of the ring finger, and a base joint P4 of the little finger;
[0009] Use the preset parameter k to calculate the score point P5 on the line segment P1P2 and the score point P6 on the line segment P3P4 according to the fixed score score formula of the line segment;
[0010] Calculate the symmetric points P7 and P8 of P5 and P6 with respect to the line segment P1P4 respectively;
[0011] Calculate the straight line l1 where P7 and P8 are located, the distance d between P7 and P8, the normal l2 of P7 on the straight line l1 and the normal l3 of P8 on the straight line l1, and calculate the target points P9 and P8 on the two normal lines l2 and l3 according to the distance d. 10, the target points P9 and P 10 The symmetrical points P7 and P8 are both on the same side of the line segment P1P4;
[0012] Connect points P7, P8, P9, P 10 and P7, and the resulting geometric shape is output as a ROI.
[0013] Preferably, the calculation method of the score points p5 and p6 is:
[0014]
[0015] Wherein, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, x1 and y1 are the x-coordinate value and y-coordinate value of the determined point P1, x2 and y2 are the x-coordinate value and y-coordinate value of the determined point P2, x3 and y3 are the x-coordinate value and y-coordinate value of the determined point P3, x4 and y4 are the x-coordinate value and y-coordinate value of the determined point P4, and k is the preset equal score point formula parameter.
[0016] Preferably, the calculation method of the symmetric point P7 is:
[0017]
[0018]
[0019] In the formula, x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7 respectively, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5 respectively, and A, B, and C are the A, B, and C items in the straight line equation Ax+By+C=0 of the line segment P1P4 respectively.
[0020] Preferably, the calculation method of the symmetric point P8 is:
[0021]
[0022] In the formula, x8 and y8 are the x-coordinate value and y-coordinate value of the symmetrical point P8, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, and A, B, and C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4.
[0023] Preferably, the target point P9 is calculated as follows:
[0024]
[0025] Where x9 and y9 are the x-coordinate value and y-coordinate value of the target point P9, x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7, d is the distance between the symmetrical points P7 and P8, A, B, and C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4, respectively; x9 and y9 are coordinate points that meet the requirements according to the following conditions:
[0026]
[0027] Wherein, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5, respectively; x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7, respectively.
[0028] Preferably, the target point p 10 The calculation method is as follows:
[0029]
[0030] In the formula, x 10 ,y 10 The target point p 10 x8 and y8 are the x and y coordinates of the symmetrical point P8, respectively. d is the distance between the symmetrical points P7 and P8. A, B, and C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4. 10 ,y 10 Filter the coordinate points that meet the requirements according to the following conditions:
[0031]
[0032] Wherein, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, respectively; x8 and y8 are the x-coordinate value and y-coordinate value of the symmetrical point P8, respectively.
[0033] A second aspect of the present invention further provides a method for detecting a rotating palm ROI, comprising the following steps:
[0034] Collecting a data set, wherein the data set is subjected to ROI extraction using the ROI extraction method described in the first aspect of the present invention, and then divided into a training set and a validation set according to a set ratio;
[0035] Select a preset YOLOv5 model network structure and hyperparameters, use the training set to train a rotation target detection model, and then use the validation set to verify the training results;
[0036] Use the trained YOLOv5 model to predict the palm image, process the prediction results, and extract the rotated ROI area of the palm image.
[0037] Preferably, the processing of the prediction result is specifically as follows:
[0038] The trained model is inferred, the image to be predicted is input into the model, and the prediction result of the model outputs the predicted coordinates and rotation angles of multiple ROI areas;
[0039] Eliminate redundant prediction boxes through the non-maximum suppression algorithm;
[0040] According to the output of the model, the midpoint of the model prediction box is used as the rotation center to calculate the rotation angle θ of the image, obtain the rotation matrix of the image, perform a rotational affine transformation on the image according to the rotation matrix, and rotate the model prediction box to the positive direction of the palm ROI of the prediction image according to the rotation matrix;
[0041] The image is sliced according to the rotated ROI vertex coordinates, and the sliced image is adaptively contrast enhanced and denoised.
[0042] Preferably, the calculation method of the rotation matrix is:
[0043] Set the image zoom ratio, calculate the center of the prediction box output by the model, and use it as the rotation center. The calculation method of the rotation center is:
[0044]
[0045] Where x0 and y0 are the x-coordinate and y-coordinate values of the prediction box center d0, respectively. 11 ,y 11 are the x-coordinate value and y-coordinate value of one vertex d1 in the output prediction box, respectively. 13 ,y 13 are the x-coordinate value and y-coordinate value of the diagonal vertex d3 of d1 respectively;
[0046] Calculate the cosine and sine of the rotation angle:
[0047]
[0048] In the formula, cosθ and sinθ are the cosine and sine values of the rotation angle respectively, and x 12 ,y 12 The x-coordinate value and y-coordinate value of the vertex d2 adjacent to the vertex d1 of the output prediction box are respectively;
[0049] According to the rotation center, scaling ratio and rotation angle, the rotation matrix is obtained:
[0050]
[0051] M is the calculated rotation matrix.
[0052] A third aspect of the present invention further provides a palm ROI extraction and rotation palm ROI detection system, comprising:
[0053] A key point detection model, which is a pre-trained model for detecting key points of a palm image: the base joint P1 of the index finger, the base joint P2 of the middle finger, the base joint P3 of the ring finger, and the base joint P4 of the little finger;
[0054] The ROI extraction module calculates the target points P7, P8, P9, P 10 , P7, P8, P9, P 10 The enclosed geometric shape is output as ROI;
[0055] An imaging module, used for acquiring a palm image to be detected;
[0056] An image preprocessing module, used for preprocessing the acquired palm image;
[0057] The palm ROI detection module detects a palm image according to the rotation palm ROI detection method according to the second aspect of the present invention, and outputs an ROI area of the rotation palm image.
[0058] In a fourth aspect of the present invention, a palm vein recognition device is further provided, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the rotating palm ROI detection method as described in the second aspect of the present invention is implemented.
[0059] Compared with the prior art, the present invention has the following technical effects:
[0060] 1. The ROI extraction method proposed in the present invention provides a labeling method specifically for palm ROI detection datasets, which is used to train an end-to-end palm ROI detection model. By using the existing dataset to train the key point detection model to detect the base joints of the index finger, the middle finger, the ring finger, and the little finger, the target point is calculated based on the four detected nodes, and the palm ROI output is generated, which has high scene applicability.
[0061] 2. The ROI extraction method proposed in the present invention calculates other target points in a plane rectangular coordinate system through the four key points detected first, and generates a palm ROI output. The calculation method is simple and reliable, with high calculation efficiency under the premise of the same performance, and lower performance requirements under the same efficiency requirements.
[0062] 3. The rotating palm ROI detection method proposed in the present invention provides an end-to-end rotating target detection model to detect the palm ROI. The model directly outputs the predicted frame and rotation angle of the palm ROI in the acquired image. No other algorithm is required to obtain the feature information of the palm to assist in positioning, which reduces the complexity of the detection process and improves the detection efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is a flowchart of a palm ROI extraction method according to an embodiment of the present invention;
[0064] Figure 2 is a schematic diagram of key points described in an embodiment of the present invention;
[0065] Figure 3 is a schematic diagram of ROI according to an embodiment of the present invention;
[0066] Figure 4 is a schematic flow chart of a method for detecting ROI of a rotated palm image according to an embodiment of the present invention;
[0067] Figure 5 It is a schematic diagram of the structure of the YOLOv5 network model according to an embodiment of the present invention;
[0068] Figure 6 3 is a schematic diagram of palm ROI image rotation comparison according to an embodiment of the present invention. DETAILED DESCRIPTION
[0069] In order to make the objectives, technical solutions and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in combination with specific embodiments of the present application and with reference to the accompanying drawings.
[0070] Embodiment 1
[0071] A palm ROI extraction method, such as Figure 1 As shown, the following steps are included:
[0072] The key points of the palm are detected using a key point detection model, wherein the key points include the base joint P1 of the index finger, the base joint P2 of the middle finger, the base joint P3 of the ring finger, and the base joint P4 of the little finger. Figure 2 shown.
[0073] In this embodiment, the training of the key point detection model uses the open source dataset CASIA-Multi-Spectral-PalmprintV1 (multi-spectral palmprint image dataset of the Institute of Automation, Chinese Academy of Sciences) as the dataset of the model, with a total of 7,200 images.
[0074] The preset parameter k is used to calculate the score point P5 on the line segment P1P2 and the score point P6 on the line segment P3P4 according to the fixed score score formula of the line segment.
[0075] The calculation method of the score points P5 and P6 is:
[0076]
[0077] Wherein, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, x1 and y1 are the x-coordinate value and y-coordinate value of the determined point P1, x2 and y2 are the x-coordinate value and y-coordinate value of the determined point P2, x3 and y3 are the x-coordinate value and y-coordinate value of the determined point P3, x4 and y4 are the x-coordinate value and y-coordinate value of the determined point P4, and k is the preset equal score point formula parameter.
[0078] Among them, k is restricted to be greater than or equal to 0, thereby restricting points P5 and P6 to be on line segments P1P2 and P3P4. The positions of p5 and P6 on their respective corresponding line segments can be adjusted by adjusting the value of k, thereby determining the size of the palm ROI area.
[0079] Calculate the symmetric points P7 and P8 of P5 and P6 with respect to the line segment P1P4 respectively. The calculation method of the symmetric point P7 is:
[0080]
[0081] In the formula, x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7 respectively, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5 respectively, and A, B, and C are the A, B, and C items in the straight line equation Ax+By+C=0 of the line segment P1P4 respectively.
[0082] The calculation method of the symmetric point P8 is:
[0083]
[0084] In the formula, x8 and y8 are the x-coordinate value and y-coordinate value of the symmetrical point P8, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, and A, B, and C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4.
[0085] Calculate the straight line l1 where P7 and P8 are located, the distance d between P7 and P8, the normal l2 of P7 on the straight line l1 and the normal l3 of P8 on the straight line l1, and calculate the target points P9 and P8 on the two normal lines l2 and l3 according to the distance d. 10 , the target points P9 and P 10The symmetrical points P7 and P8 are both on the same side of the line segment P1P4. Specifically, P7 is a point on the line l1. Draw a line l2 that passes through point P7 and is perpendicular to the line l1, i.e., the normal line l2 of P7 on the line l1. Similarly, draw a line l3 that passes through point P8 and is perpendicular to the line l1, i.e., the normal line l3 of P8 on the line l1. On l2, a line segment with a length of d is taken from P7 in the direction away from the line segment P1P4. The other end of the line segment is the target point P9. Similarly, on l3, a line segment with a length of d is taken from P8 in the direction away from the line segment P1P4. The other end of the line segment is the target point P 10 .
[0086] In particular, the equation of straight line l1 is Ax+By+C1=0, and according to the point-slope equation, the equation of normal line l2 is Bx-Ay+Ax7-By7=0, and the equation of normal line l3 is Bx-Ay+Ax8-By8=0, where (x7, y7) and (x8, y8) are the coordinates of P7 and P8.
[0087] The calculation method of the target point p9 is as follows:
[0088]
[0089] Wherein, x9, y9 are the x-coordinate value and y-coordinate value of the target point p9, x7, y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7, d is the distance between the symmetrical points P7 and P8, a, B, C are the A, B, C items in the straight line equation Ax+By+C=0 of the line segment P1P4, respectively.
[0090] There are four combinations of (x9, y9) calculated by the above method. To ensure that P7 and P9 are on the same side of the line segment P1P4, so that the target point P9 and the score point P5 are distributed on both sides of the straight line l1, x9 and y9 are selected according to the following conditions to select the coordinate points that meet the requirements:
[0091]
[0092] Wherein, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5, respectively; x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7, respectively.
[0093] The target point P 10 The calculation method is as follows:
[0094]
[0095]
[0096] In the formula, x 10 ,y 10 The target points P are10 where x8 is the x-coordinate value and y-coordinate value of the symmetrical point P8, y8 is the x-coordinate value and y-coordinate value of the symmetrical point P8, d is the distance between the symmetrical points P7 and P8, and A, B, C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4.
[0097] Correspondingly, the (x 10 ,y 10 ) There are four combinations to ensure that P8 and P 10 On the same side of line segment P1P4, so that the target point P 10 The score point P6 is distributed on both sides of the straight line l1, x 10 ,y 10 Filter the coordinate points that meet the requirements according to the following conditions:
[0098]
[0099] Wherein, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, respectively; x8 and y8 are the x-coordinate value and y-coordinate value of the symmetrical point P8, respectively.
[0100] Connect points P7, P8, P9, P 10 and P7, the resulting geometric shape is output as ROI, such as Figure 3 As shown, P7 is connected to P8, P8 is connected to P9, and P9 is connected to P 10 , P 10 Then connect to P7, and finally get a vertex P7, P8, P9, P 10 The square area is l1, l2, l3, P9, P 10 The square enclosed by the connecting lines on the plane is used as the ROI finally generated in this embodiment.
[0101] Embodiment 2
[0102] A rotating palm ROI detection method, such as Figure 4 As shown, the following steps are included:
[0103] A data set is collected. After ROI extraction is performed on the data set using the ROI extraction method described in Example 1, the data set is randomly divided into a training set and a validation set according to a set ratio. In this embodiment, the ratio of the training set to the validation set is 8:2, and the corresponding images and labels are divided into the training set and the validation set for iterative training of the rotation target detection model.
[0104] Select the preset YOLOv5 model network structure and hyperparameters, use the training set to train the rotation target detection model, and then use the validation set to verify the training results.
[0105] like Figure 5 As shown in the figure, the YOLOv5 model network structure mainly includes three parts, namely a feature extraction module, a multi-scale feature fusion module and multiple detection heads.
[0106] First, the image size is proportionally scaled to 960*960 resolution using an adaptive image scaling algorithm, and then data enhancement is performed on the training data according to the configured hyperparameters, mainly including geometric transformation, color space transformation and other image enhancement operations to improve the richness of the data and the generalization ability of the model. The geometric transformation includes operations such as scaling, flipping, rotation, translation, random scaling, etc. to change the position and size of the target. The main purpose is to increase the diversity of the position and size of the ROI area to be detected in the image, thereby enhancing the robustness of the rotation ROI detection model to the target space position and size. Color space transformation mainly includes brightness adjustment, saturation adjustment, contrast adjustment, etc. The main purpose is to increase the color space diversity of the image and enhance the robustness of the model to be trained to color.
[0107] After the training data is enhanced, it is input into the network’s feature extraction module according to the batch size. This module is mainly used to extract training data at different levels and scales (2 1 ~2 5 The semantic features of the image are extracted by upsampling (times downsampling rate) and output to the multi-scale feature fusion module. The feature extraction module outputs feature maps of 5 sizes: 480*480, 240*240, 120*120, 60*60 and 30*30. The feature maps of 120*120, 60*60 and 30*30 are input to the multi-scale feature fusion module, which uses 3 times upsampling to fuse 3 scales (2 3 ~2 5 The features are then input into the detection heads of three scales respectively. The detection heads decode the regression data and output multiple predicted ROI coordinates.
[0108] Model training uses mAP (Mean Average Precision), Precision and Recall as evaluation indicators.
[0109] The trained YOLOv5 model is used to predict the palm image, and the prediction result is processed to extract the rotation ROI area of the palm image. The processing of the prediction result is specifically as follows:
[0110] The trained model is inferred, the image to be predicted is input into the model, and the prediction result of the model outputs the predicted coordinates and rotation angles of multiple ROI areas.
[0111] Non-Maximum Suppression (NMS) is a technique used in target detection algorithms to reduce the number of overlapping bounding boxes so that each target is detected only once. After YOLOv5 outputs a prediction box, there will be many overlapping boxes pointing to the same object, so NMS is used to eliminate redundant prediction boxes; the prediction box usually consists of four coordinates (upper left corner, upper left corner, lower right corner, lower right corner), a prediction category and a confidence (or score). Before applying NMS, a specific category threshold (confidencethreshold) is selected to filter out low-confidence prediction boxes; all prediction boxes are sorted from high to low according to their confidence, and the box with the highest confidence is selected from the sorted list as the reference box; for each remaining box, their intersection over union (IoU) with the reference box is calculated. If the IoU of a box with the reference box exceeds the set threshold, it means that it is too close to the reference box, and it is removed from the list to avoid detecting duplicate targets. Repeatedly select the remaining prediction boxes from the list and compare them with the reference box until the list is empty. In this embodiment, the threshold value is set to 0.6. In other embodiments of the present invention, the threshold value may be set to a value between 0.2 and 0.9 according to the circumstances.
[0112] According to the output result of the model, the midpoint of the model prediction box is used as the rotation center, the rotation angle θ of the image is calculated, and the rotation matrix of the image is obtained. The image is rotated by affine transformation according to the rotation matrix, and the prediction box of the model is rotated to the positive direction of the palm ROI of the prediction image according to the rotation matrix; the calculation method of the rotation matrix is:
[0113] Set the image scaling ratio and calculate the center of the model output prediction box as the rotation center. 11 ,y 11 ,x 12 ,y 12 ,x 13 ,y 13 ,x 14 ,y 14 ) respectively correspond to the coordinate values of the four vertices d1, d2, d3, and d4 of the prediction box in the image. The rotation center (prediction box center) d0 (x0, y0) is calculated according to the midpoint formula as follows:
[0114]
[0115] Where x0 and y0 are the x-coordinate and y-coordinate values of the prediction box center d0, respectively. 11 ,y 11 are the x-coordinate value and y-coordinate value of one vertex d1 in the output prediction box, respectively. 13 ,y 13are the x-coordinate value and y-coordinate value of the diagonal vertex d3 of d1 respectively;
[0116] Three points can be selected to calculate the rotation angle. In this embodiment, the prediction box center d0, the midpoint d5 (x 15 ,y 15 ), and any point d6(x 16 ,y 16 ), select the coordinates of d6 as The coordinates of point d5 are calculated according to the midpoint formula. As shown in the figure, the cosine and sine of the rotation angle are then calculated according to the dot product formula of the vector. The calculation method is as follows:
[0117]
[0118] In the formula, cosθ and sinθ are the cosine and sine values of the rotation angle respectively, and x 12 ,y 12 The x-coordinate value and y-coordinate value of the vertex d2 adjacent to the vertex d1 of the output prediction box are respectively;
[0119] The rotation angle can be calculated based on cosθ and sinθ. The range of the rotation angle is , and then according to the rotation center, scaling ratio and rotation angle, get the rotation matrix:
[0120]
[0121] M is the calculated rotation matrix.
[0122] The image rotation transformation is performed according to the following formula:
[0123] X′=MX
[0124] Wherein, X is the image to be rotated, M is the rotation matrix, and X′ is the image after rotation.
[0125] After the image is rotated, the ROI coordinates predicted by the model are converted according to the following formula:
[0126]
[0127] Among them, (x, y) are the coordinates of the four ROI vertices predicted by the model, (x′, y′) are the coordinates of the ROI vertices after rotation, and the images before and after rotation are as follows: Figure 6 As shown, in Figure 6In the figure, the left side is an example of a palm image before rotation, and the right side is an example of a palm image after rotation. The image is sliced according to the coordinates of the ROI vertices after rotation, and the sliced image is subjected to adaptive contrast enhancement and denoising. The sliced image calculation method is:
[0128] X slice =X[min(x′ 11 ,x′ 12 ,x′ 13 ,x′ 14 ):max(x′ 11 ,x′ 12 ,x′ 13 ,x′ 14 ),
[0129] min(y′ 11 ,y′ 12 ,y′ 13 ,y′ 14 ):max(y′ 11 ,y′ 12 ,y′ 13 ,y′ 14 )]
[0130] In this embodiment, adaptive contrast enhancement mainly enhances the visibility of the image by adjusting the local contrast of the image, using local histogram equalization such as CLAHE (Contrast Limited Adaptive Histogram Equalization). First, the size of the small area for segmenting the image is determined, and histogram equalization is applied to each small area; after equalization, for extremely bright or extremely dim small areas, the histogram will be stretched, that is, the contrast is enhanced. In order to avoid the problem of noise amplification caused by excessive enhancement, the contrast enhancement in the histogram equalization process is usually limited. Finally, in order to remove the boundary effect between blocks, the equalized small area will be interpolated to achieve a smooth transition.
[0131] Accordingly, this embodiment uses a bilateral filter to perform denoising on the image.
[0132] Embodiment 3
[0133] A palm ROI extraction and rotation palm ROI detection system, comprising:
[0134] A key point detection model, which is a pre-trained model for detecting key points of a palm image: the base joint P1 of the index finger, the base joint P2 of the middle finger, the base joint P3 of the ring finger, and the base joint P4 of the little finger;
[0135] The ROI extraction module calculates the target points P7, P8, P9, P 10 , P7, P8, P9, P 10 The enclosed geometric shape is output as ROI;
[0136] An imaging module, used for acquiring a palm image to be detected;
[0137] An image preprocessing module, used for preprocessing the acquired palm image;
[0138] The palm ROI detection module detects the palm image according to the rotated palm image ROI detection method as described in the second embodiment, and outputs the ROI area of the rotated palm image.
[0139] Embodiment 4
[0140] A palm vein recognition device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the rotating palm ROI detection method as described in the second embodiment when executing the computer program.
[0141] The palm vein recognition device described in this embodiment can be a separate palm vein recognition device, or it can be an embedded device embedded with the above recognition method, such as a gate, access control, door lock, home control device, etc.
[0142] The words “P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15, P16, P17, P18, P19, P20, P21, P22, P23, P24, P25, P26, P27, P28, P29, P30, P31, P32, P33, P 10 ," d0, d1, d2, d3, d4, d5" or similar terms such as starting coordinate point numbers are only used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that the specific order or sequence can be interchanged where permitted so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0143] The above is only a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several modifications and improvements without departing from the inventive concept of the present invention, which all belong to the protection scope of the present invention.
Claims
1. A palm ROI extraction method, characterized in that: The following steps are involved: Using a key point detection model to detect key points of the palm, the key points include a base joint P1 of the index finger, a base joint P2 of the middle finger, a base joint P3 of the ring finger, and a base joint P4 of the little finger; Use the preset parameter k to calculate the score point P5 on the line segment P1P2 and the score point P6 on the line segment P3P4 according to the fixed score score formula of the line segment; Calculate the symmetric points P7 and P8 of P5 and P6 with respect to the line segment P1P4 respectively; Calculate the straight line l1 where P7 and P8 are located, the distance d between P7 and P8, the normal l2 of P7 on the straight line l1 and the normal l3 of P8 on the straight line l1, and calculate the target points P9 and P10 on the two normal lines l2 and l3 respectively according to the distance d. 10 The symmetrical points P7 and P8 are both on the same side of the line segment P1P4; Connect points P7, P8, P9, P 10 and P7, and the resulting geometric shape is output as a ROI.
2. The palm ROI extraction method according to claim 1, characterized in that: The calculation method of the score points P5 and P6 is: Wherein, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, x1 and y1 are the x-coordinate value and y-coordinate value of the determined point P1, x2 and y2 are the x-coordinate value and y-coordinate value of the determined point P2, x3 and y3 are the x-coordinate value and y-coordinate value of the determined point P3, x4 and y4 are the x-coordinate value and y-coordinate value of the determined point P4, and k is the preset equal score point formula parameter.
3. The palm ROI extraction method according to claim 1, characterized in that: The calculation method of the symmetric point P7 is: In the formula, x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7 respectively, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5 respectively, and A, B, and C are the A, B, and C items in the straight line equation Ax+By+C=0 of the line segment P1P4 respectively.
4. The palm ROI extraction method according to claim 1, characterized in that: The calculation method of the symmetric point P8 is: In the formula, x8 and y8 are the x-coordinate value and y-coordinate value of the symmetrical point P8, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, and A, B, and C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4.
5. The palm ROI extraction method according to claim 1, characterized in that: The calculation method of the target point P9 is as follows: Where x9 and y9 are the x-coordinate value and y-coordinate value of the target point P9, x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7, d is the distance between the symmetrical points P7 and P8, A, B, and C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4, respectively; x9 and y9 are coordinate points that meet the requirements according to the following conditions: Wherein, x5 and y5 are the x-coordinate value and y-coordinate value of the score point P5, respectively; x7 and y7 are the x-coordinate value and y-coordinate value of the symmetrical point P7, respectively; The calculation method of the target point P10 is as follows: In the formula, x 10 ,y 10 The target points P are 10 x8 and y8 are the x and y coordinates of the symmetrical point P8, respectively. d is the distance between the symmetrical points P7 and P8. A, B, and C are the A, B, and C items in the linear equation Ax+By+C=0 of the line segment P1P4. 10 ,y 10 Filter the coordinate points that meet the requirements according to the following conditions: Wherein, x6 and y6 are the x-coordinate value and y-coordinate value of the score point P6, respectively; x8 and y8 are the x-coordinate value and y-coordinate value of the symmetrical point P8, respectively.
6. A rotating palm ROI detection method, characterized in that: The following steps are involved: Collecting a data set, wherein the data set is subjected to ROI extraction using the ROI extraction method according to any one of claims 1 to 5, and then divided into a training set and a validation set according to a set ratio; Select a preset YOLOv5 model network structure and hyperparameters, use the training set to train a rotation target detection model, and then use the validation set to verify the training results; Use the trained YOLOv5 model to predict the palm image, process the prediction results, and extract the rotated ROI area of the palm image.
7. The method for detecting a rotating palm ROI according to claim 6, characterized in that: The processing of the prediction results is specifically as follows: The trained model is inferred, the image to be predicted is input into the model, and the prediction result of the model outputs the predicted coordinates and rotation angles of multiple ROI areas; Eliminate redundant prediction boxes through the non-maximum suppression algorithm; According to the output of the model, the midpoint of the model prediction box is used as the rotation center to calculate the rotation angle θ of the image, obtain the rotation matrix of the image, perform a rotational affine transformation on the image according to the rotation matrix, and rotate the model prediction box to the positive direction of the palm ROI of the prediction image according to the rotation matrix; The image is sliced according to the rotated ROI vertex coordinates, and the sliced image is adaptively contrast enhanced and denoised.
8. The method for detecting a rotating palm ROI according to claim 7, characterized in that: The calculation method of the rotation matrix is: Set the image zoom ratio, calculate the center of the prediction box output by the model, and use it as the rotation center. The calculation method of the rotation center is: Where x0 and y0 are the x-coordinate and y-coordinate values of the prediction box center d0, respectively. 11 ,y 11 are the x-coordinate value and y-coordinate value of one vertex d1 in the output prediction box, respectively. 13 ,y 13 are the x-coordinate value and y-coordinate value of the diagonal vertex d3 of d1 respectively; Calculate the cosine and sine of the rotation angle: In the formula, cosθ and sinθ are the cosine and sine values of the rotation angle respectively, and x 12 ,y 12 The x-coordinate value and y-coordinate value of the vertex d2 adjacent to the vertex d1 of the output prediction box are respectively; According to the rotation center, scaling ratio and rotation angle, the rotation matrix is obtained: M is the calculated rotation matrix.
9. A palm ROI extraction and rotation palm ROI detection system, characterized in that: include: A key point detection model, which is a pre-trained model for detecting key points of a palm image: the base joint P1 of the index finger, the base joint P2 of the middle finger, the base joint P3 of the ring finger, and the base joint P4 of the little finger; The ROI extraction module calculates the target points P7, P8, P9, P 10 , P7, P8, P9, P 10 The enclosed geometric shape is output as ROI; An imaging module, used for acquiring a palm image to be detected; An image preprocessing module, used for preprocessing the acquired palm image; The palm ROI detection module detects a palm image according to the rotation palm ROI detection method according to any one of claims 6 to 8, and outputs the ROI area of the rotation palm image.
10. A palm vein recognition device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the rotation palm ROI detection method according to any one of claims 6 to 8 when executing the computer program.
Citation Information
Patent Citations
Palm print ROI segmentation method in palm print identification
CN105938549A
Palm vein image region-of-interest extraction method and device
CN113963158A
Hand back or palm vein image key point and ROI positioning method based on improved UNet
CN116524549A
