Distance calibration device, detection equipment and method
By designing a distance calibration device including a base, a first rotation shaft, a driving assembly and a rotating plate, the problem that the prior art cannot collect calibration data of multiple different distances is solved, and fast and efficient distance sensor calibration is achieved.
Patent Information
- Application Number
- CN202510551828.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2025-05-30
- Estimated Expiration
- 2045-04-29
AI Technical Summary
The prior art distance calibration device cannot cooperate with the distance sensor to achieve the acquisition of calibration data of multiple different distances.
A distance calibration device including a base, a first rotating shaft, a driving assembly and at least one rotating plate is designed. By the rotation of the first rotation axis, the distance sensor can irradiate to a plurality of distance measurement planes at different times, and collect calibration data of a plurality of different distances.
This device greatly reduces the acquisition time of distance sensor calibration data, which requires multiple movements of distance sensors or distance measurement planes to collect calibration data of multiple different distances compared to the prior art.
Smart Images

Figure CN120063186A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of distance calibration devices, and particularly to a distance calibration device, a detection device, and a method. Background Art
[0002] In the prior art, some detection devices (for example, the pupillary light reflex detection device hereinafter referred to as the pupil detection device) need to automatically calibrate the distance sensor inside before use or before leaving the factory. Generally, a distance sensor needs to collect calibration data at multiple different distances before accurate automatic calibration can be performed. However, the distance calibration device in the prior art cannot cooperate with the distance sensor to collect calibration data at multiple different distances. Summary of the Invention
[0003] The purpose of the present application is to provide a distance calibration device, a detection device, and a method to solve the technical problem that the distance calibration device in the prior art cannot enable the distance sensor to collect calibration data at multiple different distances.
[0004] To achieve the above purpose, the present application provides the following technical solutions: In the first aspect, the present application proposes a distance calibration device. The distance calibration device is applied to the calibration of a distance sensor, and the distance calibration device includes: A base; the base includes a ranging bottom plate, and the ranging bottom plate includes a first ranging plane; the base is used to place the distance sensor; A first rotating shaft, rotatably connected to the ranging bottom plate; At least one rotating plate; each rotating plate is arranged at intervals along the axial direction of the first rotating shaft on the first rotating shaft; each rotating plate includes a second ranging plane; the normal lines of the first ranging plane and each second ranging plane are parallel to the axis of the first rotating shaft, and the first ranging plane and each second ranging plane face the same direction; if the first rotating shaft rotates, the distance sensor can irradiate the first ranging plane and each second ranging plane at different times; A driving component, arranged on the ranging bottom plate, for driving the first rotating shaft to rotate.
[0005] In the second aspect, the present application proposes a detection device, which includes a distance sensor and the distance calibration device in the above technical solution; the distance calibration device is used to calibrate the distance sensor.
[0006] In the third aspect, the present application proposes a method for using a detection device. The method for using is applied to the detection device in the above technical solution, and the detection device has an image acquisition function. The method for using includes: Obtain a first data set, where the data in the first data set is the distance collected by the detection device; before obtaining the first data set, use a distance calibration device to pre-calibrate the distance sensor in the detection device; Determine the current state of the detection device according to the first data set and the previous state of the detection device; Start or stop image acquisition according to the current state of the detection device; The states of the detection device include an observation state and a non-observation state. The observation state is the state of performing image acquisition, and the non-observation state is the state of not performing image acquisition.
[0007] Compared with the prior art, the beneficial effects of this application are: Through the settings of the first rotating shaft, the distance measuring base plate and the rotating plate in this application, it is convenient for the distance sensor to collect calibration data at multiple different distances. Compared with the prior art that requires moving the distance sensor or the position of the distance measuring plane multiple times to collect calibration data at multiple different distances, the distance calibration device proposed in this application can greatly reduce the acquisition time of the calibration data of the distance sensor. Description of the Drawings
[0008] Figure 1 Is a three-dimensional schematic diagram of a distance calibration device proposed in an embodiment of this application; Figure 2 Is Figure 1 The front view schematic diagram of the distance calibration device in Figure 3 Is Figure 1 The right view schematic diagram of the distance calibration device in Figure 4 Is a three-dimensional schematic diagram of another distance calibration device proposed in an embodiment of this application; Figure 5 Is Figure 4 The top view schematic diagram of the distance calibration device in (the first rotating shaft is in the second working state); Figure 6 Is Figure 4 The top view schematic diagram of the distance calibration device in (the first rotating shaft is in the first working state); Figure 7 Is a three-dimensional schematic diagram of another distance calibration device proposed in an embodiment of this application; Figure 8 Is a three-dimensional schematic diagram of a speed stabilizing component proposed in an embodiment of this application; Figure 9 Is a three-dimensional schematic diagram of another distance calibration device proposed in an embodiment of this application; Figure 10 Is a three-dimensional schematic diagram of another speed stabilizing component proposed in an embodiment of this application; Figure 11 A three-dimensional schematic diagram of yet another distance calibration device proposed in the embodiment of the present application; Figure 12 is Figure 11 a right view schematic diagram of the distance calibration device in Figure 13 A structural schematic diagram of a detection device proposed in the embodiment of the present application; Figure 14 A schematic flow chart of the method provided in the embodiment of the present application; Figure 15 A state schematic diagram of the pupil detection device in the embodiment of the present application; Figure 16 A schematic diagram of the distance collected by the pupil detection device in the embodiment of the present application; Figure 17 A schematic diagram of obtaining a second image based on a first image proposed in the embodiment of the present application; Figure 18 A schematic diagram of obtaining an iris edge image based on the second image proposed in the embodiment of the present application; Figure 19 A schematic diagram of obtaining a region of interest based on the iris edge image proposed in the embodiment of the present application.
[0009] In the figure: 1. Base; 11. Distance measuring base plate; 12. Positioning part; 2. First rotating shaft; 3. Rotating plate; 31. First rotating plate; 32. Second rotating plate; 4. Driving component; 41. Motor; 42. Second rotating shaft; 43. Third gear; 44. Fourth gear; 45. Fifth gear; 46. Sixth gear; 47. First gear; 48. Second gear; 5. Distance sensor; 6. Constant speed component; 61. Connecting rod; 62. First counterweight; 63. First elastic member; 64. Sleeve; 65. Telescopic rod; 66. Second counterweight; 67. Second elastic member; 7. Detection device; 71. Distance calibration device. Detailed implementation manners
[0010] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.
[0011] It should be noted that in the description of the present application, the orientation or positional relationship indicated by terms such as "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. This is only for the convenience of describing the present application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as a limitation to the present application.
[0012] In addition, it should be understood that for the convenience of description, the dimensions of the various components shown in the drawings are not drawn in accordance with the actual proportional relationship. For example, the thickness or width of some layers may be exaggerated relative to other layers.
[0013] It should be noted that similar reference numerals and letters represent similar items in the following drawings. Therefore, once an item is defined or described in one drawing, it will not be necessary to further specifically discuss and describe it in the description of subsequent drawings.
[0014] In order to solve the technical problem in the background art that the existing distance calibration device cannot cooperate with the distance sensor to collect calibration data at multiple different distances, the present application proposes a distance calibration device. This distance calibration device is applied to the calibration of the distance sensor 5. The distance calibration device includes a base 1, a first rotating shaft 2, a driving component 4, and at least one rotating plate 3. The base 1 includes a distance measuring bottom plate 11, and the distance measuring bottom plate 11 includes a first distance measuring plane. The base 1 is used to mount or place the distance sensor 5. The first rotating shaft 2 is rotatably connected to the distance measuring bottom plate 11. Each rotating plate 3 is arranged at intervals along the axial direction of the first rotating shaft 2 on the first rotating shaft 2, and each rotating plate 3 includes a second distance measuring plane. The normal lines of the first distance measuring plane and each second distance measuring plane are parallel to the axis line of the first rotating shaft 2, and the orientations of the first distance measuring plane and each second distance measuring plane are the same. If the first rotating shaft 2 rotates, the distance sensor 5 can irradiate the first distance measuring plane and each second distance measuring plane at different times respectively. The driving component 4 is arranged on the distance measuring bottom plate 11 and is used to drive the first rotating shaft 2 to rotate.
[0015] In the embodiments of the present application, there is no limitation on the number of the rotating plates 3, and an appropriate number of rotating plates 3 can be selected according to requirements. In the following, only the embodiment with two rotating plates 3 (i.e., the first rotating plate 31 and the second rotating plate 32) is used to illustrate the present application, which does not mean that the distance calibration device proposed by the present application can only be provided with two rotating plates 3. It should be understood that the embodiments of the present application can be provided with any number of rotating plates 3 according to requirements. For example, one rotating plate 3 can be provided, or four rotating plates 3 can be provided, etc.
[0016] It should be noted that the ranging principle of the distance sensor follows the time-of-flight method. The time-of-flight method refers to emitting a particularly short wave (such as: light wave, sound wave, or electromagnetic wave, etc.) and measuring the time interval after this wave is emitted and then reflected back by an object (in this embodiment, it is the first ranging plane or the second ranging plane). Then, the distance between the distance sensor and the object is calculated through this time interval. This is a mature technology and will not be elaborated here. That is to say, in this embodiment, the distance sensor 5 can be a distance sensor that emits any wave. For example, the distance sensor 5 can be a laser distance sensor, an optical distance sensor, an infrared distance sensor, or an ultrasonic distance sensor, etc.
[0017] It should be noted that in the embodiments of the present application, the ranging plane (that is, the first ranging plane and the second ranging plane) refers to the plane used to reflect the wave emitted by the distance sensor 5. As can be seen from the foregoing, since the respective rotating plates 3 are arranged at intervals along the axial direction of the first rotating shaft 2 on the first rotating shaft 2, therefore, as Figure 2 shown, when calibrating, the distances between the first ranging plane and each second ranging plane and the distance sensor 5 are not the same, and they are the distance S1, the distance S2, and the distance S3 respectively.
[0018] In the embodiments of the present application, the distances S1, S2, and S3 can be set according to requirements. For example, in the application scenario of the pupillary light reflex, a doctor generally controls a handheld detection device at a distance of 5 cm to 15 cm from the pupil. That is to say, in the application scenario of the pupillary light reflex, the distance sensor 5 only needs to ensure accurate ranging within the range of 5 cm to 15 cm to meet the usage requirements. In other words, in the application scenario of the pupillary light reflex, the distance S1 can be 5 cm, the distance S2 can be 10 cm, and the distance S3 can be 15 cm. Of course, the distances S1, S2, and S3 can also be set to other distance values according to requirements.
[0019] As can be seen from the foregoing, if the first rotating shaft 2 rotates, the distance sensor 5 can sequentially irradiate the first ranging plane and each second ranging plane. That is to say, in this embodiment, as long as the first rotating shaft 2 is rotated, the distance sensor 5 can sequentially irradiate the first ranging plane and each second ranging plane. In other words, by rotating the first rotating shaft 2, the distance sensor 5 can collect calibration data at multiple different distances. Compared with the prior art where it is necessary to move the distance sensor or the ranging plane multiple times to collect calibration data at multiple different distances, the distance calibration device proposed in the present application can greatly reduce the acquisition time of the calibration data of the distance sensor.
[0020] It should be noted that the distance sensor 5 performs manual calibration or automatic calibration based on the collected calibration data at multiple different distances, which is a mature technology and will not be elaborated here.
[0021] In the embodiments of the present application, there are no restrictions on the shape and structure of the base 1, as long as the base 1 can support various parts (such as: the first rotating shaft 2 and the motor 41, etc.), and has a ranging bottom plate 11. For example: the base 1 can be set as a bracket-shaped structure, or the base 1 can be set as an L-shaped sheet structure as Figure 1 shown.
[0022] In the embodiments of the present application, there are also no restrictions on the shape and structure of the ranging bottom plate 11. For example: the ranging bottom plate 11 can be in the shape of a semi-circular block or a triangular block, etc., or it can be in the shape of a square block as Figures 1 to 3 shown.
[0023] In order to avoid relative displacement between the base 1 and the distance sensor 5 during calibration, which may affect the calibration result, in an embodiment of the present application, the base 1 may further include a positioning portion 12. The positioning portion 12 is used to limit the relative displacement between the base 1 and the distance sensor 5. In this embodiment, the positioning portion 12 can be any suitable component or structure for limiting the relative displacement between the base 1 and the distance sensor 5. For example: the distance sensor 5 can be tubular, and the positioning portion 12 can be a pipe clamp provided on the base 1 (the pipe clamp is a prior art and will not be elaborated). Or it can be as Figure 1 shown, the positioning portion 12 is a profiling groove provided on the base 1, and the profiling groove is adapted to the distance sensor 5. When in use, the distance sensor 5 is snapped into the profiling groove in the vertical direction, then the distance sensor 5 and the base 1 cannot generate any relative displacement on the horizontal plane.
[0024] In the embodiments of the present application, there are no restrictions on the shape and structure of the rotating plate 3, as long as the projections of any two rotating plates 3 among the rotating plates 3 on the first ranging plane do not overlap or do not completely overlap. It is easy to understand that if the projections of any two rotating plates 3 among the rotating plates 3 along the axial direction of the first rotating shaft 2 (i.e., the normal direction of each second ranging plane) do not coincide, then during the rotation of the first rotating shaft 2, the distance sensor 5 will definitely be able to irradiate each rotating plate 3, that is, irradiate each second ranging plane. For example: the rotating plate 3 can be as Figure 1 and Figure 3 shown, in the shape of an equilateral triangle sheet; or it can be as Figure 11 and Figure 12 shown, in the shape of a petal-shaped sheet.
[0025] It should be noted that the distance calibration device proposed in this application can also detect and calibrate whether the test frequency and upload frequency of the distance sensor 5 match. It is easy to understand that if the test frequency of the distance sensor 5 is less than the upload frequency, it will definitely cause duplicate data upload, that is, the test results of the distance sensor 5 will be inaccurate. For example, assume that the test frequency of the distance sensor 5 is 20 times per second, and the upload frequency is 30 times per second. Then, among the 30 distance test results uploaded per second, 10 test results will definitely be duplicates, resulting in incorrect test results.
[0026] It is easy to understand that if the test frequency of the distance sensor 5 is less than the upload frequency (that is, the test frequency and upload frequency of the distance sensor 5 do not match), the distance sensor 5 will definitely have periodic and continuous repeated detection results. In this embodiment, the continuous detection result refers to a detection result whose value is the same as that of the previous detection result. For example, if the 20th and 21st test results of the distance sensor 5 in a certain second are both 10.34 cm, it means that the 21st detection result in this second is a continuous detection result. In this embodiment, the periodic and continuous repeated detection result means that the detection results of a certain number of times in each second are always continuous detection results. For example, the 20th and 21st test results of a certain second are both 10.34 cm; the 20th and 21st test results of another second are both 5.21 cm, which means that the 21st detection result in each second is probably a periodic and continuous repeated detection result.
[0027] In the prior art, since the distance between the distance sensor 5 and the ranging plane is fixed, the multiple test results are extremely close to each other. In other words, even if there are periodic and continuous repeated detection results, it is difficult to determine whether such detection results are caused by the relatively high test stability of the distance sensor 5 itself or by the mismatch between the test frequency and upload frequency of the distance sensor 5. In the embodiment of this application, since the first rotating shaft 2 can drive each rotating plate 3 to rotate, the distance between the distance sensor 5 and the ranging plane also changes dynamically. For example, if the test point is located on the second rotating plate 32 (that is, the point A as shown in Figure 3 ), the distance between the distance sensor 5 and the ranging plane is Figure 2 the distance S1 in; if the test point is located on the ranging bottom plate 11 (that is, the point A as shown in Figure 12 ), the distance between the distance sensor 5 and the ranging plane is Figure 2The distance S3 therein. That is to say, the distance between the distance sensor 5 and the ranging plane has been changing between the distance S1 and the distance S3. Therefore, even if the test stability of the distance sensor 5 is relatively high, it is difficult to obtain periodic and repeated continuous detection results. If periodic and repeated continuous detection results occur, it is very likely that the test frequency and upload frequency of the distance sensor 5 do not match. Based on this, it can be determined whether the test frequency and upload frequency of the distance sensor match.
[0028] In an embodiment of the present application, it is assumed that the upload frequency of the distance sensor 5 is y times per second, where y is any positive integer greater than or equal to 2; the calibration data acquisition duration of the distance sensor 5 is z seconds, where z is any positive integer greater than or equal to 1. In this embodiment, the calibration data of the distance sensor 5 can be segmented into z time series according to a time length of 1 second. That is to say, the number of data values in each time series is y. In order to determine how many of the detection results uploaded every y times belong to periodic and repeated continuous detection results, in this embodiment, the repeatability value of each detection result can be calculated. The larger the repeatability value, the more likely it is that the detection result uploaded this time is a repeatedly uploaded detection result. Specifically, in this embodiment, the calculation formula for the repeatability value of the i-th detection result among the detection results uploaded every y times is as follows:
[0029] Among them, represents the repeatability value of the i-th detection result among the detection results uploaded every y times, where i is greater than or equal to 1 and less than or equal to y; represents the serial number of the j-th time series, where j is greater than or equal to 1 and less than or equal to z; represents whether the i-th detection result in the j-th time series is a continuous detection result. If it is a continuous detection result, then = 1. If it is not a continuous detection result, then = 0; z represents the number of time series.
[0030] In this embodiment, if the repeatability value of the i-th detection result among the detection results uploaded every y times is greater than or equal to 0.9 (of course, in other embodiments of the present application, it can be set to other values according to requirements, such as 0.8 or 0.7, etc.), then it can be considered that the i-th detection result among the detection results uploaded every y times must be a periodically repeated and continuous detection result. In an application scenario where the test frequency and upload frequency of the distance sensor are not adjustable, this method can be used to detect whether the test frequency and upload frequency of the distance sensor 5 match. In an application scenario where the test frequency and upload frequency of the distance sensor are adjustable, based on the number of periodically repeated and continuous detection results per second, the test frequency and upload frequency of the distance sensor can be adjusted and calibrated manually or automatically. For example: if the number of periodically repeated and continuous detection results per second is m, and m is a positive integer greater than or equal to 1, then the test frequency can be increased by m times per second, or the upload frequency can be decreased by m times per second.
[0031] It should be clear that for a distance sensor with adjustable test frequency and upload frequency, adjusting its test frequency and upload frequency is a mature technology and will not be elaborated here.
[0032] In an embodiment of the present application, the driving component 4 can be a crank (not shown in the figure) provided on the first rotating shaft 2. During use, manual operation can be adopted to drive the first rotating shaft 2 to rotate through the crank. Driving the rotating shaft manually through the crank is a mature technology and will not be elaborated here. As described below, if the first rotating shaft 2 cannot perform periodic and stable rotation, it is impossible to use this distance calibration device to determine whether the test period of the distance sensor 5 is stable, and it is even more impossible to use this distance calibration device to calibrate the test period of the distance sensor 5. However, it is difficult to make the first rotating shaft 2 perform periodic and stable rotation by manually driving the first rotating shaft 2 through the crank.
[0033] In order to enable the first rotating shaft 2 to perform periodic and stable rotation, in an embodiment of the present application, as Figure 1 and Figure 2 shown, the driving component 4 can be a motor, and the motor is used to directly drive the first rotating shaft 2 to rotate. By driving the first rotating shaft 2 with the motor, it is easy to make the first rotating shaft 2 form periodic and stable rotation.
[0034] It is easy to understand that the rotation speed of the motor is relatively fast. If the motor is directly used to drive the first rotating shaft 2 to rotate, the rotation speed of the first rotating shaft 2 will also be relatively fast. In the application scenario of the pupil light reflex detection device proposed in this application, if the rotation speed of the first rotating shaft 2 is relatively fast, it may cause the distance sensor 5 to be unable to obtain different distance data. For example, if the rotation speed of the first rotating shaft 2 is 30 revolutions per second and the test frequency of the distance sensor 5 is 30 times per second, the distance sensor 5 can only test one distance data all the time. Specifically, in the application scenario of the pupil light reflex detection device, the rotation speed of the first rotating shaft 2 generally remains at about 1 revolution per second. Based on this, in an embodiment of the present application, the driving assembly 4 may include a motor 41, a first gear 47, and a second gear 48. As Figure 7 shown, the motor 41 is arranged on the ranging bottom plate 11. The first gear 47 is arranged at the output end of the motor 41. The second gear 48 is arranged on the first rotating shaft 2, and the second gear 48 meshes with the first gear 47. During design, the appropriate transmission ratio between the motor 41 and the first rotating shaft 2 can be achieved through the sizes of the first gear 47 and the second gear 48, that is, the rotation speed of the first rotating shaft 2 can meet the usage requirements through the sizes of the first gear 47 and the second gear 48.
[0035] As can be seen from the foregoing, in this embodiment, when calibrating whether the test frequency and upload frequency of the distance sensor 5 match, if there are periodic and repeated continuous detection results, it can be basically determined that the detection result is a repeatedly uploaded result. In order to accurately determine the number of periodic and repeated continuous detection results, in an embodiment of the present application, the periodic and repeated continuous detection results can be reconfirmed to improve the confirmation accuracy of the periodic and repeated continuous detection results. It should be clear that if, during the first calibration process, the i-th detection result among every y uploaded detection results is confirmed as a periodic and repeated continuous detection result, and during the second calibration process, the i-th detection result among every y uploaded detection results is also a periodic and repeated continuous detection result, it can be determined that the i-th detection result among every y uploaded detection results must be a periodic and repeated continuous detection result.
[0036] When collecting the second calibration data, the rotation speed of the first rotating shaft 2 or the distance between each rotating plate 3 and the distance sensor 5 can be adjusted, so as to increase the difference between the first calibration data and the second calibration data, and avoid the systematic error caused by the first calibration data and the second calibration data being relatively close. In order to enable the operator to adjust the rotation speed of the first rotating shaft 2 and the distance between each rotating plate 3 and the distance sensor 5 simultaneously during the second calibration process, in an embodiment of the present application, the driving assembly 4 may include a motor 41, a second rotating shaft 42, a third gear 43, a fourth gear 44, a fifth gear 45, and a sixth gear 46. AsFigure 5 As shown, the second rotating shaft 42 is rotatably connected to the distance measuring base plate 11. As Figure 4 shown, the third gear 43 and the fourth gear 44 are both arranged on the second rotating shaft 42. The fifth gear 45 and the sixth gear 46 are both arranged on the first rotating shaft 2. The first rotating shaft 2 can slide along its axis to form a first working state or a second working state. When the first rotating shaft 2 is in the first working state, as Figure 6 shown, the third gear 43 and the fifth gear 45 are engaged with each other. When the first rotating shaft 2 is in the second working state, as Figure 5 shown, the fourth gear 44 and the sixth gear 46 are engaged with each other. The transmission ratios of the third gear 43 and the fifth gear 45, and the fourth gear 44 and the sixth gear 46 are not equal. The motor 41 is arranged on the distance measuring base plate 11 and is used to drive the second rotating shaft 42 to rotate. Of course, in other embodiments of the present application, the motor 41 may not be arranged on the distance measuring base plate 11, but at other suitable positions on the base 1, which will not be listed and elaborated here.
[0037] During use, as Figure 6 shown, first engage the third gear 43 and the fifth gear 45, that is, make the first rotating shaft 2 in the first working state, then the motor 41 can drive the third gear 43 to rotate through the second rotating shaft 42. Since the third gear 43 and the fifth gear 45 are engaged, the third gear 43 can also drive the fifth gear 45 to rotate. Since the fifth gear 45 is arranged on the first rotating shaft 2, the fifth gear 45 can drive the first rotating shaft 2 to rotate. After the first calibration data is collected, move the first rotating shaft 2 along the axial direction of the first rotating shaft 2 to make the fourth gear 44 and the sixth gear 46 as Figure 5 shown be engaged with each other, that is, make the first rotating shaft 2 in the second working state, then the motor 41 can drive the fourth gear 44 to rotate through the second rotating shaft 42. Since the fourth gear 44 and the sixth gear 46 are engaged, the fourth gear 44 can drive the sixth gear 46 to rotate. Since the sixth gear 46 is arranged on the first rotating shaft 2, the sixth gear 46 can drive the first rotating shaft 2 to rotate, so that the distance sensor 5 can collect the second calibration data.
[0038] It should be clear that in this embodiment, since the transmission ratios of the third gear 43 and the fifth gear 45, and the fourth gear 44 and the sixth gear 46 are not equal, the rotational speeds of the first rotating shaft 2 in the first working state and the second working state must be different. Since the first rotating shaft 2 needs to move axially when switching between working states, the distances between each rotating plate 3 and the distance sensor 5 when the first rotating shaft 2 is in the first working state and the second working state must also be different. In other words, in the embodiment of the present application, only by moving the first rotating shaft 2 axially can the switching of the rotational speed of the first rotating shaft 2 and the distances between each rotating plate 3 and the distance sensor 5 be achieved simultaneously.
[0039] In the application scenario of the pupillary light reflex, it is necessary to accurately correspond the distance data (obtained by the distance sensor) and the video data (obtained by the micro camera) acquired by the detection device according to time, and then correct image results can be obtained based on these data. If the test period of the distance sensor is unstable, it is difficult to accurately correspond the distance data and the video data according to time one by one, that is, the subsequent obtained image results have errors.
[0040] In the embodiment of the present application, the stability of the test period of the distance sensor 5 can be determined based on the distance calibration device. On the premise that the first rotating shaft 2 rotates uniformly and the rotational speed is an integer multiple of 1 revolution per second, if the test period of the distance sensor 5 is stable, then each test result obtained by the distance sensor 5 every second during the calibration process is similar. For example: if the first rotating shaft 2 rotates uniformly and the rotational speed is 1 revolution per second, and the test period of the distance sensor 5 is 100 milliseconds, then the distance sensor 5 can test a total of 10 distance values per second. If the test period of the distance sensor 5 is stable, the 10 distance values tested in any two seconds among the 1st second, 2nd second, 3rd second... nth second of the distance sensor must be similar, where n is a positive integer greater than or equal to 2. Based on this, the stability of the test period of the distance sensor can be determined.
[0041] In an embodiment of the present application, it is assumed that the test frequency of the distance sensor 5 is x times per second, that is, the test period of the distance sensor 5 is 1000 / x milliseconds. The calibration data acquisition duration of the distance sensor 5 is z seconds, where z is any positive integer greater than or equal to 1. In this embodiment, the calibration data of the distance sensor 5 can be segmented into z time series according to a time length of 1 second. That is to say, the number of data values in each time series is x (that is, the test frequency and upload frequency of the distance sensor 5 are the same). As can be seen from the foregoing, if the test period of the distance sensor is stable, the similarity of the above z time series is extremely high. Furthermore, by calculating the similarity of each time series, it is determined whether the test period of the distance sensor 5 is stable. As can be seen from the foregoing, the higher the similarity of each time series, the more stable the test period of the distance sensor 5; the lower the similarity of each time series, the more unstable the test period of the distance sensor 5. Calculating the similarity between sequences is a mature technology and will not be elaborated here.
[0042] In an application scenario where the test period of the distance sensor is not adjustable, it is possible to determine whether it is necessary to replace the distance sensor based on the magnitude of the similarity. For example: if the similarity is less than 0.9, the distance sensor can be replaced. In an application scenario where the test period of the distance sensor is adjustable, it is possible to calibrate the test period of the distance sensor based on the magnitude of the similarity so that the above similarity of the adjusted distance sensor is greater than or equal to 0.9 (of course, in other embodiments of the present application, it can be set to other values according to requirements, such as: 0.8 or 0.7, etc.). For a distance sensor with an adjustable test period, adjusting its test period is a mature technology and will not be elaborated here.
[0043] It should be noted that in the process of determining whether the test period of the distance sensor is stable, if the rotation speed of the first rotating shaft 2 is unstable, it may also cause the similarity between the above time series to be low. In order to avoid the phenomenon that the similarity between the above time series is low due to the unstable rotation speed of the first rotating shaft 2, in an embodiment of the present application, the motor 41 can be a servo motor. A servo motor is a motor that realizes high-precision position, speed, and torque control through a closed-loop control system. That is to say, if the motor 41 is a servo motor, the rotation speed of the first rotating shaft 2 can tend to be stable.
[0044] In order to further stabilize the rotation speed of the first rotating shaft 2, in an embodiment of the present application, the first rotating shaft 2 can also be provided with a speed stabilizing component 6. The speed stabilizing component 6 is used to absorb energy to reduce the increase amplitude of the rotation speed of the first rotating shaft 2 when the rotation speed of the first rotating shaft 2 increases; and, when the rotation speed of the first rotating shaft 2 decreases, it is used to release energy to reduce the decrease amplitude of the rotation speed of the first rotating shaft 2.
[0045] In an embodiment of the present application, any device that meets the above functions can be used as the speed stabilizing component 6. For example, the speed stabilizing component 6 can be as shown in the following two embodiments.
[0046] Embodiment 1 of the speed stabilizing component In this embodiment, as Figure 7 and Figure 8 shown, the speed stabilizing component 6 may include a plurality of connecting rods 61, first counterweight blocks 62 corresponding to the connecting rods 61 one by one, and first elastic members 63. As Figure 8 shown, each connecting rod 61 is uniformly distributed around the axis of the first rotating shaft 2, and the first end of each connecting rod 61 is hinged to the first rotating shaft 2. The first counterweight block 62 is arranged at the second end of the corresponding connecting rod 61, one end of the first elastic member 63 is connected to the first rotating shaft 2, and the other end is connected to the corresponding connecting rod 61. In this embodiment, there is no restriction on the hinging direction of the connecting rod 61 and the first rotating shaft 2, as long as the connecting rod 61 does not rotate circumferentially around the first rotating shaft 2.
[0047] During use, if the first rotating shaft 2 accelerates, under the centrifugal force of inertia, the first counterweight block 62 drives the second end of the corresponding connecting rod 61 to rotate away from the first rotating shaft 2. If the second end of the connecting rod 61 rotates away from the first rotating shaft 2, the corresponding first elastic member 63 is stretched, the first elastic member 63 absorbs energy, and the elastic potential energy of the first elastic member 63 increases, that is, the increase amplitude of the rotation speed of the first rotating shaft 2 is reduced. If the first rotating shaft 2 decelerates, under the action of the elastic force of the first elastic member 63, the corresponding connecting rod 61 drives the first counterweight block 62 at its second end to rotate towards the first rotating shaft 2. If the connecting rod 61 and the corresponding first counterweight block 62 rotate towards the first rotating shaft 2, the first elastic member 63 actively contracts, the first elastic member 63 releases energy, and the elastic potential energy of the first elastic member 63 decreases, that is, the decrease amplitude of the rotation speed of the first rotating shaft 2 is reduced.
[0048] Embodiment 2 of the speed stabilizing component In this embodiment, as Figure 9 and Figure 10 shown, the speed stabilizing component 6 includes a plurality of sleeves 64, telescopic rods 65 corresponding to the sleeves 64 one by one, second counterweight blocks 66, and second elastic members 67. As Figure 10 shown, each sleeve 64 is uniformly distributed around the axis of the first rotating shaft 2, and each sleeve 64 is connected to the first rotating shaft 2. The telescopic rod 65 coincides with the axis of the corresponding sleeve 64, and the telescopic rod 65 forms a sliding connection along its axis with the corresponding sleeve 64, and the first end of the telescopic rod 65 is located inside the corresponding sleeve 64. One end of the second elastic member 67 is connected to the first end of the telescopic rod 65, and the other end is connected to the first rotating shaft 2. The second counterweight block 66 is arranged at the second end of the telescopic rod 65.
[0049] During use, if the first rotating shaft 2 accelerates, then under the centrifugal force of inertia, the second counterweight 66 drives the telescopic rod 65 to move away from the first rotating shaft 2. If the telescopic rod 65 moves away from the first rotating shaft 2, the second elastic member 67 is stretched, the second elastic member 67 absorbs energy, and the elastic potential energy of the second elastic member 67 increases, that is, the increase amplitude of the rotation speed of the first rotating shaft 2 is reduced. If the first rotating shaft 2 decelerates, then under the action of the elastic force of the second elastic member 67, the telescopic rod 65 drives the second counterweight 66 to move closer to the first rotating shaft 2. If the telescopic rod 65 moves closer to the first rotating shaft 2, the second elastic member 67 actively contracts, that is, the second elastic member 67 releases energy, and the elastic potential energy of the second elastic member 67 decreases, that is, the decrease amplitude of the rotation speed of the first rotating shaft 2 is reduced. Thus, the description of the second embodiment of the speed stabilizing component is completed.
[0050] It should be clear that in the embodiments of the present application, there are no restrictions on the shapes and structures of the first counterweight 62 and the second counterweight 66, as long as they have a counterweight function. For example: the first counterweight 62 and the second counterweight 66 can be square blocks, or can be spherical blocks as shown in Figure 8 and Figure 10 . In the embodiments of the present application, there are also no restrictions on the shapes, structures, and materials of the first elastic member 63 and the second elastic member 67, as long as they can absorb and release energy. For example: the first elastic member 63 and the second elastic member 67 can be long strip-shaped or circular rubber bands, or the first elastic member 63 and the second elastic member 67 can be springs as shown in Figure 8 and Figure 10 .
[0051] The distance calibration device proposed in the embodiments of the present application, through the settings of the first rotating shaft, the distance measuring bottom plate, and the rotating plate, facilitates the distance sensor to collect calibration data at multiple different distances. Compared with the prior art that requires moving the position of the distance sensor or the distance measuring plane multiple times to collect calibration data at multiple different distances, the distance calibration device proposed in the present application can greatly reduce the acquisition time of the calibration data of the distance sensor.
[0052] After introducing the distance calibration device proposed in the embodiments of the present application, the following introduces a detection device proposed in the present application. Specifically, as shown in Figure 13 , the detection device 7 includes a distance sensor 5 and a distance calibration device 71. The distance calibration device 71 is as shown in any one of the above embodiments, and the distance calibration device 71 is used to calibrate the distance sensor 5.
[0053] The detection device proposed in the embodiments of the present application includes a distance calibration device. Through the settings of the first rotating shaft, the distance measurement bottom plate, and the rotating plate, it is convenient for the distance sensor to collect calibration data at multiple different distances. Compared with the prior art where the position of the distance sensor or the distance measurement plane needs to be moved multiple times to collect calibration data at multiple different distances, the distance calibration device proposed in the present application can significantly reduce the acquisition time of the calibration data of the distance sensor.
[0054] After introducing the detection device proposed in the embodiments of the present application, the following introduces a usage method of a detection device proposed in the present application. Specifically, Figure 14 It is a schematic flowchart of a usage method of a detection device provided in the embodiments of the present application. Taking the detection device as a pupil detection device as an example, this method will be introduced below. As Figure 14 shown, the usage method of this pupil detection device includes Step 101 to Step 103.
[0055] Step 101, the pupil detection device acquires the first data set.
[0056] Among them, the data in the first data set is the distance collected by the pupil detection device. It should be clear that collecting the distance through the distance sensor 5 is a mature technology and will not be elaborated here.
[0057] Step 102, the pupil detection device determines the current state of the pupil detection device according to the first data set and the previous state of the pupil detection device.
[0058] Among them, the states of the pupil detection device include an observation state and a non-observation state. The observation state is the state of performing image acquisition, and the non-observation state is the state of not performing image acquisition.
[0059] Referring to Figure 15 , Figure 15 It is a schematic diagram of the states of the pupil detection device in the embodiments of the present application. In some embodiments, the observation state includes a start observation state and an ongoing observation state. The non-observation state includes an active state, an end observation state, and a standby state. Among them, the standby state is the state when the pupil detection device is in the standby stage. For example, the pupil detection device is fixedly connected to the pupil pen, and the pupil pen is placed on the table. The active state is the state when the user uses the pupil detection device during the active stage. For example, the doctor picks up the pupil pen from the table.
[0060] By setting the observation state and the non-observation state, and dividing the observation state into a start observation state and an ongoing observation state, and dividing the non-observation state into an active state, an end observation state, and a standby state. It realizes the distinction of the states of the pupil detection device according to the common operation process of the user, so that in subsequent operations, corresponding processing can be performed according to the current state of the pupil detection device.
[0061] In some embodiments, the pupil detection device determines the current state of the pupil detection device based on the currently acquired distance, the previous distance, and the previous state of the pupil detection device. For example: The first distance acquired by the pupil detection device is 410, and the state of the pupil detection device is the initial state, and the initial state is the standby state. The second distance acquired by the pupil detection device is 410, and the previous state is the standby state. Since the absolute value of the difference between the second distance acquired by the pupil detection device and the previous distance (the first distance) acquired by the pupil detection device is less than a preset difference, for example, the preset difference is 150. The current state of the pupil detection device remains unchanged and is still the standby state. The 50th distance acquired by the pupil detection device is 410, and the 51st distance is 240. When the pupil detection device acquires the 50th distance, the state is the standby state. Since the absolute value of the difference between the 51st distance and the 50th distance is greater than the preset difference, the current state of the pupil detection device changes to the active state.
[0062] Step 103, the pupil detection device turns on or off image acquisition according to the current state of the pupil detection device.
[0063] In some embodiments, when the current state of the pupil detection device is the active state or the standby state, the pupil detection device does not turn on image acquisition, or rather, the pupil detection device does not change the state of image acquisition. If image acquisition has already been turned on, image acquisition continues. If image acquisition has not been turned on, image acquisition continues to be not turned on. Thereby reducing the opening and closing operations of the image sensor and improving the continuity of the video.
[0064] Refer to Figure 16 , Figure 16 is a schematic diagram of the distance acquired by the pupil detection device. The horizontal axis is the Nth distance acquired by the pupil detection device, with the unit of "number", and N is a positive integer. The vertical axis is the distance acquired by the pupil detection device, with the unit of millimeter.
[0065] For example, intervals 1 to 7 represent the standby state, the active state, the start observation state, the ongoing observation state, the end observation state, the active state, and the standby state in sequence. When the state of the pupil detection device is the start observation state, the pupil detection device turns on image acquisition. Subsequently, when the pupil detection device is in the ongoing observation state, the pupil detection device is still performing image acquisition. Then, when the pupil detection device is in the end observation state, the pupil detection device turns off image acquisition.
[0066] Taking the example of a doctor examining a patient's pupil, the pupil detection device is fixed on a pupil pen. The pupil pen is placed in the pocket on the chest, and the state of the pupil detection device is the standby state. Then, the doctor picks up the pupil pen, and the state of the pupil detection device becomes the active state. Then, the doctor uses the pupil pen to irradiate the patient's pupil, and the state of the pupil detection device becomes the start observation state. The doctor continuously observes the patient's pupil, and the state of the pupil detection device is the ongoing observation state. After the doctor finishes the observation, the pupil pen is put back into the pocket, and the state of the pupil detection device successively becomes the end observation state, the active state, and the standby state. Thus, during the process of the doctor observing the patient's pupil, the pupil detection device can start collecting images when the doctor starts the observation and stop collecting images when the doctor finishes the observation. The images collected by the pupil detection device can assist the doctor in examining the patient's pupil and be used as a record of the condition in subsequent treatments.
[0067] In some embodiments, the pupil detection device can output photos, video files, etc. through image acquisition. As exemplified above, through operations such as analyzing and processing the images, it can assist the doctor's work.
[0068] In some embodiments, the above method further includes step 201.
[0069] Step 201: Adjust the data in the data window according to the current state of the pupil detection device.
[0070] Among them, the data window is composed of part of the data in the first dataset.
[0071] The distance collected by the pupil detection device can be used to set the data window, and part of the data is used as the data in the data window. For example, the default number of data in the data window is 20. Then, when the pupil detection device collects the 20th distance, the data in the data window is the 1st distance to the 20th distance. When the pupil detection device collects the 21st distance, the data in the data window is the 2nd distance to the 21st distance.
[0072] In some embodiments, when the pupil detection device is in the observation state, the number of data in the data window is the first number. When the pupil detection device is in a non-observation state, the number of data in the data window is the second number, and the first number is less than the second number. For example, the first number is 15 and the second number is 25.
[0073] In some embodiments, when the current state of the pupil detection device is the observation state (including the start observation state and the ongoing observation state), the number of data in the data window can be adjusted to a first value. When the current state of the pupil detection device is the end observation state, the number of data in the data window can be adjusted to a second value. When the current state of the pupil detection device is the active state, the number of data in the data window can be adjusted to a third value. When the current state of the pupil detection device is the standby state, the number of data in the data window can be adjusted to a fourth value. Exemplarily, the first value is 10, the second value is 20, the third value is 20, and the fourth value is 25. Again exemplarily, the first value is 10, the second value is 25, the third value is 30, and the fourth value is 40. In this embodiment, according to the current state of the pupil detection device, the data in the data window is adjusted, which can make the pupil detection device more accurate when confirming the next state through the window data.
[0074] In some embodiments, step 102 above can be implemented as step 202.
[0075] Step 202, the pupil detection device determines the current state of the pupil detection device according to the distance corresponding to the pupil detection device and the previous state of the pupil detection device.
[0076] Among them, the distance corresponding to the pupil detection device is determined based on the data in the data window.
[0077] The data window includes a part of the data sequentially obtained from the first dataset based on the previous state of the pupil detection device.
[0078] In some embodiments, the distance corresponding to the pupil detection device includes: a first value and a second value. The first value is used to represent the overall level of the data in the data window, and the second value is used to represent the stability of the data in the data window. In some examples, the first value is the average value, median value or mode of the data window. In some examples, the second value is the variance, standard deviation, range, interquartile range, coefficient of variation, mean absolute deviation, kurtosis or skewness of the data window.
[0079] In some embodiments, when the first value is greater than the first threshold and less than the second threshold, and the second value is not greater than the third threshold, the pupil detection device determines that the current state of the pupil detection device is the observation state.
[0080] In some embodiments, when the first value is greater than the first threshold and less than the second threshold, the second value is not greater than the third threshold, and the previous state of the pupil detection device is the ongoing observation state or the start observation state, then the pupil detection device determines that the current state of the pupil detection device is the ongoing observation state.
[0081] In some embodiments, if the first value is greater than the first threshold and less than the second threshold, the second value is not greater than the third threshold, and the previous state of the pupil detection device is not the observing state, then the pupil detection device determines that the current state of the pupil detection device is the starting observation state.
[0082] Referring to Formula 1, Formula 1 shows the judgment logic of the observing state and the starting observation state in some embodiments of the present application. Among them, represents the current state, represents the previous state, represents the first threshold, represents the second threshold, represents the first value, the second value, represents the third threshold, represents the starting observation state, represents the observing state.
[0083]
[0084] The above method for determining the starting observation state and the observing state sets the starting observation state as a transition state before the pupil detection device enters the observing state. This makes the judgment of the observing state by the pupil detection device more accurate and reduces misjudgment. Thus, it reduces the image capture caused by misjudgment and the resource occupation caused by image capture. It is particularly applicable to the pupil detection device in the embodiments of the present application with limited storage resources.
[0085] In some examples, the first threshold is 10 millimeters and the second threshold is 40 millimeters. In the scenario where a doctor examines the pupil, the distance between the pupil pen and the pupil is about 10 to 40 millimeters. Therefore, in this example, the first threshold and the second threshold are set according to the application scenario of the pupil detection device, making the set thresholds more suitable for the actual application.
[0086] In some embodiments, if the second value is not less than (or greater than or equal to) the third threshold and the previous state of the pupil detection device is not the observing state, the pupil detection device determines that the current state of the pupil detection device is the active state.
[0087] In some embodiments, if the first value is not greater than (or less than or equal to) the first threshold or not less than the second threshold, and the second value is not greater than the third threshold, and the previous state of the pupil detection device is the non-observing state, the pupil detection device determines that the current state of the pupil detection device is the standby state.
[0088] In some embodiments, if the second value is not less than the third threshold and the previous state of the pupil detection device is the observing state, the pupil detection device determines that the current state of the pupil detection device is the active state or the end of observation state.
[0089] In some embodiments, the first value is not greater than the first threshold or not less than the second threshold, and the second value is not greater than the third threshold. The previous state of the pupil detection device is the observation state, and the pupil detection device determines that the current state of the pupil detection device is the end - observation state or the standby state.
[0090] In some examples, the pupil detection device determines the current state of the pupil detection device according to the non - observation state counter. The non - observation state counter is used to indicate the cumulative number of times that the state before the current state is the non - observation state.
[0091] In some examples, the second value is not less than the third threshold, and the pupil detection device increments the non - observation state counter by 1. If the previous state of the pupil detection device is the observing state, and the non - observation state counter is not less than the fourth threshold, the pupil detection device determines that the current state of the pupil detection device is the end - observation state.
[0092] In some examples, the second value is not less than the third threshold, and the pupil detection device increments the non - observation state counter by 1. If the previous state of the pupil detection device is the observing state, and the non - observation state counter is less than the fourth threshold, the pupil detection device determines that the current state of the pupil detection device is the active state.
[0093] In some examples, the first value is not greater than the first threshold or not less than the second threshold, and the second value is not greater than the third threshold, and the pupil detection device increments the non - observation state counter by 1. If the previous state of the pupil detection device is the observing state or the ready - to - observe state, and the non - observation state counter is not less than the fourth threshold, the pupil detection device determines that the current state of the pupil detection device is the end - observation state.
[0094] In some examples, the first value is not greater than the first threshold or not less than the second threshold, and the second value is not greater than the third threshold, and the pupil detection device increments the non - observation state counter by 1. If the previous state of the pupil detection device is the observing state or the ready - to - observe state, and the non - observation state counter is less than the fourth threshold, the pupil detection device determines that the current state of the pupil detection device is the standby state.
[0095] In some examples, the initial value of the non - observation state counter is 0. If the non - observation state counter is equal to the fourth threshold, the non - observation state counter is cleared. By setting the initial value to 0 and setting the non - observation state counter to be cleared after reaching the fourth threshold, the value of the non - observation state counter is restricted, so that the state of the pupil detection device can be determined according to the non - observation state counter. Further, further processing is performed according to the state of the pupil detection device.
[0096] Referring to Formula 2, Formula 2 shows the judgment logic of the active state and the end - observation state in some embodiments of the present application. Among them, Indicates the current state, Indicates the previous state, A second value, Indicates a third threshold, Indicates the value of the non-observation state counter, Indicates a fourth threshold, Indicates the active state, Indicates the state of being observed.
[0097]
[0098] Referring to Equation 3, Equation 3 shows the judgment logic of the standby state and the end-of-observation state in some embodiments of the present application. Among them, Indicates the current state, Indicates the previous state, Indicates a first threshold, Indicates a second threshold, Indicates a first value, A second value, Indicates a third threshold, Indicates the value of the non-observation state counter, Indicates a fourth threshold, Indicates the end-of-observation state, Indicates the standby state.
[0099]
[0100] Through the above solution, the embodiments of the present application judge the state of the pupil detection device according to the order of the possible states of the pupil detection device in actual operation and the collected distance. Thus, in subsequent steps, the number of data in the window collected by the pupil detection device is adjusted according to the judged state, increasing the accuracy of state judgment. Thus, corresponding processing is performed according to the current state of the pupil detection device.
[0101] The above embodiments illustrate how the pupil detection device determines the current state according to the collected distance and performs image acquisition processing of turning on or off according to the current state. The following embodiments provide methods related to image acquisition processing. Referring to Figure 17 , the method includes step 401.
[0102] Step 401, if the first value is not less than the first threshold and not greater than the second threshold, the pupil detection device obtains the first focal length corresponding to the first value.
[0103] Exemplarily, the pupil detection device may pre-store a first focal length corresponding to a first value. For example, the first value is the average value of the data in the data window. Among them, the range of the focal length corresponding to the first value stored in the pupil detection device may be that the first value is not less than the first threshold and not less than the second threshold. Referring to Table 1, Table 1 shows the corresponding relationship between some first values and the first focal length when the first value is the average value of the data in the data window.
[0104] Table 1 Corresponding relationship between the first value and the first focal length
[0105] In some embodiments, step 401 is located before step 103. The enabling of image acquisition in step 103 may be implemented as step 402.
[0106] Step 402, the pupil detection device acquires an image with the first focal length.
[0107] When the pupil detection device enables image acquisition, by using the first focal length corresponding to the obtained first value, the first focal length can be used as the focal length for image acquisition. Thus, during image acquisition, different first focal lengths can be obtained according to the different distances between the pupil detection device and the target to be acquired. Thus, it is more convenient to obtain clear images, and it is more conducive to the subsequent analysis of the acquired images. The above embodiments exemplarily illustrate the process of determining the state according to the distance detected by the pupil detection device and performing image acquisition according to the state. Taking the acquisition of images in the form of a video as an example, the present application also provides the following embodiments. The following embodiments can process the video acquired by the pupil detection device, locate the pupil through the iris, and obtain the region of interest. Thus, the pupil detection device can identify the region of interest of the video and identify the scaling speed of the pupil. The method of the embodiments of the present application includes step 501 and step 502.
[0108] Step 501, the pupil detection device reads the pupil image.
[0109] In some examples, the pupil detection device may read the images acquired in the above embodiments. For example, it reads the video file created through step 1100. Process each frame of the video file, store the frame images in a variable multi-dimensional array, and perform frame counting on each frame image. For example, the count of the first frame image is 1, and the count of the next frame image after the first frame image is 2, and so on. The following takes the processing of frame images as an example for illustration.
[0110] In some examples, the pupil detection device regards all the images acquired through the above embodiments as pupil images and performs frame counting on these images.
[0111] In some other examples, the pupil detection device processes the images collected through the above embodiments, takes the images with pupils in the images as pupil images, and performs frame counting on these filtered pupil images.
[0112] In some other examples, the data collected by the pupil detection device is stored in image format, and the pupil detection device can directly read the stored images.
[0113] Step 502, the pupil detection device determines the region of interest of the pupil image.
[0114] In some examples, the pupil detection device intercepts the region of interest of the frame image, and takes the region near the pupil as the region of interest. Exemplarily, taking the iris as the target, as the region near the pupil. Since the pupil is within the range of the iris and the area of the pupil is small, using the iris to distinguish the region of interest can not only retain the key pupil image, but also greatly reduce the size of the frame image. By intercepting the region of interest, the computing resources consumed in subsequent processing of the frame image can be reduced.
[0115] The method of intercepting the region of interest is introduced below. This method includes Step 601 - Step 605.
[0116] Step 601, the pupil detection device performs frame skipping processing on the pupil image to obtain a first image.
[0117] Among them, the first image is the frame image after frame skipping processing.
[0118] The pupil detection device reads the frame count of the current frame image. If the remainder of the current frame count divided by the frame skipping number is 0, then this image is the first image. Subsequently, continue to process this image. The frame skipping number can be a preset number, such as values of 2, 3, 4, etc. Through frame skipping processing, the number of frame images processed by the pupil detection device can be reduced, and the computing consumption can be reduced.
[0119] Step 602, the pupil detection device performs edge detection on the first image, filters the eyelash features in the first image, and obtains the first image after processing the eyelashes. Step 602 includes Step 6021 and Step 6022.
[0120] Step 6021, the pupil detection device calculates the gradient of the first image to obtain the gradient amplitude of the image.
[0121] The pupil detection device can calculate the horizontal gradient component and the vertical gradient component of the first image, see Formula 4.
[0122]
[0123] Among them, I represents the first image, represents the horizontal gradient component of the first image, represents the vertical gradient component of the first image, x represents the horizontal gradient component, and y represents the vertical gradient component.
[0124] In some examples, the pupil detection device copies a first image and calculates the horizontal gradient component and the vertical gradient component through the copied first image.
[0125] The pupil detection device calculates the gradient magnitude of the first image, see Formula 5.
[0126]
[0127] where, represents the gradient magnitude of the first image, represents the horizontal gradient component of the first image, represents the vertical gradient component of the first image.
[0128] Step 6022, the pupil detection device obtains a second image according to the gradient magnitude of the first image.
[0129] where the second image is the first image with eyelashes removed.
[0130] The pupil detection device filters the vertical morphological structures appearing in the first image through a direction-sensitive convolution kernel. Thus, the upper and lower eyelashes are filtered to reduce the interference with the pupil image recognition.
[0131] where the direction-sensitive convolution kernel K refers to Formula 6.
[0132] Formula 6 The pupil detection device performs convolution processing on each pixel point of the first image, referring to Formula 7.
[0133] Formula 7 where each pixel point of the first image is represented by a horizontal component x and a vertical component y, represents the pixel point of the first image with a horizontal component of x and a vertical component of y - 1, represents the function of the convolution processing process.
[0134] The formula for convolving all pixel points in a first image can be simplified to Formula 8.
[0135]
[0136] The pupil detection device normalizes the first image after gradient magnitude processing, with a range of 0 to 255. The normalization formula is shown in Formula 9. By normalization, the influence of the gradient operation on the image is eliminated.
[0137]
[0138] See Figure 17 Figures A to C in Figure 17 Figure A in is a schematic diagram of the unprocessed first image of the embodiment of the present application. Figure 17 Figure B in is a schematic diagram of the first image after gradient magnitude processing in the embodiment of the present application. Figure 17 Figure C in is a schematic diagram of the second image of the embodiment of the present application.
[0139] It can be understood that the unprocessed first image can be the image acquired by the image acquisition device in the above steps, or the image after processing the image acquired by the image acquisition device, such as cropping, color adjustment, etc.
[0140] Step 603, the pupil detection device filters the pixels in the iris edge region of the second image to obtain an iris edge image. Step 603 includes Step 6031 and Step 6032.
[0141] Among them, the iris edge image refers to the image that extracts the edge of the iris. For example, it is a linear edge image composed of white discrete points on the pupil edge.
[0142] Step 6031, the pupil detection device sets a mask for the second image to obtain the second image filtered by the mask.
[0143] The pupil detection device initializes a mask that is all white and has the same size as the second image, that is, the value of the mask is 1.
[0144] The pupil detection device performs binarization processing on the second image to obtain the binarized second image. Referring to Formula 10, the binarized second image is subjected to a bitwise AND operation with the second image to generate the second image filtered by the mask. Among them, the binarized second image is a mask image composed of 0 or 1, and the second image is a grayscale image of 0 - 255. By performing a bitwise AND operation on the binarized second image and the second image, the pixels with a gray value of 1 in the second image are deducted, so that in subsequent processing, the second image filtered by the mask is strengthened. See the second image filtered by the mask Figure 18 as shown in Figure D in .
[0145]
[0146] Among them, represents the second image filtered by the mask, represents the binarized second image, represents the second image.
[0147] Step 6032: The pupil detection device performs HSV color space range filtering on the second image filtered by the mask.
[0148] Among them, for an image in HSV format, H represents hue, S represents saturation, and V represents value. The second image filtered by the mask is converted from a BGR image to an HSV image, and range filtering is performed through the iris edge color range to obtain a pupil mask. , and the range of the pupil mask is the image within the iris edge. The expression of the pupil mask is shown in Formula 11. Among them, the iris edge color range is between the fifth threshold and the sixth threshold. L represents the fifth threshold. , U represents the sixth threshold. .
[0149]
[0150] Referring to Formula 12, the pupil mask is subjected to a bitwise AND operation with the second image filtered by the mask to obtain an iris edge image.
[0151]
[0152] Among them, represents the iris edge image, represents the image after the second image filtered by the mask is converted to the HSV color space, represents the pupil mask. Refer to Figure 18 Figures E and F in Figure 18 Figure E in Figure 18 is the image after the second image filtered by the mask is converted to the HSV color space,
[0153] Figure F in
[0154] Step 604: The pupil detection device calculates a focus mask based on the iris edge image to obtain a focus region image.
[0154] The pupil detection device can perform masking processing on the iris edge image to obtain the focus area image. Exemplarily, the pupil detection device obtains the width W and height H of the iris edge image, sets the focus size ratio, and calculates to obtain the border width w and border height h. For example, if the focus size ratio is set to 80%, then 10% is intercepted from each of the upper and lower directions of the iris edge image, and 10% is intercepted from each of the left and right directions. The pupil detection device converts the iris edge image into a grayscale image to obtain the grayscale-converted iris edge image. The pupil detection device sets a first mask with an initial pixel value of 255, and performs a bitwise AND operation on the grayscale-converted iris edge image using the first mask to mask the area outside the border of the grayscale-converted iris edge image and retain the area inside the border of the grayscale-converted iris edge image. This area can be called the focus area. The expression of the first mask is shown in Formula 13. Among them, represents the first mask, b represents the border width, H represents the height of the iris edge image, and W represents the width of the iris edge image.
[0155]
[0156] Referring to Formula 14, Formula 14 is that the pupil detection device performs a bitwise AND operation on the grayscale-converted iris edge image using the first mask to obtain the focus area image. Referring to Figure 19 Figure G in Figure 19 Figure G in is a schematic diagram of the focus area image.
[0157]
[0158] Among them, represents the focus area image, represents the first mask, represents the grayscale-converted iris edge image.
[0159] The images collected in the above steps will contain redundant image areas. For example, areas outside the iris. Considering that when medical staff use a pupil pen to detect a patient's pupil, they will align the pupil pen with the pupil, so the image brightness near the pupil will be higher. The iris edge image can be further filtered to intercept the redundant areas, filter out the areas outside the border of the grayscale-converted iris edge image, reduce the noise and computational amount of the finally extracted region of interest. In the subsequent process of analyzing the image, computing power can be saved. Exemplarily, the 10% area on the right side of the image is the area outside the iris, and this area can be intercepted.
[0160] Step 605, the pupil detection device determines the region of interest according to the enhanced image.
[0161] Step 605 includes Step 6051 and Step 6052.
[0162] Step 6051: The pupil detection device performs an erosion operation on the enhanced image to obtain an eroded image.
[0163] Referring to Equation 15, the pupil detection device uses a 3×3 or 3×1 structuring element to erode the enhanced image to obtain an eroded image.
[0164]
[0165] Wherein, represents the pixel value of the eroded image at position , represents the structuring element, which defines the neighborhood of the erosion operation, represents an offset in the structuring element, represents the pixel value of the enhanced image at position .
[0166] By selecting a 3×3 or 3×1 structuring element, the eroded image has a better effect, making the overall image clearer and the vertical line features more distinct.
[0167] By performing an erosion operation on the enhanced image, small noise points are eliminated, making the enhanced image more regular and shrinking the boundary of the enhanced image.
[0168] Step 6052: The pupil detection device binarizes the eroded image to obtain a binary image.
[0169] Referring to Equation 16, the pupil detection device binarizes the eroded image to obtain a binary image. Among them, the pixel value of the eroded image is set to 255, and the pixel values of the remaining areas are set to 0. The remaining areas are filtered by the seventh threshold. The value of the seventh threshold can be determined according to experience. For example, after trying different values as the seventh threshold multiple times and obtaining the binary image, the value corresponding to the binary image with the best effect can be determined as the seventh threshold. Referring to the H graph in Figure 19 , Figure 19 the H graph in is a schematic diagram of the binary image.
[0170]
[0171] Wherein, represents the binary image, represents the eroded image, represents the seventh threshold.
[0172] Step 6053: The pupil detection device determines the minimum bounding box of the binary image.
[0173] Among them, the smallest bounding box of the binary image is the region of interest of the pupil image.
[0174] The pupil detection device can update the first variable by traversing non-zero points row by row The second variable . By traversing non-zero points column by column, the third variable and the fourth variable are updated. After traversing the binary image, the region enclosed by the first variable to the fourth variable can be obtained, and this region is the region of interest.
[0175] Traversing non-zero points row by row can refer to traversing the binary image from top to bottom or from bottom to top to check if it contains non-zero points. If there is a non-zero point, the position of this point is returned, and the position with the smallest coordinate in the y direction is used as the first variable, and the position with the largest coordinate in the y direction is used as the first variable. Traversing non-zero points column by column can refer to traversing the binary image from left to right or from right to left to check if it contains non-zero points. If there is a non-zero point, the position of this point is returned, and the position with the smallest coordinate in the x direction is used as the third variable, and the position with the largest coordinate in the x direction is used as the fourth variable. Exemplarily, the first variable to the fourth variable can be determined by formulas 17 to 21. The region of interest is represented by formula 21. Refer to Figure 19 Figure J in Figure 19 The range within the frame of Figure J in is the region of interest.
[0176]
[0177] Among them, represents the first variable, represents the second variable, represents the third variable, represents the fourth variable, and ROI represents the region of interest.
[0178] Through the above method, the pupil detection device can identify the region of interest in the collected video. Among them, the region of interest includes the pupil. Thus, in subsequent operations, the pupil detection device can better analyze the pupil through the region of interest, such as analyzing the change speed of the pupil, etc., to assist the doctor in the analysis.
[0179] Although the embodiments of the present application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and spirit of the present application. The scope of the present application is defined by the appended claims and their equivalents. For example, in order to reduce the risk of using the distance calibration device, a housing can be provided for the distance calibration device so that the housing covers components such as gears and rotating plates. Or, in order to facilitate the reflection of the waves emitted by the distance sensor 5 on the first distance measurement plane and the second distance measurement plane, corresponding reflective coatings (prior art, not elaborated) can be provided on the first distance measurement plane and the second distance measurement plane, etc.
Claims
1. A distance calibration device, used for calibrating a distance sensor (5), characterized in that: include: A base (1); the base (1) comprises a distance measuring base plate (11), and the distance measuring base plate (11) comprises a first distance measuring plane; the base (1) is used to place the distance sensor (5); A first rotating shaft (2) is rotationally connected to the distance measuring base plate (11); At least one rotating plate (3); each rotating plate (3) is arranged on the first rotating shaft (2) at intervals along the axial direction of the first rotating shaft (2); each rotating plate (3) comprises a second distance measuring plane; a normal line of the first distance measuring plane and a normal line of each second distance measuring plane are parallel to the axis center line of the first rotating shaft (2), and the first distance measuring plane and each second distance measuring plane have the same orientation; if the first rotating shaft (2) rotates, the distance sensor (5) can illuminate the first distance measuring plane and each second distance measuring plane at different times respectively; A driving assembly (4) is arranged on the distance measuring base plate (11) and is used to drive the first rotating shaft (2) to rotate.
2. The distance calibration device according to claim 1, characterized in that: The base (1) further comprises a positioning portion (12); the positioning portion (12) is used to limit the relative displacement between the base (1) and the distance sensor (5).
3. The distance calibration device according to claim 1, characterized in that: The projections of the various rotating plates (3) on the first distance measurement plane do not overlap or do not completely overlap; The rotating plate (3) is in the shape of a regular triangle or a petal-shaped plate.
4. The distance calibration device according to any one of claims 1 to 3, characterized in that: The driving component (4) comprises: A motor (41) is arranged on the distance measuring base plate (11); A first gear (47) is arranged at an output end of the motor (41); The second gear (48) is arranged on the first rotating shaft (2), and the second gear (48) is meshed with the first gear (47).
5. The distance calibration device according to any one of claims 1 to 3, characterized in that: The driving component (4) comprises: A second rotating shaft (42) is rotationally connected to the distance measuring base plate (11); A third gear (43) and a fourth gear (44), both disposed on the second rotating shaft (42); The fifth gear (45) and the sixth gear (46) are both arranged on the first rotating shaft (2); the first rotating shaft (2) can slide along its axis to form a first working state or a second working state; when the first rotating shaft (2) is in the first working state, the third gear (43) and the fifth gear (45) are meshed; when the first rotating shaft (2) is in the second working state, the fourth gear (44) and the sixth gear (46) are meshed; the transmission ratio of the third gear (43) and the fifth gear (45) and the transmission ratio of the fourth gear (44) and the sixth gear (46) are not equal; A motor (41) is arranged on the distance measuring base plate (11) and is used to drive the second rotating shaft (42) to rotate.
6. The distance calibration device according to any one of claims 1 to 3, characterized in that: The first rotating shaft (2) is further provided with a speed stabilizing component (6), the speed stabilizing component (6) being used to absorb energy to reduce the increase range of the speed of the first rotating shaft (2) when the speed of the first rotating shaft (2) increases; and to release energy to reduce the decrease range of the speed of the first rotating shaft (2) when the speed of the first rotating shaft (2) decreases.
7. The distance calibration device according to claim 6, characterized in that: The speed stabilizing component (6) comprises: a plurality of connecting rods (61), each connecting rod (61) being evenly distributed around the axis of the first rotating shaft (2), and a first end of each connecting rod (61) being hinged to the first rotating shaft (2); A first counterweight (62) and a first elastic member (63) corresponding one to the connecting rod (61); the first counterweight (62) is arranged at the second end of the corresponding connecting rod (61); one end of the first elastic member (63) is connected to the first rotating shaft (2), and the other end is connected to the corresponding connecting rod (61).
8. The distance calibration device according to claim 6, characterized in that: The speed stabilizing component (6) comprises: A plurality of sleeves (64), each sleeve (64) being evenly distributed around the axis of the first rotating shaft (2), and each sleeve (64) being connected to the first rotating shaft (2); A telescopic rod (65), a second counterweight (66) and a second elastic member (67) corresponding to the sleeve (64) in a one-to-one manner; the axis of the telescopic rod (65) and the corresponding sleeve (64) coincide with each other, and the telescopic rod (65) and the corresponding sleeve (64) form a sliding connection along their axis; the first end of the telescopic rod (65) is located inside the corresponding sleeve (64); one end of the second elastic member (67) is connected to the first end of the telescopic rod (65), and the other end is connected to the first rotating shaft (2); the second counterweight (66) is arranged at the second end of the telescopic rod (65).
9. A detection device, characterized in that: It comprises a distance sensor (5) and a distance calibration device as claimed in any one of claims 1 to 8; the distance calibration device is used to calibrate the distance sensor (5).
10. A method for using a detection device, applied to the detection device as claimed in claim 9, wherein the detection device has an image acquisition function, characterized in that: The method of use includes: Acquiring a first data set, wherein the data in the first data set is the distance collected by the detection device; before acquiring the first data set, using a distance calibration device to pre-calibrate the distance sensor (5) in the detection device; Determining a current state of the detection device according to the first data set and a previous state of the detection device; Turning on or off image acquisition according to the current state of the detection device; The state of the detection device includes an observation state and a non-observation state. The observation state is a state in which image acquisition is performed, and the non-observation state is a state in which image acquisition is not performed.
Citation Information
Patent Citations
Multiple iris collecting device using active vision feedback
CN101051349A
Laser radar automatic test device and method
CN113156410A
Glasses type drug-related behavior pupil detector and detection method
CN113509141A
Method and device for correcting laser distance measuring sensor and laser distance measuring sensor
CN116087967A
Nucleic acid sample collection system, method, device, equipment and medium
CN117523161A