Calibration Method and Related Device for a Measurement Device Based on Pupil Detection

By generating HSV mask parameters to adapt to ambient lighting, combined with calibration patterns set by pupil sample image, the measurement accuracy and operation standardization problems of traditional pupil detection and distance measurement equipment in complex environments are solved, and the automatic calibration of the equipment and the accuracy of pupil recognition is realized.

CN120176731BActive Publication Date: 2025-07-25NORTHERN JIANGSU PEOPLES HOSPITAL
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510646668.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-07-25
Estimated Expiration
2045-05-20

AI Technical Summary

Technical Problem

Traditional pupil detection and distance measurement equipment has reduced the accuracy of measurement results under complex ambient light, and the pupil observation distance depends on manual experience, resulting in poor operation.

Method used

By acquiring calibration card images at different measurement distances, extracting image boundary features to generate HSV mask parameters, realizing the adaptation of the equipment and ambient lighting conditions, and automatically calibrating with the calibration pattern set by the pupil sample image.

Benefits of technology

It improves the adaptability and measurement accuracy of the ranging equipment in complex environments, reduces manual intervention, and improves the robustness and accuracy of the pupil recognition algorithm.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120176731B_ABST
    Figure CN120176731B_ABST
Patent Text Reader

Abstract

The embodiments of the present application relate to the field of distance measurement, and provide a calibration method and related device for a measurement device based on pupil detection. The method is applied to a calibration device of a distance measurement device, and the distance measurement device has an image acquisition function to obtain calibration card images at different measurement distances; the calibration card images at least include: image information of a calibration pattern set based on pupil sample images; the measurement distance is the distance between the calibration card containing the calibration pattern and the image sensor when the calibration card image is acquired; extract the target region corresponding to the calibration pattern in the calibration card image; obtain the image boundary features of the target region at different measurement distances; generate HSV mask parameters for adapting to the current illumination condition based on the image boundary features. Thus, the automatic calibration of the pupil detection ranging device is realized, the illumination condition between the pupil detection ranging device and the surrounding environment is adapted, and the adaptation efficiency and measurement accuracy of the ranging device are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of distance measurement, and more specifically to a calibration method for a measurement device based on pupil detection and related devices. Background Art

[0002] The pupillary light reflex (PLR) is an important clinical indicator for evaluating the function of the nervous system. It refers to the reflex activity of the pupil to control the amount of light entering the eye by adjusting its size when stimulated by light. During diagnosis, doctors can irradiate the pupil with a pupil pen and observe the reflex activity of the pupil. In traditional techniques, doctors usually need to bring the light source device close to the patient's pupil and then observe. How to grasp the appropriate pupil observation distance often depends on manual experience judgment, resulting in the inspection operation effects varying from person to person and being not standard enough.

[0003] To solve the problems in traditional techniques, in related techniques, a ranging device for pupil detection can be proposed. In practical applications, the composition of ambient light is complex. For example, there are lighting lamps, device signal lights, display screen lights, etc. deployed at different positions indoors. The complex ambient light will have a greater impact on the pupil detection ranging device, resulting in a decrease in the accuracy of the measurement results of the ranging device. Therefore, there is an urgent need to design an adaptation scheme for the pupil detection ranging device to solve the above technical problems. Summary of the Invention

[0004] The embodiments of the present application provide a calibration method for a measurement device based on pupil detection and related devices, which is used to realize the automatic calibration of the pupil detection ranging device, adapt the lighting conditions between the pupil detection ranging device and the surrounding environment, and improve the adaptation efficiency and measurement accuracy of the ranging device.

[0005] In a first aspect, the embodiments of the present application provide a calibration method for a measurement device based on pupil detection, which is applied to a calibration device of a distance measurement device. The distance measurement device has an image acquisition function. The method includes:

[0006] Obtain calibration card images at different measurement distances; the calibration card images at least include: image information of a calibration pattern set based on a pupil sample image; the measurement distance is the distance between the calibration card containing the calibration pattern and the image sensor when collecting the calibration card image;

[0007] Extract a target area corresponding to the calibration pattern in the calibration card image;

[0008] Obtain the image boundary features of the target area at different measurement distances; the image boundary features include the HSV maximum value and the HSV minimum value of each pixel in the calibration pattern;

[0009] Generate HSV mask parameters for adapting to the current lighting conditions based on the image boundary features to achieve environmental adaptation in the distance measurement process.

[0010] In the above method, by obtaining calibration card images at different measurement distances and generating HSV mask parameters for adapting to the current lighting conditions based on the image boundary features of the target area at different measurement distances, the distance measurement device can better adapt to different lighting environments, achieve environmental adaptation in the distance measurement process, and improve the device's adaptability in complex ambient light (such as indoor lighting at different positions, device signal lights, display screen lighting, etc.). This method combines the color value distribution rules under different light sources to automatically generate HSV color value mask parameters suitable for multiple scenarios, reduces manual intervention, improves the efficiency and accuracy of parameter generation, and enables the device to better handle various actual scenarios. In addition, the calibration card is set based on real pupil data, covering the distributions of various pupil colors, which can provide accurate data support for this method, improve the robustness and accuracy of the pupil recognition algorithm based on this method, and thus ensure the performance of the distance measurement device.

[0011] In a second aspect, an embodiment of the present application provides a calibration device for a measurement device based on pupil detection. The calibration device for a measurement device based on pupil detection at least includes: a distance measurement device and a calibration component for performing parameter calibration on the distance measurement device; wherein, the distance measurement device includes: a housing, a distance measurement component, an image acquisition device, and a processor. The distance measurement component and the image acquisition device are both mechanically connected to the housing, and the distance measurement component and the image acquisition device are both communicatively connected to the calibration component; the calibration component includes a controller, a slider, a slide rail, a drum-type paper feeding structure for loading and moving the calibration card, and a fixing device for fixing the distance measurement device; the controller is used to control the movement of the calibration card following the rolling of the drum-type paper feeding structure; the controller is used to execute the method described in the first aspect above.

[0012] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, which includes instructions that, when running on a computer, cause the computer to execute the method described in the first aspect.

[0013] In a fourth aspect, an embodiment of the present application provides a computing device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the method described in the first aspect is implemented.

[0014] Fifth aspect, an embodiment of the present application provides a chip, which includes a processor coupled to a transceiver and is configured to execute the technical solution provided in the first aspect of the embodiment of the present application. In a possible design, the chip may also be a dedicated hardware structure for implementing the technical solution provided in the above first aspect. For example, the processing related to a neural network model may be implemented by a dedicated neural network processor or a graphics processor.

[0015] Sixth aspect, an embodiment of the present application provides a chip system, which includes a processor configured to implement the functions involved in the above first aspect. For example, generating or processing the information involved in the method provided in the above first aspect.

[0016] In a possible design, the above chip system further includes a memory, which is connected to the processor through a circuit structure. The memory is used to store the program instructions and data necessary for the terminal. The chip system may be composed of chips or may include chips and other discrete devices. Further optionally, the chip further includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive the data and / or information that needs to be processed. The processor obtains the data and / or information from the communication interface, processes the data and / or information, and outputs the processing result through the communication interface. The communication interface may be an input / output interface.

[0017] Seventh aspect, an embodiment of the present application provides a computer program product containing instructions. When the computer program product runs on a computer, it causes the computer to execute the method provided in the above first aspect. Description of the Drawings

[0018] By referring to the accompanying drawings and reading the detailed description of the embodiments of the present application, the objectives, features, and advantages of the embodiments of the present application will become easy to understand. Among them:

[0019] Figure 1 is a schematic structural diagram of a calibration device for a measurement device based on pupil detection in an embodiment of the present application;

[0020] Figure 2 is a schematic structural diagram of a distance measurement device in an embodiment of the present application;

