Disclosure of Invention
Therefore, the finger annular glow image comparison method and the finger annular glow image comparison system overcome the defect of low similarity calculation accuracy when the finger glow image is compared in the prior art.
In order to achieve the above purpose, the present invention provides the following technical solutions:
in a first aspect, an embodiment of the present invention provides a method for comparing annular glow images of a finger, including:
preprocessing finger images of a gas release imaging technology GDV of a first preset object, and generating inner contours and outer contours of glow of each finger by utilizing polar coordinate transformation;
Fitting an elliptical shape according to the pixel points of the inner contour by using a first preset function to generate an circumscribed rectangle of the ellipse, a long axis, a short axis, an elliptical center point and a rotation angle of the ellipse;
Positioning the finger direction by using a second preset function according to the pixel points of the inner contour, the circumscribed rectangle, the major axis, the minor axis, the center point of the ellipse and the rotation angle;
partitioning the finger ring according to the finger direction;
Calculating the average thickness of the outer contour and the inner contour of the whole finger glow image by utilizing the ordinate of the outer contour and the inner contour after polar coordinate transformation according to the whole finger glow image;
carrying out histogram statistics on each subarea, and calculating the thickness value of the ring subarea by utilizing the ordinate of the outer contour and the inner contour after polar coordinate transformation;
determining the defect detection degree of the glow of a first preset finger according to the average thickness and the thickness value of the ring partition;
repeating the steps to determine the defect detection degree of the finger glow of the second preset object;
and calculating the similarity of the first preset object and the second preset object according to the defect detection degree of the first preset finger glow and the defect detection degree of the second preset object.
Optionally, the first preset function comprises FITELLIPSE functions in opencv.
Optionally, partitioning the ring according to the finger direction includes:
Dividing 360 degrees into a first preset number of parts with a first preset angle according to the direction of the finger, wherein the first preset number of parts is the number of areas of the ring partition.
Alternatively, the average thickness of the outer contour, inner contour of the whole finger glow image is calculated by the following formula:
Wherein, Representing the ordinate of the outer contour of the i-th point,The ordinate representing the inner contour of the i-th point, and N representing the number of points.
Optionally, determining the defect detection degree of the first preset finger glow according to the average thickness and the thickness value of the ring subarea includes:
when the thickness value of the ring subarea is larger than the average value, the more serious the glow protrusion of the finger is;
the more severe the finger glow pits are when the thickness value of the ring segment is smaller than the average value.
Optionally, the ring partitioning includes partitioning each finger.
Optionally, the similarity of the first preset and the second preset object is calculated by the following formula:
ab is respectively represented as a first preset object and a second preset object, a single finger partition is set as N, and the histogram of the current partition is that
In a second aspect, embodiments of the present invention provide a finger annular glow image contrast system comprising:
The inner contour data acquisition module and the outer contour data acquisition module are used for preprocessing finger images of the gas release imaging technology GDV for acquiring a first preset object and generating inner contours and outer contours of glow of each finger by utilizing polar coordinate transformation;
The ellipse fitting module is used for fitting the shape of the ellipse by utilizing a first preset function according to the pixel points of the inner contour to generate an external rectangle of the ellipse, a major axis, a minor axis, an ellipse center point and a rotation angle of the ellipse;
The finger direction positioning module is used for positioning the finger direction by utilizing a second preset function according to the pixel points of the inner contour, the circumscribed rectangle, the long axis, the short axis, the elliptical center point and the rotation angle of the ellipse;
The finger ring partitioning module is used for partitioning the finger ring according to the direction of the finger;
The average thickness calculation module is used for calculating the average thickness of the outer contour and the inner contour of the whole finger glow image by utilizing the ordinate of the outer contour and the inner contour after the polar coordinate transformation according to the whole finger glow image;
The histogram statistics module is used for carrying out histogram statistics on each subarea, and calculating the thickness value of the ring subarea by utilizing the ordinate of the outer contour and the inner contour after polar coordinate transformation;
The first preset defect detection module is used for determining the defect detection degree of the glow of the first preset finger according to the average thickness and the thickness value of the ring partition;
The second preset defect detection module is used for repeating the inner contour data acquisition module and the outer contour data acquisition module to the first preset defect detection module to determine the defect detection degree of the finger glow of the second preset object;
The comparison module calculates the similarity of the first preset object and the second preset object according to the defect detection degree of the first preset finger glow and the defect detection degree of the second preset object.
In a third aspect, an embodiment of the present invention provides a terminal, including at least one processor, and a memory communicatively connected to the at least one processor, where the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor performs the finger annular glow image comparing method according to the first aspect of the embodiment of the present invention.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium storing computer instructions for causing a computer to perform the method for comparing annular glow images of fingers according to the first aspect of the embodiments of the present invention.
The technical scheme of the invention has the following advantages:
The embodiment of the invention provides a finger annular glow image comparison method and a system, which are used for ten-finger glow images acquired through GDV equipment. The method can be used for finger glow image retrieval, namely, a finger glow image of a person is searched in a finger glow image library. The method can also be used for comparing with the average characteristics of a certain group of people, and if a certain group of people has certain diseases and shows a bulge or a recess at a certain position of the finger ring, whether the currently detected people have the diseases can be estimated. The average characteristics of each of two groups of people can be calculated, and whether the two groups of people have separability or not can be analyzed. By the method provided by the embodiment of the invention, the accuracy of calculation is improved.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully in view of the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are based on the directions or positional relationships shown in the drawings, are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a specific orientation, be configured and operated in a specific orientation, and thus should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, unless explicitly specified and limited otherwise, the terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected, mechanically connected, electrically connected, directly connected, indirectly connected via an intermediate medium, and in communication with each other between two elements, and wirelessly connected, or wired. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
In addition, the technical features of the different embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
Example 1
The embodiment of the invention provides a finger annular glow image comparison method, as shown in figure 1, comprising the following steps:
step S1, preprocessing finger images of the gas release imaging technology GDV of the first preset object, and generating inner contours and outer contours of glow of each finger by utilizing polar coordinate transformation.
In the embodiment of the invention, preprocessing the finger image of the gas release imaging technology GDV for obtaining the first preset object comprises denoising the obtained ten-finger image, wherein the figure 2 is shown, locating and dividing a single finger glow area, and the figures 3 and 4 are shown, and the polar coordinate transformation is used for obtaining the inner contour and the outer contour of the finger glow.
And S2, fitting an elliptical shape according to the pixel points of the inner contour by using a first preset function, and generating an elliptical circumscribed rectangle, an elliptical long axis, an elliptical short axis, an elliptical center point and a rotation angle.
In the embodiment of the invention, the first preset function comprises FITELLIPSE functions in opencv. By way of example only, and not by way of limitation, in practical applications, corresponding functions are selected according to practical requirements.
In an embodiment of the present invention, the function FITELLIPSE in opencv may be used to complete, for example, rotatedRect fitEllipse (InputArraypoints), as shown in fig. 5, the ellipse fitted to the inner contour by the function. And simultaneously, an oval external rectangle is obtained. Thereby obtaining the major axis, the minor axis, the center point and the rotation angle of the ellipse.
And S3, positioning the finger direction by using a second preset function according to the pixel points of the inner contour, the circumscribed rectangle, the major axis, the minor axis, the center point and the rotation angle of the ellipse.
In the embodiment of the present invention, the second preset function is not limited herein, and a corresponding function is selected according to actual requirements in actual application. The second preset function may be the same as the first preset function.
In a specific embodiment, in the function of step S2, the pixel point on the inner ellipse is set as the input point, and the return circumscribed rectangle is set as the rect, as shown in fig. 6, the corresponding parameters of the corresponding ellipse are the long axis and the short axis of the corresponding ellipse are the rect.size.width, the short axis, respectively (which value is larger, here AD is the long axis, EF is the short axis), the center point rect.center (here point C) of the ellipse, and the rotation angle rect.angle (here angle BCA) of the ellipse.
The center point C may be a straight line, i.e., the long axis direction CA, which is the direction of the arrow in fig. 6, which is the direction of the finger. In the embodiment of the present invention, the preset direction of the finger is upward, that is, the required angle BCA is within 0 to 180 degrees, which is the correct finger direction, otherwise, the direction is the opposite direction.
And S4, partitioning the ring according to the direction of the finger.
In the embodiment of the invention, the ring is partitioned according to the finger direction, which comprises dividing 360 degrees into a first preset number of parts with a first preset angle according to the finger direction, wherein the first preset number of parts is the number of the partitioned areas of the ring.
In the embodiment of the present invention, 360 degrees are equally divided into 4 parts according to the finger direction as shown in fig. 7. As shown in fig. 8, or divided equally into 8 parts. The device is not limited herein, and can be divided into any number of parts at any angle according to the requirement.
And S5, calculating the average thickness of the outer contour and the inner contour of the whole finger glow image by utilizing the ordinate of the outer contour and the inner contour after polar coordinate transformation according to the whole finger glow image.
In the embodiment of the invention, the average thickness of the outer contour and the inner contour of the whole finger glow image is calculated by the following formula:
Wherein, Representing the ordinate of the outer contour of the i-th point,The ordinate representing the inner contour of the i-th point, and N representing the number of points.
In one embodiment, the polar transformed outer contour minus the inner contour ordinate is used for the entire finger glow image, and then averaged to correspond to the outer contour, as shown in fig. 9. As shown in fig. 10, corresponds to the inner profile.
In the embodiment of the invention, the average thickness in polar coordinates is obtained, and the thickness in Cartesian coordinate system is not needed because the final patent only needs to calculate the percentage of thickness deviation. For the finger defect portion, since both the inner and outer contours are 0, the thickness obtained at the end is also 0.
And S6, carrying out histogram statistics on each subarea, and calculating the thickness value of the ring subarea by utilizing the ordinate of the outer contour and the inner contour after polar coordinate transformation.
In a specific embodiment, when the inner and outer contours of the ring segments are obtained in step S4, as shown in fig. 11 a-11 b and fig. 12 a-12 b, the inner and outer contours of the first segment and the corresponding polar images are obtained, and it can be seen that the image does not start from the origin of the coordinates of the complete polar contour, so that the angular offset may be calculated for each segment first and then the histogram statistics may be performed.
And carrying out partition histogram statistics, namely carrying out histogram statistics on each partition, and subtracting the ordinate of the inner contour from the outer contour after polar coordinate transformation to obtain the thickness value of the ring partition. For the sake of convenience of observation, the present patent performs dividing the histogram into 3 parts, or 7 parts, but may be divided into any parts. A larger average value indicates a more severe protrusion, and a smaller average value indicates a more severe recess. The defect degree of a certain partition of a certain finger can be found according to the histogram. The definitions of 3 parts and 7 parts are given below, respectively, although the parts may be made in other ways.
In one embodiment, 3 portions:
bin[0]++if y<aveY*(1-T)and y∈Yj
bin[1]++if y≥aveY*(1-T)and y≤aveY*(1+T)and y∈Yj
bin[2]++if y>aveY*(1+T)and y∈Yj
Wherein bin [ k ], k [0,1,2] represents the number in the k-th partition, aveY represents the thickness mean value of the current partition, Y j represents all thickness values of the j-th partition, and T is a threshold value capable of controlling the number of thickness values near the mean value, and the patent takes 0.1.
The proportion of each portion can be calculated: it can be seen that hist [0] represents the concave proportion and hist [2] represents the convex proportion.
In another specific embodiment, 7 parts:
Wherein stdev represents standard deviation of the glow thickness of the whole finger, other symbols are similar to those in 3 parts, and the proportion of each part can be calculated:
hist [0], hist [1], hist [2] represent the proportion of the depressions of different degrees;
hist [4], hist [5], hist [6] represent the proportion of the protrusions of different degrees.
In the embodiment of the present invention, the histogram shows that for ten fingers, one histogram is provided for each partition of each finger, and in the embodiment of the present invention, as shown in fig. 13, only an example of a histogram of 7 parts of the thumb of the left hand is given.
And S7, determining the defect detection degree of the finger glow according to the average thickness and the thickness value of the ring subarea.
In the embodiment of the invention, the defect detection degree of the finger glow is determined according to the average thickness and the thickness value of the ring partition, wherein the defect detection degree comprises that when the thickness value of the ring partition is larger than the average value, the finger glow bulge is more serious, and when the thickness value of the ring partition is smaller than the average value, the finger glow recess is more serious.
And S8, repeating the steps S1-S7, and determining the defect detection degree of the finger glow of the second preset object.
Step S9, calculating the similarity of the first preset object and the second preset object according to the defect detection degree of the first preset finger glow and the defect detection degree of the second preset object.
In the embodiment of the invention, the similarity of the first preset object and the second preset object is calculated through the following formula:
the method comprises the steps that a and b are respectively expressed as a first preset object and a second preset object, a single finger partition is set to be N, and a histogram of a current partition is as follows:
In a specific embodiment, in order to compare the similarity of glow images of two fingers a, b, the embodiment of the invention uses the histogram distance as an evaluation index of the similarity.
First, if a single finger partition is set to N, the histogram of the current partition is:
Where N may be 3 or 7, and is not limited thereto, and may be a larger number.
Secondly, calculating the similarity of single fingers corresponding to the two persons a and b, wherein the formula is as follows:
finally, the similarity of 10 pairs of fingers is averaged to obtain the overall similarity:
The embodiment of the invention provides a finger annular glow image comparison method for ten finger glow images acquired by GDV equipment. The method can be used for finger glow image retrieval, namely, a finger glow image of a person is searched in a finger glow image library. The method can also be used for comparing with the average characteristics of a certain group of people, and if a certain group of people has certain diseases and shows a bulge or a recess at a certain position of the finger ring, whether the currently detected people have the diseases can be estimated. The average characteristics of each of two groups of people can be calculated, whether the two groups of people have separability or not is analyzed, and the accuracy of similarity calculation is improved by the method provided by the embodiment of the invention.
Example 2
An embodiment of the present invention provides a finger annular glow image contrast system, as shown in fig. 14, including:
The inner and outer contour data obtaining module 1 is used for preprocessing the finger image of the gas release imaging technology GDV for obtaining the first preset object, generating the inner contour and the outer contour of each finger glow by using polar coordinate transformation, and executing the method described in step S1 in embodiment 1, which is not described herein.
The ellipse fitting module 2 is configured to fit an ellipse shape according to the pixel points of the inner contour by using a first preset function to generate an circumscribed rectangle of the ellipse, a major axis, a minor axis, a center point of the ellipse, and a rotation angle, and the method described in step S2 in embodiment 1 is executed by the module, which is not described herein.
The finger direction positioning module 3 is configured to position the finger direction according to the pixel point of the inner contour, the circumscribed rectangle, the major axis, the minor axis, the center point of the ellipse, and the rotation angle by using a second preset function, and the method described in step S3 in embodiment 1 is executed by the module and will not be described herein.
The ring partitioning module 4 is configured to partition the ring according to the finger direction, and the method described in step S4 in embodiment 1 is executed by this module, which is not described herein.
The average thickness calculating module 5 is configured to calculate the average thickness of the outer contour and the inner contour of the whole finger glow image according to the whole finger glow image by using the ordinate of the outer contour and the inner contour after the polar coordinate transformation, and the method described in step S5 in embodiment 1 is executed by the module, and will not be described herein.
The histogram statistics module 6 is configured to perform histogram statistics on each partition, and calculate the thickness value of the ring partition by using the ordinate of the outer contour and the ordinate of the inner contour after the polar coordinate transformation, and the method described in step S6 in embodiment 1 is executed by the module, which is not described herein.
The first preset defect detection module 7 is configured to determine the defect detection degree of the glow of the first preset finger according to the average thickness and the thickness value of the ring partition, and the method described in step S7 in embodiment 1 is executed by this module, which is not described herein.
The second preset defect detection module 8 is configured to repeat the inner and outer profile data acquisition module to the first preset defect detection module to determine the defect detection degree of the finger glow of the second preset object, and the method described in step S8 in embodiment 1 is executed by the second preset defect detection module, which is not described herein.
The comparison module 9 is configured to calculate the similarity between the first preset object and the second preset object according to the defect detection degree of the first preset finger glow and the defect detection degree of the second preset object, and the method described in step S9 in embodiment 1 is executed by the comparison module, which is not described herein.
The embodiment of the invention provides a finger annular glow image comparison system, which can be used for searching finger glow images, namely searching finger glow images of a person in a finger glow image library. The method can also be used for comparing with the average characteristics of a certain group of people, and if a certain group of people has certain diseases and shows a bulge or a recess at a certain position of the finger ring, whether the currently detected people have the diseases can be estimated. The average characteristics of each of two groups of people can be calculated, whether the two groups of people have separability or not is analyzed, and the accuracy of similarity calculation is improved through the system provided by the invention.
Example 3
An embodiment of the present invention provides a terminal, as shown in fig. 15, comprising at least one processor 401, e.g. a CPU (Central Processing Unit ), at least one communication interface 403, a memory 404, at least one communication bus 402. Wherein communication bus 402 is used to enable connected communications between these components. The communication interface 403 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional communication interface 403 may further include a standard wired interface and a wireless interface. The memory 404 may be a high-speed RAM memory (RandomAccess Memory) or a nonvolatile memory (nonvolatile memory), such as at least one magnetic disk memory. The memory 404 may also optionally be at least one storage device located remotely from the aforementioned processor 401. Wherein the processor 401 may perform the finger annular glow image contrast method of example 1. A set of program codes is stored in the memory 404, and the processor 401 calls the program codes stored in the memory 404 for performing the finger annular glow image contrast method in embodiment 1. The communication bus 402 may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (extended industry standard architecture, EISA) bus, among others. Communication bus 402 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one line is shown in fig. 15, but not only one bus or one type of bus. The memory 404 may include a volatile memory (english) such as a random-access memory (RAM), a nonvolatile memory (english) such as a flash memory (english), a hard disk (english: HARD DISK DRIVE, HDD) or a solid-state hard disk (english: solid-STATE DRIVE, SSD), and the memory 404 may include a combination of the above types of memories. The processor 401 may be a central processor (english: central processing unit, abbreviated: CPU), a network processor (english: networkprocessor, abbreviated: NP) or a combination of CPU and NP.
The memory 404 may include volatile memory (english) such as random-access memory (RAM), nonvolatile memory (non-volatile memory) such as flash memory (flashmemory), hard disk (HARD DISK DRIVE, HDD) or solid state disk (solid-state-STATE DRIVE, SSD), and the memory 404 may include a combination of the above types of memory.
The processor 401 may be a central processor (english: central processing unit, abbreviated: CPU), a network processor (english: network processor, abbreviated: NP) or a combination of CPU and NP.
Wherein the processor 401 may further comprise a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof (English: programmable logic device). The PLD may be a complex programmable logic device (English: complex programmable logic device, abbreviated: CPLD), a field-programmable gate array (English: field-programmable GATE ARRAY, abbreviated: FPGA), a general-purpose array logic (English: GENERIC ARRAY logic, abbreviated: GAL), or any combination thereof.
Optionally, the memory 404 is also used for storing program instructions. The processor 401 may invoke program instructions to implement the finger annular glow image contrast method as in the present application performing embodiment 1.
The embodiment of the invention also provides a computer readable storage medium, and the computer readable storage medium stores computer executable instructions thereon, wherein the computer executable instructions can execute the finger ring glow image comparison method in the embodiment 1. The storage medium may be a magnetic disk, an optical disc, a Read-only Memory (ROM), a random access Memory (RandomAccess Memory, RAM), a Flash Memory (Flash Memory), a hard disk (HARD DISK DRIVE, abbreviated as HDD), a Solid state disk (Solid-state disk STATE DRIVE, SSD), or the like, and the storage medium may further include a combination of the above types of memories.
It is apparent that the above examples are given by way of illustration only and are not limiting of the embodiments. Other variations or modifications of the above teachings will be apparent to those of ordinary skill in the art. It is not necessary here nor is it exhaustive of all embodiments. And obvious variations or modifications thereof are contemplated as falling within the scope of the present invention.