A light spot numbering method, system, device and storage medium

By generating an ideal spot position array and numbering sequence, combined with vector angle screening, accurate numbering of spots is achieved, solving the problem of inaccurate numbering in the prior art, and improving the accuracy of line of sight estimation.

CN118797091BActive Publication Date: 2025-02-21NANCHANG VIRTUAL REALITY RES INST CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411267552.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-11
Publication Date
2025-02-21
Estimated Expiration
2044-09-11

AI Technical Summary

Technical Problem

The prior art cannot achieve accurate numbering of light spots, resulting in inaccurate line of sight estimation.

Method used

Through initialization detection, an ideal spot position array and a numbered sequence are generated, an array of spot positions to be numbered is received, a candidate spot numbered sequence is generated, and a spot numbered result sequence is obtained through vector angle screening.

Benefits of technology

Accurate numbering of light spots is achieved, improving the accuracy of line of sight estimation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797091B_ABST
    Figure CN118797091B_ABST
Patent Text Reader

Abstract

The present application provides a method, system, device and storage medium for spot numbering. First, the ideal spot position array and the corresponding ideal spot numbering sequence of each light source are obtained through initialization detection; then a first candidate spot numbering sequence set is generated for the array of spot positions to be numbered; when the number of spots is greater than 1, the coordinates of the spot positions to be numbered and the coordinates of the ideal spot positions are vectorized, the first vector angle between the first spot vector to be numbered and the corresponding first ideal spot vector between two adjacent spot position coordinates to be numbered is calculated, the first candidate spot numbering sequence is screened, and a spot numbering result sequence is obtained. The embodiment of the present application can realize light source numbering of each spot in spot detection through vectorized comparison, and can ensure the accuracy of the spot numbering result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of line of sight tracking technology, and specifically to a light spot numbering method, system, device and storage medium. Background Art

[0002] With the development of science and technology, eye tracking technology has become a hot topic of research. Eye tracking is a technology used to study the movement trajectory of human eyes in visual tasks. It can record the position and duration of the gaze point of human eyes when viewing visual information, and further infer the perception, cognition and decision-making process of human eyes in visual tasks, helping to understand the mechanism of human visual information processing.

[0003] In eye tracking, line of sight estimation is the key, but visual estimation requires the confirmation of the spot number through eye movement spot detection for visual estimation. Spot numbering refers to finding the number of the corresponding light source for a certain spot. The infrared light source forms a spot on the cornea of ​​the eyeball, such as the spot formed by light source No. 1 is spot No. 1. In the prior art, the human eye diagram is usually collected to manually mark the spots, or the position of the spots on the eye diagram is detected or screened by an algorithm. However, it is impossible to number the spots and ensure the accuracy of the numbering results. Summary of the invention

[0004] To this end, the embodiments of the present application provide a light spot numbering method, system, device and storage medium to solve the technical problem that it is impossible to number the light spots and ensure the accuracy of the numbering results in the existing light spot detection.

[0005] In order to achieve the above objectives, the present application provides the following technical solutions:

[0006] According to a first aspect of an embodiment of the present application, an embodiment of the present application provides a method for numbering light spots, the method comprising:

[0007] Initialize and detect the ideal light spot position coordinates of each light source in the light source group to generate a sorted ideal light spot position array and a corresponding ideal light spot number sequence;

[0008] Receiving the sorted array of light spot positions to be numbered, and generating a first candidate light spot number sequence set according to a first preset rule;

[0009] Determine whether the number of light spots in the array of light spot positions to be numbered is greater than 1;

[0010] If the number of light spots in the array of light spot positions to be numbered is greater than 1, a first light spot vector to be numbered between two adjacent light spot position coordinates to be numbered is calculated to obtain a first light spot vector array to be numbered;

[0011] Matching two adjacent spot numbers in each first candidate spot number sequence with the middle light source number of the ideal spot number sequence, calculating the first ideal spot vector corresponding to each first to-be-numbered spot vector, and obtaining the first ideal spot vector array corresponding to each first to-be-numbered spot vector array;

[0012] Calculate the first vector angle between each first spot vector to be numbered and the corresponding first ideal spot vector to obtain a first vector angle array corresponding to each first candidate spot numbering sequence;

[0013] Determine whether the maximum value of the first vector angle in each first vector angle array is greater than a first preset threshold;

[0014] If the maximum first vector angle in the current first vector angle array is greater than a first preset threshold, the corresponding first candidate spot number sequence is deleted;

[0015] If the maximum value of the first vector angle in the current first vector angle array is less than or equal to the first preset threshold, the corresponding first candidate light spot number sequence is retained as the second candidate light spot number sequence;

[0016] Generate a set of second candidate light spot number sequences by using all the reserved second candidate light spot number sequences;

[0017] Determine whether the number of the second candidate light spot number sequence is 1;

[0018] If the number of the second candidate light spot numbering sequence is 1, the second candidate light spot numbering sequence is used as the light spot numbering result sequence corresponding to the current light spot position array to be numbered.

[0019] Furthermore, before determining whether the number of light spots in the array of light spot positions to be numbered is greater than 1, the method further includes:

[0020] Determine whether the original eye diagram corresponding to the array of light spot positions to be numbered is the first frame of collected eye diagram;

[0021] If the original eye diagram corresponding to the array of light spot positions to be numbered is not the first frame of collected eye diagram, forming an original eye diagram pair using the current original eye diagram and the previous frame of original eye diagram;

[0022] Based on the original eye diagram pair, detecting whether the target human eye is in a first gaze state;

[0023] If the target human eye is in the first gaze state, the spot numbering result sequence of the original eye image of the previous frame is directly referenced as the spot numbering result sequence corresponding to the current array of spot positions to be numbered;

[0024] If the target human eye is not in the first gaze state, detecting whether the target human eye is in the second gaze state based on the original eye diagram pair;

[0025] If the target human eye is in the second gaze state, the spot numbering result sequence of the original eye image of the previous frame is directly referenced as the spot numbering result sequence corresponding to the current array of spot positions to be numbered;

[0026] If the original eye diagram corresponding to the array of light spot positions to be numbered is the first frame acquisition eye diagram, or the target human eye is not in the second gaze state, it is determined whether the number of light spots in the array of light spot positions to be numbered is greater than 1.

[0027] Further, based on the original eye diagram pair, detecting whether the target human eye is in a first gaze state includes:

[0028] For the original eye diagram pair, obtaining a first pupil center point position coordinate pair;

[0029] Calculating a first difference based on the first pupil center point position coordinate pair;

[0030] using the first difference as first detection information;

[0031] Determine whether the first detection information satisfies a first preset condition, where the first preset condition is that the first difference is less than a second preset threshold;

[0032] If the first detection information satisfies the first preset condition, determining whether the number of light spot numbers in the light spot numbering result sequence of the previous frame of the original eye image is equal to the number of light spots in the current array of light spot positions to be numbered;

[0033] If the number of light spot numbers in the light spot numbering result sequence of the previous frame of the original eye image is equal to the number of light spots in the current array of light spot positions to be numbered, it is determined that the target human eye is in the first gaze state;

[0034] If the first detection information does not meet the first preset condition, or the number of spot numbers in the spot numbering result sequence of the previous frame of the original eye diagram is not equal to the number of spots in the current array of spot positions to be numbered, it is determined that the target human eye is not in the first gaze state.

[0035] Further, based on the original eye diagram pair, detecting whether the target human eye is in the second gaze state includes:

[0036] For the original eye diagram pair, obtaining each pair of coordinate points of the light spot position to be numbered and the total number of pairs of coordinate points of the light spot position to be numbered from the corresponding array of light spot positions to be numbered;

[0037] Calculate the corresponding second difference based on each pair of light spot position coordinate points to be numbered;

[0038] Using each second difference value and the total number of pairs of the position coordinates of the light spots to be numbered as second detection information;

[0039] Determine whether the second detection information satisfies a second preset condition, where the second preset condition is that each second difference is less than a third preset threshold and the total number of the coordinates of the two light spot positions to be numbered is the same;

[0040] If the second detection information satisfies a second preset condition, determining that the target human eye is in a second gaze state;

[0041] If the second detection information does not satisfy the second preset condition, it is determined that the target human eye is not in the second gaze state.

[0042] Furthermore, a method for numbering light spots in an embodiment of the present application further includes:

[0043] If the number of the second candidate light spot number sequences is not 1, determining whether the number of the second candidate light spot number sequences in the second candidate light spot number sequence set is 0;

[0044] If the number of second candidate light spot numbering sequences in the second candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the first light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system;

[0045] Comparing the sizes of the converted coordinates of the positions of the first light spots, and identifying the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule;

[0046] The coordinates of the light spot position to be numbered corresponding to the identified interfering light spot are deleted from the current light spot position array to be numbered to obtain an updated light spot position array to be numbered, and the process is repeated until a first candidate light spot number sequence set is generated according to a first preset rule.

[0047] Furthermore, a method for numbering light spots in an embodiment of the present application further includes:

[0048] Using the numbers of the light sources in the light source group, the storage numbers of the light spot position storage sequences corresponding to the light sources are sequentially set;

[0049] Setting initial values ​​for each spot position storage sequence to construct a typical value spot array;

[0050] Based on each spot number in the spot numbering result sequence, the coordinates of each spot position to be numbered in the spot position array to be numbered are saved to a corresponding storage bit of a corresponding spot position storage sequence in the typical value spot array;

[0051] For each spot position storage sequence, the average value / median value / weighted sum value of all stored values ​​is calculated as the corresponding typical spot position coordinate.

[0052] Furthermore, a method for numbering light spots in an embodiment of the present application further includes:

[0053] If the number of second candidate light spot number sequences in the second candidate light spot number sequence set is not 0, determining whether the number of light spots in the array of light spot positions to be numbered is greater than 2;

[0054] If the number of spots in the array of spots to be numbered is not greater than 2, the number of spots in the array of spots to be numbered is 2, and it is determined whether the spot position storage sequences corresponding to each spot number in each second candidate spot number sequence have typical spot position coordinates that are not initial values;

[0055] If the spot position storage sequences corresponding to each spot number in each second candidate spot number sequence have typical spot position coordinates that are not initial values, then for each second candidate spot number sequence, the third distance between one of the spot position coordinates to be numbered in the array of spot positions to be numbered and the corresponding typical spot position coordinates and the fourth distance between another of the spot position coordinates to be numbered and the corresponding typical spot position coordinates are calculated in sequence;

[0056] Taking the third distance and the fourth distance as a distance error pair, forming a distance error pair array corresponding to the second candidate light spot number sequence set by the distance error pairs corresponding to each second candidate light spot number sequence;

[0057] The spot numbers in the second candidate spot number sequence corresponding to the third maximum distance value and the fourth maximum distance value in the distance error pair array are used as the first spot number and the second spot number respectively;

[0058] Determining whether the first light spot sequence number is equal to the second light spot sequence number;

[0059] If the first spot number is not equal to the second spot number, the third maximum distance value and the fourth maximum distance value are compared, the distance error pair corresponding to the larger value is deleted from the distance error pair array, and the second candidate spot number sequence corresponding to the larger value is deleted from the second candidate spot number sequence set, and the loop is repeated until it is determined whether the number of the second candidate spot number sequence is 1;

[0060] If the first light spot number is equal to the second light spot number, determining whether the number of the current second candidate light spot number sequence is greater than 2;

[0061] If the number of the current second candidate spot number sequences is greater than 2, the second candidate spot number sequences corresponding to the first spot number and the second spot number are deleted from the second candidate spot number sequence set, and the distance error pair corresponding to the first spot number and the second spot number is deleted from the distance error pair array, and the process is repeated until it is determined whether the number of the second candidate spot number sequences is 1;

[0062] If the number of the current second candidate spot number sequence is not greater than 2, the number of the current second candidate spot number sequence is equal to 2, and the fifth distance between the position coordinates of the two spots to be numbered and the sixth distance between the typical spot position coordinates corresponding to the two spot numbers in each second candidate spot number sequence are calculated;

[0063] Calculating a ratio of the fifth distance divided by the sixth distance to obtain a corresponding first error reference ratio;

[0064] retaining a second candidate light spot number sequence corresponding to a first error reference ratio closer to 1;

[0065] The finally retained second candidate spot number sequence is used as the spot number result sequence corresponding to the current array of spot positions to be numbered, and a loop is performed to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the array of spot positions to be numbered.

[0066] Furthermore, a light spot detection method disclosed in an embodiment of the present application also includes:

[0067] If there is a spot position storage sequence corresponding to a spot number in each second candidate spot number sequence that has only an initial value, directly calculate the fifth distance between the coordinates of the two spots to be numbered and the seventh distance between the coordinates of the two ideal spot positions in the ideal spot position array corresponding to the two spot numbers in each second candidate spot number sequence;

