Eye image enhancement method for strabismus detection
By performing color space conversion, edge detection and bounded pixel point screening on eye images, real arc edge lines are selected and circle fitted, the problem that the existing technology cannot extract the real iris region and improve the accuracy of strabismus detection sex.
Patent Information
- Application Number
- CN202410647259.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-23
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2044-05-23
AI Technical Summary
The prior art cannot effectively extract the real iris area of the eyes of the person to be tested, resulting in a decrease in the accuracy of strabismus detection.
By acquiring eye images and performing color space conversion, the initial iris region is extracted, edge detection and bounded pixel point screening, the real arc edge lines are selected, circle fitting and adjustment are performed, and the complete iris region is obtained.
Improve the enhancement effect on eye images, ensuring that the extracted iris area is more realistic and complete, thereby improving the accuracy of strabismus detection.
Smart Images

Figure CN118446945B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image enhancement, and in particular to an eye image enhancement method for strabismus detection. Background Art
[0002] Strabismus is a visual disorder of the human eye. When collecting the eye image of the person to be tested, due to factors such as noise or eyelid occlusion, the real iris area cannot be extracted, which reduces the accuracy of strabismus detection. Therefore, enhancing the eye image of the person to be tested is of great significance for strabismus detection.
[0003] In the related technology, usually only the eye image of the person to be tested is subjected to denoising and enhancement processing, and the iris area of the eye is extracted using image segmentation technology. However, in the process of collecting the eye image, the iris area of the eye is often blocked by the eyelid, resulting in some pixels missing in the iris area. The actual iris area of the eye of the person to be tested cannot be extracted using only the existing technology, thereby reducing the enhancement effect of the eye image. Summary of the invention
[0004] In order to solve the technical problem that the existing technology cannot extract the real iris area of the eye of the person to be tested, thereby reducing the enhancement effect of the eye image, the purpose of the present invention is to provide an eye image enhancement method for strabismus detection, and the technical solution adopted is as follows:
[0005] The present invention proposes an eye image enhancement method for strabismus detection, the method comprising:
[0006] Obtain an eye image of the person to be tested, perform color space conversion on the eye image to obtain a grayscale image and a color space image, and extract an initial iris area in the grayscale image based on the brightness component value of each pixel in the color space image;
[0007] Perform edge detection on the initial iris area to obtain an initial edge line; obtain boundary pixel points on the initial edge line according to the difference in grayscale values of pixel points within a preset neighborhood range centered on each pixel point on the initial edge line; divide the initial edge line into different edge curve segments using the boundary pixel points, and obtain the true edge possibility of each edge curve segment according to the change in gradient direction and gradient value of all pixel points on each edge curve segment; based on the true edge possibility, screen out the true arc edge line of the initial iris area from all edge curve segments;
[0008] Performing circle fitting on each of the real circular arc edge lines to obtain a fitting circle center and a fitting radius of each real circular arc edge line; adjusting the fitting circle center and the fitting radius respectively based on the real edge possibility to obtain a complete iris area;
[0009] Based on the grayscale values of the pixels in the initial iris area, the grayscale values of the pixels in the complete iris area are enhanced to obtain the real iris area of the person to be tested.
[0010] Furthermore, the step of obtaining the boundary pixel points on the initial edge line according to the difference in grayscale values of the pixel points within a preset neighborhood range centered on each pixel point on the initial edge line includes:
[0011] Based on the grayscale values of the pixels, all pixels within a preset neighborhood are clustered to obtain a first cluster, where the number of the first cluster is 3;
[0012] The absolute value of the difference between the maximum value and the second largest value of the cluster center in all the first clusters is taken as the first difference value, and the absolute value of the difference between the minimum value and the second largest value of the cluster center in all the first clusters is taken as the second difference value;
[0013] Normalizing the minimum value of the first difference value and the second difference value to obtain the demarcation point possibility of each pixel point on the initial edge line;
[0014] According to the demarcation point possibility, demarcation pixel points are screened out from all pixel points of the initial edge line.
[0015] Furthermore, the step of selecting the boundary pixel points from all the pixel points of the initial edge line according to the boundary point possibility includes:
[0016] Based on the possibility of the demarcation point, all pixel points on the initial edge line are clustered to obtain a second cluster, where the number of the second cluster is 2;
[0017] The pixel point in the second cluster corresponding to the maximum value of the cluster center in the second cluster is used as the boundary pixel point.
[0018] Furthermore, obtaining the true edge possibility of each edge curve segment according to the change of the gradient direction and the gradient value of all the pixels on each edge curve segment includes:
[0019] The absolute value of the difference in the gradient direction between any two adjacent pixels on each edge curve segment is taken as the gradient direction change of the adjacent pixels;
[0020] The variance of the gradient direction changes of all adjacent pixels is negatively normalized to obtain the circularity of each edge curve segment;
[0021] Normalize the gradient value of each pixel on each edge curve segment to obtain the standard gradient value of each pixel; take the average value of the standard gradient values of all pixels on each edge curve segment as the overall gradient of each edge curve segment;
[0022] The product value of the circularity degree and the overall gradient is taken as the true edge possibility of each edge curve segment.
[0023] Furthermore, the filtering out the true arc edge line of the initial iris region from all edge curve segments based on the true edge possibility includes:
[0024] The edge curve segment whose true edge possibility is greater than a preset possibility threshold is used as the true arc edge line of the initial iris region.
[0025] Furthermore, performing circle fitting on each of the real circular arc edge lines to obtain the fitting center and fitting radius of each real circular arc edge line includes:
[0026] In the grayscale image, the line between the two end points of each real arc edge line is taken as the chord line of the corresponding real arc edge line, and the distance between the midpoint of each real arc edge line and the midpoint of the corresponding chord line is taken as the arch height of the corresponding real arc edge line;
[0027] Input the length of the chord and the arch height into a preset radius calculation equation and solve it to obtain a fitting radius corresponding to the real arc edge line;
[0028] Draw a ray from the midpoint of each real arc edge line to the midpoint of the corresponding chord line, and take the position on the ray that is equal to the fitting radius from the midpoint of the real arc edge line as the fitting center of the corresponding real arc edge line.
[0029] Furthermore, adjusting the fitting center and the fitting radius based on the true edge possibility to obtain a complete iris area includes:
[0030] The fitting circle center includes a fitting circle center abscissa and a fitting circle center ordinate;
[0031] Normalizing the true edge possibility of each true circular arc edge line to obtain a weight coefficient corresponding to the true circular arc edge line, wherein the accumulated value of the weight coefficients of all true circular arc edge lines is equal to 1;
[0032] Based on the weight coefficient, the horizontal coordinates of the fitted center of the corresponding real arc edge line are weighted summed to obtain the horizontal coordinates of the real center of the circle; based on the weight coefficient, the vertical coordinates of the fitted center of the corresponding real arc edge line are weighted summed to obtain the vertical coordinates of the real center of the circle; based on the weight coefficient, the fitted radius of the corresponding real arc edge line is weighted summed to obtain the real radius;
[0033] The position determined by the real circle center abscissa and the real circle center ordinate is taken as the real circle center; the circular area determined by the real circle center and the real radius is taken as the complete iris area.
[0034] Furthermore, the step of enhancing the grayscale values of the pixels in the complete iris region based on the grayscale values of the pixels in the initial iris region to obtain the real iris region of the person to be tested includes:
[0035] Obtaining a filling gray value according to the gray values of all pixels in the initial iris area;
[0036] The pixel points that are in the complete iris area but not in the initial iris area are regarded as the missing pixel points of the complete iris area;
[0037] The grayscale value of the missing pixel is replaced with the filled grayscale value, and the replaced complete iris area is used as the real iris area of the person to be tested.
[0038] Furthermore, obtaining the filling grayscale value according to the grayscale values of all pixels in the initial iris area includes:
[0039] The average grayscale value of all pixels in the initial iris region is used as the filling grayscale value.
[0040] Furthermore, extracting the initial iris region in the grayscale image based on the brightness component value of each pixel in the color space image includes:
[0041] Marking the pixels in the color space image whose brightness component value is less than a preset brightness threshold, and marking the pixels in the corresponding position in the grayscale image;
[0042] Perform a closing operation on the region composed of marked pixels in the grayscale image to obtain the initial iris region.
[0043] The present invention has the following beneficial effects:
[0044] Considering that the prior art cannot obtain the real iris area of the eye of the person to be tested, resulting in poor enhancement effect on the eye image and reducing the accuracy of subsequent strabismus detection, the present invention first converts the eye image into a grayscale image and a color space image. Considering that the brightness difference between the iris, sclera and eyelid is large, the initial iris area in the grayscale image can be preliminarily extracted based on the brightness component value of each pixel in the color space image. Considering that the initial iris area is incomplete due to the occlusion of the eyelid, and the edge line of the initial iris area has a pseudo edge formed by the occlusion of the eyelid, as well as a real edge formed between the iris and the sclera, it is necessary to extract the real Edges are extracted. Considering that the dividing point between the pseudo edge and the real edge is at the junction of the iris, sclera and eyelid where the local grayscale difference is large, the initial edge line can be divided into multiple edge curve segments through the dividing pixel points. Considering that the shape of the iris is close to a circle, the gradient change of the pixels on its real edge is relatively uniform, and the grayscale difference on both sides is large. Therefore, the real edge of the initial iris area, that is, the real arc edge line, can be screened out through the real edge possibility, and the fitting center and fitting radius can be adjusted to obtain an accurate and complete iris area, thereby improving the subsequent enhancement effect of the grayscale value of the pixels in the complete iris area and obtaining a more realistic iris area. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flow chart of an eye image enhancement method for strabismus detection provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0047] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the eye image enhancement method for strabismus detection proposed by the present invention, its specific implementation, structure, features and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.
[0048] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0049] An eye image enhancement method embodiment for strabismus detection:
[0050] A specific scheme of an eye image enhancement method for strabismus detection provided by the present invention is described in detail below with reference to the accompanying drawings.
[0051] See also Figure 1 , which shows a flow chart of an eye image enhancement method for strabismus detection provided by an embodiment of the present invention, the method comprising:
[0052] Step S1: Obtain an eye image of the person to be tested, perform color space conversion on the eye image to obtain a grayscale image and a color space image, and extract an initial iris area in the grayscale image based on the brightness component value of each pixel in the color space image.
[0053] To detect strabismus, it is necessary to analyze the iris image to obtain the detection result. In the prior art, the denoised eye image is usually segmented to extract the iris area of the eye. However, since the iris area of the eye is often blocked by the eyelid, some pixels are missing in the iris area. The actual iris area of the eye of the person to be tested cannot be extracted using the prior art alone, thereby reducing the enhancement effect of the eye image. Therefore, an embodiment of the present invention proposes an eye image enhancement method for strabismus detection to solve this problem.
[0054] In an embodiment of the present invention, an eye image of a person to be tested is first acquired by using an eye imaging device such as a fundus camera. During the shooting process, the head of the person to be tested is ensured to be stable and the ambient light is moderate, so as to obtain a clearer eye image. Since the initially acquired eye image is an RGB image, in order to reduce the amount of calculation for subsequent image processing and improve the processing speed, in one embodiment of the present invention, the acquired eye image is grayed and converted into a single-channel grayscale image. Meanwhile, considering that the color of the iris area in the eye image is close to black and its brightness is relatively low, and the brightness difference between the iris area, the sclera area and the eyelid area is relatively large, in order to more accurately obtain the iris area in the grayscale image, the initially acquired eye image can be converted into other color space images, and the iris area in the grayscale image, i.e., the initial iris area, is preliminarily extracted based on the brightness component value of each pixel in the color space image. Color space conversion is a technical means well known to those skilled in the art and will not be elaborated here.
[0055] Preferably, in one embodiment of the present invention, the HSV color space is selected. Since the brightness of the iris area is relatively small, the pixels in the HSV image whose brightness component values are less than a preset brightness threshold value may be marked, and the pixels at the corresponding positions in the grayscale image may be marked, wherein the brightness component of the pixels in the HSV image is the V component, and its value is in the range of [0,1]. Since there is usually reflection in the iris area, resulting in holes inside the area composed of the marked pixels in the grayscale image, a closing operation may be performed on the area composed of the marked pixels in the grayscale image to remove the holes inside, thereby obtaining the initial iris area in the grayscale image, wherein the preset brightness threshold value may be set to 0.25, and the specific value of the preset brightness threshold value may be set by the implementer according to the specific implementation scenario, and is not limited here. The closing operation is a technical means well known to those skilled in the art and will not be elaborated here.
[0056] It should be noted that in other embodiments of the present invention, other color spaces containing brightness components, such as HSI color space or HSB color space, etc., may also be used, which is not limited here.
[0057] It should be noted that when marking a pixel point, a marking value can be set for the pixel point, and its specific value can be set by the implementer. In one embodiment of the present invention, the marking value of all pixels can be initialized to 0, and the marking value of the pixel point to be marked can be set to 1, then the pixel point with a marking value of 1 represents a marked pixel point.
[0058] Step S2: Perform edge detection on the initial iris area to obtain an initial edge line; obtain boundary pixel points on the initial edge line based on the difference in grayscale values of pixels within a preset neighborhood centered on each pixel on the initial edge line; use the boundary pixel points to divide the initial edge line into different edge curve segments, and obtain the true edge possibility of each edge curve segment based on the change in gradient direction and gradient value of all pixels on each edge curve segment; based on the true edge possibility, screen out the true arc edge line of the initial iris area from all edge curve segments.
[0059] Since the eyelids of the person to be tested will block part of the iris, the initial iris area obtained in the above process is incomplete and some pixels are missing. Considering that the edge of the iris itself is close to a circle, the near-circular features of the iris edge line can be used to perform circular fitting in the subsequent process to obtain a more complete iris area. Therefore, it is first necessary to perform edge detection on the initial iris area obtained above and extract the initial edge line of the initial iris area.
[0060] Preferably, in one embodiment of the present invention, the initial edge line of the initial iris region is extracted using the Canny edge detection algorithm. The Canny edge detection algorithm is a technical means well known to those skilled in the art and will not be described in detail herein.
[0061] Some of the initial edge lines obtained are formed due to the occlusion of the eyelids. This part of the edge line is actually the edge of the eyelid, not the real edge of the iris, that is, the pseudo edge. The other part of the edge line is formed between the iris and the sclera, and is located at the junction of the iris and the sclera. It is the real edge of the iris. In the subsequent process, the real edge of the iris is used for circle fitting to obtain a more realistic iris area. Therefore, it is necessary to extract the real edge of the iris from the initial edge line. Since the initial edge line obtained is a whole, it is necessary to determine the dividing point between the pseudo edge and the real edge, that is, the dividing pixel point. Considering that the dividing pixel point is located between the iris, sclera and The junction of the three eyelids, and the local grayscale difference at the junction of the three is large. Therefore, the boundary pixel point on the initial edge line can be obtained according to the difference in the grayscale value of the pixel points in the preset neighborhood range centered on each pixel point on the initial edge line. In the subsequent process, the initial edge line can be segmented by the boundary point to achieve the independence of the pseudo-edge and the real edge on the initial edge line, which is convenient for distinguishing the pseudo-edge from the real edge, and can more accurately extract the real edge of the iris from the initial edge line. The size of the preset neighborhood range is set to 5×5, and the specific size of the preset neighborhood range can also be set by the implementer according to the specific implementation scenario, which is not limited here.
[0062] Preferably, in one embodiment of the present invention, the method for acquiring the boundary pixel points on the initial edge line specifically includes:
[0063] Since the boundary pixel is located at the junction of the iris, sclera and eyelid, the k-means clustering algorithm with parameter k=3 can be used to cluster all pixels within the preset neighborhood according to the grayscale value of the pixel point, and obtain three first clusters; the absolute value of the difference between the maximum value and the second maximum value of the cluster center in all the first clusters is used as the first difference value, and the absolute value of the difference between the minimum value and the second maximum value of the cluster center in all the first clusters is used as the second difference value, where the cluster center of each first cluster is the average value of the grayscale values of all pixels in the corresponding cluster; the minimum value of the first difference value and the second difference value is normalized to obtain the boundary point possibility of each pixel on the initial edge line. Since the boundary point possibility The larger the probability is, the more likely the corresponding pixel point is to be the demarcation point between the pseudo edge and the real edge. In addition, the embodiment of the present invention believes that there are two types of pixel points on the initial edge line, namely demarcation pixel points and non-demarcation pixel points. Therefore, the k-means clustering algorithm with parameter k=2 can be used. The Euclidean distance of the demarcation point possibility is used as the distance metric. All pixel points on the initial edge line are clustered for the second time according to the demarcation point possibility to obtain two second clustering clusters. The pixel point in the second clustering cluster corresponding to the maximum value of the cluster center in the second clustering cluster is used as the demarcation pixel point, where the cluster center of each second clustering cluster is the average value of the demarcation possibility of all pixel points in the corresponding clustering cluster. The k-means clustering algorithm is a technical means well known to those skilled in the art and will not be described in detail here. The expression of demarcation possibility can be specifically, for example, as follows:
[0064] D z = norm[min(|A z -B z |,|C z -B z |)]
[0065] Among them, D z A represents the boundary possibility of the zth pixel on the initial edge line; z represents the maximum value of cluster centers in all first clusters obtained after clustering the pixels within the preset neighborhood of the z-th pixel on the initial edge line; B z represents the second largest value of the cluster centers in all the first clusters obtained after clustering the pixels within the preset neighborhood of the z-th pixel on the initial edge line; C z represents the minimum value of the cluster centers of all the first clusters obtained after clustering the pixels within the preset neighborhood of the zth pixel on the initial edge line, where A z ≥B z ≥C z ; min() represents the minimum function; norm[] represents the normalization function.
[0066] In the process of obtaining the boundary possibility of each pixel on the initial edge line, the boundary possibility D z The larger the value is, the more likely the corresponding pixel on the initial edge line is to be the boundary point between the pseudo edge and the real edge, i.e., the boundary pixel. Since the boundary pixel is located at the junction of the iris, sclera and eyelid, and the grayscale values of the pixels in the iris, sclera and eyelid regions are quite different, there are three types of grayscale pixels within the preset neighborhood of the boundary pixel. After clustering the pixels within the preset neighborhood of the boundary pixel, the differences in the cluster centers between the three first clusters are large, and the first difference value between the second largest value and the maximum value of the cluster center |A z -B z | Larger, the second difference between the second largest value and the minimum value of the cluster center |C z -B z | is also relatively large, and the non-boundary pixel is located at the junction of the iris and sclera or the junction of the iris and eyelid. Therefore, there are only two types of grayscale pixels in the preset neighborhood of the non-boundary pixel. After clustering the pixels in the preset neighborhood of the non-boundary pixel, the first difference value between the second largest value and the maximum value of the cluster center in the three first clusters is obtained. z -B z | may be smaller, or the second difference between the second largest value and the smallest value of the cluster center |C z -B z | is smaller, so min(|A z -B z |,|C z -B z |) reflects the possibility that the pixel point on the initial edge line is the boundary pixel point, min(|A z -B z |,|C z -B z |) is larger, the more likely the pixel is to be at the junction of the iris, sclera, and eyelid, which means the pixel is more likely to be a boundary pixel. z The larger the value, the easier it is to evaluate and analyze the min(|A z -B z |,|C z -B z |) is normalized and the boundary possibility D z Limited to the range [0, 1].
[0067] In one embodiment of the present invention, the normalization processing can be specifically, for example, maximum and minimum value normalization processing, and the normalization in subsequent steps can all adopt maximum and minimum value normalization processing. In other embodiments of the present invention, other normalization methods can be selected according to the specific range of numerical values, which will not be described in detail.
[0068] In other embodiments of the present invention, pixel points on the initial edge line whose demarcation probability is greater than a preset demarcation threshold can be used as demarcation pixel points. The preset demarcation probability can be set to 0.8, and the specific value of the preset demarcation probability can also be set by the implementer according to the specific implementation scenario, which is not limited here.
[0069] After demarcation pixels are extracted from the initial edge line, the demarcation pixels can be used as segmentation points on the initial edge line, so that the initial edge line can be divided into multiple curve segments, i.e., edge curve segments, by using multiple demarcation pixels, wherein the edge curve segment is a partial curve of the initial edge line, and the edge curve segment includes the real edge and pseudo edge of the iris, and the pseudo edge is not actually the edge of the iris. Therefore, in order to obtain a more accurate and real iris region in the subsequent process, the embodiment of the present invention needs to extract the real edge of the iris, i.e., the real arc edge line, from the edge curve segment. Considering that the shape of the iris is close to a circle, in the grayscale image, the gradient direction of the pixel points on the real edge changes more uniformly than the pseudo edge of the iris, and the pixel points on the real edge are located at the junction of the iris and the sclera. The difference in the grayscale values of the pixel points on both sides of the real edge is greater, and the gradient value of the pixel points on the real edge is greater. Therefore, the gradient direction change and the gradient value of all the pixel points on each edge curve segment can be analyzed, and the possibility of each edge curve segment being the real edge of the iris is reflected by the obtained real edge possibility, so that the real edge of the iris, i.e., the real arc edge line, can be accurately extracted according to the real edge possibility in the subsequent process.
[0070] Preferably, in one embodiment of the present invention, the method for obtaining the true edge possibility of each edge curve segment specifically includes:
[0071] First, the Sobel gradient operator is used to calculate the gradient value and gradient direction of each pixel point on each edge curve segment, and the absolute value of the difference in the gradient direction of any two adjacent pixel points on each edge curve segment is used as the gradient direction change of the adjacent pixel points; the variance of the gradient direction change of all adjacent pixel points is negatively normalized to obtain the circularity of each edge curve segment; the gradient value of each pixel point on each edge curve segment is normalized to obtain the standard gradient value of each pixel point; the average value of the standard gradient values of all pixel points on each edge curve segment is used as the overall gradient of each edge curve segment; the product value of the circularity and the overall gradient is used as the true edge possibility of each edge curve segment. The Sobel gradient operator is a technical means well known to those skilled in the art and will not be described in detail here. The expression of the true edge possibility can be specifically, for example, as follows:
[0072]
[0073] Y i ={Δθ (i,j) |Δθ (i,j) =|θ (i,j) -θ (i,j+1) |, j = 1, 2...w i -1}
[0074] Among them, E i represents the true edge possibility of the i-th edge curve segment; Y i represents the set of gradient direction changes of all adjacent pixels on the i-th edge curve segment; w i Indicates the number of pixels on the i-th edge curve segment; F (i,j) represents the gradient value of the jth pixel on the i-th edge curve segment; Δθ (i,j) Represents the gradient change of the jth adjacent pixel point on the i-th edge curve segment; θ (i,j ) represents the gradient direction of the jth pixel on the i-th edge curve segment; θ (i,j+1) Represents the gradient direction of the j+1th pixel on the i-th edge curve segment, where the j-th pixel and the j+1-th pixel are adjacent pixels. exp[] represents the exponential function with the natural constant e as the base; norm() represents the normalization function; Var() represents the variance function; {|} represents the set symbol; || represents the absolute value.
[0075] In the process of obtaining the true edge probability of each edge curve segment, the true edge probability E iThe larger the value is, the more likely it is that the edge curve segment is the real edge of the iris. The shape of the iris is close to a circle. Therefore, in the grayscale image, compared with the pseudo edge of the iris, the gradient direction of the pixel points on the real edge changes more evenly, and the difference between the gradient direction changes of all adjacent pixels on the real edge is relatively small. Therefore, the set of all gradient direction changes of the real edge is Y i The variance of Var(Y i ) is smaller, the circularity degree exp[-Var(Y i )] is larger, indicating that the edge curve segment is closer to the arc, and further indicating that the edge curve segment is more likely to be the true edge of the iris, and the true edge probability E i The larger the value, the greater the gradient value of the pixel on the real edge. Therefore, the gradient value F of each pixel on the edge curve segment is (i,j) The larger the value is, the more likely the pixel point on the edge curve segment is to be at the junction of the iris and sclera, which means that the edge curve segment is more likely to be the true edge of the iris. i In order to make the true marginal probability E i The value is limited to the range of [0, 1] to facilitate subsequent evaluation and analysis. In one embodiment of the present invention, the gradient value of each pixel on the edge curve segment is normalized to obtain the standard gradient value norm(F (i,j) ), and the average value of the standard gradient values of all pixels on the edge curve segment is taken as the overall gradient of each edge curve segment
[0076] Since the greater the true edge possibility, the more likely the corresponding edge curve segment is to be the true edge of the iris, the true edge of the initial iris area, that is, the true arc edge line, can be screened out from all edge curve segments based on the true edge possibility, so as to facilitate subsequent circle fitting of the true arc edge line to obtain a more complete and accurate iris area, thereby improving the enhancement effect on the eye image.
[0077] Preferably, in one embodiment of the present invention, an edge curve segment whose true edge probability is greater than a preset probability threshold is used as the true arc edge line of the initial iris area. The preset probability threshold is set to 0.8. The specific value of the preset probability threshold can also be set by the implementer according to the specific implementation scenario and is not limited here.
[0078] After the real arc edge line in the initial edge line of the initial iris region is obtained, the real arc edge line is the real edge of the iris, so in the subsequent process, the real arc edge line can be circularly fitted to obtain a complete iris region.
[0079] Step S3: Perform circle fitting on each real arc edge line to obtain the fitting center and fitting radius of each real arc edge line; adjust the fitting center and fitting radius based on the real edge possibility to obtain the complete iris area.
[0080] Since the shape of the iris is close to a circle, the real arc edge line obtained above is closer to an arc. In order to determine a more complete iris area, the real arc edge line can be fitted with a circle to preliminarily obtain the fitting center and fitting radius of each real arc edge line, so as to facilitate the subsequent combination of the fitting center and fitting radius of all the real arc edge lines to further obtain the center and radius corresponding to the complete iris area.
[0081] Preferably, in one embodiment of the present invention, the method for obtaining the fitting center and fitting radius of each real arc edge line specifically includes:
[0082] A two-dimensional coordinate system is established with the lower boundary of the grayscale image as the horizontal axis and the left boundary of the grayscale image as the vertical axis; in the grayscale image, the line between the two end points of each real arc edge line is used as the chord of the corresponding real arc edge line, and the distance between the midpoint of each real arc edge line and the midpoint of the corresponding chord is used as the arch height of the corresponding real arc edge line; the length and arch height of the chord are input into the preset radius calculation equation and solved to obtain the fitting radius of the corresponding real arc edge line; a ray is drawn from the midpoint of each real arc edge line to the direction of the midpoint of the corresponding chord, and the position on the ray whose distance from the midpoint of the real arc edge line is equal to the fitting radius is used as the fitting center of the corresponding real arc edge line.
[0083] Among them, the preset radius calculation formula is:
[0084]
[0085] Among them, r k Represents the fitting radius of the kth true arc edge line, r k is an unknown number; G k represents the length of the chord of the kth true arc edge line; H k Represents the arch height of the kth true arc edge line.
[0086] The length G of the chord of each true arc edge line k and arch height H k Substitute it into the preset radius calculation equation and solve the equation to get the fitting radius r of each real arc edge line. k .
[0087] Based on the fitting radius and fitting center obtained above, the fitting circle corresponding to each real arc edge line can be uniquely determined in the two-dimensional coordinate system. Since there are certain differences in the fitting radius and fitting center of different real arc edge lines, there are certain deviations in the fitting circles corresponding to different real arc edge lines. In order to more accurately obtain the area corresponding to the iris, it is necessary to analyze the fitting radius and fitting center of all real arc edge lines. Since the real edge possibility can also reflect the degree to which the corresponding real arc edge line is close to a circle, the greater the real edge possibility, the less the corresponding real arc edge line is affected by noise points, and the circle fitted by the real arc edge line is closer to the complete iris area. Therefore, the fitting center and fitting radius can be adjusted based on the real edge possibility to obtain the complete iris area. In the subsequent process, the pixel points in the complete iris area can be further filled and enhanced to obtain a more realistic iris area, thereby improving the enhancement effect on the eye image.
[0088] Preferably, in one embodiment of the present invention, the method for acquiring the complete iris region specifically includes:
[0089] In a two-dimensional coordinate system, each fitted circle center includes a fitted circle center horizontal coordinate and a fitted circle center vertical coordinate. The real edge possibility of each real arc edge line is normalized to obtain a weight coefficient of the corresponding real arc edge line, wherein the cumulative value of the weight coefficients of all real arc edge lines is equal to 1; based on the weight coefficient, the fitted circle center horizontal coordinate of the corresponding real arc edge line is weighted and summed to obtain the real circle center horizontal coordinate; based on the weight coefficient, the fitted circle center vertical coordinate of the corresponding real arc edge line is weighted and summed to obtain the real circle center vertical coordinate; based on the weight coefficient, the fitted radius of the corresponding real arc edge line is weighted and summed to obtain the real radius; the position determined by the real circle center horizontal coordinate and the real circle center vertical coordinate is used as the real circle center; the circular area determined by the real circle center and the real radius is used as the complete iris area. The expressions of the real circle center horizontal coordinate, the real circle center vertical coordinate and the real radius can be specifically, for example, as follows:
[0090]
[0091]
[0092]
[0093] Where x′ represents the horizontal coordinate of the true center of the circle; E k represents the true edge possibility of the kth true arc edge line; E n represents the true edge possibility of the nth true arc edge line; x krepresents the horizontal coordinate of the fitted center of the kth true arc edge line; N represents the number of true arc edge lines; y′ represents the vertical coordinate of the true center; y k represents the ordinate of the center of the kth true arc edge line; r′ represents the true radius; r k Represents the fitting radius of the kth true arc edge line.
[0094] In the process of obtaining the true circle center abscissa, true circle center ordinate and true radius, due to the true edge possibility E k It can reflect the degree to which the corresponding real arc edge line is close to a circle, and the real edge possibility E k The larger the value is, the less the corresponding real arc edge line is affected by the noise points, and the circle fitted by the real arc edge line is closer to the complete iris area. Therefore, the real edge possibility of each real arc edge line can be normalized to obtain the weight coefficient of the corresponding real arc edge line. The cumulative value of the true edge probability of all true arc edge lines For E k Normalization is performed. The larger the weight coefficient of the real arc edge line is, the more accurate the horizontal coordinate of the fitted center of the circle corresponding to the real arc edge line is. Therefore, the weight coefficient is used to perform weighted summation on the horizontal coordinate of the fitted center of the circle corresponding to the real arc edge line to obtain a more accurate horizontal coordinate x′ of the real center of the circle. Similarly, the analysis of the vertical coordinate y′ of the real center of the circle and the real radius r′ can refer to the analysis of the horizontal coordinate x′ of the real center of the circle, which will not be repeated here.
[0095] Step S4: Based on the grayscale values of the pixels in the initial iris area, the grayscale values of the pixels in the complete iris area are enhanced to obtain the real iris area of the person to be tested.
[0096] Due to the occlusion of the eyelids, the iris is missing some pixels. The complete iris area obtained by the above process only determines the complete area where the iris is located. There are some pixels in the complete iris area whose grayscale values are greatly different from those of the initial iris area. Therefore, based on the grayscale values of the pixels in the initial iris area, the grayscale values of the pixels in the complete iris area are filled and enhanced to obtain the real iris area of the person to be tested, thereby improving the enhancement effect of the eye image of the person to be tested.
[0097] Preferably, in one embodiment of the present invention, the method for acquiring the real iris area specifically includes:
[0098] The average grayscale value of all pixels in the initial iris area is used as the filling grayscale value; the pixels in the complete iris area but not in the initial iris area are used as the missing pixels of the complete iris area; the grayscale value of the missing pixels is replaced with the filling grayscale value, and the replaced complete iris area is used as the real iris area of the person to be tested, thereby enhancing the iris image of the person to be tested.
[0099] In the embodiment of the present invention, the acquired real iris area of the person to be tested is used for subsequent strabismus detection of the person to be tested.
[0100] In summary, the embodiment of the present invention first performs color space conversion on the eye image of the person to be tested to obtain a grayscale image and a color space image, extracts the initial iris area in the grayscale image based on the brightness component value of each pixel in the color space image, and extracts the initial edge line of the initial iris area, obtains the boundary pixel points on the initial edge line according to the difference in the grayscale values of the pixels within a preset neighborhood range of each pixel on the initial edge line, and then uses the boundary pixel points to divide the initial edge line into different edge curve segments, obtains the real edge possibility of each edge curve segment according to the change in the gradient direction and the gradient value of the pixels on each edge curve segment, selects the real circular arc edge line of the initial iris area based on the real edge possibility, performs circle fitting on each real circular arc edge line, and obtains the fitting center and fitting radius of each real circular arc edge line; adjusts the fitting center and fitting radius based on the real edge possibility to obtain the complete iris area; fills and enhances the missing pixel grayscale values in the complete iris area based on the grayscale values of the pixels in the initial iris area to obtain the real iris area of the person to be tested.
[0101] An embodiment of a method for extracting a complete iris image:
[0102] In the related art, image segmentation technology is usually used to extract the iris image of the eye of the person to be tested. However, when the eye image is captured and collected, part of the iris area will be blocked by the eyelid of the person to be tested, resulting in the inability to extract the complete iris area through the existing image segmentation technology.
[0103] In order to solve this problem, this embodiment provides a method for extracting a complete iris image, including:
[0104] Step S1: obtaining an eye image of the person to be tested, performing color space conversion on the eye image to obtain a grayscale image and a color space image, and extracting an initial iris area in the grayscale image based on the brightness component value of each pixel in the color space image;
[0105] Step S2: performing edge detection on the initial iris region to obtain an initial edge line; obtaining boundary pixel points on the initial edge line according to the difference in grayscale values of pixel points within a preset neighborhood range centered on each pixel point on the initial edge line; dividing the initial edge line into different edge curve segments using the boundary pixel points, and obtaining the true edge possibility of each edge curve segment according to the change in gradient direction and gradient value of all pixel points on each edge curve segment; based on the true edge possibility, screening out the true arc edge line of the initial iris region from all edge curve segments;
[0106] Step S3: Perform circle fitting on each real arc edge line to obtain the fitting center and fitting radius of each real arc edge line; adjust the fitting center and fitting radius based on the real edge possibility to obtain the complete iris area.
[0107] Among them, steps S1 to S3 have been described in detail in the above-mentioned embodiment of an eye image enhancement method for strabismus detection, and will not be repeated here.
[0108] The beneficial effects brought by the present embodiment are as follows: considering that the real iris region of the eye of the person to be tested cannot be obtained in the prior art, the present invention first converts the eye image into a grayscale image and a color space image; considering that the brightness difference between the iris, sclera and eyelid is large, the initial iris region in the grayscale image can be preliminarily extracted based on the brightness component value of each pixel in the color space image; considering that the initial iris region is incomplete due to the occlusion of the eyelid, and the edge line of the initial iris region has a pseudo-edge formed by the occlusion of the eyelid, and a real edge formed between the iris and the sclera, it is necessary to extract the real edge; considering that the dividing point between the pseudo-edge and the real edge is at the junction of the iris, sclera and eyelid where the local grayscale difference is large, the initial edge line can be divided into multiple edge curve segments through the dividing pixel points; considering that the shape of the iris is close to a circle, the gradient change of the pixel points on its real edge is relatively uniform, and the grayscale difference on both sides is large, the real edge of the initial iris region, that is, the real arc edge line, can be screened out through the real edge possibility, and the fitting center and fitting radius are adjusted to obtain an accurate and complete iris region.
[0109] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0110] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
Claims
1. An eye image enhancement method for strabismus detection, characterized in that: The method comprises: Obtain an eye image of the person to be tested, perform color space conversion on the eye image to obtain a grayscale image and a color space image, and extract an initial iris area in the grayscale image based on the brightness component value of each pixel in the color space image; Perform edge detection on the initial iris area to obtain an initial edge line; obtain boundary pixel points on the initial edge line according to the difference in grayscale values of pixel points within a preset neighborhood range centered on each pixel point on the initial edge line; divide the initial edge line into different edge curve segments using the boundary pixel points, and obtain the true edge possibility of each edge curve segment according to the change in gradient direction and gradient value of all pixel points on each edge curve segment; based on the true edge possibility, screen out the true arc edge line of the initial iris area from all edge curve segments; Perform circle fitting on each of the real circular arc edge lines to obtain the fitting circle center and fitting radius of each real circular arc edge line; adjust the fitting circle center and fitting radius respectively based on the real edge possibility to obtain a complete iris area; including: the fitting circle center includes a fitting circle center horizontal coordinate and a fitting circle center vertical coordinate; normalize the real edge possibility of each real circular arc edge line to obtain a weight coefficient of the corresponding real circular arc edge line, wherein the accumulated value of the weight coefficients of all real circular arc edge lines is equal to 1; perform weighted summation on the fitting circle center horizontal coordinate of the corresponding real circular arc edge line based on the weight coefficient to obtain the real circle center horizontal coordinate; perform weighted summation on the fitting circle center vertical coordinate of the corresponding real circular arc edge line based on the weight coefficient to obtain the real circle center vertical coordinate; perform weighted summation on the fitting radius of the corresponding real circular arc edge line based on the weight coefficient to obtain the real radius; take the position determined by the real circle center horizontal coordinate and the real circle center vertical coordinate as the real circle center; take the circular area determined by the real circle center and the real radius as the complete iris area; Based on the grayscale values of the pixels in the initial iris area, the grayscale values of the pixels in the complete iris area are enhanced to obtain the real iris area of the person to be tested.
2. The eye image enhancement method for strabismus detection according to claim 1, characterized in that: The step of obtaining the boundary pixel points on the initial edge line according to the difference in the grayscale values of the pixel points within a preset neighborhood range centered on each pixel point on the initial edge line comprises: Based on the grayscale values of the pixels, all pixels within a preset neighborhood are clustered to obtain a first cluster, where the number of the first cluster is 3; The absolute value of the difference between the maximum value and the second largest value of the cluster center in all the first clusters is taken as the first difference value, and the absolute value of the difference between the minimum value and the second largest value of the cluster center in all the first clusters is taken as the second difference value; Normalizing the minimum value of the first difference value and the second difference value to obtain the demarcation point possibility of each pixel point on the initial edge line; According to the demarcation point possibility, demarcation pixel points are screened out from all pixel points of the initial edge line.
3. The eye image enhancement method for strabismus detection according to claim 2, characterized in that: The step of selecting the boundary pixel points from all the pixel points of the initial edge line according to the boundary point possibility includes: Based on the possibility of the demarcation point, all pixel points on the initial edge line are clustered to obtain a second cluster, where the number of the second cluster is 2; The pixel point in the second cluster corresponding to the maximum value of the cluster center in the second cluster is used as the boundary pixel point.
4. The eye image enhancement method for strabismus detection according to claim 1, characterized in that: The obtaining of the true edge possibility of each edge curve segment according to the change of the gradient direction and the gradient value of all the pixels on each edge curve segment comprises: The absolute value of the difference in the gradient direction between any two adjacent pixels on each edge curve segment is taken as the gradient direction change of the adjacent pixels; The variance of the gradient direction changes of all adjacent pixels is negatively normalized to obtain the circularity of each edge curve segment; Normalize the gradient value of each pixel on each edge curve segment to obtain the standard gradient value of each pixel; take the average value of the standard gradient values of all pixels on each edge curve segment as the overall gradient of each edge curve segment; The product value of the circularity degree and the overall gradient is taken as the true edge possibility of each edge curve segment.
5. The eye image enhancement method for strabismus detection according to claim 1, characterized in that: The step of selecting the true arc edge line of the initial iris region from all edge curve segments based on the true edge possibility comprises: The edge curve segment whose true edge possibility is greater than a preset possibility threshold is used as the true arc edge line of the initial iris region.
6. The eye image enhancement method for strabismus detection according to claim 1, characterized in that: The performing circle fitting on each of the real circular arc edge lines to obtain the fitting center and fitting radius of each real circular arc edge line comprises: In the grayscale image, the line between the two end points of each real arc edge line is taken as the chord line of the corresponding real arc edge line, and the distance between the midpoint of each real arc edge line and the midpoint of the corresponding chord line is taken as the arch height of the corresponding real arc edge line; Input the length of the chord and the arch height into a preset radius calculation equation and solve it to obtain a fitting radius corresponding to the real arc edge line; Draw a ray from the midpoint of each real arc edge line to the midpoint of the corresponding chord line, and take the position on the ray that is equal to the fitting radius from the midpoint of the real arc edge line as the fitting center of the corresponding real arc edge line.
7. The eye image enhancement method for strabismus detection according to claim 1, characterized in that: The step of enhancing the grayscale values of the pixels in the complete iris region based on the grayscale values of the pixels in the initial iris region to obtain the real iris region of the person to be tested comprises: Obtaining a filling grayscale value according to the grayscale values of all pixels in the initial iris area; The pixel points that are in the complete iris area but not in the initial iris area are regarded as the missing pixel points of the complete iris area; The grayscale value of the missing pixel is replaced with the filled grayscale value, and the replaced complete iris area is used as the real iris area of the person to be tested.
8. The eye image enhancement method for strabismus detection according to claim 7, characterized in that: The step of obtaining a filling grayscale value according to the grayscale values of all pixels in the initial iris area comprises: The average grayscale value of all pixels in the initial iris region is used as the filling grayscale value.
9. The eye image enhancement method for strabismus detection according to claim 1, characterized in that: The step of extracting the initial iris region in the grayscale image based on the brightness component value of each pixel in the color space image comprises: Marking the pixels in the color space image whose brightness component value is less than a preset brightness threshold, and marking the pixels in the corresponding position in the grayscale image; Perform a closing operation on the region composed of marked pixels in the grayscale image to obtain the initial iris region.
Citation Information
Patent Citations
Method for selecting qualified iris image from video frequency stream
CN101339603A
Auxiliary eye nursing intelligent control system based on data analysis
CN116999017A