[0021] Figure 3 is a schematic structural diagram of a drum-type paper feeding structure in an embodiment of the present application;

[0022] Figure 4 is a schematic flowchart of a calibration method for a measurement device based on pupil detection provided in an embodiment of the present application;

[0023] Figures 5 to 9 is a schematic diagram of the principle of a calibration method for a measurement device based on pupil detection in an embodiment of the present application;

[0024] Figure 10 A schematic diagram of the calibration card according to an embodiment of the present application;

[0025] Figure 11 Another structural schematic diagram of the calibration device for a measurement device based on pupil detection according to an embodiment of the present application;

[0026] Figure 12 A structural schematic diagram of a computing device according to an embodiment of the present application.

[0027] In the figure: 10, calibration component; 11, drum-type paper feeding structure; 12, calibration card; 13, motor controller; 14, slider; 15, left slide rail; 16, right slide rail; 17, auxiliary detection device; 18, fixing device; 19, bottom plate; 300, image acquisition device; 200, ranging component; 100, housing. Detailed implementation manners

[0028] The embodiments of the present application provide a calibration method and related device for a measurement device based on pupil detection, which can be applied to the calibration device of a distance measurement device. Here, the distance measurement device can also be called a ranging device. The distance measurement device can be a pupil detection device, and the pupil detection device has an image acquisition function. The pupil detection device can be fixed to a pupil pen. Or, a pupil pen is provided on the pupil detection device. The calibration method for a measurement device based on pupil detection provided by the embodiments of the present application can determine the state of the pupil detection device according to the distance measured by the pupil detection device, and turn on or off image acquisition according to the state of the pupil detection device. Thus, the distance for observing the pupil can be better determined, which is beneficial to the observation of the pupil.

[0029] In the embodiments of the present application, by acquiring calibration card images at different measurement distances and generating HSV mask parameters adapted to the current illumination condition based on the image boundary features of the target region at different measurement distances, the distance measurement device can better adapt to different illumination environments, realize the environmental adaptation of the distance measurement process, and improve the use adaptability of the device in complex ambient light (such as illumination lamps at different positions indoors, device signal lights, display screen illumination, etc.). This method combines the color value distribution rules under different light sources to automatically generate HSV color value mask parameters adapted to multiple scenarios, reduces manual intervention, improves the efficiency and accuracy of parameter generation, and also enables the device to better cope with various actual scenarios.

[0030] In some embodiments of the present application, the calibration card is set based on real pupil data, covering the distribution of various pupil colors, and can provide accurate data support for this method, improving the robustness and accuracy of the pupil recognition algorithm based on this method, and further ensuring the performance of the distance measurement device.

[0031] In some embodiments of the present application, from obtaining a calibration card image to extracting a target area, then to obtaining image boundary features, and finally generating HSV mask parameters, the entire process can calibrate the measurement device relatively accurately. Combining distance and pupil diameter joint calibration (synchronously calibrating distance and pupil diameter through a short-distance measurement device) further improves the measurement accuracy.

[0032] In addition, in some embodiments of the present application, the number of distances measured by the pupil detection device corresponding to each state is different. By adjusting the number of distances measured by the pupil detection device, the pupil detection device has different distance measurement response times in different states. It has a high speed in a state where a quick response is required, and reduces the measurement state update speed in a state where a quick response is not required, saving energy.

[0033] For example, when a doctor picks up a pupil pen to irradiate a patient's pupil, it can be determined that the pupil detection device is in an observation state, and image acquisition is started. After the doctor irradiates the patient's pupil, it can be determined that the pupil detection device is in an end-observation state, and image acquisition is turned off. Thus, the doctor can analyze the acquired image to better determine the patient's condition. In addition, it can also reduce the time for the doctor to irradiate the patient's pupil, reducing the damage to the eyes. Among them, the above image can be one or more, and multiple images can form a video, and the doctor can analyze the acquired video.

[0034] It can be understood that a pupil pen refers to a light source that can emit light and irradiate the pupil, such as a flashlight.

[0035] Refer to Figure 1 , the calibration device for a measurement device based on pupil detection at least includes: a distance measurement device, and a calibration component 10 for performing parameter calibration on the distance measurement device. Among them, the distance measurement device includes: a housing, a ranging component, an image acquisition device, and a processor. The ranging component and the image acquisition device are both mechanically connected to the housing, and the ranging component and the image acquisition device are both communicatively connected to the calibration component 10. The calibration component 10 includes a controller, a slider 14, a slide rail, a drum-type paper feeding structure 11 for loading and moving a calibration card 12, and a fixing device 18 for fixing the distance measurement device; the controller is used to control the movement of the calibration card 12 following the rolling of the drum-type paper feeding structure 11. The controller is used to execute the calibration method for a measurement device based on pupil detection described in any one of the above or the following embodiments.

[0036] Refer to Figure 1Introduce the control and communication mechanisms of the calibration device (i.e., the calibration device for a pupil detection-based measurement device), in combination with the illustrated components. Specifically, the drum-type paper feeding structure 11 is a key execution component for realizing the paper feeding function, which is driven by a driving motor to complete related operations such as paper conveyance. The calibration card 12 works in cooperation with the drum-type paper feeding structure 11 and may be an object that needs to be conveyed, detected, or processed. The motor controller 13 receives external control signals and controls the driving motor of the drum-type paper feeding structure 11. The calibration device also includes a slider 14, a left slide rail 15, and a right slide rail 16. The slider 14 can move on the left and right slide rails and may be used to adjust the positions of device components to achieve functions such as calibration. The fixing device 18 is used to fix relevant components of the device to ensure the stability of the device during operation. The auxiliary detection device 17 can detect the operating state of the device, the state of the calibration card, etc., and provide feedback information for control and operation. The calibration component 10 may be a core functional component for detecting, calibrating, etc. the calibration card 12. The bottom plate 19 serves as the basic support structure of the device and bears other components.

[0037] In the communication link, the auxiliary device can establish a communication link with the factory device through various interface methods such as UART (Universal Asynchronous Receiver-Transmitter), I2C (Inter-Integrated Circuit), RJ45 (Ethernet interface), Wi-Fi, etc. With the help of these communication links, data transmission and instruction interaction between the auxiliary device and the factory device can be realized.

[0038] From the perspective of the control principle, the auxiliary device sends instructions to the calibration device controller through a communication protocol. The controller, according to the instructions, controls the power supply of the driving motor of the drum-type paper feeding structure 11 through a power MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor), that is, controls the PSW (i.e., the drum power switch), to achieve the control of turning the drum-type paper feeding structure 11 on or off. When the PSW is closed, the driving motor is powered on and the drum-type paper feeding structure 11 operates. When the PSW is opened, the driving motor is powered off and the structure stops operating. The controller can also control the current direction through the H-bridge circuit MOSFET, that is, control the HSW (i.e., the power reverse switch). When the HSW switches states, the direction of the current flowing into the driving motor changes, thereby realizing the reversal of the rolling direction of the drum-type paper feeding structure 11 to meet the requirements for the paper feeding direction, etc. in different working scenarios.

[0039] Reference Figure 2 As shown Figure 2 provides Figure 1Schematic structural diagram (top view) of the distance measurement device involved. The distance measurement device may include a housing 100, a distance measurement component 200, an image acquisition device 300, and a processor (not shown in the figure). Among them, the distance measurement component is used to measure distance, and the image acquisition device is used to acquire images. The distance measurement component and the image acquisition device are both mechanically connected to the housing, such as fixedly connected or detachably connected. The distance measurement component 200 and the image acquisition device 300 are both communicatively connected to the processor. It can be understood that the connection method of the mechanical connection can be a direct connection or an indirect connection. Exemplarily, the distance measurement component 200 is a laser distance measurement component, an infrared distance measurement component, etc. Exemplarily, the image acquisition device 300 is a camera. In some embodiments, the distance measurement device further includes a light source, and the light source is communicatively connected to the processor.