[0068] Calculating a ratio of the fifth distance divided by the seventh distance to obtain a corresponding second error reference ratio;

[0069] Calculate the absolute value error between each second error reference ratio and 1;

[0070] Determining whether the absolute value error is greater than a fourth preset threshold;

[0071] If the absolute value error is greater than a fourth preset threshold, deleting the corresponding second candidate spot number sequence;

[0072] If the absolute value error is less than or equal to a fourth preset threshold, retaining the corresponding second candidate light spot number sequence as a third candidate light spot number sequence;

[0073] Using all the reserved third candidate light spot number sequences, a third candidate light spot number sequence set is generated;

[0074] Determine whether the number of the third candidate light spot number sequence is 1;

[0075] If the number of the third candidate spot numbering sequence is 1, the third candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and the process is looped to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the array of spot positions to be numbered.

[0076] Furthermore, a light spot detection method disclosed in an embodiment of the present application also includes:

[0077] If the number of the third candidate light spot number sequences is not 1, determining whether the number of the third candidate light spot number sequences in the third candidate light spot number sequence set is 0;

[0078] If the number of the third candidate light spot numbering sequences in the third candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the second light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system;

[0079] Comparing the sizes of the converted coordinates of the positions of the second light spots, and identifying the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule;

[0080] The coordinates of the light spot position to be numbered corresponding to the identified interfering light spot are deleted from the current light spot position array to be numbered to obtain an updated light spot position array to be numbered, and the process is repeated until a first candidate light spot number sequence set is generated according to a first preset rule.

[0081] Furthermore, a method for numbering light spots disclosed in an embodiment of the present application also includes:

[0082] If the number of the third candidate light spot numbering sequences in the third candidate light spot numbering sequence set is not 0, calculating the second center point position coordinates between the two to-be-numbered light spot position coordinates and the first pupil center position coordinates of the original eye image;

[0083] Calculate a first center point vector from the first pupil center position coordinate to the second center point position coordinate;

[0084] For the third candidate spot number sequence set, calculate the third center point position coordinates between two ideal spot position coordinates corresponding to two spot numbers in each third candidate spot number sequence and the ideal pupil center position coordinates between each ideal spot position coordinates;

[0085] Calculate the second center point vector from the ideal pupil center position coordinate to each third center point position coordinate;

[0086] Calculating a third vector angle between the first center point vector and each second center point vector;

[0087] Selecting the absolute value error, the second vector angle, and the third vector angle corresponding to each third candidate spot number sequence as the first scoring indicator;

[0088] Assigning a corresponding first preset weight to each first scoring indicator, and obtaining a first comprehensive score corresponding to each third candidate light spot number sequence through weighted calculation;

[0089] A third candidate spot numbering sequence with the lowest first comprehensive score is selected as the spot numbering result sequence, and a loop is performed to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

[0090] Furthermore, a method for numbering light spots in an embodiment of the present application further includes:

[0091] If the number of light spots in the array of light spot positions to be numbered is greater than 2, a second light spot vector to be numbered between any two light spot position coordinates to be numbered is calculated to obtain a second light spot vector array to be numbered;

[0092] Matching any two spot numbers in each second candidate spot numbering sequence with the middle light source number of the ideal spot numbering sequence, calculating the second ideal spot vector corresponding to each second spot vector to be numbered, and obtaining the second ideal spot vector array corresponding to the second spot vector array to be numbered;

[0093] Calculate the second vector angle between each second to-be-numbered light spot vector and the corresponding second ideal light spot vector to obtain a second vector angle array corresponding to each second candidate light spot numbering sequence;

[0094] Determine whether the maximum value of the second vector angle in each second vector angle array is greater than a fifth preset threshold;

[0095] If the maximum value of the second vector angle in the current second vector angle array is greater than the fifth preset threshold, the corresponding second candidate spot number sequence is deleted;

[0096] If the maximum value of the second vector angle in the current second vector angle array is less than or equal to the fifth preset threshold, the corresponding second candidate light spot number sequence is retained as the fourth candidate light spot number sequence;

[0097] Using all the retained fourth candidate light spot number sequences, a fourth candidate light spot number sequence set is generated;

[0098] Determine whether the number of the fourth candidate light spot number sequence is 1;

[0099] If the number of the fourth candidate spot numbering sequence is 1, the fourth candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and the process is looped to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the array of spot positions to be numbered.

[0100] Furthermore, a method for numbering light spots in an embodiment of the present application further includes:

[0101] If the number of the fourth candidate light spot number sequences is not 1, determining whether the number of the fourth candidate light spot number sequences in the fourth candidate light spot number sequence set is 0;

[0102] If the number of fourth candidate light spot numbering sequences in the fourth candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the third light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system;

[0103] Comparing the sizes of the converted coordinates of the positions of the third light spots, and identifying the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule;

[0104] The coordinates of the light spot position to be numbered corresponding to the identified interfering light spot are deleted from the current light spot position array to be numbered to obtain an updated light spot position array to be numbered, and the process is repeated until a first candidate light spot number sequence set is generated according to a first preset rule.

[0105] Furthermore, a method for numbering light spots in an embodiment of the present application further includes:

[0106] If the number of fourth candidate light spot numbering sequences in the fourth candidate light spot numbering sequence set is not 0, calculating the candidate light spot side lengths of each second light spot vector to be numbered to obtain a corresponding candidate light spot side length array;

[0107] Calculate the ideal spot side lengths of the second ideal spot vectors corresponding to the second to-be-numbered spot vectors in each second ideal spot vector array, and obtain an ideal spot side length array corresponding to each fourth candidate spot number sequence;

[0108] Calculate the spot side length ratio of each ideal spot side length in each ideal spot side length array divided by the corresponding candidate spot side length to obtain a spot side length ratio array corresponding to each fourth candidate spot number sequence;

[0109] Select the corresponding maximum value and minimum value of the spot side length ratio from each spot side length ratio array;

[0110] Calculate the first extreme value ratio of the maximum value of each spot side length ratio divided by the minimum value of the corresponding spot side length ratio;

[0111] Determine whether each first extreme value ratio is greater than a sixth preset threshold;

[0112] If the current first extreme value ratio is greater than the sixth preset threshold, the corresponding fourth candidate spot number sequence is deleted;

[0113] If the current first extreme value ratio is less than or equal to the sixth preset threshold, the corresponding fourth candidate light spot number sequence is retained as the fifth candidate light spot number sequence;

[0114] Using all the retained fifth candidate light spot number sequences, a fifth candidate light spot number sequence set is generated;

[0115] Determine whether the number of the fifth candidate light spot number sequence is 1;

[0116] If the number of the fifth candidate spot numbering sequence is 1, the fifth candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and the cycle is repeated based on each spot number in the spot numbering result sequence, and the coordinates of each spot position to be numbered in the array of spot positions to be numbered are saved to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array.

[0117] Furthermore, a method for numbering light spots disclosed in an embodiment of the present application also includes:

[0118] If the number of the fifth candidate light spot number sequences is not 1, determining whether the number of the fifth candidate light spot number sequences in the fifth candidate light spot number sequence set is 0;

[0119] If the number of the fifth candidate light spot numbering sequences in the fifth candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the fourth light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system;

[0120] Comparing the sizes of the converted coordinates of the positions of the fourth light spots, and identifying the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule;

[0121] The coordinates of the position of the light spot to be numbered corresponding to the identified interfering light spot are deleted from the current array of light spot positions to be numbered, so as to obtain an updated array of light spot positions to be numbered;

[0122] According to the number of spots corresponding to the updated array of spots positions to be numbered, all sorting sequences corresponding to all light source numbers are regenerated and stored as updated first candidate spot numbering sequences as an updated first candidate spot numbering sequence set.

[0123] Furthermore, a method for numbering light spots disclosed in an embodiment of the present application also includes:

[0124] If the number of the fifth candidate light spot numbering sequences in the fifth candidate light spot numbering sequence set is not 0, calculating the inner angle of the light spot to be numbered between two adjacent second light spot vectors to be numbered to obtain an array of inner angles of the light spot to be numbered;

[0125] Calculate the ideal spot inner angle between two adjacent second spot vectors to be numbered in each second ideal spot vector array to obtain an ideal spot inner angle array corresponding to each fifth candidate spot number sequence;

[0126] Calculate the third difference between each of the to-be-numbered light spot inner angles and the corresponding ideal light spot inner angle in each ideal light spot inner angle array, and obtain a third difference array corresponding to each fifth candidate light spot numbering sequence;

[0127] Obtain the maximum third difference value corresponding to each third difference value array;

[0128] Selecting the maximum value of the second vector angle, the first extreme value ratio, and the third difference maximum value corresponding to each fifth candidate spot number sequence as the second scoring index;

[0129] Assigning a corresponding second preset weight to each second scoring indicator, and obtaining a second comprehensive score corresponding to each fifth candidate light spot number sequence through weighted calculation;

[0130] A fifth candidate spot numbering sequence with the lowest second comprehensive score is selected as the spot numbering result sequence, and a loop is performed to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

[0131] Furthermore, a method for numbering light spots disclosed in an embodiment of the present application also includes:

[0132] If the number of spots in the array of spots to be numbered is not greater than 1, the number of spots in the array of spots to be numbered is 1, and it is determined whether there is a spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array;

[0133] If there is no spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array, the current array of spot positions to be numbered is not numbered, and the process is looped to process the array of spot positions to be numbered corresponding to the next frame of the original eye diagram;

[0134] If there is a spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array, the spot number of the spot position storage sequence corresponding to the typical spot position coordinates closest to the current spot position coordinates to be numbered is selected to obtain the corresponding spot number result sequence, and the cycle is repeated based on each spot number in the spot number result sequence to save each to-be-numbered spot position coordinate in the to-be-numbered spot position array to the corresponding storage bit of the spot position storage sequence in the typical value spot array.

[0135] According to a second aspect of an embodiment of the present application, a spot numbering system is provided, for executing the steps in a spot numbering method as described in any one of the above items, the system comprising:

[0136] An initialization module is used to initialize and detect the ideal light spot position coordinates of each light source in the light source group, and generate a sorted ideal light spot position array and a corresponding ideal light spot number sequence;

[0137] A generating module, configured to receive the sorted array of light spot positions to be numbered, and generate a first candidate light spot numbering sequence set according to a first preset rule;

[0138] A screening module that performs the following steps:

[0139] Determine whether the number of light spots in the array of light spot positions to be numbered is greater than 1;

[0140] If the number of light spots in the array of light spot positions to be numbered is greater than 1, a first light spot vector to be numbered between two adjacent light spot position coordinates to be numbered is calculated to obtain a first light spot vector array to be numbered;

[0141] Matching two adjacent spot numbers in each first candidate spot number sequence with the middle light source number of the ideal spot number sequence, calculating the first ideal spot vector corresponding to each first to-be-numbered spot vector, and obtaining the first ideal spot vector array corresponding to each first to-be-numbered spot vector array;

[0142] Calculate the first vector angle between each first spot vector to be numbered and the corresponding first ideal spot vector to obtain a first vector angle array corresponding to each first candidate spot numbering sequence;

[0143] Determine whether the maximum value of the first vector angle in each first vector angle array is greater than a first preset threshold;

[0144] If the maximum first vector angle in the current first vector angle array is greater than a first preset threshold, the corresponding first candidate spot number sequence is deleted;

[0145] If the maximum value of the first vector angle in the current first vector angle array is less than or equal to the first preset threshold, the corresponding first candidate light spot number sequence is retained as the second candidate light spot number sequence;

[0146] Generate a set of second candidate light spot number sequences by using all the reserved second candidate light spot number sequences;

[0147] The output module is used to determine whether the number of the second candidate spot numbering sequence is 1; if the number of the second candidate spot numbering sequence is 1, the second candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered.

[0148] Furthermore, a spot numbering system disclosed in an embodiment of the present application further includes: a storage module, configured to perform the following steps:

[0149] Using the numbers of the light sources in the light source group, the storage numbers of the light spot position storage sequences corresponding to the light sources are sequentially set;

[0150] Setting initial values ​​for each spot position storage sequence to construct a typical value spot array;

[0151] Based on each spot number in the spot numbering result sequence, the coordinates of each spot position to be numbered in the spot position array to be numbered are saved to a corresponding storage bit of a corresponding spot position storage sequence in the typical value spot array;

[0152] For each spot position storage sequence, the average value / median value / weighted sum value of all stored values ​​is calculated as the corresponding typical spot position coordinate.

[0153] According to a third aspect of an embodiment of the present application, a light spot numbering device is provided, the device comprising: a processor and a memory;

[0154] The memory is used to store one or more program instructions;

[0155] The processor is used to run one or more program instructions to execute the steps of a light spot numbering method as described in any one of the above items.

