Measuring equipment calibration method based on pupil detection and related device
By generating HSV mask parameters that are adapted to the current lighting conditions, the problem of the reduction in the accuracy of measurement results of traditional pupil detection equipment under complex ambient light is solved, automatic calibration and efficient adaptation of the equipment are realized, and measurement accuracy and standardization of the equipment are improved.
Patent Information
- Application Number
- CN202510646668.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2045-05-20
AI Technical Summary
The accuracy of measurement results of traditional pupil detection equipment under complex ambient light is reduced, and the operation depends on manual experience, resulting in the effect varies from person to person and is not standard enough.
The measuring device calibration method based on pupil detection is adopted. By acquiring the calibration card images at different measurement distances, the image boundary features of the target area are extracted, and the HSV mask parameters are generated that are adapted to the current lighting conditions, so as to realize automatic calibration of the device and environmental adaptation.
It improves the adaptability and measurement accuracy of the pupil detection and ranging equipment under complex ambient light, reduces manual intervention, and improves the efficiency and accuracy of parameter generation.
Smart Images

Figure CN120176731A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application relate to the field of distance measurement, and more particularly 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 in which the pupil adjusts its size to control the amount of light entering the eye 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 technologies, 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 relies on manual experience judgment, resulting in the inspection operation effects varying from person to person and being not standardized enough.
[0003] To solve the problems in traditional technologies, in related technologies, 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 illuminations, etc. deployed at different positions indoors. The complex ambient light will have a great 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] Embodiments of the present application provide a calibration method for a measurement device based on pupil detection and related devices, which are 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, 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: Obtaining 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 collecting the calibration card image; Extracting a target area corresponding to the calibration pattern in the calibration card image; Obtaining 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 lighting conditions based on the image boundary features to achieve environmental adaptation during the distance measurement process.
[0006] In the above method, by obtaining calibration card images at different measurement distances and generating HSV mask parameters that adapt 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 during 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.). This method combines the color value distribution rules under different light sources to automatically generate HSV color value mask parameters suitable for multiple scenarios, reducing manual intervention, improving the efficiency and accuracy of parameter generation, and enabling 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.
[0007] 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.
[0008] 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.
[0009] 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. Wherein, when the processor executes the computer program, it implements the method described in the first aspect.
[0010] Fifth aspect, an embodiment of the present application provides a chip, which includes a processor coupled to a transceiver and is used 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 the neural network model may be implemented by a dedicated neural network processor or a graphics processor.
[0011] Sixth aspect, an embodiment of the present application provides a chip system, which includes a processor for implementing 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.
[0012] 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.
[0013] 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
[0014] 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: Figure 1 It is a schematic structural diagram of a calibration device for a measurement device based on pupil detection in an embodiment of the present application; Figure 2 It is a schematic structural diagram of a distance measurement device in an embodiment of the present application; Figure 3 It is a schematic structural diagram of a drum-type paper feeding structure in an embodiment of the present application; Figure 4 It is a schematic flowchart of a calibration method for a measurement device based on pupil detection provided by an embodiment of the present application; Figures 5 to 9 It is a schematic principle diagram of a calibration method for a measurement device based on pupil detection in an embodiment of the present application; Figure 10 It is a schematic diagram of a calibration card in an embodiment of the present application; Figure 11Another structural schematic diagram of the calibration device for the measurement device based on pupil detection according to the embodiment of the present application; Figure 12 A structural schematic diagram of the computing device according to the embodiment of the present application.
[0015] In the figure: 10, calibration component; 11, drum 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. Specific embodiments
[0016] The embodiment of the present application provides a method and related device for calibrating 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 method for calibrating a measurement device based on pupil detection provided by the embodiment 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.
[0017] In the embodiment of the present application, by acquiring 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, realize the environmental adaptation of the distance measurement process, and improve the usability of the device 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 also enables the device to better handle various actual scenarios.
[0018] In some embodiments of the present application, the calibration card is set based on real pupil data, covering the distribution 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.
[0019] In some embodiments of the present application, the method can calibrate the measurement device relatively accurately from obtaining the calibration card image, extracting the target area, obtaining the image boundary features, to finally generating the HSV mask parameters. Combining the distance and pupil diameter joint calibration (synchronously calibrating the distance and pupil diameter through a short-distance measurement device) further improves the measurement accuracy.
[0020] 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 the state where a quick response is required and reduces the measurement state update speed in the state where a quick response is not required, saving energy.
[0021] For example, when the doctor picks up the pupil pen to irradiate the patient's pupil, it can be determined that the pupil detection device is in the 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 the 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 and reduce 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.
[0022] It can be understood that the pupil pen refers to a light source that can emit light and irradiate the pupil, such as a flashlight.
[0023] 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 the 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 following embodiments.
[0024] Refer to Figure 1Introduce the control and communication mechanism of the calibration device (i.e., the calibration device for the pupil detection-based measurement device), and combine with the illustrated components. Specifically, the drum-type paper feeding structure 11 is the key execution component for realizing the paper feeding function, which is driven by a driving motor to complete related operations such as paper transportation. The calibration card 12 works in cooperation with the drum-type paper feeding structure 11 and may be the object to be transported, 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 the relevant components of the device to ensure the stability during device operation. The auxiliary detection device 17 can detect the device operation state, the calibration card state, etc., and provide feedback information for control and operation. The calibration component 10 may be the 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.
[0025] 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.
[0026] From the perspective of the control principle, the auxiliary device sends instructions to the calibration device controller through the 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 the power MOSFET (Metal-Oxide-Semiconductor Field-Effect Transistor), that is, controls the PSW (i.e., the drum power switch), to realize the control of turning on or off the drum-type paper feeding structure 11. When the PSW is closed, the driving motor is powered on and the drum-type paper feeding structure 11 operates. When the PSW is disconnected, 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 reverse rotation 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.
[0027] Reference Figure 2 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. Both the distance measurement component and the image acquisition device are mechanically connected to the housing, such as fixedly connected or detachably connected. Both the distance measurement component 200 and the image acquisition device 300 are communicatively connected to the processor. It can be understood that the mechanical connection method 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.
[0028] Reference Figure 3 As shown, Figure 3 provides Figure 1 Schematic diagrams of the calibration card 12 and the drum paper feeding structure 11 involved.
[0029] In practical 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, increasing 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.
[0030] Refer to Figure 4 , Figure 4 is a schematic flow diagram 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 a pupil detection device as an example, the method will be introduced below. The method includes steps 101-104.
[0031] Step 101, obtain calibration card images at different measurement distances; Step 102, extract the target area corresponding to the calibration pattern in the calibration card image; Step 103, obtain the image boundary features of the target area at different measurement distances; Step 104, generate HSV mask parameters for adapting to the current illumination condition based on the image boundary features, so as to realize the environmental adaptation of the distance measurement process.
[0032] In traditional techniques, 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 lighting 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 traditional techniques.
[0033] 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 restricted by external conditions.
[0034] 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 ranging device's measurement results. 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.
[0035] 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.
[0036] 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.
[0037] The purpose of this setting is to associate the calibration card image with pupil detection. Since the calibration pattern is set based on the pupil sample image, subsequent tasks related to pupil detection, such as determining pupil characteristics and calibrating the pupil detection device, can be assisted by analyzing the calibration card image.
[0038] 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.
[0039] 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 can be calculated 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.
[0040] In the embodiments of the present application, the image boundary features include the HSV maximum value and the HSV minimum value of each pixel in the calibration pattern.
[0041] The image boundary features specifically include the maximum value and the minimum value of the HSV color space of each pixel in the calibration pattern. HSV, including Hue, Saturation, and Value, is a color representation model, and each pixel has corresponding hue, saturation, and brightness values in this model. The image boundary features mentioned here are 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 applies to saturation and brightness. Here, obtaining these image boundary features is crucial for generating HSV mask parameters adapted to the environment in the subsequent process. By understanding 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 achieve adaptation 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.
[0042] In some embodiments, the calibration card image further includes 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: Collect a first calibration card image that includes a first calibration pattern and a matched 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 a first HSV value that includes at least one pixel in the first positioning point, and position the first calibration pattern and the matched first positioning point based on the first HSV value to obtain the position information of each of the first calibration pattern and the matched first positioning point; control the movement trajectory between the calibration cards based on the first HSV value 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 matched second positioning point at the adjusted measurement distance.
[0043] Thus, by repeating the above step 101, multiple groups of calibration card images can be obtained for subsequent calibration processes.
[0044] Specifically, in step 101, first, collect a calibration card image at the current measurement distance and convert it from the RGB color space to the HSV color space. The HSV color space is more conducive to recognition based on color attributes. Use a pre-set HSV threshold range to identify the pixel values that meet the conditions in the positioning point, that is, the first HSV value. 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 and adjust the distance between it and the image sensor. Then collect the calibration card image at the new distance again, and so on. This is because the calibration card images at different measurement distances can reflect the imaging characteristics of the image sensor in various situations.
[0045] In this way, by collecting and processing calibration card images at different measurement distances, rich and diverse calibration data can be obtained. These data are used in the subsequent calibration process, which can improve the accuracy and comprehensiveness of the calibration of the image sensor, adapt to different working distance scenarios, and enhance the accuracy and stability of the entire system for detecting and recognizing targets at different distances.
[0046] For example, Figure 1 Taking the system architecture shown as an example, after the auxiliary device camera captures a calibration card image, convert it to the HSV color space. Using a pre-loaded HSV threshold range, the color of the auxiliary positioning point can be accurately recognized. Since the colors of the top and left positioning points of the circular target are different, through the above processing, the rectangular bounding boxes (TR, LR) of the top positioning point (T) and the left positioning point (L) can be obtained respectively. Information such as the upper left corner coordinates x and y, width w, and height h recorded in 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:
[0047]
[0048] 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.
[0049] 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 according to 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:
[0050]
[0051]
[0052] 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 subsequent accurate calibration based on the target shape and position information.
[0053] In some embodiments, controlling the movement trajectory between the calibration cards based on the first HSV value and the position information includes: 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.
[0054] 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.
[0055] 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 shows 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 uses color and position features to achieve precise control of the movement trajectory of the calibration card so that it can be calibrated at the appropriate position.
[0056] 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 acquired under various environmental conditions such as lighting, provide reliable data for subsequent calibration work, and further improve the accuracy and stability of the entire system's processing of the calibration card, guaranteeing the calibration effect and performance of the system.
[0057] 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 point (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 so that the calibration card can continue to move for subsequent operations. This exemplary operation method intuitively shows how to control the switch state based on color and position information, and then achieve the control of the movement trajectory and movement state of the calibration card.
[0058] In some embodiments, 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 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.
[0059] Exemplarily, according to the center coordinates O(x,y) and the radius of the center 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.
[0060] In some embodiments, the obtaining of 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 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 value and the HSV minimum value of the calibration pattern at different measurement distances as the image boundary features.
[0061] Specifically, first, the target region is converted 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, the hue, saturation, and brightness feature values of each pixel in the calibration pattern of the target region are extracted 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, these maximum and minimum values are used as the image boundary features because they define the variation 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.
[0062] 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 reasonably adjusting can effectively expand the threshold range for the system to recognize color characteristics, enhance the system's adaptability to environmental changes such as different illuminations and color differences, improve the accuracy and stability of target region recognition, 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 a complex environment.
[0063] 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).
[0064] 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 and expanded.
[0065] 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.
[0066] 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, which can be expressed as:
[0067]
[0068] 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: 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.
[0069] Thus, synchronous calibration of distance and pupil diameter is achieved, improving the measurement accuracy.
[0070] 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. Here, the pixel radius is associated with the pupil diameter because in related scenarios involving visual measurement, the pupil diameter affects the imaging effect and thus has an inherent relationship with the pixel radius of the calibration pattern.
[0071] After obtaining the pixel radii at different measurement distances, calculate the ratio between them 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.
[0072] 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.
[0073] Thus, by establishing the mapping relationship among the HSV value, the pixel radius, and the scale factor, considering both the color feature and the size ratio information comprehensively, 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 the 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.
[0074] In some embodiments, obtaining the pixel radii of the calibration pattern in the target area at different measurement distances includes: 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.
[0075] 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 edges of the calibration pattern and 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.
[0076] 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, which helps 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.
[0077] 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 moving 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:
[0078]
[0079] 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.
[0080] After the above steps and actions, finally, the lower bound (L) and upper bound (U) of the circular target in the calibration card, the mapping table of distance and pixel / real distance ratio ( ) are returned, and the result (res) is saved in the memory. The structure of res is as follows:
[0081] In practical applications, the calibration device of the pupil measurement device runs in a low-computing-power embedded system, which is difficult to meet the computing resource requirements for running deep neural networks. 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.
[0082] 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 adapted to multiple scenarios, thereby reducing manual intervention and improving the efficiency and accuracy of parameter generation, enabling the device to better handle various actual scenarios.
[0083] To achieve the above technical effects, in the embodiments of the present application, the target region is converted from the RGB space to the HSV space. The HSV space is more in line with the human perception of colors, where the hue (H) represents the type of color, the saturation (S) represents the vividness of the color, and the value (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 region, including the hue feature value, saturation feature value, and value feature 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 feature 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 pixel radius and scale factor, the lower bound (L) and 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.
[0084] 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 region in various actual scenarios.
[0085] 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.).
[0086] 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 distributions of various pupil colors and having strong generalization ability.
[0087] In the above or following embodiments, the present application also provides a specific implementation 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: The first step is to collect pupil reflection images under multiple light sources.
[0088] For example, collect pupil reflection videos under multiple light colors. Under different light sources, the colors generated by the pupil reflection light are different, resulting in differences in pupil colors in the pupil reflection images of the same individual under different light sources.
[0089] 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, with a bluish-white light, giving a refreshing and bright feeling; neutral white light has a moderate color temperature, close to natural light, and provides a relatively comfortable visual experience; low blue warm light has a low color temperature, with a yellowish-red light, which is 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 and natural light at different times.
[0090] 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 and brightness, to increase the richness of the data and enable the algorithm to perform well in various complex environments.
[0091] 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 the 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.
[0092] 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 accurately define and annotate the pupil area, ensuring the accuracy of the annotation. The automated calculation tools 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.
[0093] 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, thus enhancing the recognition ability for pupils of various colors.
[0094] 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, thus enhancing the robustness and accuracy of the algorithm.
[0095] Furthermore, adjust the orientation of the captured images and save them in a structured manner. Before adjustment, as shown in Figure 5 and after adjustment, as shown in Figure 6
[0096] 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.
[0097] 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 shown in Figure 7 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 shown in Figure 8 As shown. After all are completed, a data set composed of the corresponding original image and the annotation file is formed.
[0098] In the third step, calculate the pupil color value within the annotated range in the pupil image.
[0099] Specifically, in the embodiment 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: First, load the pupil image and the corresponding annotation file, and extract the pupil area image based on the annotation file.
[0100] 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 ( ). The corresponding formula is as follows:
[0101]
[0102] 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.
[0103] Furthermore, an unsupervised algorithm is used to select the color similar to the maximum average color in the pupil area.
[0104] 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, and the mean of the colors is taken ( ). The above processing process is expressed as the following formula:
[0105] Among them, represents all the data points in the k-th cluster, is the average color of the k-th cluster, is the number of pixels within a cluster, For each pixel within a cluster, after processing all clusters, two lists can be obtained:
[0106]
[0107] where N is the number of all clusters, is the array of mean pixel colors of clusters, 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 ( ) with the largest number of pixel points in ns, and find the corresponding mean pixel according to as the one finally extracted for each image.
[0108] Furthermore, traverse and process all images, and call the single-image pupil color extraction function for each image to obtain the maximum mean pupil color array, where N is the number of all images.
[0109]
[0110] Step 4: Count the types of different pupil colors under different light sources.
[0111] 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:
[0112] where c is the light type corresponding to . N sets of maximum mean pupil colors under different types of lights (c) will be regenerated ( ). Each type of light (c) in the set has M corresponding maximum mean pupil colors , expressed by the following formula:
[0113] 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 statistically obtained different pupil color types as the calibration pattern. And print the calibration pattern as a calibration card, that is, a calibration card containing the calibration pattern.
[0114] Process the set , 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 be referred to Figure 10 as shown. In Figure 10 , each circular pattern represents a color.
[0115] Further optionally, it can be printed using various types of materials such as opaque white-bottom acrylic, abs plastic, paper, etc.
[0116] In the above embodiments, through the pupil data acquisition under three different light source environments (such as cold white light, neutral white light, 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.
[0117] 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.
[0118] Refer to Figure 11 , as Figure 11 shown, which is another structural schematic diagram of a calibration device of a measurement device based on pupil detection, and it can calibrate the distance measurement device, thereby improving the measurement accuracy and accuracy of the distance measurement device.
[0119] The calibration device of the measurement device based on pupil detection in the embodiments of the present application can implement the steps corresponding to the calibration method of the measurement device based on pupil detection executed in the corresponding embodiments in the above Figure 4 . 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. The function implementation of the processing module 602 and the input / output module 601 can refer to Figure 4 the operations executed 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. 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. The processing module 602 is configured to extract a target region corresponding to the calibration pattern in the calibration card image; obtain 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; generate HSV mask parameters for adapting to the current lighting condition based on the image boundary features, so as to achieve environmental adaptation in the distance measurement process.
[0120] In some embodiments, the calibration card image further includes image information of positioning points matching the calibration pattern; the input / output module 601, which is configured to obtain 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 a first HSV value including at least one pixel in the first positioning point, and position the first calibration pattern and the matching first positioning point based on the first HSV value to obtain the position information of the first calibration pattern and the matching first positioning point respectively; control the moving trajectory between the calibration cards based on the first HSV value 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.
[0121] In some embodiments, the processing module 602, which is configured to control the moving trajectory between the calibration cards based on the first HSV value and the position information, is configured to: if the first HSV value indicates red, set the moving direction reverse switch to the off state; if the first HSV value indicates blue, set the moving 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.
[0122] After the processing module 602 generates HSV mask parameters for adapting to the current lighting condition based on the image boundary features to achieve environmental adaptation in the distance measurement process, it is further configured to: if the first calibration card image is calibrated, set the roller power switch to the on state.
[0123] In some embodiments, the processing module 602 extracts a target region corresponding to the calibration pattern in the calibration card image and is configured to: 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; and use the target mask to extract a first target region corresponding to the position where the calibration pattern is located from the region of interest.
[0124] In some embodiments, the processing module 602 obtains the image boundary features of the target region at different measurement distances and is configured to: Convert the target region from the RGB color space to the HSV color space; extract the HSV parameters of each pixel in the calibration pattern from the target region; the HSV parameters include: hue feature value, saturation feature value, and 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, and the maximum and minimum values of the brightness feature value; and use the HSV maximum and minimum values of the calibration pattern at different measurement distances as the image boundary features.
[0125] 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: Obtain the pixel radius of the calibration pattern in the target region 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; and obtain a mapping table corresponding to the calibration pattern based on the mapping relationship between the HSV maximum and minimum values of the calibration pattern at different measurement distances and the scale factor of the calibration pattern at different measurement distances.
[0126] In some embodiments, the processing module 602 obtains the pixel radius of the calibration pattern in the target region at different measurement distances and is configured to: 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 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.
[0127] 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. Next, the distance measurement device in the embodiments of the present application will be described from the perspective of hardware processing.
[0128] It should be noted that Figure 11 The physical device corresponding to the input / output module 601 shown can be a transceiver, a radio frequency circuit, a communication module, an input / output (I / O) interface, etc., and the physical device corresponding to the processing module 602 can be a processor.
[0129] Figure 11 The devices shown can 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 transceiver in Figure 12 can implement the same or similar functions as the processing module 602 and the input / output module 601 provided by the device embodiment corresponding to the device.
[0130] The embodiments of the present application further relate 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 instructions and / or data interaction through the interface circuit, so that the chip system executes the method of any of the above embodiments. In a possible implementation manner, the chip system can also directly include a memory, and the memory stores computer programs or computer instructions. Exemplarily, the memory can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), or a flash memory. The volatile memory can 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 RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DRRAM). An embodiment of the present application further relates to a processor, which includes a plurality of storage units for invoking a computer program or computer instructions stored in the memory, so that the processor executes the method described in any one of the above embodiments. Exemplarily, in an embodiment 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, and 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, an embodiment of the present application further provides a computer-readable storage medium, and the computer-readable storage medium stores program code, and when the program code runs on the computer, the computer is caused to execute the above method embodiment.
[0131] In the above embodiments, the descriptions of the various embodiments each have their own emphases. For parts not detailed in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0132] 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.
[0133] In several embodiments provided in 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, and there may be other division methods in actual implementation. 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 indirect couplings or communication connections through some interfaces, devices, or modules, and can be in electrical, mechanical, or other forms.
[0134] 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 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.
[0135] In addition, in each embodiment of the embodiments of the present application, the various functional modules 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 modules can be implemented in the form of hardware or in the form of software functional modules. If the above integrated modules are implemented in the form of software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0136] 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.
[0137] The computer program product includes one or more computer instructions. When the computer program is loaded and executed on a computer, it generates, in whole or in part, the processes or functions described in the embodiments of the present application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.
[0138] The technical solutions provided by the embodiments of the present application have been introduced in detail above. Specific examples are used in the embodiments of the present application to illustrate the principles and implementation manners of the embodiments of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the embodiments of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the embodiments of the present 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 the present application.
Claims
1. A method for calibrating a measuring device based on pupil detection, characterized in that: A calibration device applied to a distance measuring device, wherein the distance measuring device has an image acquisition function, and the method comprises: Acquire a calibration card image at different measurement distances; the calibration card image at least includes: 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 area corresponding to the calibration pattern in the calibration card image; Acquire the image boundary features of the target area at different measurement distances; the image boundary features include the HSV maximum value and HSV minimum value of each pixel in the calibration pattern; Based on the image boundary features, HSV mask parameters for adapting to current lighting conditions are generated to achieve environmental adaptation in the distance measurement process.
2. The method according to claim 1, characterized in that The calibration card image also includes image information of positioning points that match the calibration pattern; The obtaining of the calibration card images at different measurement distances includes: Acquire a first calibration card image including a first calibration pattern and a matched first positioning point at a current measurement distance; Convert the first calibration card image from RGB space to HSV space; Using a preloaded HSV threshold range, identifying a first HSV value of at least one pixel in the first positioning point, and locating the first calibration pattern and the matched first positioning point based on the first HSV value to obtain respective position information of the first calibration pattern and the matched first positioning point; Based on the first HSV value and the position information, controlling the movement track between the calibration cards to adjust the measurement distance between the calibration card and the image sensor; A second calibration card image including a second calibration pattern and a matched second positioning point at the adjusted measurement distance is collected.
3. The method according to claim 2, characterized in that The controlling the movement track between the calibration cards based on the first HSV value and the position information includes: If the first HSV value indication is red, the moving direction reversal switch is set to the off state; If the first HSV value indicator is blue, set the moving direction reversal switch to the on state; If the position information indicates that the first calibration pattern is in the center area of the calibration card image, setting the drum power switch to an off state; After generating the HSV mask parameters for adapting the current illumination conditions based on the image boundary features to achieve the environment adaptation of the distance measurement process, the method further includes: If the image calibration of the first calibration card is completed, the power switch of the drum is set to the on state.
4. The method according to claim 2, characterized in that: The step of extracting a target area corresponding to the calibration pattern in the calibration card image includes: Extracting a region of interest including the first calibration pattern in the calibration card image based on the position information and the size information of the first calibration pattern; Creating a target mask having the same shape as the calibration pattern; The target mask is used to extract a first target region corresponding to the position of the calibration pattern from the region of interest.
5. The method according to claim 1, characterized in that The obtaining of image boundary features of the target area at different measurement distances includes: Convert the target area from RGB space to HSV space; Extracting HSV parameters of each pixel in the calibration pattern in the HSV space from the target area; the HSV parameters include: hue characteristic value, saturation characteristic value, and brightness characteristic value; Obtaining HSV boundary parameters of the calibration pattern at different measurement distances; the HSV boundary parameters include: the maximum and minimum values of the hue characteristic value, the maximum and minimum values of the saturation characteristic value, and the maximum and minimum values of the brightness characteristic value; The maximum HSV value and the minimum HSV value of the calibration pattern at different measurement distances are used as the image boundary features.
6. The method according to claim 5, characterized in that The calibration pattern is a circle; the HSV maximum value and HSV minimum value of the calibration pattern at different measurement distances are used as the image boundary features, including: 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 a ratio between a pixel radius of the calibration pattern at different measurement distances and an actual radius of the calibration pattern as a proportional coefficient of the calibration pattern at different measurement distances; The mapping table corresponding to the calibration pattern is obtained by the mapping relationship between the HSV maximum value and the HSV minimum value of the calibration pattern at different measurement distances and the proportionality coefficient of the calibration pattern at different measurement distances.
7. The method according to claim 6, characterized in that The obtaining the pixel radius of the calibration pattern in the target area at different measurement distances includes: 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, obtaining 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 horizontal coordinate of the center in the center coordinates and the second relative distance is the first distance difference, the difference between the horizontal coordinate of the center in the center coordinates and the horizontal coordinate 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.
8. A measuring device calibration device based on pupil detection, characterized in that: The measuring device calibration device based on pupil detection comprises at least: a distance measuring device, and a calibration component for performing parameter calibration on the distance measuring device; The distance measuring device comprises: a housing, a distance measuring component, an image acquisition device and a processor, wherein the distance measuring component and the image acquisition device are both mechanically connected to the housing, and the distance measuring component and the image acquisition device are both communicatively connected to the calibration component; The calibration assembly includes a controller, a slider, a slide rail, a roller-type paper feed structure for loading and moving the calibration card, and a fixing device for fixing the distance measuring device; the controller is used to control the calibration card to move following the rolling of the roller-type paper feed structure; The controller is used to execute the measurement device calibration method based on pupil detection as described in any one of claims 1 to 7.
9. A computing device, characterized in that It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the measurement device calibration method based on pupil detection as described in any one of claims 1 to 7.
10. A readable storage medium, comprising instructions, characterized in that: When the instructions are executed by a processor, the method for calibrating a measuring device based on pupil detection according to any one of claims 1 to 7 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
Ground target reality sense simulation method in remote sensing scene
CN112017159A
Display screen calibration method and system, product and medium
CN119339687A
Image detection and training method, related apparatus, device, medium, and program product
WO2023155494A1