[0040] Reference Figure 3 shown Figure 3 provides Figure 1 Schematic diagram of the calibration card 12 and the drum paper feeding structure 11 involved.

[0041] In actual applications, the general production structure and the workpiece to be produced operate independently. However, the pupil measurement device applied in the embodiments of the present application can be linked with the calibration device, which brings new advantages to the use and operation of the pupil detection device and increases the flexibility and functionality of the device use. The calibration device realizes the environmental adaptation of the distance measurement process by generating HSV mask parameters adapted to the environment, and solves the problem of the influence of ambient light on the measurement result accuracy of the pupil detection ranging device.

[0042] Refer to Figure 4 , Figure 4 is a schematic flowchart of a calibration method for a measurement device based on pupil detection provided by an embodiment of the present application. Taking the distance measurement device as an example of the pupil detection device, this method will be introduced below. This method includes steps 101-104.

[0043] Step 101, obtaining calibration card images at different measurement distances;

[0044] Step 102, extracting the target area corresponding to the calibration pattern in the calibration card image;

[0045] Step 103, obtaining the image boundary features of the target area at different measurement distances;

[0046] Step 104, generating HSV mask parameters for adapting to the current lighting conditions based on the image boundary features to achieve environmental adaptation in the distance measurement process.

[0047] In the traditional technology, when doctors perform pupil detection, determining the appropriate pupil observation distance often relies on manual experience judgment, resulting in varying inspection operation effects among individuals and lacking standardization. This method realizes the automatic calibration of the pupil detection ranging device, adapts the light conditions between the device and the surrounding environment, improves the adaptation efficiency and measurement accuracy of the ranging device, and solves the problem of non-standard inspection operations in the traditional technology.

[0048] In addition, the accuracy of existing target recognition algorithms is limited by external conditions such as light, color value distribution, and target characteristics in the operating environment. This method accurately calibrates the target area (such as the pupil), generates HSV mask parameters adapted to the environment, improves the robustness of initial recognition, ensures the algorithm's ability to recognize the target color, and solves the problem of algorithm accuracy being limited by external conditions.

[0049] In practical applications, complex ambient light can have a significant impact on the pupil detection ranging device, resulting in a decrease in the accuracy of the measurement results of the ranging device. This method realizes the environmental adaptation of the distance measurement process by generating HSV mask parameters adapted to the environment, and solves the problem of the impact of ambient light on the accuracy of the measurement results of the pupil detection ranging device.

[0050] In the embodiments of this application, the calibration card image at least includes: image information of a calibration pattern set based on a pupil sample image.

[0051] The calibration card image should at least cover the relevant image information of the calibration pattern set based on the pupil sample image. That is to say, the image information on the calibration card is a calibration pattern set based on the pupil sample image. For example, specific calibration patterns may be designed according to the characteristics of different pupils, such as color, shape, size, etc. Then this calibration pattern is presented on the calibration card. When the calibration card image is collected, the obtained calibration card image must contain the image information of this calibration pattern, and this information can include the shape of the pattern, color distribution, pattern details, etc., for subsequent analysis and processing. For the specific setting method, refer to the following embodiments.

[0052] The purpose of such a setting is to associate the calibration card image with pupil detection. Since the calibration pattern is set based on the pupil sample image, subsequent analysis of the calibration card image can be used to assist in completing pupil detection-related tasks, such as determining the characteristics of the pupil and realizing the calibration of the pupil detection device.

[0053] In the embodiments of this application, the measured distance is the distance between the calibration card containing the calibration pattern and the image sensor when collecting the calibration card image.

[0054] When performing the calibration card image acquisition operation, the spatial distance between the calibration card containing the calibration pattern and the image sensor is the measurement distance. For example, when the image sensor takes a picture of the calibration card with the calibration pattern to acquire an image, the actual distance between the calibration card and the image sensor at this time is the measurement distance. Different measurement distances may cause differences in aspects such as the size and clarity of the calibration card image, and these factors will in turn affect the subsequent extraction and processing of information in the image. For example, through the known measurement distance, the actual size, etc. can be deduced by combining information such as the size of the target in the image. Therefore, accurately defining the measurement distance helps to improve the accuracy of the entire measurement and analysis process.

[0055] In the embodiments of the present application, the image boundary feature includes the HSV maximum value and the HSV minimum value of each pixel in the calibration pattern.

[0056] The image boundary feature specifically includes the maximum value and the minimum value of the HSV color space of each pixel in the calibration pattern. HSV, including Hue (hue), Saturation (saturation), and Value (brightness), is a color representation model. Each pixel has corresponding hue, saturation, and brightness values in this model. The image boundary feature here is to obtain the maximum value and the minimum value among the HSV values of all pixels in the calibration pattern. For example, for the hue, find the maximum and minimum hue values among all pixels, and the same goes for saturation and brightness. Here, obtaining these image boundary features is crucial for generating HSV mask parameters adapted to the environment later. By knowing the HSV maximum value and the HSV minimum value of the pixels in the calibration pattern, the color range of the calibration pattern under the current lighting conditions can be better determined, and then appropriate HSV mask parameters can be generated based on this information to adapt to the measurement environment. For example, when performing pupil detection, these parameters are used to accurately identify features such as the color of the pupil, improving the accuracy and robustness of the detection.

[0057] In some embodiments, the calibration card image further includes the image information of the positioning points matching the calibration pattern. Based on this, in step 101, obtaining the calibration card images at different measurement distances includes:

[0058] Collect a first calibration card image that includes a first calibration pattern and a matching first positioning point at the current measurement distance; convert the first calibration card image from the RGB color space to the HSV color space; use a pre-loaded HSV threshold range to identify the first HSV values of at least one pixel included in the first positioning point, and position the first calibration pattern and the matching first positioning point based on the first HSV values to obtain the position information of the first calibration pattern and the matching first positioning point respectively; control the movement trajectory between the calibration cards based on the first HSV values and the position information to adjust the measurement distance between the calibration card and the image sensor; collect a second calibration card image that includes a second calibration pattern and a matching second positioning point at the adjusted measurement distance.

[0059] Thus, by looping through the above step 101, multiple sets of calibration card images can be obtained for subsequent calibration processes.

[0060] Specifically, in step 101, first collect the calibration card image at the current measurement distance, convert it from the RGB color space to the HSV color space, and the HSV color space is more conducive to recognition according to color attributes. Use the pre-set HSV threshold range to identify the pixel values that meet the conditions in the positioning point, that is, the first HSV values. Through this value, the position of the positioning point can be determined, and then the position of the calibration pattern can be determined. Based on this position information, control the movement trajectory of the calibration card to adjust the distance between it and the image sensor. Collect the calibration card image at the new distance again, and so on. This is done because the calibration card images at different measurement distances can reflect the imaging characteristics of the image sensor in various situations.

[0061] In this way, by collecting and processing the calibration card images at different measurement distances, rich and diverse calibration data can be obtained. These data are used for subsequent calibration processes, which can improve the accuracy and comprehensiveness of the image sensor calibration, adapt to different working distance scenarios, and enhance the accuracy and stability of the entire system for detecting and recognizing targets at different distances.

[0062] For example, taking Figure 1 the shown system architecture as an example, after the auxiliary device camera captures the calibration card image, convert it to the HSV color space, and use the pre-loaded HSV threshold range to accurately identify the color of the auxiliary positioning point. Since the colors of the top and left positioning points of the circular target are different, the rectangular bounding boxes (TR, LR) of the top positioning point (T) and the left positioning point (L) can be obtained respectively through the above processing. Information such as the upper left corner coordinates x and y, width w, and height h recorded by each bounding box can be used to calculate the position of the center point of the bounding box. Exemplarily, the width (w) and height (h) of the bounding box are expressed as the following formulas:

[0063]

[0064]

[0065] Furthermore, in the above steps, the center coordinates O(x, y) of the circular target can be located through the center points of the two positioning point rectangular bounding boxes. Assuming the distance between each center O and the positioning point, and the distance d from the circular edge to the edge of each positioning point, the radius of the circle can be further calculated according to geometric relationships. The radius of the circle here is the pixel radius in the following embodiments.

[0066] Exemplarily, through the center point position of the rectangular bounding box, the center coordinates (O(x, y)) of the circular target can be located, and the distance between each center O and the positioning point is known , and based on the distance d from the circular edge to the edge of each positioning point, the radius of the circle can be obtained , and the specific process is as follows:

[0067]

[0068]

[0069]

[0070] This method of determining the center coordinates and radius of a circular target through positioning points provides an effective means for accurate measurement and positioning of the target during the calibration process, and helps with accurate calibration based on the shape and position information of the target.

[0071] In some embodiments, controlling the movement trajectory between the calibration cards based on the first HSV value and the position information includes:

[0072] If the first HSV value indicates red, set the movement direction reverse switch to the off state. If the first HSV value indicates blue, set the movement direction reverse switch to the on state. If the position information indicates that the first calibration pattern is in the central region of the calibration card image, set the roller power switch to the off state.

[0073] Further optionally, after generating the HSV mask parameters for adapting to the current lighting conditions based on the image boundary features to achieve environmental adaptation during the distance measurement process, if the calibration of the first calibration card image is completed, the roller power switch can also be set to the on state.

[0074] Specifically, the movement of the calibration card is controlled based on the color information (represented by HSV values) of the positioning points in the calibration card image and the position information of the calibration pattern. When the first HSV value indicates red, the movement direction reverse switch (HSW) is set to the off state, meaning it moves in the normal direction; when it indicates blue, the HSW is set to the on state, and the movement direction is reversed. If the position information indicates that the first calibration pattern is in the central area of the calibration card image, it means the current position is appropriate, and the roller power switch (PSW) is set to the off state to stop the movement. After generating the HSV mask parameters adapted to the current lighting conditions based on the image boundary features and completing the current calibration, the PSW is reset to the on state for the next round of operations. This utilizes color and position features to achieve precise control of the movement trajectory of the calibration card, enabling it to perform calibration at the appropriate position.

[0075] In this way, through this control method, the calibration card can accurately adjust its movement trajectory and state according to the image information. It can effectively adapt to different color features and position requirements, improve the automation and accuracy of the calibration process, ensure that appropriate calibration card images can be accurately captured under various lighting and other environmental conditions, provide reliable data for subsequent calibration work, and further enhance the accuracy and stability of the entire system's processing of the calibration card, guaranteeing the calibration effect and performance of the system.

[0076] For example, taking Frame (frame image) as the processing unit. When a red edge is recognized in the current Frame through the HSV color space, the first HSV value in the corresponding principle indicates red. At this time, the HSW is controlled to be in the off state, and the calibration card moves in the normal direction; if a blue edge is recognized, that is, the first HSV value indicates blue, the HSW is controlled to be in the on state, and the movement direction is reversed. When the recognized center (O) is within the central area range of the current Frame, which conforms to the situation where the position information in the principle indicates that the calibration pattern is in the central area, the PSW is controlled to be in the closed state to stop the roller movement and pause the movement of the calibration card until the calibration of this color circular area is completed. Then, the PSW is controlled to be in the on state to start the roller, enabling the calibration card to continue moving for subsequent operations. This exemplified operation method intuitively demonstrates how to control the switch state based on color and position information, and thus achieve the control of the movement trajectory and motion state of the calibration card.

[0077] In some embodiments, extracting the target area corresponding to the calibration pattern in the calibration card image includes:

[0078] Based on the position information and the size information of the first calibration pattern, extracting the region of interest in the calibration card image that contains the first calibration pattern; creating a target mask with the same shape as the calibration pattern; using the target mask to extract the first target area corresponding to the position where the calibration pattern is located from the region of interest.

[0079] Exemplarily, based on the center coordinates O(x, y) and the center radius of the circular target , the region of interest of the circle is extracted from the calibration card image, and the first target region corresponding to the position where the calibration pattern is located is extracted through this region of interest.

[0080] In some embodiments, the obtaining of the image boundary features of the target region at different measurement distances includes:

[0081] Converting the target region from the RGB space to the HSV space; extracting the HSV parameters of each pixel in the calibration pattern from the target region; the HSV parameters include: hue feature value, saturation feature value, brightness feature value; obtaining the HSV boundary parameters of the calibration pattern at different measurement distances; the HSV boundary parameters include: the maximum and minimum values of the hue feature value, the maximum and minimum values of the saturation feature value, the maximum and minimum values of the brightness feature value; using the HSV maximum and minimum values of the calibration pattern at different measurement distances as the image boundary features.

[0082] Specifically, first convert the target region from the RGB space to the HSV space, because the HSV space can better reflect the characteristics of colors and is convenient for analyzing color-related parameters. Then extract the hue, saturation, and brightness feature values of each pixel in the calibration pattern of the target region in the HSV space. By obtaining the maximum and minimum values of these feature values at different measurement distances, the HSV boundary parameters are obtained. Furthermore, using these maximum and minimum values as the image boundary features is because they define the change range of the color parameters of the calibration pattern at different distances. In the above steps, by creating a mask consistent with the target circle, the HSV values within the circular region are accurately extracted, excluding external interference. Adding a tolerance to expand the threshold range and adjusting within the effective range is to enable the system to adapt to more actual scene changes.

[0083] Through the above steps, the boundary conditions of the color parameters of the calibration pattern at different measurement distances can be accurately defined, enabling the system to have a clear understanding of the color characteristics of the target region at different distances. Adding a tolerance and making reasonable adjustments can effectively expand the threshold range of the system's recognition of color characteristics, enhance the system's adaptability to environmental changes such as different illuminations and color differences, improve the accuracy and stability of the recognition of the target region, provide a reliable basis for subsequent operations related to image boundary features (such as environmental adaptation, target positioning, etc.), and improve the working performance of the entire system in complex environments.

[0084] In one example, for a circular target area, a circular mask with the same range is created, and only the HSV values within the mask are extracted, which can avoid interference from areas outside the mask and accurately obtain the color information of the target area. The minimum and maximum values of hue, saturation, and brightness within this area are calculated respectively (only the minimum value of hue is calculated).

[0085] Further optionally, to make the calibration device more adaptable, a tolerance T is added to expand the threshold range. According to actual requirements, within the valid range where the hue value does not exceed 0 - 179, and the saturation and brightness values do not exceed 0 - 255, the calculated minimum and maximum values are adjusted by expansion.

[0086] After these operations, the lower bound (L) and upper bound (U) of the HSV target image feature mask under a specific light source (k) are finally obtained. These two boundary values determine the value range of the color features of the target area, laying a foundation for subsequent operations such as image analysis and target recognition using this feature mask.

[0087] For example, the lower bound (L) and upper bound (U) of the HSV target image feature mask under this light source (k) are finally obtained and can be expressed as:

[0088]

[0089]

[0090] In some embodiments, the calibration pattern is circular; using the HSV maximum value and HSV minimum value of the calibration pattern at different measurement distances as the image boundary features includes:

[0091] Obtaining the pixel radius of the calibration pattern in the target area at different measurement distances; the pixel radius is associated with the pupil diameter; obtaining the ratio between the pixel radius of the calibration pattern at different measurement distances and the actual radius of the calibration pattern as the scale factor of the calibration pattern at different measurement distances; obtaining the mapping table corresponding to the calibration pattern based on the mapping relationship between the HSV maximum value and HSV minimum value of the calibration pattern at different measurement distances and the scale factor of the calibration pattern at different measurement distances.