[0156] According to a fourth aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of a spot numbering method as described in any one of the above items are implemented.

[0157] Compared with the prior art, the spot numbering method, system, device and storage medium provided in the embodiment of the present application first obtain the ideal spot position array and the corresponding ideal spot numbering sequence of each light source through initialization detection; then generate a first candidate spot numbering sequence set for the array of spot positions to be numbered; when the number of spots is greater than 1, the coordinates of the spot positions to be numbered and the coordinates of the ideal spot positions are vectorized, the first spot vector to be numbered between the coordinates of the two adjacent spot positions to be numbered and the first vector angle between the corresponding first ideal spot vector are calculated, the first candidate spot numbering sequence is screened, and the spot numbering result sequence is obtained. The embodiment of the present application can realize the light source numbering of each spot in the spot detection through vectorized comparison, and can ensure the accuracy of the spot numbering result. BRIEF DESCRIPTION OF THE DRAWINGS

[0158] In order to more clearly illustrate the implementation methods of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings in the following description are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0159] The structures, proportions, sizes, etc. illustrated in this specification are only used to match the contents disclosed in the specification so as to facilitate understanding and reading by persons familiar with the technology. They are not used to limit the conditions under which the present invention can be implemented, and therefore have no substantial technical significance. Any structural modification, change in proportion or adjustment of size shall still fall within the scope of the technical contents disclosed in the present invention without affecting the effects and purposes that can be achieved by the present invention.

[0160] Figure 1 A schematic diagram of the logical structure of a spot numbering system provided by an embodiment of the present application;

[0161] Figure 2 A schematic diagram of a process of a light spot numbering method provided in one embodiment of the present application;

[0162] Figure 3 A schematic flow chart of a spot numbering method provided in another embodiment of the present application;

[0163] Figure 4 A schematic diagram of a process for detecting whether a target human eye is in a first gaze state based on an original eye diagram provided in an embodiment of the present application;

[0164] Figure 5 A schematic diagram of a process for detecting whether a target human eye is in a second gaze state based on an original eye diagram provided in another embodiment of the present application;

[0165] Figure 6 A schematic diagram of a flow chart of filtering out the coordinates of the light spot positions to be numbered corresponding to the interfering light spots from the light spot positions to be numbered array when the number of the second candidate light spot numbering sequence is 0, provided for one embodiment of the present application;

[0166] Figure 7 A schematic diagram of a process for constructing a method for storing the position coordinates of light spots to be numbered based on a light spot numbering result sequence provided in one embodiment of the present application;

[0167] Figure 8 A schematic flow chart of a spot numbering method provided in another embodiment of the present application;

[0168] Fig. 9 A schematic flow chart of a spot numbering method provided in another embodiment of the present application;

[0169] Fig.10 A schematic flow chart of a spot numbering method provided in another embodiment of the present application;

[0170] Fig.11 A schematic flow chart of a spot numbering method provided in another embodiment of the present application;

[0171] Fig.12 A schematic flow chart of a spot numbering method provided in another embodiment of the present application;

[0172] Fig.13 A schematic flow chart of a spot numbering method provided in another embodiment of the present application;

[0173] Fig.14A flowchart of a spot numbering method provided in accordance with another embodiment of the present application. DETAILED DESCRIPTION

[0174] The following is a description of the implementation of the present invention by specific embodiments. People familiar with the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0175] The purpose of this application is to: after performing spot position detection on the original eye diagram to obtain a spot position array, use the spot position array as the spot position array to be numbered, and how to number the spots in the spot position array to be numbered and ensure the accuracy of the numbering results.

[0176] In order to solve the above technical problems, Figure 1 As shown, an embodiment of the present application provides a light spot numbering system, which is used to implement interference light spot screening.

[0177] Specifically, a light spot numbering system provided in an embodiment of the present application includes: an initialization module 1, a generation module 2, a screening module 3, and an output module 4.

[0178] Furthermore, the initialization module 1 is used to perform initialization detection on the ideal light spot position coordinates of each light source of the light source group, and generate a sorted ideal light spot position array and a corresponding ideal light spot number sequence.

[0179] Furthermore, the generating module 2 is used to receive the sorted array of light spot positions to be numbered, and generate a first candidate light spot numbering sequence set according to a first preset rule.

[0180] Further, the screening module 3 is used to perform the following steps: determine whether the number of spots in the array of spots to be numbered is greater than 1; if the number of spots in the array of spots to be numbered is greater than 1, calculate the first spot vector to be numbered between the coordinates of two adjacent spots to be numbered to obtain a first spot vector array to be numbered; match the two adjacent spot numbers in each first candidate spot numbering sequence with the light source number in the ideal spot numbering sequence, calculate the first ideal spot vector corresponding to each first spot vector to be numbered, and obtain the first ideal spot vector array corresponding to each first spot vector array to be numbered; calculate the first spot vector to be numbered and the corresponding first ideal spot vector array; The first vector angle between the light spot vectors is obtained to obtain the first vector angle array corresponding to each first candidate light spot numbering sequence; whether the maximum value of the first vector angle in each first vector angle array is greater than the first preset threshold value; if the maximum value of the first vector angle in the current first vector angle array is greater than the first preset threshold value, the corresponding first candidate light spot numbering sequence is deleted; if the maximum value of the first vector angle in the current first vector angle array is less than or equal to the first preset threshold value, the corresponding first candidate light spot numbering sequence is retained as the second candidate light spot numbering sequence; using all the retained second candidate light spot numbering sequences, a second candidate light spot numbering sequence set is generated;

[0181] Furthermore, the output module 4 is used to determine whether the number of the second candidate spot numbering sequence is 1; if the number of the second candidate spot numbering sequence is 1, the second candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered.

[0182] Furthermore, a spot numbering system disclosed in an embodiment of the present application also includes: a storage module 5, which is used to perform the following steps: using the respective light source numbers in the light source group, sequentially setting the storage numbers of the spot position storage sequences corresponding to the respective light sources; setting initial values ​​for the respective spot position storage sequences, and constructing a typical value spot array; based on the respective spot numbers in the spot numbering result sequence, saving the position coordinates of the respective spots to be numbered in the spot position array to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array; for each spot position storage sequence, calculating the average value / median value / weighted sum value of all stored values ​​as the corresponding typical spot position coordinates.

[0183] Compared with the prior art, the spot numbering system provided by the embodiment of the present application first obtains the ideal spot position array of each light source and the corresponding ideal spot numbering sequence through initialization detection; then generates a first candidate spot numbering sequence set for the array of spot positions to be numbered; when the number of spots is greater than 1, the coordinates of the spot positions to be numbered and the coordinates of the ideal spot positions are vectorized, the first vector angle between the first spot vector to be numbered and the corresponding first ideal spot vector between two adjacent spot position coordinates to be numbered is calculated, the first candidate spot numbering sequence is screened, and the spot numbering result sequence is obtained. The embodiment of the present application can realize the light source numbering of each spot in the spot detection through vectorized comparison, and can ensure the accuracy of the spot numbering result.

[0184] Corresponding to the above-disclosed light spot numbering system, the present application embodiment further discloses a light spot numbering method. The following describes in detail a light spot numbering method disclosed in the present application embodiment in combination with the above-described light spot numbering system.

[0185] like Figure 2 As shown, the specific steps of a light spot numbering method provided in an embodiment of the present application are described in detail below.

[0186] The initialization module 1 performs initialization detection on the ideal light spot position coordinates of each light source in the light source group to generate a sorted ideal light spot position array and a corresponding ideal light spot number sequence.

[0187] In one embodiment of the present application, the coordinates of the ideal spot position of each light source can be obtained from a frame of the original eye diagram, which is a grayscale image of the eye captured by a camera. For example, the target person can wear a head-mounted display device, and a predetermined number of light sources are arranged near the left and right eye optical lenses of the head-mounted display device. If the predetermined number can be 8 or 10, then 8 or 10 light sources are distributed in a circle around the left eye optical lens, and a camera is located directly below or diagonally below the left eye optical lens, and the camera is close to the cheek. Similarly, 8 or 10 light sources are distributed in a circle around the right eye optical lens, and a camera is located directly below or diagonally below the right eye optical lens, and the camera is close to the cheek. By collecting an eye diagram for a single target human eye (left eye or right eye), the above-mentioned original eye diagram can be obtained.

[0188] The corresponding light spots on the original eye diagram are detected and their positions are obtained. The original eye diagram requires that the light spots formed by all light sources appear on the cornea. For example, if the light source group has 8 light sources in total, the original eye diagram is required to have 8 correct light spots, and the 8 light spot position coordinates obtained in this way are the light spot position coordinates.

[0189] By sticking opaque tape on the light source, take pictures again to get an original eye diagram. Assuming that light source No. 1 is stuck, it can be confirmed that the light spot that exists in the first original eye diagram and disappears in the second original eye diagram is light spot No. 1. There are some differences in the eye diagrams collected by the same person at different times, but the distribution trend of the light spot position is the same, so by comparing the above two original eye diagrams, the correct ideal light spot position coordinates of each light source and the corresponding light source number can be effectively obtained. In this way, the ideal light spot position coordinates and the corresponding light source numbers corresponding to other light sources can be confirmed in turn, and the ideal light spot position coordinates of each ideal light spot are obtained in a clockwise or counterclockwise order. The coordinates are matched with the light source number in turn, and the ideal light spot position array and the corresponding ideal light spot number sequence are generated.

[0190] Taking the light source group with 8 light sources as an example, the ideal light spot position array obtained by the above initialization detection is recorded as U_idea, and the array size N of U_idea is the number of light spots, that is, N is equal to 8. At this time, the ideal light spot number sequence corresponding to the ideal light spot position array U_idea is [1 2 3 4 5 6 7 8], that is, the number of the i-th ideal light spot position coordinate U_idea(i) is i.

[0191] The generating module 2 receives the sorted array of light spot positions to be numbered, and generates a first candidate light spot numbering sequence set according to a first preset rule.

[0192] In the embodiment of the present application, the coordinates of the light spot positions to be numbered in the received array of light spot positions to be numbered are also sorted in a clockwise or counterclockwise order, and the sorting order is consistent with the sorting order of the ideal light spot position coordinates in the ideal light spot position array. Further, the first preset rule is to generate all non-repeating sorting sequences corresponding to all light source numbers according to the number of light spots corresponding to the array of light spot positions to be numbered, and store them as the first candidate light spot numbering sequence as the first candidate light spot numbering sequence set. In addition, the above sorting sequence is sorted in a clockwise or counterclockwise order.

[0193] Further, the above steps specifically include: taking all light source numbers as objects, obtaining all non-repeating light source number sorting sequences with the same number as the number of light spots corresponding to the light spot position array to be numbered in the same sorting order as in the initialization detection, as the first candidate light spot number sequences. For example, taking the number of light sources as 8 and the clockwise sorting order as an example, the light spot position array to be numbered is denoted as glints, a generated corresponding first candidate light spot number sequence is denoted as glints_id, and the number of light spots corresponding to the light spot position array to be numbered is denoted as n. When the number of light spots n is 1, a total of 8 non-repeating first candidate light spot number sequences are generated, which are [1], [2], [3], [4], [5], [6], [7], [8]. When the number of light spots n is 2, 56 non-repeating first candidate light spot number sequences are generated, such as [1,2], [1,5], [2,1], [2,8], [7,1], etc. Among them, the light source numbers in each first candidate light spot number sequence will not appear twice. When the number of light spots n is 3, only sequential serial numbers are generated, and they are also sorted in clockwise order. In the same first candidate light spot number sequence, the same light source number will not repeat, and the (i + 1)-th light source number glints_id(i + 1) is greater than the i-th light source number glints_id(i), or only once in a first candidate light spot number sequence, the (i + 1)-th light source number glints_id(i + 1) is less than the i-th light source number glints_id(i), where i < n. Taking N = 8 and n = 6 as an example, such as the following first candidate light spot number sequences generated: [1 3 4 5 6 7], [3 4 5 6 7 8], the (i + 1)-th light source number glints_id(i + 1) is greater than the i-th light source number glints_id(i). Such as the following first candidate light spot number sequences generated: [5 6 7 8 1 2], [4 5 6 7 1 3], [8 1 2 3 4 5], only once the (i + 1)-th light source number glints_id(i + 1) is less than the i-th light source number glints_id(i), and the rest satisfy that the (i + 1)-th light source number glints_id(i + 1) is greater than the i-th light source number glints_id(i). Store all the first candidate light spot number sequences generated according to the above method in the structure possibility[n].sequence to obtain the first candidate light spot number sequence set in the case of n light spots to be numbered.

