Pupil detection method and device based on pupil pen, medium and equipment
By using a pupil pen to collect multiple pupil images and perform image processing, identifying the pupil boundary and calculating the pupil diameter, the problem of inaccurate pupil size measurement in the prior art is solved, and the reliability of diagnosis is improved.
Patent Information
- Application Number
- CN202411738400.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-25
AI Technical Summary
The lack of accurate pupil size measurement methods in the prior art leads to errors in judgment and difficulty in diagnosis.
Multiple pupil images of the patient were collected by using a pupil pen, and the pupil boundaries were identified and the pupil diameter was calculated through pixel feature binarization processing, image calibration and superposition.
Improves the accuracy of pupil size measurement, reduces the impact of physician experience, and provides more reliable diagnostic data.
Smart Images

Figure CN119515865A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of pupil detection, and in particular to a pupil detection method, device, medium and equipment based on a pupil pen. Background Art
[0002] The pupil is a small round hole in the middle of the disc-shaped iris in the eye. The normal value is 2.5mm-5.0mm. It shrinks in bright light and expands in dim light. The pupil will dilate when you are nervous or excited, and shrink when you take a deep breath, do mental work, or sleep. In addition, the pupil will dilate or shrink when you have certain diseases or take certain drugs.
[0003] Changes in pupil size and reaction to light. In addition to reflecting ophthalmic diseases, it can also reflect systemic diseases. It is valuable in the identification, diagnosis and treatment of internal medicine diseases, neurology diseases and brain surgery diseases. It can be used to identify patients in coma, convulsions, shock, food and drug poisoning, respiratory and circulatory failure, and patients with craniocerebral injury. The location of craniocerebral injury can be determined based on pupil changes. The approximate location of craniocerebral hemorrhage or cerebral infarction can also be determined. If pupil changes are observed in a timely and dynamic manner, it can indicate the prognosis of certain diseases or the precursor of worsening of certain diseases, and the best time can be seized to treat patients.
[0004] At present, pupil size is mostly determined subjectively, and there is no special instrument to measure pupil size. It is impossible to accurately measure the change in pupil size. In actual judgment, flashlight illumination and doctor's naked eye observation are used, which are greatly affected by the experience of the observer. For inexperienced doctors, it is easy to make mistakes in judgment. Summary of the invention
[0005] In order to solve the above technical problems, the present application is proposed. The embodiments of the present application provide a pupil detection method, device, medium and equipment based on a pupil pen.
[0006] According to one aspect of the present application, a pupil detection method based on a pupil pen is provided, comprising: using a pupil pen to collect multiple pupil images of a patient; binarizing the multiple pupil images based on pixel features of the pupil to obtain multiple binary pupil images; calibrating the multiple binary pupil images, and superimposing the multiple binary pupil images based on the calibration results to obtain a superimposed image; identifying the boundary area of the superimposed image to obtain the pupil boundary; and calculating the pupil diameter of the patient according to the pupil boundary.
[0007] In one embodiment, the collecting of multiple pupil images of the patient using a pupil pen includes: collecting multiple pupil images of the patient at different positions or different angles using the pupil pen.
[0008] In one embodiment, the calibrating the multiple binary pupil images includes: adjusting the size or shape of the binary pupil images according to the distance between the pupil pen and the patient's pupil and the shooting angle when collecting the binary pupil images; wherein the distance represents the vertical distance between the pupil pen and the patient's pupil, and the shooting angle represents the angle formed by the line connecting the pupil pen and the patient's pupil and the perpendicular line of the patient's pupil.
[0009] In one embodiment, adjusting the size or shape of the binary pupil image according to the distance and the shooting angle between the pupil pen and the patient's pupil when collecting the binary pupil image includes: reducing or enlarging the size of the binary pupil image according to the distance between the pupil pen and the patient's pupil when collecting the binary pupil image; wherein the size of the binary pupil image is inversely correlated with the distance; and adjusting the shape of the binary pupil image according to the shooting angle between the pupil pen and the patient's pupil when collecting the binary pupil image.
[0010] In one embodiment, identifying the boundary area of the superimposed image to obtain the pupil boundary includes: selecting a point in the pupil area in the superimposed image, and diffusing with the point as the center of a circle until diffusing to a point in a non-pupil area, and determining whether there are any points in the pupil area outside the circle; if so, adjusting the position of the center of the circle, and continuing to diffuse based on the adjusted position of the center of the circle until there are no points in the pupil area outside the circle, and then using the circumference of the circle as the pupil boundary.
[0011] In one embodiment, identifying the boundary area of the superimposed image to obtain the pupil boundary includes: if the center position of the circle cannot be adjusted to obtain a larger circle and there are points in the pupil area outside the circle, then the point in the pupil area outside the circle that is farthest from the circumference is used as the target point; adjusting the center position of the circle to get close to the target point and continue to spread until there are no points in the pupil area outside the circle, and using the circumference as the pupil boundary.
[0012] In one embodiment, calculating the pupil diameter of the patient based on the pupil boundary includes: calculating the distance between any two points on the pupil boundary; and selecting the farthest distance as the pupil diameter of the patient.
[0013] According to another aspect of the present application, a pupil detection device based on a pupil pen is provided, including: an image acquisition module, used to use the pupil pen to acquire multiple pupil images of a patient; a binarization processing module, used to binarize the multiple pupil images based on the pixel features of the pupil to obtain multiple binary pupil images; an image superposition module, used to calibrate the multiple binary pupil images, and superimpose the multiple binary pupil images based on the calibration results to obtain a superimposed image; a boundary recognition module, used to identify the boundary area of the superimposed image to obtain the pupil boundary; and a diameter calculation module, used to calculate the pupil diameter of the patient based on the pupil boundary.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute any of the above-mentioned pupil detection methods based on a pupil pen.
[0015] According to another aspect of the present application, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; the processor is used to execute any of the above-mentioned pupil detection methods based on a pupil pen.
[0016] The present application provides a pupil detection method, device, medium and equipment based on a pupil pen, which uses a pupil pen to collect multiple pupil images of a patient; based on the pixel characteristics of the pupil, the multiple pupil images are binarized to obtain multiple binary pupil images; the multiple binary pupil images are calibrated, and based on the calibration results, the multiple binary pupil images are superimposed to obtain a superimposed image; the boundary area of the superimposed image is identified to obtain the pupil boundary; according to the pupil boundary, the pupil diameter of the patient is calculated; that is, multiple pupil images of the patient are collected, the multiple pupil images are binarized and then calibrated, and the calibrated multiple images are superimposed to identify the boundary of the superimposed image to obtain the pupil boundary, and then the pupil diameter is calculated, and the multiple images are calibrated with each other to obtain a more accurate superimposed image, so as to identify the accurate pupil boundary, and then improve the accuracy of the pupil diameter, so as to provide an accurate data basis for subsequent diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0018] Figure 1It is a flowchart of a pupil detection method based on a pupil pen provided by an exemplary embodiment of the present application.
[0019] Figure 2 It is a structural schematic diagram of a pupil detection device based on a pupil pen provided by an exemplary embodiment of the present application.
[0020] Figure 3 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0021] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.
[0022] Figure 1 FIG. 1 is a flow chart of a pupil detection method based on a pupil pen provided by an exemplary embodiment of the present application. Figure 1 As shown, the pupil detection method based on the pupil pen comprises the following steps:
[0023] Step 110: Use a pupil pen to collect multiple pupil images of the patient.
[0024] The present application uses a pupil pen to collect pupil images of a patient multiple times to obtain multiple pupil images, and performs pupil detection on the patient based on the multiple pupil images of the same patient to improve detection accuracy.
[0025] Step 120: Based on the pixel features of the pupil, binarize the multiple pupil images to obtain multiple binary pupil images.
[0026] Since pupil detection mainly focuses on the pupil area and other areas are interference, the present application performs binarization processing on the pupil image to divide the pupil image into the pupil area and the background area, thereby reducing the interference of images in other areas on the pupil area.
[0027] Step 130: calibrate the multiple binary pupil images, and superimpose the multiple binary pupil images based on the calibration results to obtain a superimposed image.
[0028] Since there may be differences in the angles and distances when multiple pupil images are collected, resulting in different angles and scaling ratios of the multiple pupil images, the present application calibrates multiple binarized pupil images to convert all pupil images into images under the same angle and distance conditions, and superimposes the multiple binary pupil images based on the calibration results to obtain a pupil image, that is, multiple pupil images are superimposed on each other to highlight the distinction between the pupil area and the background area, so that the boundary line between the pupil area and the background area can be obtained more accurately.
[0029] Step 140: Identify the boundary area of the superimposed image to obtain the pupil boundary.
[0030] The present application obtains the boundary area of the superimposed image, that is, the pupil boundary, by identifying the superimposed image of multiple pupil images.
[0031] Step 150: Calculate the pupil diameter of the patient based on the pupil boundary.
[0032] After the pupil boundary is determined, the pupil shape in the pupil image is obtained, and the pupil diameter of the patient is calculated based on the pupil boundary, that is, the pupil size is obtained.
[0033] The present application provides a pupil detection method based on a pupil pen, which uses a pupil pen to collect multiple pupil images of a patient; based on the pixel features of the pupil, binarizes the multiple pupil images to obtain multiple binary pupil images; calibrates the multiple binary pupil images, and superimposes the multiple binary pupil images based on the calibration results to obtain a superimposed image; identifies the boundary area of the superimposed image to obtain the pupil boundary; calculates the pupil diameter of the patient according to the pupil boundary; that is, collects multiple pupil images of the patient, binarizes the multiple pupil images and then calibrates them, and superimposes the calibrated multiple images to identify the boundary of the superimposed image to obtain the pupil boundary, and then calculates the pupil diameter, and uses multiple images to calibrate each other to obtain a more accurate superimposed image, thereby identifying an accurate pupil boundary, and then improving the accuracy of the pupil diameter, providing an accurate data basis for subsequent diagnosis.
[0034] In one embodiment, the specific implementation of the above step 110 may be: using a pupil pen to collect multiple pupil images of the patient at different positions or angles.
[0035] Because the pupil image captured by the pupil pen may be inaccurate or contain certain interference information due to the influence of factors such as shooting angle, distance, and light, in order to ensure that at least one pupil image among the collected pupil images can accurately reflect the patient's pupil state, the present application photographs the patient's pupils at different positions or angles to obtain multiple pupil images, thereby providing accurate basic image data for subsequent pupil recognition.
[0036] In one embodiment, the specific implementation method of the above-mentioned step 130 may be: adjusting the size or shape of the binary pupil image according to the distance between the pupil pen and the patient's pupil and the shooting angle when collecting the binary pupil image; wherein the distance represents the vertical distance between the pupil pen and the patient's pupil, and the shooting angle represents the angle formed by the line connecting the pupil pen and the patient's pupil and the vertical line of the patient's pupil.
[0037] The present application adjusts the size and shape of the pupil image according to the distance between the pupil pen and the patient's pupil and the shooting angle when the pupil image is collected, so as to adjust all the pupil images to images in a unified state. Specifically, for example, pupil images with different shooting angles can be rotated to make the shooting angle consistent, so that image overlap and superposition can be achieved. The distance can be obtained by setting a distance sensor on the pupil pen, and using the distance sensor to measure the vertical distance between the pupil pen and the patient's pupil. The shooting angle can use the distance sensor to respectively collect the length of the line connecting the pupil pen and the patient's pupil, and the shortest distance between the pupil pen and the pupil (that is, the length of the vertical line between the pupil pen and the patient's pupil), and then calculate the angle between the two lines based on the right triangle formed by the two lines, the plane where the patient's face is located, and the line connecting the intersection of the two lines.
[0038] In one embodiment, the specific implementation method of the above-mentioned step 130 may be: reducing or enlarging the size of the binary pupil image according to the distance between the pupil pen and the patient's pupil when collecting the binary pupil image; wherein the size of the binary pupil image is inversely correlated with the distance; and adjusting the shape of the binary pupil image according to the shooting angle between the pupil pen and the patient's pupil when collecting the binary pupil image.
[0039] Since the closer the distance between the pupil pen and the patient's pupil is, the larger the proportion of the pupil image captured is, therefore, the present application can reduce or enlarge the size of the binary pupil image according to the distance between the pupil pen and the patient's pupil when collecting the binary pupil image, that is, taking one of the pupil images as a standard, enlarge the pupil image with a long shooting distance relative to the pupil image, and reduce the pupil image with a short shooting distance, so as to adjust all the pupil images to images under the same shooting distance condition. And according to the shooting angle between the pupil pen and the patient's pupil when collecting the binary pupil image, adjust the shape of the binary pupil image, that is, taking one of the pupil images as a standard, rotate the corresponding angles of the different shooting angles relative to the pupil image in the opposite direction, so as to adjust all the pupil images to images under the same shooting angle condition.
[0040] In one embodiment, the specific implementation method of the above step 140 may be: select a point in the pupil area in the superimposed image, and diffuse with the point as the center of the circle until it diffuses to a point in the non-pupil area, and then determine whether there are any points in the pupil area outside the circle; if so, adjust the position of the center of the circle, and continue to diffuse based on the adjusted position of the center of the circle until there are no points in the pupil area outside the circle, and then use the circumference as the pupil boundary.
[0041] The present application can select a point in the pupil area in the superimposed image (the point can be determined as a point in the pupil area) as the initial point, and diffuse with the initial point as the center of the circle. Specifically, by comparing the pixel difference between the surrounding points and the initial point, it is determined whether the surrounding points are points in the pupil area. If so, it is a point in the pupil area. If not, its diffusion direction is changed, and so on, until it diffuses to a point outside the pupil area, the boundary of the pupil area is obtained. At this time, if there are still points in the pupil area outside the circle, it means that the center position of the circle is incorrect. By adjusting the center position of the circle and continuing to diffuse, the pupil boundary can be obtained.
[0042] In one embodiment, the specific implementation method of the above step 140 may be: if the center position of the circle cannot be adjusted to obtain a larger circle and there are points in the pupil area outside the circle, then the point in the pupil area outside the circle that is farthest from the circumference is used as the target point; the center position of the circle is adjusted to get closer to the target point and continue to spread until there are no points in the pupil area outside the circle, and the circumference is used as the pupil boundary.
[0043] During the adjustment process, if the circle cannot continue to diffuse after adjusting the center position, it is determined whether there are still points in the pupil area outside the circle. If so, the point in the pupil area farthest from the circumference is selected as the target point, and the center position of the circle is adjusted to be close to the target point and continue to diffuse until there are no points in the pupil area outside the circle to obtain the pupil boundary.
[0044] In one embodiment, the specific implementation of the above step 150 may be: calculating the distance between any two points on the pupil boundary; and selecting the farthest distance as the pupil diameter of the patient.
[0045] Since the pupil area in the collected pupil image may not be a complete pupil shape, for example, part of the pupil area is blocked by the eyelids, this application calculates the distance between any two points on the pupil boundary and selects the farthest distance as the patient's pupil diameter to obtain the patient's accurate pupil size.
[0046] In one embodiment, the pupil detection method based on the pupil pen may further include: calculating the pupil diameters in multiple directions, and if the difference between the pupil diameters in two directions exceeds a preset difference threshold, determining that the patient's pupil is abnormal. For example, if the difference between the distance between the pupil boundary points in the horizontal direction and the distance between the pupil boundary points in the vertical direction is large, it means that the patient's pupil shape is abnormal (not nearly circular), and it may be that the patient is ill (for example, cataracts block the pupil area), resulting in an abnormal pupil area in the pupil image. At this time, an abnormal prompt can be given, and the doctor can further check and determine to avoid the abnormal results of automatic detection affecting subsequent diagnosis and treatment.
[0047] Figure 2 1 is a schematic diagram of the structure of a pupil detection device based on a pupil pen provided by an exemplary embodiment of the present application. Figure 2 As shown, the pupil detection device 20 based on the pupil pen includes: an image acquisition module 21, which is used to use the pupil pen to collect multiple pupil images of the patient; a binarization processing module 22, which is used to binarize the multiple pupil images based on the pixel characteristics of the pupil to obtain multiple binary pupil images; an image superposition module 23, which is used to calibrate the multiple binary pupil images, and superimpose the multiple binary pupil images based on the calibration results to obtain a superimposed image; a boundary recognition module 24, which is used to identify the boundary area of the superimposed image to obtain the pupil boundary; a diameter calculation module 25, which is used to calculate the patient's pupil diameter according to the pupil boundary.
[0048] The present application provides a pupil detection device based on a pupil pen, which uses an image acquisition module 21 to acquire multiple pupil images of a patient using a pupil pen; a binarization processing module 22 performs binarization processing on multiple pupil images based on pixel features of the pupil to obtain multiple binary pupil images; an image superposition module 23 calibrates multiple binary pupil images, and superimposes multiple binary pupil images based on the calibration results to obtain a superimposed image; a boundary recognition module 24 identifies the boundary area of the superimposed image to obtain the pupil boundary; a diameter calculation module 25 calculates the pupil diameter of the patient according to the pupil boundary; that is, multiple pupil images of the patient are acquired, the multiple pupil images are binarized and then calibrated, and the calibrated multiple images are superimposed to identify the boundary of the superimposed image to obtain the pupil boundary, and then the pupil diameter is calculated, and multiple images are calibrated with each other to obtain a more accurate superimposed image, thereby identifying an accurate pupil boundary, and then improving the accuracy of the pupil diameter, providing an accurate data basis for subsequent diagnosis.
[0049] In one embodiment, the image acquisition module 21 may be further configured to: use a pupil pen to acquire multiple pupil images of the patient at different positions or angles.
[0050] In one embodiment, the image overlay module 23 may be further configured to adjust the size or shape of the binary pupil image according to the distance between the pupil pen and the patient's pupil and the shooting angle when collecting the binary pupil image; wherein the distance represents the vertical distance between the pupil pen and the patient's pupil, and the shooting angle represents the angle formed by the line connecting the pupil pen and the patient's pupil and the vertical line of the patient's pupil.
[0051] In one embodiment, the image overlay module 23 can be further configured as follows: reducing or enlarging the size of the binary pupil image according to the distance between the pupil pen and the patient's pupil when collecting the binary pupil image; wherein the size of the binary pupil image is inversely correlated with the distance; and adjusting the shape of the binary pupil image according to the shooting angle between the pupil pen and the patient's pupil when collecting the binary pupil image.
[0052] In one embodiment, the boundary recognition module 24 may be further configured as follows: selecting a point in the pupil area in the superimposed image, and diffusing with the point as the center of the circle until diffusing to a point in the non-pupil area, and then determining whether there are any points in the pupil area outside the circle; if so, adjusting the position of the center of the circle, and continuing to diffuse based on the adjusted position of the center of the circle until there are no points in the pupil area outside the circle, and then using the circumference as the pupil boundary.
[0053] In one embodiment, the boundary recognition module 24 may be further configured as follows: if the center position of the circle cannot be adjusted to obtain a larger circle and there are points in the pupil area outside the circle, then the point in the pupil area outside the circle that is farthest from the circumference is used as the target point; the center position of the circle is adjusted to approach the target point and continue to diffuse until there are no points in the pupil area outside the circle, and the circumference is used as the pupil boundary.
[0054] In one embodiment, the diameter calculation module 25 may be further configured to: calculate the distance between any two points on the pupil boundary; and select the farthest distance as the pupil diameter of the patient.
[0055] In one embodiment, the pupil detection device 20 based on the pupil pen can be further configured to: calculate the pupil diameters in multiple directions, and if the difference between the pupil diameters in two directions exceeds a preset difference threshold, it is determined that the patient's pupil is abnormal.
[0056] Below, reference Figure 3 The electronic device according to the embodiment of the present application is described. The electronic device may be any one or both of the first device and the second device, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signal from them.
[0057] Figure 3 A block diagram of an electronic device according to an embodiment of the present application is illustrated.
[0058] like Figure 3 As shown, the electronic device 10 includes one or more processors 11 and a memory 12 .
[0059] The processor 11 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
[0060] The memory 12 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may include, for example, a read-only memory (ROM), a hard disk, a flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may run the program instructions to implement the methods of the various embodiments of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0061] In one example, the electronic device 10 may further include: an input device 13 and an output device 14 , and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0062] When the electronic device is a stand-alone device, the input device 13 may be a communication network connector, which is used to receive the collected input signals from the first device and the second device.
[0063] In addition, the input device 13 may also include, for example, a keyboard, a mouse, and the like.
[0064] The output device 14 can output various information to the outside, including the determined distance information, direction information, etc. The output device 14 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0065] Of course, to simplify, Figure 3 Only some of the components related to the present application in the electronic device 10 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 10 may also include any other appropriate components.
[0066] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of this specification.
[0067] The computer program product may be written in any combination of one or more programming languages to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages, such as Java, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0068] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the method according to various embodiments of the present application described in the above "Exemplary Method" section of this specification.
[0069] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0070] The basic principles of the present application are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present application are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present application. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, not for limitation, and the above details do not limit the present application to being implemented by adopting the above specific details.
[0071] The block diagrams of the devices, apparatuses, equipment, and systems involved in this application are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0072] It should also be noted that in the apparatus, device and method of the present application, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present application.
[0073] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present application. Therefore, the present application is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0074] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present application to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A pupil detection method based on a pupil pen, characterized in that: include: A pupil pen was used to collect multiple pupil images of the patient; Based on the pixel features of the pupil, binarization processing is performed on the multiple pupil images to obtain multiple binary pupil images; Calibrate the multiple binary pupil images, and superimpose the multiple binary pupil images based on the calibration result to obtain a superimposed image; Identifying a boundary area of the superimposed image to obtain a pupil boundary; Based on the pupil boundary, the pupil diameter of the patient is calculated.
2. The pupil detection method based on pupil pen according to claim 1, characterized in that: The method of collecting multiple pupil images of a patient using a pupil pen comprises: The pupil pen is used to collect multiple pupil images of the patient at different positions or different angles.
3. The pupil detection method based on pupil pen according to claim 1, characterized in that: The calibrating the plurality of binary pupil images comprises: The size or shape of the binary pupil image is adjusted according to the distance between the pupil pen and the patient's pupil and the shooting angle when collecting the binary pupil image; wherein the distance represents the vertical distance between the pupil pen and the patient's pupil, and the shooting angle represents the angle formed by the line connecting the pupil pen and the patient's pupil and the perpendicular line of the patient's pupil.
4. The pupil detection method based on pupil pen according to claim 3, characterized in that: The adjusting the size or shape of the binary pupil image according to the distance between the pupil pen and the pupil of the patient and the shooting angle when collecting the binary pupil image comprises: Reduce or enlarge the size of the binary pupil image according to the distance between the pupil pen and the pupil of the patient when collecting the binary pupil image; wherein the size of the binary pupil image is inversely correlated with the distance; The shape of the binary pupil image is adjusted according to a shooting angle between the pupil pen and the pupil of the patient when the binary pupil image is collected.
5. The pupil detection method based on pupil pen according to claim 1, characterized in that: The step of identifying the boundary area of the superimposed image to obtain the pupil boundary comprises: Select a point in the pupil area of the superimposed image, and diffuse the image with the point as the center until it diffuses to a point in the non-pupil area, and then determine whether there are still points in the pupil area outside the circle; If it exists, the position of the center of the circle is adjusted, and the diffusion continues based on the adjusted position of the center of the circle until there are no points in the pupil area outside the circle, and the circumference is used as the pupil boundary.
6. The pupil detection method based on pupil pen according to claim 5, characterized in that: The step of identifying the boundary area of the superimposed image to obtain the pupil boundary comprises: If the center position of the circle cannot be adjusted to obtain a larger circle and there is a point in the pupil area outside the circle, the point in the pupil area that is farthest from the circumference of the circle is taken as the target point; The center position of the circle is adjusted to be close to the target point and continues to spread until there are no points in the pupil area outside the circle, and the circumference of the circle is used as the pupil boundary.
7. The pupil detection method based on pupil pen according to claim 1, characterized in that: Calculating the pupil diameter of the patient according to the pupil boundary includes: Calculating the distance between any two points on the pupil boundary; The farthest distance is selected as the pupil diameter of the patient.
8. A pupil detection device based on a pupil pen, characterized in that: include: An image acquisition module, used for acquiring multiple pupil images of a patient using a pupil pen; A binarization processing module, used for performing binarization processing on the plurality of pupil images based on the pixel features of the pupil to obtain a plurality of binary pupil images; An image superposition module, used for calibrating the multiple binary pupil images, and superimposing the multiple binary pupil images based on the calibration result to obtain a superimposed image; A boundary recognition module, used to identify the boundary area of the superimposed image to obtain the pupil boundary; A diameter calculation module is used to calculate the pupil diameter of the patient according to the pupil boundary.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to execute the pupil detection method based on the pupil pen as described in any one of claims 1 to 7.
10. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is used to execute the pupil detection method based on the pupil pen as described in any one of claims 1-7 above.