[0092] Thus, synchronous calibration of distance and pupil diameter is achieved, improving the measurement accuracy.

[0093] Specifically, since the calibration pattern is circular, the pixel radius of this circular calibration pattern in the target area at different measurement distances is obtained through image processing techniques. The pixel radius is associated with the pupil diameter because in relevant scenarios involving visual measurement, etc., the pupil diameter will affect the imaging effect and thus has an inherent relationship with the pixel radius of the calibration pattern.

[0094] After obtaining the pixel radii at different measurement distances, calculate the ratio between the pixel radius and the actual radius of the calibration pattern to obtain the scale factor. This scale factor reflects the correspondence between the pixel size and the actual size in the image at different measurement distances.

[0095] Finally, establish a mapping relationship between the HSV maximum and minimum values of the calibration pattern at different measurement distances and the corresponding scale factors to form a mapping table. In this way, through this mapping table, the color feature (HSV value) can be associated with the distance-related size ratio (scale factor). During actual measurement, when the HSV value of the calibration pattern at a certain measurement distance is obtained, the corresponding scale factor can be found through the mapping table, and then combined with information such as the actual radius of the known calibration pattern, the current measurement distance and the parameters related to the pupil diameter can be inferred to achieve synchronous calibration of the distance and the pupil diameter.

[0096] Thus, by establishing the mapping relationship among the HSV value, the pixel radius, and the scale factor, taking into account both the color feature and the size ratio information, it can more comprehensively and accurately reflect various factors in the measurement scenario. Compared with measuring relying solely on a certain type of information, it effectively improves the measurement accuracy. Considering the situations at different measurement distances and incorporating factors related to the pupil diameter, it has better adaptability to different visual conditions, measurement environments, etc., and can ensure the accuracy and reliability of the measurement in various complex situations. With the help of the mapping table, the synchronous calibration of the distance and the pupil diameter can be achieved more conveniently and quickly, reducing manual intervention and complex calculation processes, and improving the efficiency and automation degree of calibration.

[0097] In some embodiments, obtaining the pixel radii of the calibration pattern in the target region at different measurement distances includes:

[0098] Determine the position of the calibration pattern, the position of the positioning point matching the calibration pattern, and the size information of the calibration pattern; based on the size information, the position of the calibration pattern, and the position of the positioning point, obtain the pixel radius of the calibration pattern at the current measurement distance; wherein, the pixel radius is the product of the first relative distance and the distance difference coefficient; the relative distance between the center coordinates of the calibration pattern and the position coordinates of the positioning point is the first relative distance, the relative distance between the edge of the calibration pattern and the edge of the positioning point is the second relative distance, the difference between the center abscissa in the center coordinates and the second relative distance is the first distance difference, the difference between the center abscissa in the center coordinates and the abscissa of the upper left corner of the calibration pattern is the second distance difference, and the distance difference coefficient is the relative ratio between the first distance difference and the second distance difference.

[0099] Specifically, first, by determining the position and size information of the calibration pattern (circle) and its matching positioning points, the pixel radius is calculated. The pixel radius is obtained by multiplying the first relative distance (the relative distance between the center coordinates of the calibration pattern and the position coordinates of the positioning point) by the distance difference coefficient. The distance difference coefficient is determined by the relative ratio of the first distance difference (the difference between the abscissa of the center and the second relative distance, i.e., the difference between the relative distances of the edge of the calibration pattern and the edge of the positioning point) and the second distance difference (the difference between the abscissa of the center of the circle and the abscissa of the upper left corner of the calibration pattern). Such a calculation method can utilize the positional relationship between the circular calibration pattern and its positioning points to accurately obtain the pixel radius of the circle at the current measurement distance. Then, based on the pre-acquired distance between the pupil calibration card and the camera and the actual distance on the calibration card, the ratio of the pixel distance to the actual distance can be obtained. By manually changing the distance between the sensor and the calibration card, a distance array DS is formed, and then a mapping table f of distance and ratio is established.

[0100] Thus, through the above steps, the pixel radius of the calibration pattern at different measurement distances can be accurately obtained, providing an accurate data basis for subsequent synchronous calibration of distance and pupil diameter, and helping to improve the measurement accuracy. By establishing a mapping table of distance and ratio, different measurement distance changes can be adapted, providing strong support for accurate measurement in various practical application scenarios.

[0101] Exemplarily, through the distance D between the pupil calibration card and the camera and the actual distance R on the calibration card, combined with the calculated pixel radius of the target circle, the ratio of the pixel distance to the actual distance at distance D is obtained, denoted as Radio. When manually sliding the slider to change the sensor distance D, an array DS of length N is formed, and finally a mapping table f of distance D and Radio is obtained, expressed as the following formula:

[0102]

[0103]

[0104] This mapping table, together with the lower bound L and upper bound U of the circular target in the calibration card, is saved as the result res in the memory. The structure of res contains these key measurement and mapping information, providing comprehensive data support for subsequent analysis and application.

[0105] After the above steps and actions, finally, the lower bound (L) and upper bound (U) of the circular target in the calibration card are returned, the mapping table of distance and pixel / true distance ratio ( ) is obtained, and the result (res) is saved in the memory. The structure of res is as follows:

[0106]

[0107] In practical applications, the calibration device of the pupil measurement device runs in a low-computing-power embedded system, making it difficult to meet the computing resource requirements for running a deep neural network. This method uses a mathematical model combined with traditional computer vision algorithms to complete the target recognition task (such as pupil detection) under low-computing-power conditions, solving the problem of insufficient computing resources.

[0108] It can be understood that the present application combines the color value distribution rules under different light sources in the following way to automatically generate HSV color value mask parameters suitable for multiple scenarios, thereby reducing manual intervention, improving the efficiency and accuracy of parameter generation, and enabling the device to better handle various actual scenarios.

[0109] To achieve the above technical effects, in the embodiments of the present application, the target area is converted from the RGB space to the HSV space. The HSV space is more in line with the human perception of colors. Among them, the hue (H) represents the type of color, the saturation (S) represents the vividness of the color, and the brightness (V) represents the brightness of the color. Such a conversion helps to more intuitively analyze and process color information, laying a foundation for generating HSV color value mask parameters according to the color value distribution rules under different light sources. Furthermore, the parameters of each pixel in the calibration pattern in the HSV space are extracted from the target area, including the hue characteristic value, the saturation characteristic value, and the brightness characteristic value, and the HSV boundary parameters of the calibration pattern at different measurement distances are obtained, that is, the maximum and minimum values of each characteristic value. By analyzing the variation rules of these parameters under different light sources, the distribution range of color values can be understood. Finally, based on the HSV boundary parameters at different measurement distances and information such as the pixel radius and the proportional coefficient, the lower bound (L) and the upper bound (U) of the HSV color value mask parameters are determined. Since the variation of color values under different measurement distances and different light sources is considered, the generated mask parameters can adapt to multiple scenarios. For example, in an environment with different light intensities or color temperatures, the device can automatically adjust the HSV color value mask parameters according to the pre-determined mapping relationship and color value distribution rules without manual intervention.

[0110] Through the above steps, the present application can automatically learn and adapt to the color value distribution rules under different light sources, automatically generate accurate HSV color value mask parameters, reduce the workload and error of manually setting parameters, improve the efficiency and accuracy of parameter generation, and enable the device to more accurately identify and process the image information of the target area in various actual scenarios.