[0194] The screening module 3 performs the following steps: determining whether the number of spots in the array of spots to be numbered is greater than 1; if the number of spots in the array of spots to be numbered is greater than 1, calculating the first spot vector to be numbered between two adjacent spot position coordinates to be numbered, and obtaining a first spot vector array to be numbered; matching two adjacent spot numbers in each first candidate spot numbering sequence with the light source number in the ideal spot numbering sequence, calculating the first ideal spot vector corresponding to each first spot vector to be numbered, and obtaining a first ideal spot vector array corresponding to each first spot vector array to be numbered; calculating the first vector sandwich between each first spot vector to be numbered and the corresponding first ideal spot vector; Angle, obtain the first vector angle array corresponding to each first candidate light spot numbering sequence; determine whether the maximum value of the first vector angle in each first vector angle array is greater than the first preset threshold; if the maximum value of the first vector angle in the current first vector angle array is greater than the first preset threshold, delete the corresponding first candidate light spot numbering sequence; if the maximum value of the first vector angle in the current first vector angle array is less than or equal to the first preset threshold, retain the corresponding first candidate light spot numbering sequence as the second candidate light spot numbering sequence; use all the retained second candidate light spot numbering sequences to generate a set of second candidate light spot numbering sequences; determine whether the number of second candidate light spot numbering sequences is 1.

[0195] If the number of the second candidate light spot numbering sequence is 1, the output module 4 uses the second candidate light spot numbering sequence as the light spot numbering result sequence corresponding to the current array of light spot positions to be numbered.

[0196] When the number of light spots in the input light spot position array to be numbered is greater than 1, taking a first candidate light spot number sequence glints_id = [2 4 5 6] in the case of n = 4 as an example, its meaning is that the light source number corresponding to the position coordinate of the i-th light spot to be numbered is glints_id(i). For example, the light source number corresponding to the position coordinate of the light spot to be numbered at the glints_id(2) position is 4, and the light source number corresponding to the position coordinate of the light spot to be numbered at the glints_id(4) position is 6. Denote the first light spot vector array to be numbered as u_vec. Then when i < n, calculate the i-th first light spot vector u_vec(i) according to the following formula: u_vec(i)=glints(i + 1)-glints(i); when i = n, calculate the i-th first light spot vector u_vec(i) according to the following formula: u_vec(i)=glints(1)-glints(n). Taking glints_id = [2 4 5 6] as an example, the obtained first light spot vector array u_vec = [glints(4)-glints(2), glints(5)-glints(4), glints(6)-glints(5), glints(2)-glints(6)].

[0197] Taking the first light spot vector glints(4)-glints(2) in the above-obtained first light spot vector array u_vec = [glints(4)-glints(2), glints(5)-glints(4), glints(6)-glints(5), glints(2)-glints(6)] as an example, by matching, obtain the light source numbers "2 and 4" in the ideal light spot number sequence corresponding to the adjacent two light spot numbers "2 and 4" in the first candidate light spot number sequence, and calculate the corresponding first ideal light spot vector U_idea_vec according to the following formula: U_idea_vec = U_idea(4)-U_idea(2); in this way, calculate the first ideal light spot vectors corresponding to the remaining first light spot vectors to be numbered in turn according to the above steps, and obtain the first ideal light spot vector array corresponding to each first light spot vector array to be numbered.

[0198] The first vector angle between the first spot vector to be numbered and the corresponding first ideal spot vector is recorded as angle. For a certain possible first candidate spot numbering sequence glints_id, the corresponding first vector angles angle(i) are calculated according to the following formula: angle(i)= anglebetween(u_vec(i),U_idea_vec(i)). In this way, the first vector angle array corresponding to each first candidate spot numbering sequence is obtained. Then the maximum value of the first vector angle corresponding to a possible first candidate spot numbering sequence glints_id is obtained, that is, angle_max=max(angle). If the maximum value of the first vector angle angle_max is greater than the first preset threshold Angle_MAX, the first candidate spot numbering sequence is not considered, and it is considered that the first candidate spot numbering sequence cannot be the corresponding spot numbering sequence number under the current array of spot positions to be numbered. If the maximum value of the first vector angle angle_max is less than or equal to the first preset threshold Angle_MAX, the first candidate spot numbering sequence is saved in candidate_angle as the second candidate spot numbering sequence. In the embodiment of the present application, the first preset threshold Angle_MAX can be set to 8 degrees, more than ten degrees, or more than twenty degrees. For example, the first preset threshold Angle_MAX is set to 25 degrees.

[0199] Compared with the prior art, the spot numbering method provided by the embodiment of the present application first obtains the ideal spot position array of each light source and the corresponding ideal spot numbering sequence through initialization detection; then generates a first candidate spot numbering sequence set for the array of spot positions to be numbered; when the number of spots is greater than 1, the coordinates of the spot positions to be numbered and the coordinates of the ideal spot positions are vectorized, the first vector angle between the first spot vector to be numbered and the corresponding first ideal spot vector between two adjacent spot position coordinates to be numbered is calculated, the first candidate spot numbering sequence is screened, and the spot numbering result sequence is obtained. The embodiment of the present application can realize the light source numbering of each spot in the spot detection through vectorized comparison, and can ensure the accuracy of the spot numbering result.

[0200] refer to Figure 3Before determining whether the number of light spots in the array of light spot positions to be numbered is greater than 1, a light spot numbering method disclosed in the present application further includes the following steps performed by the screening module 3: determining whether the original eye diagram corresponding to the array of light spot positions to be numbered is the first frame acquisition eye diagram; if the original eye diagram corresponding to the array of light spot positions to be numbered is not the first frame acquisition eye diagram, forming an original eye diagram pair using the current original eye diagram and the previous frame original eye diagram; based on the original eye diagram pair, detecting whether the target human eye is in the first gaze state; if the target human eye is in the first gaze state, the output module 4 directly refers to the light spot numbering result sequence of the previous frame original eye diagram as the light spot numbering result sequence corresponding to the current light spot position array to be numbered.

[0201] refer to Figure 4 In one embodiment of the present application, detecting whether the target human eye is in the first gaze state based on the original eye diagram pair specifically includes the following steps: obtaining a first pupil center point position coordinate pair for the original eye diagram pair; calculating a first difference based on the first pupil center point position coordinate pair; using the first difference as the first detection information; judging whether the first detection information satisfies a first preset condition, where the first preset condition is that the first difference is less than a second preset threshold; if the first detection information satisfies the first preset condition, judging whether the number of spot numbers in the spot numbering result sequence of the previous frame of the original eye diagram is equal to the number of spots in the current array of spots to be numbered; if the number of spot numbers in the spot numbering result sequence of the previous frame of the original eye diagram is equal to the number of spots in the current array of spots to be numbered, determining that the target human eye is in the first gaze state; if the first detection information does not satisfy the first preset condition, or the number of spot numbers in the spot numbering result sequence of the previous frame of the original eye diagram is not equal to the number of spots in the current array of spots to be numbered, determining that the target human eye is not in the first gaze state.

[0202] In an embodiment of the present application, in the above-mentioned original eye diagram pair, the pupil center point position coordinates of the current frame original eye diagram are expressed as v, and the pupil center point position coordinates of the previous frame original eye diagram are expressed as v_last. The first difference v_shift is calculated according to the following formula, v_shift=abs(v-v_last). In this embodiment, the second preset threshold is recorded as v_max. For example, the second preset threshold v_max can be set to 1.8. In this way, if the first difference v_shift is less than 1.8, it is determined whether the number of spot numbers in the spot numbering result sequence of the previous frame original eye diagram is equal to the number of spots in the current array of spot positions to be numbered; if the number of spot numbers in the spot numbering result sequence of the previous frame original eye diagram is equal to the number of spots in the current array of spot positions to be numbered, it is considered that the user target eye is in the first gaze state.

[0203] If the target human eye is not in the first gaze state, then based on the original eye diagram pair, detect whether the target human eye is in the second gaze state; if the target human eye is in the second gaze state, directly refer to the spot numbering result sequence of the previous frame of the original eye diagram as the spot numbering result sequence corresponding to the current array of spot positions to be numbered.

[0204] refer to Figure 5 In one embodiment of the present application, detecting whether the target human eye is in the second gaze state based on the original eye diagram pair specifically includes the following steps: for the original eye diagram pair, obtaining each pair of light spot position coordinate points to be numbered and the total number of light spot position coordinate points to be numbered from the corresponding light spot position array to be numbered; calculating the corresponding second difference based on each pair of light spot position coordinate points to be numbered; using each second difference and the total number of light spot position coordinate points to be numbered as second detection information; judging whether the second detection information meets the second preset condition, the second preset condition being that each second difference is less than the third preset threshold and the total number of two light spot position coordinates to be numbered of the total number of light spot position coordinate points to be numbered is the same; if the second detection information meets the second preset condition, determining that the target human eye is in the second gaze state; if the second detection information does not meet the second preset condition, determining that the target human eye is not in the second gaze state.

[0205] In the above-mentioned original eye diagram pair, the array of the positions of the light spots to be numbered of the original eye diagram of the current frame is recorded as u, and the array of the positions of the light spots to be numbered of the original eye diagram of the previous frame is recorded as u_last. If the total number of the coordinates of the positions of the light spots to be numbered corresponding to the original eye diagram of the current frame is equal to the total number of the coordinates of the positions of the light spots to be numbered corresponding to the original eye diagram of the previous frame, both are n, and for the i-th pair of coordinates of the positions of the light spots to be numbered [u(i), u_last(i)], the i-th second difference u_shift(i) is calculated according to the following formula, u_shift(i)=abs(u(i)-u_last(i)). In this embodiment, the third preset threshold is recorded as u_max. For example, the third preset threshold u_max can be set to 2. When each of the above second difference u_shift(i) is less than 2, it is considered that the user target human eye is in the second gaze state.

[0206] As described above, before officially starting to number the light spots, it is possible to first determine whether the original eye diagram corresponding to the array of light spot positions to be numbered is the first frame acquisition eye diagram, and whether the target human eye is in the first gaze state or the second gaze state, to determine whether the light spot numbering process can be simplified. If the original eye diagram corresponding to the array of light spot positions to be numbered is not the first frame acquisition eye diagram, and the target human eye is in the first gaze state or the second gaze state, at this time, the light spot numbering result sequence of the original eye diagram of the previous frame can be directly referenced as the light spot numbering result sequence corresponding to the current array of light spot positions to be numbered, so that the light spot numbering can be completed in a very short time.

[0207] If the original eye diagram corresponding to the array of light spot positions to be numbered is the eye diagram collected in the first frame, or the target human eye is not in the second gaze state, it is determined whether the number of light spots in the array of light spot positions to be numbered is greater than 1.

[0208] refer to Figure 6 In the embodiment of the present application, if the number of the second candidate light spot numbering sequences is not 1, the following steps are performed by the screening module 3: determine whether the number of the second candidate light spot numbering sequences in the second candidate light spot numbering sequence set is 0; if the number of the second candidate light spot numbering sequences in the second candidate light spot numbering sequence set is 0, establish an eye diagram horizontal line coordinate system, determine the first light spot position conversion coordinates corresponding to each to-be-numbered light spot position coordinate in the current to-be-numbered light spot position array in the eye diagram horizontal line coordinate system; compare the sizes of each first light spot position conversion coordinate, and identify the to-be-numbered light spot position coordinates corresponding to the interference light spot according to the second preset rule; delete the to-be-numbered light spot position coordinates corresponding to the identified interference light spot from the current to-be-numbered light spot position array to obtain an updated to-be-numbered light spot position array, and loop to generate the first candidate light spot numbering sequence set according to the first preset rule.

[0209] In an embodiment of the present application, the step of establishing an eye diagram horizontal line coordinate system specifically includes: establishing a three-dimensional world coordinate system based on the target face; detecting the first left eye center position coordinate and the first right eye center position coordinate of the target face in the three-dimensional world coordinate system; converting the first left eye center position coordinate and the first right eye center position coordinate to the camera coordinate system of the original eye diagram to obtain the corresponding second left eye center position coordinate and the second right eye center position coordinate; using the second left eye center position coordinate and the second right eye center position coordinate, calculating the slope of the eye diagram horizontal line, the eye diagram horizontal line being the projection line connecting the left eye center and the right eye center of the target face in the camera coordinate system; selecting any point from the camera coordinate system as the origin, determining the direction of the coordinate axis using the slope of the eye diagram horizontal line, and establishing the eye diagram horizontal line coordinate system.

