ROI (Region of Interest) multi-angle integral projection pupil detection method and detection system based on YOLO
By adopting YOLO-based ROI region multi-angle integral projection method in pupil detection technology, combining deep learning and geometric feature fitting, the problems of pupil positioning accuracy and robustness in the existing technology are solved, and a more efficient pupil detection effect is achieved.
Patent Information
- Application Number
- CN202510257928.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-05
- Publication Date
- 2025-06-20
AI Technical Summary
In human-computer interaction, the existing pupil detection technology has reduced the accuracy of pupil center positioning, weakened robustness, and difficult to achieve accurate positioning.
The pupil detection method based on YOLO is used to divide the region of interest through deep learning, and combine geometric feature fitting and multi-angle integral projection function to determine the pupil center.
The accuracy and robustness of pupil detection are improved, especially in eye images containing noise and artifacts, and accurate extraction and positioning of pupil sites can be achieved more effectively.
Smart Images

Figure CN120182212A_ABST
Abstract
Description
Background Art
[0002] Pupil detection plays a crucial role in human-computer interaction. However, due to problems such as noise like reflection, blinking, and eyelash occlusion, as well as issues like non-centered pupil position and blurring caused by movement, the accuracy of pupil center localization decreases and the robustness weakens, resulting in great difficulties in accurately locating the pupil.
[0003] When performing rough pupil localization, common methods mainly include methods based on gray information and methods based on pupil geometric feature information. Among them, the method based on gray information mainly utilizes the characteristic that the pupil has a darker color in the iris, and the method based on geometric feature information mainly utilizes the near-circular characteristic of the pupil. With the rapid development of machine learning, pupil center localization algorithms based on machine learning have also emerged, such as Support Vector Machine (SVM), Convolutional Neural Network, etc., which need to learn various characteristics of the pupil through a large number of data sets. When performing precise pupil center localization, it is necessary to utilize the gray, geometric, gradient, edge features, etc. of the pupil. Common algorithms include the gradient vector method, Hough circle transform method, ellipse fitting method, etc. The gradient vector method uses the gradient feature of the pupil in the human eye image to perform pupil center localization. This algorithm has a relatively high accuracy, but it is easily interfered by noise points and has a large computational amount. The Hough circle transform method is based on the fact that the pupil of the human eye is approximately a circle, and then through parameter space transformation, it realizes the precise localization of the pupil center. This algorithm has a very high accuracy and is not easily affected by noise, that is, it has strong anti-noise ability, but its real-time performance is very poor. The ellipse fitting method is based on the edge feature of the pupil, searches for an ellipse passing through or close to the vast majority of edge points, and takes the center of the obtained ellipse as the pupil center. The advantages of this algorithm are small computational amount, accurate localization, and good robustness. Even if the shape of the pupil changes, it can still have a good localization effect, so it is widely used. The disadvantage is that its localization accuracy is greatly affected by the accuracy of pupil edge point extraction. Summary of the Invention
[0004] Aiming at the problems existing in the prior art, this application proposes a multi-angle integral projection pupil detection method and detection system based on ROI of YOLO. First, based on deep learning, it divides the region of interest (ROI) to accurately locate the pupil position, reduces the possibility of false detection, and reduces the computational difficulty. At the same time, for the problem of noise and artifacts in the eye image, an algorithm based on the multi-angle integral projection function is used to obtain the best detection performance.
[0005] In the first aspect, this application provides a multi-angle integral projection pupil detection method based on ROI of YOLO, including the following content:
[0006] S1: Crop the pupil bounding box using YOLO to obtain the ROI region;
[0007] S2: Perform image preprocessing;
[0008] S3: For the preprocessed image, determine whether it is an elliptical shape by fitting through geometric features; if it is determined to be an elliptical shape, execute step S4; if it is determined not to be an elliptical shape, execute step S5;
[0009] S4: First, use the CLAHE algorithm to enhance the image, secondly, use the Canny edge detection algorithm to detect the pupil edge, and then use the Hough transform to fit the pupil;
[0010] S5: Use the multi-angle integral projection function to determine the pupil center.
[0011] In a preferred embodiment, step S1 uses yolov8n to crop the pupil bounding box.
[0012] In a preferred embodiment, the image preprocessing includes image filtering, grayscale conversion, and binarization.
[0013] In a preferred embodiment, in step S4, the CLAHE algorithm avoids local overbrightness or overdarkness by block equalization and contrast limitation; it divides the image into multiple blocks, performs histogram equalization independently on each block to enhance local contrast; the CLAHE algorithm controls the intensity of contrast enhancement through the control parameter clipLimit, and sets the size of the blocks through the control parameter tileGridSize.
[0014] In a preferred embodiment, in step S4, the Canny edge detection algorithm first uses a Gaussian filter to smooth the image; secondly, it calculates the gradient of the image to identify potential edge positions; then it suppresses the gradient amplitude of each pixel to retain the local maximum, thereby refining the edges; further, it uses double-threshold detection to judge edge points.
[0015] In a preferred embodiment, in step S4, the Sobel operator is used to calculate the gradients of the image in the horizontal and vertical directions.
[0016] Furthermore, in step S4, the gradient magnitude G and direction θ are calculated by the following formulas:
[0017]
[0018] where G x represents the gradient of the image in the horizontal direction, and G y represents the gradient of the image in the vertical direction.
[0019] In a preferred embodiment, in step S5, the specific steps for the multi-angle integral projection function to determine the pupil center are as follows:
[0020] S501: Perform connected component labeling on the binary image to identify different connected components in the image and assign a unique label value to each region;
[0021] S502: For each labeled connected component, calculate its centroid. The coordinates (C x , C y ) are calculated by the following formula:
[0022]
[0023] where N represents the number of pixel points in the region, and (x i , y i ) represents the coordinates of each pixel point;
[0024] S503: Determine a line l between the centroid, the starting point, the ending point and the x-axis through the Bresenham algorithm. The clamping of l and the x-axis is θ, and θ is between 0 and 90 degrees;
[0025] S504: Randomly rotate θ by 12 uniformly distributed directions, including 12 angles of 0°, 15°, 30°, 45°, 60°, 75°, 90°, 105°, 120°, 135°, 150°, 165°;
[0026] The integral projection functions in the horizontal and vertical directions are expressed as follows:
[0027]
[0028] In the formula, I(x, y) is the gray value of the pixel at the position (x, y) of the eye image; [x1, x2] and [y1, y2] are the integral intervals in the horizontal and vertical directions;
[0029] Calculate the angular integral projection function in any other direction:
[0030]
[0031] In the formula, θ represents the angle from the line for calculating the integral rotated by 90° to the x-axis; p represents the position on the line or bin of the corresponding histogram; h represents the number of pixels participating in the integral; (x0, y0) represents the starting position of the line for calculating the integral rotated by 90°, and j represents the imaginary unit;
[0032] S505: Determine the histogram thresholds in 12 directions. The threshold set for each histogram represents 20% of the maximum histogram value;
[0033] S506: Use the median line generated by the intersection of the histogram and the threshold as the optimal light ray, corresponding to a section of the interval in the histogram, with 12 thresholds in 12 directions;
[0034] S507: Determine the pupil center within this section of the interval. The coordinates of the pupil center are generated by the intersection of 6 pairs of perpendicular optimal rays;
[0035] S508: The average value of the intersection coordinates of 6 pairs of perpendicular optimal rays is the pupil center coordinate.
[0036] In a preferred embodiment, in step S501, the four-neighborhood gradient function is used to define the adjacency relationship of the connected regions. For each pixel in the image, calculate the difference between the pixel and its four neighboring pixels, obtain the gradient value by summing the differences, and generate a boundary image based on the gradient value to perform the labeling of the connected regions.
[0037] In a second aspect, the present application provides a system for performing the multi-angle integral projection pupil detection method in the ROI region, including:
[0038] A rough positioning unit that uses YOLO to crop the pupil bounding box to obtain the ROI region;
[0039] A preprocessing unit that performs image preprocessing;
[0040] A geometric feature judgment unit that, for the preprocessed image, determines whether it is an elliptical shape by fitting through geometric features;
[0041] A first fine positioning unit that, for an image determined to be an elliptical shape by geometric feature judgment, first uses the CLAHE algorithm to enhance the image, secondly uses the Canny edge detection algorithm to detect the pupil edge, and then uses the Hough transform to fit the pupil;
[0042] A second fine positioning unit that, for an image determined not to be an elliptical shape by geometric feature judgment, uses the multi-angle integral projection function to determine the pupil center.
[0043] Compared with the existing methods, the present application has the following beneficial effects:
[0044] The present application is a pupil detection method from rough to fine, combining deep learning and geometric feature fitting methods. Based on the multi-angle integral projection function, it uses uniformly distributed angles with random offsets, which is more effective for eye images containing artifacts in different directions;
[0045] For the case of uneven and variable illumination conditions, the present application determines the position of the pupil center as the average value of the coordinates of six intersection points. Through experimental verification, this method is feasible and useful;
[0046] This application is applicable to databases with noisy eye images and many artifacts, enabling the precise extraction of the pupil area and improving the accuracy of further pupil detection. Description of the Drawings
[0047] Figure 1 is a flowchart of a multi-angle integral projection pupil detection method for the ROI area based on YOLO provided by an embodiment of this application;
[0048] Figure 2 is a flowchart of determining the pupil center using a multi-angle integral projection function provided by an embodiment of this application;
[0049] Figure 3 is an original image and the ROI area after cropping the pupil bounding box using YOLOv8n provided by an embodiment of this application;
[0050] Figure 4 is a schematic diagram of the pupil edge before and after using canny edge detection provided by an embodiment of this application;
[0051] Figure 5 is a line in a certain direction starting from the centroid during the process of determining the pupil center using a multi-angle integral projection function provided by an embodiment of this application;
[0052] Figure 6 is a schematic diagram of the intersection of a histogram and a threshold provided by an embodiment of this application;
[0053] Figure 7 is a comparison chart of the detection results between a traditional algorithm and a detection method provided by an embodiment of this application. Detailed Embodiments
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings.
[0055] It should be clear that the described embodiments are only part of the embodiments of this application, not all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this application without creative efforts belong to the scope of protection of this application.
[0056] The terms used in the embodiments of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The singular forms "a", "the", and "said" used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0057] In the first aspect, as Figures 1 - 3As shown in the figure, the present application provides a multi-angle integral projection pupil detection method for the ROI region based on YOLO, including the following content:
[0058] S1: Use YOLO to crop the pupil bounding box, obtain the ROI region, and achieve rough localization of the pupil center;
[0059] S2: Perform image preprocessing;
[0060] S3: For the preprocessed image, judge whether it is an elliptical shape by fitting through geometric features; if it is judged to be an elliptical shape, execute step S4; if it is judged not to be an elliptical shape, execute step S5;
[0061] S4: First, use the CLAHE algorithm to enhance the image, make the image clearer by adjusting the contrast, brightness, details, etc. of the image. Secondly, use the Canny edge detection algorithm to detect the pupil edge. Then, use the Hough transform to fit the pupil to achieve fine localization of the pupil center;
[0062] S5: Use the multi-angle integral projection function to determine the pupil center and achieve fine localization of the pupil center.
[0063] Specifically, in step S1, use YOLO to crop the ROI region. The ROI is used to narrow the detection range, thereby improving the detection speed and accuracy; YOLO takes the pupil as the region of interest to better roughly locate the pupil center, which can effectively locate the pupil region and reduce the influence caused by the non-central position of the pupil; then use the judgment method of geometric shape to fit the pupil, which can effectively and quickly accurately locate the pupil; preferably, YOLOv8n can be used for object detection. Figure 2 (a), Figure 2 (b) are respectively the original input image and the ROI region obtained after pupil detection using YOLOv8n. YOLOv8n is a lightweight object detection model, whose model architecture has been optimized and has relatively few parameters, suitable for running on mobile devices or edge computing devices. Although the model is small, YOLOv8n can still provide a high detection speed and can achieve real-time object detection.
[0064] Secondly, the present application uses the public dataset CASIA, a face database composed of visual (VIS), near-infrared (NIR), and three-dimensional (3D) face images, with a total of more than 50,000 original images, including VIS and JPEG formats, NIR images with a size of 640x480, and 3D faces in wrl format; it also involves the public datasets OpenEDS dataset and LPW dataset; use the lablimg annotation tool to annotate the pictures, preferably divided into a training set and a test set according to 7:3 for pre-training; the trained best.pt weight file is used as the model for YOLO cropping and used for subsequent image inference.
[0065] Furthermore, in step S2, the image preprocessing includes image filtering, grayscale conversion, and binarization. Filtering the image can effectively remove noise and smooth the image while retaining strong edge information. Common filters include Gaussian filter, median filter, mean filter, etc. Binarization divides the pixel values in the grayscale image into two categories: black and white, that is, the pixel values are set to 0 (black) or 255 (white). The otsu’s algorithm is used to automatically determine the optimal threshold. The optimal threshold is calculated based on the image grayscale histogram to minimize the between-class variance to distinguish the foreground and background.
[0066] The between-class variance of the otsu’s algorithm is defined as:
[0067]
[0068] where T is the threshold, pixels less than T are foreground pixels, pixels greater than T are background pixels, ω0(T) is the proportion of foreground pixels in the total image pixels, μ0(T) is the average grayscale value of foreground pixels, ω1(T) is the proportion of background pixels in the total image pixels, and μ1(T) is the average grayscale value of background pixels.
[0069] The optimal threshold T is found through the above otsu’s algorithm such that is maximized.
[0070] Furthermore, in step S4, the CLAHE algorithm is used to enhance the image contrast. By block equalization and limiting the contrast, it avoids the problem of local over-brightness or over-darkness. The algorithm divides the image into many small blocks (called "tiles"), and performs histogram equalization independently on each tile to enhance the local contrast. Different from ordinary adaptive histogram equalization, CLAHE applies a contrast limit (clip limit) to each tile to limit the intensity change of some pixels in the histogram and avoid the appearance of over-bright or over-dark areas. The purpose of enhancing the image contrast is specifically achieved by controlling the following two parameters:
[0071] clipLimit: Controls the intensity of contrast enhancement; a smaller value will suppress the enhancement effect, and a larger value will increase the contrast.
[0072] tileGridSize: Sets the size of the divided blocks, usually set to (8,8); larger tiles can retain more global information, while smaller tiles will enhance more local details.
[0073] During the process of refining edges using Canny edge detection, first, a Gaussian filter is used to smooth the image to reduce the impact of noise on edge detection. By calculating the gradient of the image, potential edge positions are identified. Then, the gradient magnitude of each pixel is suppressed, and local maxima are retained to refine the edges. This step is achieved by comparing each pixel with its neighboring pixels in the gradient direction. Figure 3 (a), Figure 3 (b) are schematic diagrams of the pupil edges before and after using Canny edge detection, respectively.
[0074] Among them, the Sobel operator is usually used to calculate the gradients of the image in the horizontal and vertical directions. The gradient magnitude G and direction θ can be calculated by the following formulas:
[0075]
[0076] G x represents the gradient of the image in the horizontal direction, and G y represents the gradient of the image in the vertical direction.
[0077] The Canny algorithm applies two thresholds (a high threshold and a low threshold) to further determine which pixels belong to the edges. Double-threshold detection is used to judge edge points. Strong edges are pixel points greater than the high threshold and are definitely edges. Weak edges are pixel points between the low threshold and the high threshold and may be edges. Non-edges are pixel points less than the low threshold and are judged as non-edges.
[0078] Furthermore, as Figure 4 shown, in step S5, the specific steps for the multi-angle integral projection function to determine the pupil center are as follows:
[0079] S501: Perform connected component labeling on the binary image to identify different connected regions in the image and assign a unique label value to each region. The core idea of connected component labeling is to find all adjacent (connected) pixel blocks that belong to the same object. Specifically, the four-neighborhood gradient function can be used to define the adjacency relationship of the connected regions. For each pixel in the image, calculate the difference between this pixel and its four neighboring pixels. Define the pixel coordinates of the image as (x, y), and its four neighboring pixels are (x - 1, y), (x + 1, y), (x, y + 1). The gradient value is obtained by summing the differences, and the boundary image generated based on the gradient information is used for connected region labeling.
[0080] S502: For each labeled connected region, calculate its centroid. The coordinates of the centroid (C x , C y ) are calculated by the following formula:
[0081]
[0082] Where N represents the number of pixel points in the region, and (x i , y i ) represents the coordinates of each pixel point;
[0083] S503: Determine a line l with an angle θ between the centroid, the starting point, the ending point and the x-axis through the Bresenham algorithm. The coordinates of the points on the line l include the starting point, the ending point, and the centroid. l makes an angle θ with the x-axis, and θ is between 0 and 90 degrees; as Figure 5 shown is the line in a certain direction starting from the centroid during the process of determining the pupil center using the multi-angle integral projection function ("center anchor point" is the centroid);
[0084] S504: Randomly offset θ and rotate in 12 uniformly distributed directions, including 12 angles of 0°, 15°, 30°, 45°, 60°, 75°, 90°, 105°, 120°, 135°, 150°, 165°;
[0085] The integral projection functions in the horizontal and vertical directions are expressed as follows:
[0086]
[0087] In the formula, I(x, y) is the gray value of the pixel at the position (x, y) of the eye image; [x1, x2] and [y1, y2] are the integral intervals in the horizontal and vertical directions;
[0088] Calculate the angular integral projection function in any other direction:
[0089]
[0090] In the formula, θ represents the angle between the line for calculating the integral rotated by 90° and the x-axis; p represents the position on the line or bin of the corresponding histogram; h represents the number of pixels participating in the integral; (x0, y0) represents the starting position of the line for calculating the integral rotated by 90°, and j represents the imaginary unit;
[0091] This application first determines the projection functions in the vertical and horizontal angles and then rotates θ to determine the projection functions in other directions; or randomly offsets θ and then confirms the projection functions in other directions.
[0092] S505: Determine the histogram thresholds in 12 directions. The threshold set for each histogram represents 20% of the maximum histogram value; used to eliminate the noise generated by different artifacts;
[0093] S506: As Figure 6As shown, the median line generated by the intersection of the histogram and the threshold is used as the optimal light, corresponding to a certain interval in the histogram, with 6 thresholds in 6 directions;
[0094] S507: Determine the pupil center within this section of the interval. The coordinates of this pupil center are generated by the intersection of 6 pairs of perpendicular optimal rays;
[0095] S508: The pupil center is recognized as the average value of the coordinates of 6 intersection points generated by the intersection of 6 pairs of perpendicular optimal rays.
[0096] Through the above steps, the present application can effectively suppress noise and pseudo-edges, making the detection result more accurate. The core idea of the angular integral projection function is to project the image from multiple angles and use the projection results to obtain the geometric features of the image or object. Based on 12 angular integral projection functions, using uniformly distributed angles with random offsets, it is more effective to process eye images with artifacts in different directions. For uneven and variable illumination conditions, the position of the pupil center is determined as the average value of the coordinates of two nearest intersection points. It is applicable to databases with noisy eye images and many artifacts, realizing the precise extraction of the pupil part and improving the accuracy of further pupil detection. As Figure 7 (a), 6(b) show the comparison chart of the detection results of the classical algorithm ExCuSe algorithm and the multi-angle integral projection pupil detection method based on YOLO in the ROI region of the present application. It can be seen that the detection result of the present application is more accurate.
[0097] In the second aspect, the present application provides a system for the multi-angle integral projection pupil detection method in the ROI region, including:
[0098] A rough positioning unit, which uses YOLO to crop the pupil bounding box to obtain the ROI region;
[0099] A preprocessing unit, which performs image preprocessing;
[0100] A geometric feature judgment unit, which, for the preprocessed image, judges whether it is an elliptical shape through geometric feature fitting;
[0101] A first fine positioning unit, for the image judged to be an elliptical shape by the geometric feature judgment, first uses the CLAHE algorithm to enhance the image, secondly uses the Canny edge detection algorithm to detect the pupil edge, and then uses the Hough transform to fit the pupil;
[0102] A second fine positioning unit, for the image judged not to be an elliptical shape by the geometric feature judgment, uses the multi-angle integral projection function to determine the pupil center.
[0103] Those skilled in the art of the present application know that the present application can be implemented as a system, a method, or a computer program product. Therefore, the present application can be specifically implemented in the following forms: it can be entirely hardware, entirely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software. The present application is generally referred to as a "module" or a "system". In addition, in some embodiments, the present application can also be implemented in the form of a computer program product in one or more computer-readable media, which contain computer-readable program code.
[0104] The above embodiments are only for illustrating the technical concept and features of the present application, and the purpose is to enable those skilled in the art of this technology to understand the content of the present application and implement it accordingly. It cannot be used to limit the protection scope of the present application. For those of ordinary skill in the art of this technology, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.
Claims
1. A pupil detection method based on YOLO ROI area multi-angle integral projection, characterized in that: It includes the following: S1: Use YOLO to crop the pupil bounding box and obtain the ROI area; S2: perform image preprocessing; S3: for the preprocessed image, fitting is performed through geometric features to determine whether it is an ellipse shape; if it is determined to be an ellipse shape, step S4 is executed; if it is determined not to be an ellipse shape, step S5 is executed; S4: First, the CLAHE algorithm is used to enhance the image, then the Canny edge detection algorithm is used to detect the pupil edge, and then the Hough transform is used to fit the pupil; S5: Determine the pupil center using the multi-angle integral projection function.
2. The ROI area multi-angle integral projection pupil detection method according to claim 1, characterized in that: In step S1, the pupil bounding box is cropped using yolov8n.
3. The ROI area multi-angle integral projection pupil detection method according to claim 1, characterized in that: The image preprocessing includes image filtering, grayscale conversion and binarization.
4. The ROI area multi-angle integral projection pupil detection method according to claim 1, characterized in that: In step S4, the CLAHE algorithm avoids local over-brightness or over-darkness by block equalization and contrast limitation; it divides the image into multiple blocks, performs histogram equalization on each block independently, and enhances the local contrast; the CLAHE algorithm controls the intensity of contrast enhancement by controlling the parameter clipLimit, and sets the size of the block by controlling the parameter tileGridSize.
5. The ROI area multi-angle integral projection pupil detection method according to claim 1, characterized in that: In step S4, the Canny edge detection algorithm first uses a Gaussian filter to smooth the image; secondly, the potential edge position is identified by calculating the gradient of the image; then the gradient amplitude of each pixel is suppressed, the local maximum value is retained, and the edge is refined; and further, dual threshold detection is used to determine the edge point.
6. The ROI area multi-angle integral projection pupil detection method according to claim 5, characterized in that: In step S4, the Sobel operator is used to calculate the gradient of the image in the horizontal and vertical directions.
7. The ROI region multi-angle integral projection pupil detection method according to claim 6, characterized in that: In step S4, the gradient magnitude G and direction θ are calculated by the following formula: Among them, G x Represents the horizontal gradient of the image, G y Represents the vertical gradient of the image.
8. The ROI area multi-angle integral projection pupil detection method according to claim 1, characterized in that: In step S5, the specific steps of determining the pupil center using the multi-angle integral projection function are as follows: S501: marking connected regions of a binary image, identifying different connected regions in the image, and assigning a unique label value to each region; S502: For each marked connected area, calculate its centroid and the coordinates of the centroid (C x ,C y ) is calculated by the following formula: Where N represents the number of pixels in the area, (x i ,y i ) represents the coordinates of each pixel; S503: Determine, by Bresenham algorithm, that the centroid, the starting point, the end point and the x-axis are aligned with a line l, where the angle between l and the x-axis is θ, and θ is between 0 and 90 degrees; S504: randomly shifting θ to rotate 12 evenly distributed directions, including 12 angles of 0°, 15°, 30°, 45°, 60°, 75°, 90°, 105°, 120°, 135°, 150°, and 165°; The integral projection functions in the horizontal and vertical directions are expressed as follows: Where I(x,y) is the grayscale value of the pixel at the position (x,y) from the eye image; [x1,x2], [y1,y2] are the integration intervals in the horizontal and vertical directions; Compute the angle-integrated projection function for any other direction: Where θ represents the angle from the line for calculating the integral rotated 90° to the x-axis; p represents the position on the line or bin of the corresponding histogram; h represents the number of pixels involved in the integration; (x0, y0) represents the starting position of the line for calculating the integral rotated 90°, and j represents the imaginary unit; S505: Determine histogram thresholds in 12 directions, where each threshold set for the histogram represents 20% of the maximum histogram value; S506: taking the median line generated by the intersection of the histogram and the threshold as the best light, corresponding to a section in the histogram, 12 directions and 12 thresholds; S507: Determine the pupil center within the segment, where the coordinates of the pupil center are generated by the intersection of six pairs of perpendicular optimal rays; S508: The average value of the intersection coordinates of the six pairs of perpendicular optimal rays is the pupil center coordinate.
9. The ROI area multi-angle integral projection pupil detection method according to claim 8, characterized in that: In step S501, a four-neighborhood gradient function is used to define the adjacency relationship of the connected area. For each pixel in the image, the difference between the pixel and its four neighboring pixels is calculated, and the gradient value is obtained by summing the differences. The connected area is marked based on the boundary image generated by the gradient value.
10. A system for executing the ROI region multi-angle integral projection pupil detection method according to any one of claims 1 to 9, characterized in that: include: The coarse positioning unit uses YOLO to crop the pupil bounding box and obtain the ROI area; A preprocessing unit, performing image preprocessing; A geometric feature judgment unit, for the preprocessed image, performs fitting through geometric features to judge whether it is an ellipse shape; The first precision positioning unit, for an image whose geometric features are judged to be an ellipse, first uses the CLAHE algorithm to enhance the image, then uses the Canny edge detection algorithm to detect the pupil edge, and then uses the Hough transform to fit the pupil; The second precise positioning unit determines the pupil center by using a multi-angle integral projection function based on the geometric features of the image which is not an ellipse.