[0111] In the embodiments of the present application, by obtaining calibration card images at different measurement distances and generating HSV mask parameters adapted to the current lighting conditions based on the image boundary features of the target area at different measurement distances, the distance measurement device can better adapt to different lighting environments, achieve environmental adaptation in the distance measurement process, and improve the usability of the device under complex ambient light (such as indoor lighting at different positions, device signal lights, display screen lighting, etc.).

[0112] In the embodiments of the present application, the calibration card can be used for pupil detection in various light source environments, providing accurate data support for subsequent pupil recognition algorithms. It supports pupil color acquisition and calibration under different lighting environments (such as cold white light, neutral white light, and low blue warm light), and has the characteristics of high precision and diversification. The calibration card is designed based on statistical results, covering the distribution of various pupil colors and having strong generalization ability.

[0113] In the above or following embodiments, the present application also provides a specific implementation manner for setting the calibration pattern. Further optionally, before step 101, the step of setting the calibration pattern based on the pupil sample image can also be implemented as the following steps:

[0114] The first step is to collect pupil reflection images under multiple light sources.

[0115] For example, collect pupil reflection videos under multiple light colors. Under different light sources, the colors generated by the pupil reflection light are different, which will cause differences in pupil colors in the pupil reflection images of the same individual under different light sources.

[0116] Specifically, in the data collection stage, set the active mode of the device and select three representative light sources: cold white light, neutral white light, and low blue warm light. Cold white light usually has a high color temperature, the light is bluish-white, giving a fresh and bright feeling; neutral white light has a moderate color temperature, close to natural light, and the visual experience is relatively comfortable; low blue warm light has a low color temperature, the light is yellowish-red, relatively soft and has less blue light component. Selecting these three light sources can simulate different actual lighting environments, such as different indoor lighting fixtures, natural light at different times, etc.

[0117] When shooting the pupil video, pay attention to covering the diversity of different individuals and environments. The pupils of different individuals vary in size, color, shape, etc. By collecting pupil videos of different individuals, the subsequent algorithms can better adapt to various situations. At the same time, consider different environmental factors, such as different background colors, brightness, etc., to increase the richness of the data and make the algorithms perform well in various complex environments.

[0118] Pupil data is collected under three different light source environments, and a sufficient amount of pupil video data is collected under each light source environment. This allows the algorithm to learn the characteristic changes of the pupils under different light conditions, thus achieving adaptation to multiple scenarios. For example, under cold white light, the pupils may contract due to strong light, while under low blue warm light, the pupils may expand relatively. By learning the characteristics in these different scenarios, the algorithm can more accurately identify the pupils.

[0119] To quickly complete the color value statistics and analysis within the pupil area, a combination of manual annotation and automated calculation tools is adopted. Manual annotation can be carried out by professionals to precisely define and annotate the pupil area, ensuring the accuracy of the annotation. The automated calculation tool can quickly process a large amount of pupil video data and statistically analyze the color value information within the pupil area, such as hue, saturation, brightness, etc. Through the combination of the two, both the accuracy of data processing and the processing efficiency are guaranteed.

[0120] The calibration card is generated based on the collected real pupil data, which covers a variety of pupil colors, such as blue, brown, black, etc. Since the calibration card contains rich pupil color information, when training the pupil recognition algorithm, the algorithm can learn the characteristics of pupils of different colors, thereby enhancing the recognition ability for pupils of various colors.

[0121] When the pupil recognition algorithm encounters pupils of different colors in actual applications, since it has been exposed to pupil data of various colors during the training stage, the algorithm can accurately identify the pupils based on the characteristics learned previously. In addition, due to the consideration of different light sources and environmental factors during the data collection stage, the algorithm can also maintain good recognition performance when facing different lighting conditions and environmental backgrounds, thereby enhancing the robustness and accuracy of the algorithm.

[0122] Furthermore, adjust the orientation of the captured images and save them in a structured manner. Before adjustment, as Figure 5 shown, after adjustment, as Figure 6 shown.

[0123] In the second step, intercept the pupil images to be calibrated (i.e., pupil sample images) from the pupil reflection images under multiple light sources, and mark the pupil range in the pupil images.

[0124] Specifically, play the video in a loop, intercept and store the video frames every N frames, and the images in each video are saved in the folder created by the video file name. For example, the intercepted video images can be as Figure 7 shown. Furthermore, annotate each video image, and respectively annotate the pupil classification under natural light, cold white light, neutral white light, and low blue warm light. For example, the specific effect of the annotated video image is as Figure 8As shown. After all are completed, a data set composed of the corresponding original image and the annotation file is formed.

[0125] In the third step, calculate the pupil color value within the marked range in the pupil image.

[0126] Specifically, in the embodiments of the present application, a single-image pupil color extraction function model can also be used. This function model is used to extract the color information of the pupil area from the pupil image. This function model locates and extracts the pupil area by reading the image and the corresponding annotation data. The input information of the above function model can be a video image and the corresponding annotation file, and the output information is the maximum average color of the pupil area. The implementation process is as follows:

[0127] First, load the pupil image and the corresponding annotation file, and extract the pupil area image based on the annotation file.

[0128] Load the image and annotation data from the file system, traverse all the shapes in the annotation file, find the circular annotation information, and extract the center coordinates ( ) and the radius (r), use the mask (M) to extract the pixel values of the corresponding area in the image (I), and then use the mask to extract the pupil area ( ), and the corresponding formula is as follows:

[0129]

[0130]

[0131] The image effect of the pupil area extracted here is as Figure 9 shown. In Figure 9 , the pupil area corresponds to Figure 8 the pupil image information shown on the right.

[0132] Furthermore, an unsupervised algorithm is used to select the color similar to the maximum average color in the pupil area.

[0133] In practical applications, the color of each pixel in the captured video image is different. It is meaningless to count thousands or even tens of thousands of pixels. Therefore, it is necessary to count the mean of the closest colors. The three primary colors of rgb are used as the positioning point coordinates in the three directions of the xyz axis respectively, the color is converted into a spatial coordinate, and an unsupervised algorithm (K-means) is used for automatic classification. The data of different classifications are divided into individual clusters (Cluster), and the mean of its color is taken ( ). The above processing process is expressed as the following formula:

[0134]

[0135] Among them, represents all data points in the k-th cluster, is the average color of the k-th cluster, is the number of pixels within the cluster, is each pixel within the cluster. After processing all clusters, two lists can be obtained:

[0136]

[0137]

[0138] where N is the number of all clusters, is the array of cluster mean pixel colors, is the mean pixel color of each cluster, is the array of the number of cluster pixel points, is the number of pixel points in each cluster, and have the same length. Take the array index of the array with the largest number of pixel points in ns ( ), and find the corresponding mean pixel according to as the final one extracted for each image.

[0139] Furthermore, traverse and process all images, call the single-image pupil color extraction function for each image for processing, and obtain the maximum mean pupil color array, where N is the number of all images.

[0140]

[0141] Step 4: Count the types of different pupil colors under different light sources.

[0142] Through the annotation file, the light type (class) of the annotated pupil in each image can be obtained, which can form a mapping relationship with as follows:

[0143]

[0144] where c is the light type corresponding to . N different types of light (c) will be regenerated for the maximum mean pupil color set ( ), and each type of light (c) in the set has M corresponding maximum mean pupil colors , expressed as the following formula:

[0145]

[0146] ​Step 5: Generate a calibration card based on the statistical results. For example, select at least one color pattern corresponding to a pupil color from the different pupil color types obtained statistically as the calibration pattern. And print the calibration pattern as a calibration card, that is, a calibration card containing the calibration pattern.

[0147] Processing set , record the first N in each array of the record set , randomly generate a new array , and generate a circular pattern in the order from left to right, using colors in the pattern , and generate a rectangular block on the left and directly above each circular pattern as an auxiliary positioning point. Among them, the leftmost side of the calibration card is red (rgb: 255, 0, 0), and the right side is blue (rgb: 0, 0, 255). For example, the layout style of the calibration card can refer to Figure 10 as shown. In Figure 10 , each circular pattern represents a color.