[0210] As mentioned above, the establishment of the eye diagram horizontal line coordinate system requires calculating the slope of the line formed by the horizontal line connecting the two eyes in the eye diagram in the three-dimensional world coordinate system. The three-dimensional world coordinate system takes the bridge of the target face's nose as the origin (0,0,0), the X-axis represents the horizontal direction, the Y-axis represents the vertical direction, and the Z-axis represents the vertical direction of the plane formed by the X-axis and the Y-axis. The first left eye center position coordinate and the first right eye center position coordinate can be expressed as E left and E right For example, E left =(-31.5,0,0),E right=(31.5,0,0). The eye diagram horizontal line coordinate system is established on the assumption that the user wears the head display device normally. Usually, the line between the left eye center 3D position coordinate and the right eye center 3D position coordinate is parallel to the line between the optical center of the left eye physical lens and the optical center of the right eye physical lens of the head display device, and the former and the latter only have a translation relationship (ignore the length of the line segment). The first left eye center position coordinate and the first right eye center position coordinate are respectively converted to the camera coordinate system, and then converted to image pixel coordinates to obtain the corresponding second left eye center position coordinate and the second right eye center position coordinate, which are recorded as P respectively. left and P right The second left eye center position coordinate P left and the second right eye center position coordinate P right The line between them is denoted as P l P r , that is, the first left eye center position coordinate E in the three-dimensional world coordinate system left and the first right eye center position coordinate E right The line between l E r Line segments projected onto the original eye diagram.

[0211] Under the above usage scenario layout of the embodiment of the present application, the second left eye center position coordinate P left =X_P left , Y_P left ), the second right eye center position coordinate P right =X_P right , Y_P right ), calculate the second left eye center position coordinate P according to the following formula left and the second right eye center position coordinate P right The line P between l P r The slope k.

[0212]

[0213] Thus, the first left eye center position coordinate E in the three-dimensional world coordinate system left and the first right eye center position coordinate E right The line between l E r , which can be represented as a line segment with a slope of k in the camera coordinate system of the original eye diagram. Based on the camera coordinate system of the original eye diagram, a new eye diagram horizontal line coordinate system is established. The eye diagram horizontal line coordinate system can select any point in the camera coordinate system of the original eye diagram as the origin. For example, the eye diagram horizontal line coordinate system selects the following points as the origin: the center point of the original eye diagram, the center position of the pupil of the original eye diagram, the origin (0,0) of the original eye diagram pixel coordinate system, the coordinate P of the center position of the second left eyeleft and the second right eye center position coordinate P right The line P between l P r The eye diagram horizontal line takes the line segment y=kx+b with a slope of k in the original eye diagram coordinate system (the camera coordinate system of the original eye diagram) as the X-axis direction, where the value of b depends on the origin of the new eye diagram horizontal line coordinate system.

[0214] In the embodiment of the present application, the second preset rule includes: identifying the to-be-numbered light spot position coordinates corresponding to the maximum value / minimum value in each first light spot position conversion coordinate as the interference light spot position coordinates.

[0215] The following is only an example of the above-mentioned specific usage scenario. As mentioned above, taking the original eye diagram acquired from the left eye as an example, the positive direction of the X-axis of the eye diagram horizontal line coordinate system is from the coordinate P of the center position of the second right eye right To the second left eye center position coordinate P left The direction of the vector. The coordinates of the positions of the light spots to be numbered where there are interference light spots are converted into the new eye diagram horizontal line coordinate system. According to the x-values ​​of the corresponding first light spot position conversion coordinates in the new eye diagram horizontal line coordinate system, it can be judged that the interference light spot most likely to be formed by the opposite light source. Taking the original eye diagram collected from the left eye as an example, the specific rule is that the larger the x-value of the corresponding first light spot position conversion coordinate is, the closer it is to the other eye (right eye). The coordinates of the light spot position to be numbered corresponding to the maximum value of the x-value of each corresponding first light spot position conversion coordinate are most likely to be the interference light spot position coordinates formed by the opposite light source, and they are deleted from the current array of light spot positions to be numbered.

[0216] In addition, the examples in the above specific usage scenarios. As mentioned above, taking the original eye diagram collected from the right eye as an example, the positive direction of the X-axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The direction of the vector. The coordinates of the positions of the light spots to be numbered with interference light spots are converted into the new eye diagram horizontal line coordinate system. According to the x-values ​​of the corresponding first light spot position conversion coordinates in the new eye diagram horizontal line coordinate system, the interference light spots most likely to be formed by the opposite light source can be judged. Taking the original eye diagram collected from the right eye as an example, the specific rule is that the smaller the x-value of the corresponding first light spot position conversion coordinate is, the closer it is to the other eye (left eye). The coordinates of the light spot position to be numbered corresponding to the minimum x-value of the corresponding first light spot position conversion coordinates are most likely to be the interference light spot position coordinates formed by the opposite light source, and they are deleted from the current array of light spot positions to be numbered.

[0217] Similarly, taking the original eye diagram collected from the left eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the coordinate P of the center position of the second right eye. right To the second left eye center position coordinate P left The second preset rule is that the larger the y value of the corresponding first light spot position conversion coordinate is, the closer it is to the other eye (right eye), and the light spot position coordinate to be numbered corresponding to the maximum value of the y value of each first light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected for the right eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the smaller the y value of the corresponding first light spot position conversion coordinate is, the closer it is to the other eye (left eye), and the light spot position coordinate to be numbered corresponding to the minimum y value of each corresponding first light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source.

[0218] refer to Figure 7 , a spot numbering method disclosed in an embodiment of the present application also includes: the storage module 5 performs the following steps: using each light source number in the light source group, sequentially setting the storage number of the spot position storage sequence corresponding to each light source; setting an initial value for each spot position storage sequence to construct a typical value spot array; based on each spot number in the spot numbering result sequence, saving each to-be-numbered spot position coordinate in the to-be-numbered spot position array to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array; for each spot position storage sequence, calculating the average value / median value / weighted sum value of all stored values ​​as the corresponding typical spot position coordinate.

[0219] In the embodiment of the present application, the above-mentioned construction of the typical value spot array stores the coordinates of the spot positions to be numbered corresponding to each spot number in the spot numbering result sequence, and its purpose is to solve the problem of how to implement spot numbering when the number of spots n in the spot position array glints to be numbered is less than 3. The typical value spot array is recorded as Ureals, and each spot position storage sequence is recorded as Ureals[i]. If there are 8 light sources in the light source group, there are 8 spot position storage sequences in total, namely Ureals[1], Ureals[2], Ureals[3], Ureals[4], Ureals[5], Ureals[6], Ureals[7], and Ureals[8]. The initial value of each spot position storage sequence is set to 0. For example, there are four to-be-numbered light spot position coordinates in the to-be-numbered light spot position array glints, and the final light spot numbering result sequence Glints_id is [2 4 5 6], then the following corresponding to-be-numbered light spot position coordinates glints(1), glints(2), glints(3), glints(4) are stored in the following light spot position storage sequences Ureals[2], Ureals[4], Ureals[5], and Ureals[6] of the typical value light spot array, respectively. The specific implementation method of the typical value light spot array is to set N containers in the Ureals container, where N represents the array size of U_idea or the number of light spots in the ideal light spot position array, so that the number of infrared light sources in the light source group is also N, and N=1 represents the light spot position storage sequence of the light spot formed by light source No. 1. Each Ureals container can be provided with 10 containers for accommodating the to-be-numbered light spot position coordinates. For example, Ureals[2] is a storage container for the coordinates of the spots to be numbered formed by light source 2. Ureals[2] can store the coordinates of the 10 latest spots to be numbered formed by light source 2. The average value / median value / weighted value of the coordinates of the spots to be numbered formed by all the spots formed by light source 2 in Ureals[2] is taken as the typical coordinates of the spots formed by light source 2.

[0220] refer to Figure 8, if the number of second candidate spot number sequences in the second candidate spot number sequence set is not 0, the screening module 3 continues to perform the following steps: determine whether the number of spots in the to-be-numbered spot position array is greater than 2; if the number of spots in the to-be-numbered spot position array is not greater than 2, the number of spots in the to-be-numbered spot position array is 2, and determine whether the spot position storage sequences corresponding to each spot number in each second candidate spot number sequence have typical spot position coordinates that are not initial values; if the spot position storage sequences corresponding to each spot number in each second candidate spot number sequence have typical spot position coordinates that are not initial values, then for each second candidate spot number sequence, sequentially calculate the third distance between a to-be-numbered spot position coordinate in the to-be-numbered spot position array and the corresponding typical spot position coordinate, and another to-be-numbered spot position coordinate in the to-be-numbered spot position array. the fourth distance between the coordinates and the corresponding typical spot position coordinates; taking the third distance and the fourth distance as the distance error pair, and forming a distance error pair array corresponding to the second candidate spot number sequence set by the distance error pairs corresponding to each second candidate spot number sequence; taking the spot numbers in the second candidate spot number sequence corresponding to the third distance maximum value and the fourth distance maximum value in the distance error pair array as the first spot number and the second spot number respectively; judging whether the first spot number is equal to the second spot number; if the first spot number is not equal to the second spot number, comparing the third distance maximum value and the fourth distance maximum value, deleting the distance error pair corresponding to the larger value in the distance error pair array, and deleting the second candidate spot number sequence corresponding to the larger value in the second candidate spot number sequence set, and looping to judge whether the number of the second candidate spot number sequence is 1.

[0221] refer to Figure 8 , if the first spot number is equal to the second spot number, the screening module 3 continues to perform the following steps: determine whether the number of the current second candidate spot number sequence is greater than 2; if the number of the current second candidate spot number sequence is greater than 2, delete the second candidate spot number sequence corresponding to the first spot number and the second spot number in the second candidate spot number sequence set, and delete the distance error pair corresponding to the first spot number and the second spot number in the distance error pair array, and loop to determine whether the number of the second candidate spot number sequence is 1.

[0222] refer to Figure 8If the number of the current second candidate spot numbering sequences is not greater than 2, the number of the current second candidate spot numbering sequences is equal to 2, and the screening module 3 continues to perform the following steps: calculating the fifth distance between the position coordinates of the two spots to be numbered and the sixth distance between the typical spot position coordinates corresponding to the two spot numbers in each second candidate spot numbering sequence; calculating the ratio of the fifth distance divided by the sixth distance to obtain the corresponding first error reference ratio; and retaining the second candidate spot numbering sequence corresponding to the first error reference ratio that is closer to 1.

[0223] refer to Figure 8 , the output module 4 uses the finally retained second candidate spot number sequence as the spot number result sequence corresponding to the current array of spot positions to be numbered, and loops to the storage module 5 to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot number result sequence.

[0224] refer to Fig. 9 , if there is a spot position storage sequence corresponding to the spot number in each second candidate spot number sequence that only has an initial value, the screening module 3 performs the following steps: directly calculate the fifth distance between the coordinates of the two spot positions to be numbered and the seventh distance between the coordinates of the two ideal spot positions in the ideal spot position array corresponding to the two spot numbers in each second candidate spot number sequence; calculate the ratio of the fifth distance divided by the seventh distance to obtain the corresponding second error reference ratio; calculate the absolute value error between each second error reference ratio and 1; determine whether the absolute value error is greater than the fourth preset threshold, specifically, in the embodiment of the present application, the fourth preset threshold can be set to 1.5; if the absolute value error is greater than the fourth preset threshold, delete the corresponding second candidate spot number sequence; if the absolute value error is less than or equal to the fourth preset threshold, retain the corresponding second candidate spot number sequence as the third candidate spot number sequence; use all the retained third candidate spot number sequences to generate a set of third candidate spot number sequences; determine whether the number of third candidate spot number sequences is 1.

[0225] refer to Fig. 9 If the number of the third candidate spot numbering sequence is 1, the output module 4 uses the third candidate spot numbering sequence as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and loops to the storage module 5 to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

[0226] refer to Fig. 9If the number of the third candidate light spot numbering sequences is not 1, the screening module 3 continues to perform the following steps: determine whether the number of the third candidate light spot numbering sequences in the third candidate light spot numbering sequence set is 0; if the number of the third candidate light spot numbering sequences in the third candidate light spot numbering sequence set is 0, establish an eye diagram horizontal line coordinate system, determine the second light spot position conversion coordinates corresponding to each light spot position coordinate to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system; compare the sizes of each second light spot position conversion coordinates, and identify the light spot position coordinate to be numbered corresponding to the interference light spot according to the second preset rule; delete the light spot position coordinate to be numbered corresponding to the identified interference light spot from the current light spot position array to be numbered, obtain an updated light spot position array to be numbered, and loop to generate the first candidate light spot numbering sequence set according to the first preset rule.

[0227] At this time, the specific steps of establishing the eye diagram horizontal line coordinate system are the same as the specific steps of establishing the eye diagram horizontal line coordinate system when the number of the second candidate spot number sequence in the aforementioned second candidate spot number sequence set is 0, and will not be repeated here.

[0228] Similarly, in the embodiment of the present application, the second preset rule includes: identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value in each second light spot position conversion coordinate as the interference light spot position coordinates. Specifically, according to different ways of establishing the coordinate system, the second preset rule has multiple judgment rules, for example, identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value of the horizontal coordinate x in each second light spot position conversion coordinate as the interference light spot position coordinates. Or identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value of the vertical coordinate y in each second light spot position conversion coordinate as the interference light spot position coordinates.

[0229] Similarly, taking the original eye diagram collected from the left eye as an example, the positive direction of the X-axis of the eye diagram horizontal line coordinate system is from the coordinate P of the center position of the second right eye. right To the second left eye center position coordinate P left The second preset rule is that the larger the x value of the corresponding second light spot position conversion coordinate is, the closer it is to the other eye (right eye), and the light spot position coordinate to be numbered corresponding to the maximum value of the x value of each corresponding second light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the right eye as an example, the positive direction of the X-axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P leftThe second preset rule is that the smaller the x value of the corresponding second light spot position conversion coordinate is, the closer it is to the other eye (left eye), and the light spot position coordinate to be numbered corresponding to the minimum x value of each corresponding second light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the left eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the larger the y value of the corresponding second light spot position conversion coordinate is, the closer it is to the other eye (right eye), and the light spot position coordinate to be numbered corresponding to the maximum value of the y value of each corresponding second light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the right eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the smaller the y value of the corresponding second light spot position conversion coordinate is, the closer it is to the other eye (left eye), and the light spot position coordinate to be numbered corresponding to the minimum y value of each corresponding second light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source.

[0230] refer to Fig.10 If the number of third candidate spot numbering sequences in the third candidate spot numbering sequence set is not 0, the screening module 3 performs the following steps: calculating the second center point position coordinates between the two to-be-numbered spot position coordinates and the first pupil center position coordinates of the original eye diagram; calculating the first center point vector from the first pupil center position coordinates to the second center point position coordinates; for the third candidate spot numbering sequence set, calculating the third center point position coordinates between the two ideal spot position coordinates corresponding to the two spot numbers in each third candidate spot numbering sequence and the ideal pupil center position coordinates between each ideal spot position coordinates; calculating the second center point vector from the ideal pupil center position coordinates to each third center point position coordinates; calculating the third vector angle between the first center point vector and each second center point vector; selecting the absolute value error, the second vector angle, and the third vector angle corresponding to each third candidate spot numbering sequence as the first scoring indicator; assigning the corresponding first preset weight to each first scoring indicator, and obtaining the first comprehensive score corresponding to each third candidate spot numbering sequence through weighted calculation.

[0231] In the embodiment of the present application, the first pupil center position coordinates are the position coordinates of the pupil center in the original eye diagram, and the first pupil center position coordinates can be calculated from the position coordinates of multiple collected pupil contour points in the original eye diagram. The first comprehensive score is calculated according to the following formula:

[0232] Score1=a1·ratio_error+b1·angle_v+c1·angle_vec

[0233] Among them, Score1 is the first comprehensive score, ratio_error is the absolute value error, angle_v is the second vector angle, angle_vec is the third vector angle, a1, b1, c1 are the first preset weights corresponding to the absolute value error, the second vector angle, and the third vector angle, respectively. In one embodiment, a1, b1, c1 can be set to 0.5, 0.25, and 0.25, respectively.

[0234] The output module 4 selects the third candidate spot numbering sequence with the lowest first comprehensive score as the spot numbering result sequence, and loops until the output module 4 saves the coordinates of each to-be-numbered spot position in the to-be-numbered spot position array to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

[0235] refer to Fig.11 , if the number of spots in the array of spots to be numbered is greater than 2, the screening module 3 performs the following steps: calculating the second spot vector to be numbered between any two spot position coordinates to be numbered to obtain a second spot vector array to be numbered; matching any two spot numbers in each second candidate spot numbering sequence with the light source number in the ideal spot numbering sequence, calculating the second ideal spot vector corresponding to each second spot vector to be numbered, and obtaining a second ideal spot vector array corresponding to the second spot vector array to be numbered; calculating the second vector angle between each second spot vector to be numbered and the corresponding second ideal spot vector, and obtaining each second candidate spot vector array. The second vector angle array corresponding to the spot numbering sequence; judging whether the second vector angle maximum value in each second vector angle array is greater than the fifth preset threshold; if the second vector angle maximum value in the current second vector angle array is greater than the fifth preset threshold, deleting the corresponding second candidate spot numbering sequence; if the second vector angle maximum value in the current second vector angle array is less than or equal to the fifth preset threshold, retaining the corresponding second candidate spot numbering sequence as the fourth candidate spot numbering sequence; using all the retained fourth candidate spot numbering sequences to generate a fourth candidate spot numbering sequence set; judging whether the number of fourth candidate spot numbering sequences is 1.

[0236] In the embodiment of the present application, the fifth preset threshold Angle_MAX can be set to 8 degrees, more than ten degrees, or more than twenty degrees. For example, the fifth preset threshold Angle_MAX is set to 25 degrees.

[0237] If the number of the fourth candidate spot numbering sequence is 1, the output module 4 uses the fourth candidate spot numbering sequence as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and loops to the storage module 5 to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

[0238] refer to Fig.11 , if the number of the fourth candidate light spot numbering sequence is not 1, the screening module 3 performs the following steps: determining whether the number of the fourth candidate light spot numbering sequence in the fourth candidate light spot numbering sequence set is 0; if the number of the fourth candidate light spot numbering sequence in the fourth candidate light spot numbering sequence set is 0, establishing an eye diagram horizontal line coordinate system, determining the third light spot position conversion coordinates corresponding to the position coordinates of each light spot to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system; comparing the sizes of the third light spot position conversion coordinates, identifying the position coordinates of the light spot to be numbered corresponding to the interference light spot according to the second preset rule; deleting the position coordinates of the light spot to be numbered corresponding to the identified interference light spot from the current light spot position array to be numbered, obtaining an updated light spot position array to be numbered, and looping to generate the first candidate light spot numbering sequence set according to the first preset rule.

[0239] At this time, the specific steps of establishing the eye diagram horizontal line coordinate system are the same as the specific steps of establishing the eye diagram horizontal line coordinate system when the number of the second candidate spot number sequence in the aforementioned second candidate spot number sequence set is 0, and will not be repeated here.

[0240] Similarly, in the embodiment of the present application, the second preset rule includes: identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value in each third light spot position conversion coordinate as the interference light spot position coordinates. Specifically, according to different ways of establishing the coordinate system, the second preset rule has multiple judgment rules, for example, identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value of the horizontal coordinate x in each third light spot position conversion coordinate as the interference light spot position coordinates. Or identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value of the vertical coordinate y in each third light spot position conversion coordinate as the interference light spot position coordinates.

[0241] Similarly, taking the original eye diagram collected from the left eye as an example, the positive direction of the X-axis of the eye diagram horizontal line coordinate system is from the coordinate P of the center position of the second right eye. right To the second left eye center position coordinate P leftThe second preset rule is that the larger the x value of the corresponding third light spot position conversion coordinate is, the closer it is to the other eye (right eye), and the light spot position coordinate to be numbered corresponding to the maximum value of the x value of each corresponding third light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the right eye as an example, the positive direction of the X axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the smaller the x value of the corresponding third light spot position conversion coordinate is, the closer it is to the other eye (left eye), and the light spot position coordinate to be numbered corresponding to the minimum x value of each corresponding third light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the left eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the larger the y value of the corresponding third light spot position conversion coordinate is, the closer it is to the other eye (right eye), and the light spot position coordinate to be numbered corresponding to the maximum value of the y value of each corresponding third light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the right eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the smaller the y value of the corresponding third light spot position conversion coordinate is, the closer it is to the other eye (left eye), and the light spot position coordinate to be numbered corresponding to the minimum y value of each corresponding third light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source.

[0242] refer to Fig.12If the number of fourth candidate spot numbering sequences in the fourth candidate spot numbering sequence set is not 0, the screening module 3 performs the following steps: calculating the candidate spot side lengths of each second spot vector to be numbered to obtain a corresponding candidate spot side length array; calculating the ideal spot side lengths of the second ideal spot vectors corresponding to each second spot vector to be numbered in each second ideal spot vector array to obtain an ideal spot side length array corresponding to each fourth candidate spot numbering sequence; calculating the spot side length ratio of each ideal spot side length in each ideal spot side length array divided by the corresponding candidate spot side length to obtain a spot side length ratio array corresponding to each fourth candidate spot numbering sequence; selecting the corresponding spot side length from each spot side length ratio array. The maximum value of the ratio and the minimum value of the spot side length ratio; calculate the first extreme value ratio of the maximum value of each spot side length ratio divided by the corresponding minimum value of the spot side length ratio; determine whether each first extreme value ratio is greater than the sixth preset threshold. Specifically, in the embodiment of the present application, the sixth preset threshold can be set to 1.5; if the current first extreme value ratio is greater than the sixth preset threshold, the corresponding fourth candidate spot number sequence is deleted; if the current first extreme value ratio is less than or equal to the sixth preset threshold, the corresponding fourth candidate spot number sequence is retained as the fifth candidate spot number sequence; use all the retained fifth candidate spot number sequences to generate a fifth candidate spot number sequence set; determine whether the number of the fifth candidate spot number sequence is 1.

[0243] If the number of the fifth candidate spot numbering sequence is 1, the output module 4 uses the fifth candidate spot numbering sequence as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and loops to the storage module 5 to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

[0244] refer to Fig.12, if the number of the fifth candidate light spot numbering sequence is not 1, the screening module 3 performs the following steps: determining whether the number of the fifth candidate light spot numbering sequence in the fifth candidate light spot numbering sequence set is 0; if the number of the fifth candidate light spot numbering sequence in the fifth candidate light spot numbering sequence set is 0, establishing an eye diagram horizontal line coordinate system, determining the fourth light spot position conversion coordinates corresponding to the coordinates of the positions of the light spots to be numbered in the current array of light spot positions to be numbered in the eye diagram horizontal line coordinate system; comparing the sizes of the fourth light spot position conversion coordinates, identifying the coordinates of the positions of the light spots to be numbered corresponding to the interference light spots according to the second preset rule; deleting the coordinates of the positions of the light spots to be numbered corresponding to the identified interference light spots from the current array of light spot positions to be numbered, to obtain an updated array of light spot positions to be numbered; regenerating all sorting sequences corresponding to all light source numbers according to the number of light spots corresponding to the updated array of light spot positions to be numbered, and storing them as the updated first candidate light spot numbering sequence as the updated set of first candidate light spot numbering sequences.

[0245] At this time, the specific steps of establishing the eye diagram horizontal line coordinate system are the same as the specific steps of establishing the eye diagram horizontal line coordinate system when the number of the second candidate spot number sequence in the aforementioned second candidate spot number sequence set is 0, and will not be repeated here.

[0246] Similarly, in the embodiment of the present application, the second preset rule includes: identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value in each fourth light spot position conversion coordinate as the interference light spot position coordinates. Specifically, according to different ways of establishing the coordinate system, the second preset rule has multiple judgment rules, for example, identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value of the horizontal coordinate x in each fourth light spot position conversion coordinate as the interference light spot position coordinates. Or identifying the to-be-numbered light spot position coordinates corresponding to the maximum / minimum value of the vertical coordinate y in each fourth light spot position conversion coordinate as the interference light spot position coordinates.

[0247] Similarly, taking the original eye diagram collected from the left eye as an example, the positive direction of the X-axis of the eye diagram horizontal line coordinate system is from the coordinate P of the center position of the second right eye. right To the second left eye center position coordinate P left The second preset rule is that the larger the x value of the corresponding fourth light spot position conversion coordinate is, the closer it is to the other eye (right eye), and the light spot position coordinate to be numbered corresponding to the maximum value of the x value of each corresponding fourth light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the right eye as an example, the positive direction of the X axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P leftThe second preset rule is that the smaller the x value of the corresponding fourth light spot position conversion coordinate is, the closer it is to the other eye (left eye), and the light spot position coordinate to be numbered corresponding to the minimum x value of each corresponding fourth light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the left eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the larger the y value of the corresponding fourth light spot position conversion coordinate is, the closer it is to the other eye (right eye), and the light spot position coordinate to be numbered corresponding to the maximum value of the y value of each corresponding fourth light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source. Taking the original eye diagram collected from the right eye as an example, the positive direction of the Y axis of the eye diagram horizontal line coordinate system is from the second right eye center position coordinate P right To the second left eye center position coordinate P left The second preset rule is that the smaller the y value of the corresponding fourth light spot position conversion coordinate is, the closer it is to the other eye (left eye), and the light spot position coordinate to be numbered corresponding to the minimum y value of each corresponding fourth light spot position conversion coordinate is most likely to be the interference light spot position coordinate formed by the opposite light source.