[0148] Further optionally, it can be printed using various types of materials such as opaque white-bottom acrylic, abs plastic, paper, etc.

[0149] In the above embodiments, through the acquisition of pupil data under three different light source environments (such as cold white light, neutral white light, and low-blue warm light), multi-scene adaptation is achieved. Combining manual annotation and automated calculation tools, the color value statistics and analysis within the pupil area are quickly completed. The calibration card is generated based on real pupil data, can cover a variety of pupil colors, and improves the robustness and accuracy of the pupil recognition algorithm.

[0150] The above describes the calibration method of the measurement device based on pupil detection in the embodiments of the present application. The following introduces the calibration device of the measurement device based on pupil detection that executes the above.

[0151] Refer to Figure 11 , as Figure 11 shown in another structural schematic diagram of a calibration device of a measurement device based on pupil detection, which can calibrate the distance measurement device, thereby improving the measurement accuracy and accuracy of the distance measurement device.

[0152] In the calibration device of the measurement device based on pupil detection in the embodiments of the present application, it can be realized corresponding to the above Figure 4Steps of the calibration method of the measurement device based on pupil detection performed in the corresponding embodiments. The functions implemented by the calibration device of the measurement device based on pupil detection can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions, and the modules can be software and / or hardware. The calibration device of the measurement device based on pupil detection may include an input / output module 601 and a processing module 602. For the implementation of the functions of the processing module 602 and the input / output module 601, reference can be made to Figure 4 the operations performed in the corresponding embodiments, which will not be elaborated here. For example, the processing module 602 can be used to control operations such as the transceiver and acquisition of the input / output module 601.

[0153] The input / output module 601 is configured to obtain calibration card images at different measurement distances; the calibration card images at least include: image information of a calibration pattern set based on pupil sample images; the measurement distance is the distance between the calibration card including the calibration pattern and the image sensor when collecting the calibration card image.

[0154] The processing module 602 is configured to extract the target area corresponding to the calibration pattern in the calibration card image; obtain the image boundary features of the target area at different measurement distances; the image boundary features include the HSV maximum value and the HSV minimum value of each pixel in the calibration pattern; generate HSV mask parameters for adapting to the current illumination conditions based on the image boundary features to achieve environmental adaptation during the distance measurement process.

[0155] In some embodiments, the calibration card image further includes image information of positioning points matching the calibration pattern; the input / output module 601, which obtains calibration card images at different measurement distances, is configured to: collect a first calibration card image including a first calibration pattern and a matching first positioning point at the current measurement distance; convert the first calibration card image from the RGB space to the HSV space; use a pre-loaded HSV threshold range to identify the first HSV values of at least one pixel included in the first positioning point, and based on the first HSV values, position the first calibration pattern and the matching first positioning point to obtain the position information of the first calibration pattern and the matching first positioning point respectively; control the movement trajectory between the calibration cards based on the first HSV values and the position information to adjust the measurement distance between the calibration card and the image sensor; collect a second calibration card image including a second calibration pattern and a matching second positioning point at the adjusted measurement distance.

[0156] In some embodiments, the processing module 602 controls the movement trajectory between the calibration cards based on the first HSV value and the position information, and is configured to: if the first HSV value indicates red, set the movement direction reverse switch to the off state; if the first HSV value indicates blue, set the movement direction reverse switch to the on state; if the position information indicates that the first calibration pattern is in the central area of the calibration card image, set the roller power switch to the off state.

[0157] After the processing module 602 generates HSV mask parameters for adapting to the current illumination conditions based on the image boundary features to achieve environmental adaptation in the distance measurement process, it is further configured to: if the calibration of the first calibration card image is completed, set the roller power switch to the on state.

[0158] In some embodiments, the processing module 602 extracts the target area corresponding to the calibration pattern in the calibration card image and is configured to:

[0159] Based on the position information and the size information of the first calibration pattern, extract the region of interest in the calibration card image that contains the first calibration pattern; create a target mask having the same shape as the calibration pattern; use the target mask to extract the first target area corresponding to the position where the calibration pattern is located from the region of interest.

[0160] In some embodiments, the processing module 602 obtains the image boundary features of the target area at different measurement distances and is configured to:

[0161] Convert the target area from the RGB space to the HSV space; extract the HSV parameters of each pixel in the calibration pattern in the HSV space from the target area; the HSV parameters include: hue feature value, saturation feature value, brightness feature value; obtain the HSV boundary parameters of the calibration pattern at different measurement distances; the HSV boundary parameters include: the maximum and minimum values of the hue feature value, the maximum and minimum values of the saturation feature value, the maximum and minimum values of the brightness feature value; use the HSV maximum and minimum values of the calibration pattern at different measurement distances as the image boundary features.

[0162] In some embodiments, the calibration pattern is circular; the processing module 602 uses the HSV maximum and minimum values of the calibration pattern at different measurement distances as the image boundary features and is configured to:

[0163] Obtain the pixel radius of the calibration pattern in the target area at different measurement distances; the pixel radius is associated with the pupil diameter; obtain the ratio between the pixel radius of the calibration pattern at different measurement distances and the actual radius of the calibration pattern as the scale factor of the calibration pattern at different measurement distances; obtain the mapping table corresponding to the calibration pattern based on the mapping relationship between the HSV maximum value and the HSV minimum value of the calibration pattern at different measurement distances and the scale factor of the calibration pattern at different measurement distances.

[0164] In some embodiments, the processing module 602 that obtains the pixel radius of the calibration pattern in the target area at different measurement distances is configured to:

[0165] Determine the position of the calibration pattern, the position of the positioning point matching the calibration pattern, and the size information of the calibration pattern; based on the size information, the position of the calibration pattern, and the position of the positioning point, obtain the pixel radius of the calibration pattern at the current measurement distance; wherein, the pixel radius is the product of the first relative distance and the distance difference coefficient; the relative distance between the center coordinates of the calibration pattern and the position coordinates of the positioning point is the first relative distance, the relative distance between the edge of the calibration pattern and the edge of the positioning point is the second relative distance, the difference between the abscissa of the center in the center coordinates and the second relative distance is the first distance difference, the difference between the abscissa of the center in the center coordinates and the abscissa of the upper left corner of the calibration pattern is the second distance difference, and the distance difference coefficient is the relative ratio between the first distance difference and the second distance difference.

[0166] The calibration device of the measurement device based on pupil detection in the embodiments of the present application has been described above from the perspective of modular functional entities. Below, the distance measurement device in the embodiments of the present application will be described from the perspective of hardware processing.

[0167] It should be noted that Figure 11 The physical device corresponding to the input / output module 601 shown may be a transceiver, a radio frequency circuit, a communication module, and an input / output (I / O) interface, etc., and the physical device corresponding to the processing module 602 may be a processor.

[0168] Figure 11 The devices shown may all have the structure as Figure 12 shown. When Figure 11 the calibration device of the measurement device based on pupil detection shown has the structure as Figure 12 shown, Figure 12 the processor and the transceiver in it can implement the same or similar functions of the processing module 602 and the input / output module 601 provided by the corresponding device embodiment of the device. Figure 12The memory therein stores a computer program that needs to be called when the processor executes the above-mentioned calibration method of the measurement device based on pupil detection.

[0169] An embodiment of the present application further relates to a chip system, which includes at least one processor and an interface circuit. The processor includes a plurality of vector storage units. The processor is used to execute the interaction of instructions and / or data through the interface circuit, so that the chip system executes the method of any of the above embodiments.