[0248] refer to Fig.13 If the number of the fifth candidate spot numbering sequences in the fifth candidate spot numbering sequence set is not 0, the screening module 3 performs the following steps: calculating the inner angle of the spot to be numbered between two adjacent second spot vectors to be numbered to obtain an array of inner angles of the spot to be numbered; calculating the ideal inner angle of the spot between two adjacent second spot vectors to be numbered in each second ideal spot vector array to obtain an array of ideal inner angles of the spot corresponding to each fifth candidate spot numbering sequence; calculating the third difference between each inner angle of the spot to be numbered and the corresponding ideal inner angle of the spot in each ideal spot inner angle array to obtain a third difference array corresponding to each fifth candidate spot numbering sequence; obtaining the third maximum difference value corresponding to each third difference array; selecting the second vector angle maximum value, the first extreme value ratio, and the third maximum difference value corresponding to each fifth candidate spot numbering sequence as the second scoring index; assigning a corresponding second preset weight to each second scoring index, and obtaining a second comprehensive score corresponding to each fifth candidate spot numbering sequence through weighted calculation.

[0249] In the embodiment of the present application, the second comprehensive score is calculated according to the following formula:

[0250] Score2=a2·angle_max_new+b2·ratio_max / ratio_min+c2·interiorangle_max

[0251] Among them, Score2 is the second comprehensive score, angle_max_new is the maximum value of the second vector angle, ratio_max / ratio_min is the first extreme value ratio, interiorangle_max is the third maximum difference value, a2, b2, and c2 are the second preset weights corresponding to the maximum value of the second vector angle, the first extreme value ratio, and the third maximum difference value, respectively. In one embodiment, a2, b2, and c2 can be set to 0.2, 0.2, and 0.6, respectively.

[0252] The output module 4 selects the fifth candidate spot numbering sequence with the lowest second comprehensive score as the spot numbering result sequence, and loops to the storage module 5 to save the coordinates of each to-be-numbered spot position in the to-be-numbered spot position array to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

[0253] refer to Fig.14 , if the number of spots in the array of spot positions to be numbered is not greater than 1, the number of spots in the array of spot positions to be numbered is 1, and the screening module 3 performs the following steps: judging whether there is a spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array; if there is no spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array, the current array of spot positions to be numbered is not numbered, and the process is cycled to process the array of spot positions to be numbered corresponding to the next frame of the original eye diagram.

[0254] If there is a spot position storage sequence whose typical spot position coordinates are not the initial values ​​in the current typical value spot array, the output module 4 selects the spot number of the spot position storage sequence corresponding to the typical spot position coordinates closest to the current spot position coordinates to be numbered, obtains the corresponding spot number result sequence, and loops to the storage module 5 to save the coordinates of each to-be-numbered spot position in the to-be-numbered spot position array to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot number result sequence.

[0255] In addition, an embodiment of the present application further provides a spot numbering device, which includes: a processor and a memory; the memory is used to store one or more program instructions; the processor is used to run one or more program instructions to execute the steps of a spot numbering method as described in any of the above items.

[0256] In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a light spot numbering method as described in any one of the above items are implemented.

[0257] In the embodiment of the present application, the processor may be an integrated circuit chip having the ability to process signals. The processor may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0258] The methods, steps and logic diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The processor reads the information in the storage medium and completes the steps of the above method in combination with its hardware.

[0259] The storage medium may be a memory, which may be, for example, a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memory.

[0260] Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory.

[0261] The volatile memory may be a random access memory (RAM) which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM).

[0262] The storage media described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memory.

[0263] Those skilled in the art will appreciate that in one or more of the above examples, the functions described in the present invention can be implemented using a combination of hardware and software. When software is used, the corresponding functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein communication media include any media that facilitates the transmission of computer programs from one place to another. Storage media can be any available media that can be accessed by general or special-purpose computers.

[0264] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A method for numbering light spots, characterized in that: The method comprises: Initialize and detect the ideal light spot position coordinates of each light source in the light source group to generate a sorted ideal light spot position array and a corresponding ideal light spot number sequence; Receiving the sorted array of light spot positions to be numbered, and generating a first candidate light spot number sequence set according to a first preset rule; Determine whether the number of light spots in the array of light spot positions to be numbered is greater than 1; If the number of light spots in the array of light spot positions to be numbered is greater than 1, a first light spot vector to be numbered between two adjacent light spot position coordinates to be numbered is calculated to obtain a first light spot vector array to be numbered; Matching two adjacent spot numbers in each first candidate spot number sequence with the light source number in the ideal spot number sequence, calculating the first ideal spot vector corresponding to each first to-be-numbered spot vector, and obtaining the first ideal spot vector array corresponding to each first to-be-numbered spot vector array; Calculate the first vector angle between each first to-be-numbered light spot vector and the corresponding first ideal light spot vector to obtain a first vector angle array corresponding to each first candidate light spot numbering sequence; Determine whether the maximum value of the first vector angle in each first vector angle array is greater than a first preset threshold; If the maximum first vector angle in the current first vector angle array is greater than a first preset threshold, the corresponding first candidate spot number sequence is deleted; If the maximum value of the first vector angle in the current first vector angle array is less than or equal to the first preset threshold, the corresponding first candidate light spot number sequence is retained as the second candidate light spot number sequence; Generate a set of second candidate light spot number sequences by using all the reserved second candidate light spot number sequences; Determine whether the number of the second candidate light spot number sequence is 1; If the number of the second candidate light spot numbering sequence is 1, the second candidate light spot numbering sequence is used as the light spot numbering result sequence corresponding to the current light spot position array to be numbered.

2. A method for numbering light spots as claimed in claim 1, characterized in that: Before determining whether the number of light spots in the array of light spot positions to be numbered is greater than 1, the method further includes: Determine whether the original eye diagram corresponding to the array of light spot positions to be numbered is the first frame of collected eye diagram; If the original eye diagram corresponding to the array of light spot positions to be numbered is not the first frame of collected eye diagram, forming an original eye diagram pair using the current original eye diagram and the previous frame of original eye diagram; Based on the original eye diagram pair, detecting whether the target human eye is in a first gaze state; If the target human eye is in the first gaze state, the spot numbering result sequence of the original eye image of the previous frame is directly referenced as the spot numbering result sequence corresponding to the current array of spot positions to be numbered; If the target human eye is not in the first gaze state, detecting whether the target human eye is in the second gaze state based on the original eye diagram pair; If the target human eye is in the second gaze state, the spot numbering result sequence of the original eye image of the previous frame is directly referenced as the spot numbering result sequence corresponding to the current array of spot positions to be numbered; If the original eye diagram corresponding to the array of light spot positions to be numbered is the first frame acquisition eye diagram, or the target human eye is not in the second gaze state, it is determined whether the number of light spots in the array of light spot positions to be numbered is greater than 1.

3. A method for numbering light spots as claimed in claim 2, characterized in that: Based on the original eye diagram pair, detecting whether the target human eye is in a first gaze state includes: For the original eye diagram pair, obtaining a first pupil center point position coordinate pair; Calculating a first difference based on the first pupil center point position coordinate pair; using the first difference as first detection information; Determine whether the first detection information satisfies a first preset condition, where the first preset condition is that the first difference is less than a second preset threshold; If the first detection information satisfies the first preset condition, determining whether the number of light spot numbers in the light spot numbering result sequence of the previous frame of the original eye image is equal to the number of light spots in the current array of light spot positions to be numbered; If the number of light spot numbers in the light spot numbering result sequence of the previous frame of the original eye image is equal to the number of light spots in the current array of light spot positions to be numbered, it is determined that the target human eye is in the first gaze state; If the first detection information does not meet the first preset condition, or the number of spot numbers in the spot numbering result sequence of the previous frame of the original eye diagram is not equal to the number of spots in the current array of spot positions to be numbered, it is determined that the target human eye is not in the first gaze state.

4. A method for numbering light spots as claimed in claim 3, characterized in that: Detecting whether the target human eye is in a second gaze state based on the original eye diagram pair includes: For the original eye diagram pair, obtaining each pair of coordinate points of the light spot position to be numbered and the total number of pairs of coordinate points of the light spot position to be numbered from the corresponding array of light spot positions to be numbered; Calculate the corresponding second difference based on each pair of light spot position coordinate points to be numbered; Using each second difference value and the total number of pairs of the position coordinates of the light spots to be numbered as second detection information; Determine whether the second detection information satisfies a second preset condition, where the second preset condition is that each second difference is less than a third preset threshold and the total number of the coordinates of the two light spot positions to be numbered is the same; If the second detection information satisfies a second preset condition, determining that the target human eye is in a second gaze state; If the second detection information does not satisfy the second preset condition, it is determined that the target human eye is not in the second gaze state.

5. A method for numbering light spots according to any one of claims 1 to 4, characterized in that: The method further comprises: If the number of the second candidate light spot number sequences is not 1, determining whether the number of the second candidate light spot number sequences in the second candidate light spot number sequence set is 0; If the number of second candidate light spot numbering sequences in the second candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the first light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system; Compare the sizes of the converted coordinates of the positions of the first light spots, and identify the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule; The coordinates of the light spot position to be numbered corresponding to the identified interfering light spot are deleted from the current light spot position array to be numbered to obtain an updated light spot position array to be numbered, and the process is repeated until a first candidate light spot number sequence set is generated according to a first preset rule.

6. A method for numbering light spots as claimed in claim 5, characterized in that: The method further comprises: Using the numbers of the light sources in the light source group, the storage numbers of the light spot position storage sequences corresponding to the light sources are sequentially set; Setting initial values ​​for each spot position storage sequence to construct a typical value spot array; Based on each spot number in the spot numbering result sequence, the coordinates of each spot position to be numbered in the spot position array to be numbered are saved to a corresponding storage bit of a corresponding spot position storage sequence in the typical value spot array; For each spot position storage sequence, the average value / median value / weighted sum value of all stored values ​​is calculated as the corresponding typical spot position coordinate.

7. A method for numbering light spots as claimed in claim 6, characterized in that: The method further comprises: If the number of second candidate light spot number sequences in the second candidate light spot number sequence set is not 0, determining whether the number of light spots in the array of light spot positions to be numbered is greater than 2; If the number of spots in the array of spots to be numbered is not greater than 2, the number of spots in the array of spots to be numbered is 2, and it is determined whether the spot position storage sequences corresponding to each spot number in each second candidate spot number sequence have typical spot position coordinates that are not initial values; If the spot position storage sequences corresponding to each spot number in each second candidate spot number sequence have typical spot position coordinates that are not initial values, then for each second candidate spot number sequence, the third distance between one of the spot position coordinates to be numbered in the array of spot positions to be numbered and the corresponding typical spot position coordinates and the fourth distance between another of the spot position coordinates to be numbered and the corresponding typical spot position coordinates are calculated in sequence; Taking the third distance and the fourth distance as a distance error pair, forming a distance error pair array corresponding to the second candidate light spot number sequence set by the distance error pairs corresponding to each second candidate light spot number sequence; The spot numbers in the second candidate spot number sequence corresponding to the third maximum distance value and the fourth maximum distance value in the distance error pair array are used as the first spot number and the second spot number respectively; Determining whether the first light spot sequence number is equal to the second light spot sequence number; If the first spot number is not equal to the second spot number, the third maximum distance value and the fourth maximum distance value are compared, the distance error pair corresponding to the larger value is deleted from the distance error pair array, and the second candidate spot number sequence corresponding to the larger value is deleted from the second candidate spot number sequence set, and the loop is repeated until it is determined whether the number of the second candidate spot number sequence is 1; If the first light spot number is equal to the second light spot number, determining whether the number of the current second candidate light spot number sequence is greater than 2; If the number of the current second candidate spot number sequences is greater than 2, the second candidate spot number sequences corresponding to the first spot number and the second spot number are deleted from the second candidate spot number sequence set, and the distance error pair corresponding to the first spot number and the second spot number is deleted from the distance error pair array, and the process is repeated until it is determined whether the number of the second candidate spot number sequences is 1; If the number of the current second candidate spot number sequence is not greater than 2, the number of the current second candidate spot number sequence is equal to 2, and the fifth distance between the position coordinates of the two spots to be numbered and the sixth distance between the typical spot position coordinates corresponding to the two spot numbers in each second candidate spot number sequence are calculated; Calculating a ratio of the fifth distance divided by the sixth distance to obtain a corresponding first error reference ratio; retaining a second candidate light spot number sequence corresponding to a first error reference ratio closer to 1; The finally retained second candidate spot number sequence is used as the spot number result sequence corresponding to the current array of spot positions to be numbered, and a loop is performed to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the array of spot positions to be numbered.

8. A method for numbering light spots as claimed in claim 7, characterized in that: The method further comprises: If there is a spot position storage sequence corresponding to a spot number in each second candidate spot number sequence that has only an initial value, directly calculate the fifth distance between the coordinates of the two spots to be numbered and the seventh distance between the coordinates of the two ideal spot positions in the ideal spot position array corresponding to the two spot numbers in each second candidate spot number sequence; Calculating a ratio of the fifth distance divided by the seventh distance to obtain a corresponding second error reference ratio; Calculate the absolute value error between each second error reference ratio and 1; Determining whether the absolute value error is greater than a fourth preset threshold; If the absolute value error is greater than a fourth preset threshold, deleting the corresponding second candidate spot number sequence; If the absolute value error is less than or equal to a fourth preset threshold, retaining the corresponding second candidate light spot number sequence as a third candidate light spot number sequence; Using all the reserved third candidate light spot number sequences, a third candidate light spot number sequence set is generated; Determine whether the number of the third candidate light spot number sequence is 1; If the number of the third candidate spot numbering sequence is 1, the third candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and the process is looped to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the array of spot positions to be numbered.

9. A method for numbering light spots as claimed in claim 8, characterized in that: The method further comprises: If the number of the third candidate light spot number sequences is not 1, determining whether the number of the third candidate light spot number sequences in the third candidate light spot number sequence set is 0; If the number of the third candidate light spot numbering sequences in the third candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the second light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system; Compare the sizes of the converted coordinates of the positions of the second light spots, and identify the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule; The coordinates of the light spot position to be numbered corresponding to the identified interfering light spot are deleted from the current light spot position array to be numbered to obtain an updated light spot position array to be numbered, and the process is repeated until a first candidate light spot number sequence set is generated according to a first preset rule.

10. A method for numbering light spots as claimed in claim 9, characterized in that: The method further comprises: If the number of third candidate light spot numbering sequences in the third candidate light spot numbering sequence set is not 0, calculating the second center point position coordinates between the two to-be-numbered light spot position coordinates and the first pupil center position coordinates of the original eye image; Calculate a first center point vector from the first pupil center position coordinate to the second center point position coordinate; For the third candidate spot number sequence set, calculate the third center point position coordinates between two ideal spot position coordinates corresponding to two spot numbers in each third candidate spot number sequence and the ideal pupil center position coordinates between each ideal spot position coordinates; Calculate the second center point vector from the ideal pupil center position coordinate to each third center point position coordinate; Calculating a third vector angle between the first center point vector and each second center point vector; Selecting the absolute value error, the second vector angle, and the third vector angle corresponding to each third candidate spot number sequence as the first scoring index; Assigning a corresponding first preset weight to each first scoring indicator, and obtaining a first comprehensive score corresponding to each third candidate light spot number sequence through weighted calculation; A third candidate spot numbering sequence with the lowest first comprehensive score is selected as the spot numbering result sequence, and a loop is performed to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

11. A method for numbering light spots as claimed in claim 7, characterized in that: The method further comprises: If the number of light spots in the array of light spot positions to be numbered is greater than 2, a second light spot vector to be numbered between any two light spot position coordinates to be numbered is calculated to obtain a second light spot vector array to be numbered; Matching any two spot numbers in each second candidate spot numbering sequence with the middle light source number of the ideal spot numbering sequence, calculating the second ideal spot vector corresponding to each second spot vector to be numbered, and obtaining the second ideal spot vector array corresponding to the second spot vector array to be numbered; Calculate the second vector angle between each second to-be-numbered light spot vector and the corresponding second ideal light spot vector to obtain a second vector angle array corresponding to each second candidate light spot number sequence; Determine whether the maximum value of the second vector angle in each second vector angle array is greater than a fifth preset threshold; If the maximum second vector angle in the current second vector angle array is greater than a fifth preset threshold, the corresponding second candidate spot number sequence is deleted; If the maximum value of the second vector angle in the current second vector angle array is less than or equal to the fifth preset threshold, the corresponding second candidate light spot number sequence is retained as the fourth candidate light spot number sequence; Using all the reserved fourth candidate light spot number sequences, a fourth candidate light spot number sequence set is generated; Determine whether the number of the fourth candidate light spot number sequence is 1; If the number of the fourth candidate spot numbering sequence is 1, the fourth candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and the process is looped to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the array of spot positions to be numbered.

12. A method for numbering light spots as claimed in claim 11, characterized in that: The method further comprises: If the number of the fourth candidate light spot number sequences is not 1, determining whether the number of the fourth candidate light spot number sequences in the fourth candidate light spot number sequence set is 0; If the number of fourth candidate light spot numbering sequences in the fourth candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the third light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system; Compare the sizes of the converted coordinates of the positions of the third light spots, and identify the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule; The coordinates of the light spot position to be numbered corresponding to the identified interfering light spot are deleted from the current light spot position array to be numbered to obtain an updated light spot position array to be numbered, and the process is repeated until a first candidate light spot number sequence set is generated according to a first preset rule.

13. A method for numbering light spots as claimed in claim 12, characterized in that: The method further comprises: If the number of fourth candidate light spot numbering sequences in the fourth candidate light spot numbering sequence set is not 0, calculating the candidate light spot side lengths of each second light spot vector to be numbered to obtain a corresponding candidate light spot side length array; Calculate the ideal spot side lengths of the second ideal spot vectors corresponding to the second to-be-numbered spot vectors in each second ideal spot vector array, and obtain an ideal spot side length array corresponding to each fourth candidate spot number sequence; Calculate the spot side length ratio of each ideal spot side length in each ideal spot side length array divided by the corresponding candidate spot side length to obtain a spot side length ratio array corresponding to each fourth candidate spot number sequence; Select the corresponding maximum value and minimum value of the light spot side length ratio from each light spot side length ratio array; Calculate the first extreme value ratio of the maximum value of each spot side length ratio divided by the minimum value of the corresponding spot side length ratio; Determine whether each first extreme value ratio is greater than a sixth preset threshold; If the current first extreme value ratio is greater than the sixth preset threshold, the corresponding fourth candidate spot number sequence is deleted; If the current first extreme value ratio is less than or equal to the sixth preset threshold, the corresponding fourth candidate light spot number sequence is retained as the fifth candidate light spot number sequence; Using all the retained fifth candidate light spot number sequences, a fifth candidate light spot number sequence set is generated; Determine whether the number of the fifth candidate light spot number sequence is 1; If the number of the fifth candidate spot numbering sequence is 1, the fifth candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered, and the cycle is repeated based on each spot number in the spot numbering result sequence, and the coordinates of each spot position to be numbered in the array of spot positions to be numbered are saved to the corresponding storage bits of the corresponding spot position storage sequence in the typical value spot array.

14. A method for numbering light spots as claimed in claim 13, characterized in that: The method further comprises: If the number of the fifth candidate light spot number sequences is not 1, determining whether the number of the fifth candidate light spot number sequences in the fifth candidate light spot number sequence set is 0; If the number of the fifth candidate light spot numbering sequences in the fifth candidate light spot numbering sequence set is 0, then establishing an eye diagram horizontal line coordinate system, and determining the fourth light spot position conversion coordinates corresponding to the coordinates of each light spot position to be numbered in the current light spot position array to be numbered in the eye diagram horizontal line coordinate system; Compare the sizes of the converted coordinates of the positions of the fourth light spots, and identify the coordinates of the positions of the light spots to be numbered corresponding to the interfering light spots according to the second preset rule; The coordinates of the position of the light spot to be numbered corresponding to the identified interfering light spot are deleted from the current array of light spot positions to be numbered, so as to obtain an updated array of light spot positions to be numbered; According to the number of spots corresponding to the updated array of spots positions to be numbered, all sorting sequences corresponding to all light source numbers are regenerated and stored as updated first candidate spot numbering sequences as an updated first candidate spot numbering sequence set.

15. A method for numbering light spots as claimed in claim 14, characterized in that: The method further comprises: If the number of the fifth candidate light spot numbering sequences in the fifth candidate light spot numbering sequence set is not 0, calculating the inner angle of the light spot to be numbered between two adjacent second light spot vectors to be numbered to obtain an array of inner angles of the light spot to be numbered; Calculate the ideal spot inner angle between two adjacent second spot vectors to be numbered in each second ideal spot vector array to obtain an ideal spot inner angle array corresponding to each fifth candidate spot number sequence; Calculate the third difference between each of the to-be-numbered light spot inner angles and the corresponding ideal light spot inner angle in each ideal light spot inner angle array, and obtain a third difference array corresponding to each fifth candidate light spot numbering sequence; Obtain the maximum third difference value corresponding to each third difference value array; Selecting the maximum value of the second vector angle, the first extreme value ratio, and the third difference maximum value corresponding to each fifth candidate spot number sequence as the second scoring index; Assigning a corresponding second preset weight to each second scoring indicator, and obtaining a second comprehensive score corresponding to each fifth candidate light spot number sequence through weighted calculation; A fifth candidate spot numbering sequence with the lowest second comprehensive score is selected as the spot numbering result sequence, and a loop is performed to save the coordinates of each spot position to be numbered in the array of spot positions to be numbered to the corresponding storage bit of the corresponding spot position storage sequence in the typical value spot array based on each spot number in the spot numbering result sequence.

16. A method for numbering light spots according to any one of claims 6 to 15, characterized in that: The method further comprises: If the number of spots in the array of spots to be numbered is not greater than 1, the number of spots in the array of spots to be numbered is 1, and it is determined whether there is a spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array; If there is no spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array, the current array of spot positions to be numbered is not numbered, and the process is looped to process the array of spot positions to be numbered corresponding to the next frame of the original eye diagram; If there is a spot position storage sequence whose typical spot position coordinates are not initial values ​​in the current typical value spot array, the spot number of the spot position storage sequence corresponding to the typical spot position coordinates closest to the current spot position coordinates to be numbered is selected to obtain the corresponding spot number result sequence, and the cycle is repeated based on each spot number in the spot number result sequence to save each to-be-numbered spot position coordinate in the to-be-numbered spot position array to the corresponding storage bit of the spot position storage sequence in the typical value spot array.

17. A spot numbering system, characterized in that: The system for executing the steps in a spot numbering method according to any one of claims 1 to 16 comprises: An initialization module is used to initialize and detect the ideal light spot position coordinates of each light source in the light source group, and generate a sorted ideal light spot position array and a corresponding ideal light spot number sequence; A generating module, configured to receive the sorted array of light spot positions to be numbered, and generate a first candidate light spot numbering sequence set according to a first preset rule; A screening module that performs the following steps: Determine whether the number of light spots in the array of light spot positions to be numbered is greater than 1; If the number of light spots in the array of light spot positions to be numbered is greater than 1, a first light spot vector to be numbered between two adjacent light spot position coordinates to be numbered is calculated to obtain a first light spot vector array to be numbered; Matching two adjacent spot numbers in each first candidate spot number sequence with the middle light source number of the ideal spot number sequence, calculating the first ideal spot vector corresponding to each first to-be-numbered spot vector, and obtaining the first ideal spot vector array corresponding to each first to-be-numbered spot vector array; Calculate the first vector angle between each first to-be-numbered light spot vector and the corresponding first ideal light spot vector to obtain a first vector angle array corresponding to each first candidate light spot numbering sequence; Determine whether the maximum value of the first vector angle in each first vector angle array is greater than a first preset threshold; If the maximum first vector angle in the current first vector angle array is greater than a first preset threshold, the corresponding first candidate spot number sequence is deleted; If the maximum value of the first vector angle in the current first vector angle array is less than or equal to the first preset threshold, the corresponding first candidate light spot number sequence is retained as the second candidate light spot number sequence; Generate a set of second candidate light spot number sequences by using all the reserved second candidate light spot number sequences; The output module is used to determine whether the number of the second candidate spot numbering sequence is 1; if the number of the second candidate spot numbering sequence is 1, the second candidate spot numbering sequence is used as the spot numbering result sequence corresponding to the current array of spot positions to be numbered.

18. A spot numbering system as claimed in claim 17, characterized in that: The system further comprises: a storage module, configured to perform the following steps: Using the numbers of the light sources in the light source group, the storage numbers of the light spot position storage sequences corresponding to the light sources are sequentially set; Setting initial values ​​for each spot position storage sequence to construct a typical value spot array; Based on each spot number in the spot numbering result sequence, the coordinates of each spot position to be numbered in the spot position array to be numbered are saved to a corresponding storage bit of a corresponding spot position storage sequence in the typical value spot array; For each spot position storage sequence, the average value / median value / weighted sum value of all stored values ​​is calculated as the corresponding typical spot position coordinate.

19. A light spot numbering device, characterized in that: The device comprises: a processor and a memory; The memory is used to store one or more program instructions; The processor is used to run one or more program instructions to execute the steps of a spot numbering method as described in any one of claims 1 to 16.

20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a light spot numbering method according to any one of claims 1 to 16 are implemented.

Citation Information

Patent Citations

  • Light spot labeling method and system

    CN116051631A

  • Human eye image light spot classification method, system and device and storage medium

    CN116524581A