[0170] In a possible implementation, the chip system may also directly include a memory, and a computer program or computer instructions are stored in the memory.

[0171] Exemplarily, the memory may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DRRAM).

[0172] An embodiment of the present application further relates to a processor, which includes a plurality of storage units and is used to call a computer program or computer instructions stored in a memory, so that the processor executes the method described in any of the above embodiments.

[0173] Exemplarily, in the embodiments of the present application, the processor is an integrated circuit chip with the ability to process signals. For example, the processor can be an FPGA, a general-purpose processor, a DSP, an ASIC, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, an SoC, a CPU, a network processor (NP), a microcontroller unit (MCU), a PLD, or other integrated chips, which can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. In a possible implementation manner, the embodiments of the present application further provide a computer-readable storage medium, and the computer-readable storage medium stores program codes. When the program codes run on the computer, the computer is enabled to execute the above method embodiments.

[0174] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0175] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and modules described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0176] In the several embodiments provided by the embodiments of the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the modules is only a logical function division. In actual implementation, there can be other division methods. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or modules can be in electrical, mechanical, or other forms.

[0177] The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they can be located in one place, or can be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0178] In addition, in each embodiment of this application, each functional module can be integrated into one processing module, or each module can exist physically alone, or two or more modules can be integrated into one module. The above integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0179] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product.

[0180] The computer program product includes one or more computer instructions. When the computer program is loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can store, or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive (SSD)).

[0181] The technical solutions provided in the embodiments of this application have been introduced in detail above. Specific examples are used in the embodiments of this application to elaborate on the principles and implementation manners of the embodiments of this application. The descriptions of the above embodiments are only used to help understand the method and its core idea of the embodiments of this application; at the same time, for those of ordinary skill in the art, according to the idea of the embodiments of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the embodiments of this application.

Claims

1. A calibration method for a measurement device based on pupil detection, characterized in that, A calibration device applied to a distance measurement device, the distance measurement device having an image acquisition function, the method comprising: Obtaining calibration card images at different measurement distances; the calibration card images at least include: image information of a calibration pattern set based on a pupil sample image; the measurement distance is the distance between the calibration card containing the calibration pattern and the image sensor when acquiring the calibration card image; Extracting a target region corresponding to the calibration pattern in the calibration card image; Obtaining image boundary features of the target region at different measurement distances; the image boundary features include the HSV maximum value and the HSV minimum value of each pixel in the calibration pattern; Generating HSV mask parameters for adapting to the current illumination condition based on the image boundary features to achieve environmental adaptation in the distance measurement process; Wherein, the obtaining the image boundary features of the target region at different measurement distances includes: converting the target region from the RGB space to the HSV space; extracting the HSV parameters of each pixel in the calibration pattern from the target region; the HSV parameters include: hue feature value, saturation feature value, brightness feature value; obtaining the HSV boundary parameters of the calibration pattern at different measurement distances; the HSV boundary parameters include: the maximum value and the minimum value of the hue feature value, the maximum value and the minimum value of the saturation feature value, the maximum value and the minimum value of the brightness feature value; using the HSV maximum value and the HSV minimum value of the calibration pattern at different measurement distances as the image boundary features; Wherein, the calibration pattern is circular; the using the HSV maximum value and the HSV minimum value of the calibration pattern at different measurement distances as the image boundary features includes: obtaining the pixel radius of the calibration pattern in the target region at different measurement distances; the pixel radius is associated with the pupil diameter; obtaining the ratio between the pixel radius of the calibration pattern at different measurement distances and the actual radius of the calibration pattern as the scale factor of the calibration pattern at different measurement distances; obtaining a mapping table corresponding to the calibration pattern from the mapping relationship between the HSV maximum value and the HSV minimum value of the calibration pattern at different measurement distances and the scale factor of the calibration pattern at different measurement distances; Among them, obtaining the pixel radius of the calibration pattern in the target area at different measurement distances includes: determining the position of the calibration pattern, the position of the positioning point matching the calibration pattern, and the size information of the calibration pattern; based on the size information, the position of the calibration pattern, and the position of the positioning point, obtaining the pixel radius of the calibration pattern at the current measurement distance; where the pixel radius is the product of the first relative distance and the distance difference coefficient; the relative distance between the center coordinates of the calibration pattern and the position coordinates of the positioning point is the first relative distance, the relative distance between the edge of the calibration pattern and the edge of the positioning point is the second relative distance, the difference between the abscissa of the center of the circle in the center coordinates and the second relative distance is the first distance difference, the difference between the abscissa of the center of the circle in the center coordinates and the abscissa of the upper left corner of the calibration pattern is the second distance difference, and the distance difference coefficient is the relative ratio between the first distance difference and the second distance difference.

2. The method according to claim 1, wherein The calibration card image further includes the image information of the positioning point matching the calibration pattern. Obtaining the calibration card images at different measurement distances includes: Collecting a first calibration card image including a first calibration pattern and a matching first positioning point at the current measurement distance; Converting the first calibration card image from the RGB space to the HSV space; Using a pre-loaded HSV threshold range to identify the first HSV values including at least one pixel in the first positioning point, and positioning the first calibration pattern and the matching first positioning point based on the first HSV values to obtain the position information of the first calibration pattern and the matching first positioning point respectively; Based on the first HSV values and the position information, controlling the movement trajectory between the calibration cards to adjust the measurement distance between the calibration card and the image sensor; Collecting a second calibration card image including a second calibration pattern and a matching second positioning point at the adjusted measurement distance.

3. The method according to claim 2, characterized in that, The controlling the movement trajectory between the calibration cards based on the first HSV values and the position information includes: If the first HSV value indicates red, setting the movement direction reverse switch to the off state; If the first HSV value indicates blue, setting the movement direction reverse switch to the on state; If the position information indicates that the first calibration pattern is in the central area of the calibration card image, setting the roller power switch to the off state; After generating the HSV mask parameters for adapting to the current illumination condition based on the image boundary features to achieve the environmental adaptation during the distance measurement process, it further includes: If the first calibration card image is calibrated, setting the roller power switch to the on state.

4. The method according to claim 2, characterized in that, Extracting the target area corresponding to the calibration pattern in the calibration card image includes: Based on the position information and the size information of the first calibration pattern, extracting the region of interest in the calibration card image that includes the first calibration pattern; Creating a target mask having the same shape as the calibration pattern. The first target area corresponding to the position where the calibration pattern is located is extracted from the region of interest by using the target mask.

5. A calibration device for a measurement device based on pupil detection, characterized in that, The calibration device for a measurement device based on pupil detection at least includes: a distance measurement device, and a calibration component for performing parameter calibration on the distance measurement device; Wherein, the distance measurement device includes: a housing, a distance measurement component, an image acquisition device and a processor. The distance measurement component and the image acquisition device are both mechanically connected to the housing, and the distance measurement component and the image acquisition device are both communicatively connected to the calibration component; The calibration component includes a controller, a slider, a slide rail, a drum paper feeding structure for loading and moving a calibration card, and a fixing device for fixing the distance measurement device; the controller is used to control the movement of the calibration card following the rolling of the drum paper feeding structure; The controller is used to execute the calibration method for a measurement device based on pupil detection according to any one of claims 1-4 above.

6. A computing device, characterized in that, It includes a memory, a processor, and a computer program stored on the memory and executable on the processor. Wherein, the processor executes the computer program to implement the calibration method for a measurement device based on pupil detection according to any one of claims 1-4.

7. A readable storage medium, comprising instructions, characterized in that, When the instruction is executed by the processor, the calibration method for a measurement device based on pupil detection according to any one of claims 1-4 is implemented.

Citation Information

Patent Citations

  • Hyperopia diopter measurement system and method

    CN108703738A

  • Object color recognition method and device, electronic equipment and storage medium

    CN111476849A