Refraction-corrective lens detection method, and electronic device
By capturing eye images and matching edge information using a built-in camera component in the head-mounted display device, the problem of detecting refractive lenses in head-mounted displays is solved, ensuring the accuracy of interpupillary distance and eye tracking, and improving the user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- VIVO MOBILE COMM CO LTD
- Filing Date
- 2025-11-03
- Publication Date
- 2026-05-15
AI Technical Summary
When using a head-mounted display device, how can we promptly detect whether refractive lenses are configured in order to obtain the user's refractive information and solve the problems of inaccurate pupillary distance and inaccurate eye tracking caused by visual refractive abnormalities?
The head-mounted display takes images of the eyes while the device is worn, extracts edge information of the eye area, and matches it with preset edge information to determine whether to configure refractive correction lenses.
It enables timely detection of whether the head-mounted display device is equipped with refractive correction lenses, ensuring the accuracy of pupillary distance and eye tracking, and improving the user's device experience.
Smart Images

Figure CN2025132134_15052026_PF_FP_ABST
Abstract
Description
Testing methods and electronic equipment for refractive corrective lenses
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202411583329.5, filed on November 7, 2024, entitled "Detection Method and Electronic Equipment for Refractive Correction Lenses", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This application belongs to the field of electronic equipment technology, specifically relating to a method for detecting refractive corrective lenses and an electronic device. Background Technology
[0004] Currently, with the continuous development of technologies such as Virtual Reality (VR), Extended Reality (XR), and Mixed Reality (MR), head-mounted display devices are being used more and more widely. A significant proportion of users of head-mounted display devices have refractive errors. If a user has refractive errors, the head-mounted display device needs to adjust the interpupillary distance and the eye-tracking algorithm's determined visual axis and fixation point based on the user's refractive information during operation.
[0005] In related technologies, users with refractive errors often require additional refractive lenses when using head-mounted displays. Therefore, how to detect whether a head-mounted display is equipped with refractive lenses, in order to obtain the user's refractive information in a timely manner, has become an urgent problem to be solved. Summary of the Invention
[0006] The purpose of this application is to provide a method and electronic device for detecting refractive corrective lenses, which can solve the problem of how to detect whether a head-mounted display device is equipped with refractive corrective lenses.
[0007] In a first aspect, embodiments of this application provide a method for detecting refractive corrective lenses, applied to a head-mounted display device, the head-mounted display device having a built-in imaging component, the method comprising:
[0008] When it is detected that the head-mounted display device is being worn, an eye image is obtained by taking a picture in the direction of the eyes based on the shooting component;
[0009] The edge information of the eye region in the eye image is matched with preset edge information; the preset edge information is the edge information of the eye region in the reference eye image, which is obtained by the shooting component taking a picture of the eye without the head-mounted display device being equipped with refractive corrective lenses;
[0010] If the edge information does not match the preset edge information, it is determined that the head-mounted display device is currently equipped with refractive corrective lenses.
[0011] Secondly, embodiments of this application provide a detection device for refractive corrective lenses, applied to a head-mounted display device, wherein the head-mounted display device has a built-in imaging component, and the device includes:
[0012] The first imaging module is used to capture an image of the eyes based on the imaging component when the head-mounted display device is detected to be worn.
[0013] The matching module is used to match the edge information of the eye region in the eye image with preset edge information; the preset edge information is the edge information of the eye region in the reference eye image, which is obtained by the shooting component taking a picture of the eye without the head-mounted display device being equipped with refractive corrective lenses;
[0014] The first determining module is used to determine that the head-mounted display device is currently equipped with refractive corrective lenses if the edge information does not match the preset edge information.
[0015] Thirdly, embodiments of this application provide an electronic device including a processor and a memory, wherein the memory stores a program or instructions executable on the processor, and the program or instructions, when executed by the processor, implement the steps of the refractive corrective lens detection method as described in the first aspect.
[0016] Fourthly, embodiments of this application provide a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the refractive corrective lens detection method as described in the first aspect.
[0017] Fifthly, embodiments of this application provide a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the refractive corrective lens detection method as described in the first aspect.
[0018] In a sixth aspect, embodiments of this application provide a computer program product stored in a storage medium, which is executed by at least one processor to implement the method for detecting refractive corrective lenses as described in the first aspect.
[0019] In this embodiment, when the wearing of a head-mounted display device is detected, an image of the eye is first captured by the camera component built into the head-mounted display device, pointing towards the eyes. Then, the edge information of the eye region in the eye image is matched with preset edge information. Since the reference eye image is obtained by capturing the image of the eye region in the eye image without refractive lenses, the preset edge information can characterize the edge information of the eye region in the eye image without refractive lenses. Accordingly, by matching the edge information of the eye region in the eye image with the preset edge information, if the edge information does not match the preset edge information, it can be determined that the head-mounted display device is currently equipped with refractive lenses, thereby realizing the detection of whether the head-mounted display device is equipped with refractive lenses.
[0020] Furthermore, in this embodiment, when the head-mounted display device is detected to be worn, an image of the eyes is automatically captured to detect whether the head-mounted display device is currently equipped with refractive lenses. This allows for more timely automatic detection of whether refractive lenses are configured, thereby enabling more timely acquisition of the user's refractive information. Attached Figure Description
[0021] Figure 1 is a flowchart of the steps of the detection method for refractive corrective lenses provided in the embodiments of this application;
[0022] Figure 2 is a schematic diagram of a reference eye image provided in an embodiment of this application;
[0023] Figure 3 is a schematic diagram of another reference eye image provided in an embodiment of this application;
[0024] Figure 4 is a schematic diagram of an eye image provided in an embodiment of this application;
[0025] Figure 5 is a schematic diagram of another eye image provided in an embodiment of this application;
[0026] Figure 6 is a schematic diagram of a processing flow provided in an embodiment of this application;
[0027] Figure 7 is a block diagram of the detection device for refractive corrective lenses provided in an embodiment of this application;
[0028] Figure 8 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0029] Figure 9 is a second schematic diagram of the structure of the electronic device provided in the embodiment of this application. Specific Implementation
[0030] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0031] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0032] This application provides a method for detecting refractive lenses, which can be applied to head-mounted display devices. The head-mounted display device can be VR glasses, XR glasses, MR glasses, etc. The head-mounted display device can include lenses corresponding to the user's eye area, specifically a left-eye lens corresponding to the left eye and a right-eye lens corresponding to the right eye. Since a significant proportion of users of head-mounted display devices have refractive errors, these users typically use additional refractive lenses. For example, the refractive lenses can be attached to the lenses of the head-mounted display device. In this way, the light emitted from the display module in the head-mounted display device passes through the refractive lenses and enters the user's eye, allowing the user with refractive errors to see a clear display image.
[0033] Furthermore, during operation, the head-mounted display device performs interpupillary distance (IPD) determination and eye-tracking based on eye-related algorithms (e.g., iris recognition algorithms). During eye tracking, the visual axis and fixation point need to be determined. If the user has refractive errors, the IPD, visual axis, and fixation point need to be adjusted according to the user's refractive information to ensure accuracy. If the user has refractive errors and the head-mounted display device is equipped with refractive correction lenses, but the corresponding refractive information cannot be obtained, the IPD will be inaccurate. This will lead to problems such as poor image quality, blurriness, and binocular misalignment in the displayed image, as well as inaccurate eye tracking, resulting in hand-eye interaction problems and an inability to perform precise control. Therefore, this application provides a method for detecting refractive correction lenses to detect whether the head-mounted display device is equipped with refractive correction lenses, thereby enabling timely acquisition of the user's refractive information.
[0034] The following description, in conjunction with the accompanying drawings, details the detection method for refractive corrective lenses provided in this application through specific embodiments and application scenarios.
[0035] Figure 1 is a flowchart of the detection method for refractive corrective lenses provided in an embodiment of this application. As shown in Figure 1, the method includes:
[0036] Step 101: When it is detected that the head-mounted display device is being worn, an eye image is obtained by taking a picture in the direction of the eyes based on the shooting component.
[0037] Step 102: Match the edge information of the eye region in the eye image with preset edge information; the preset edge information is the edge information of the eye region in the reference eye image, which is obtained by shooting the image in the direction of the eye using the shooting component when the head-mounted display device is not equipped with refractive correction lenses.
[0038] Step 103: If the edge information does not match the preset edge information, then it is determined that the head-mounted display device is currently equipped with refractive corrective lenses.
[0039] In this embodiment, the head-mounted display device can detect whether it is currently being worn based on internal sensors. For example, it can be determined that the head-mounted display device is currently being worn when a contact signal is detected by a contact sensor. In specific usage scenarios, after a user wears the head-mounted display device, the contact area between the user's face and the device applies pressure; therefore, the contact signal can be pressure information. Alternatively, other methods can be used to determine whether the head-mounted display device is currently being worn. For example, by using built-in accelerometers and gyroscopes, it can be determined that the head-mounted display device is currently being worn when the movement and orientation changes of the device meet preset change conditions. Furthermore, in scenarios where users use the head-mounted display device, they often put it on first. Therefore, upon detecting that the head-mounted display device is currently being worn, the refractive lens detection method provided in this embodiment can be started to ensure timely detection of whether the user is currently wearing refractive lenses.
[0040] The head-mounted display device has a built-in imaging component, which can be positioned opposite a surface with a lens. The lens surface is closest to the user's eyes. Light emitted from the display module in the head-mounted display device passes through the lens and enters the user's eyes, allowing the user to see the displayed image. Specifically, the imaging component can be integrated into an optical engine, which refers to the assembly consisting of the display module and the lens. The imaging component can be positioned on the side of the lens furthest from the user's eyes. The built-in imaging component can be an infrared camera from the eye-tracking device within the head-mounted display device. This eliminates the need for an additional camera, enabling the refractive lens detection method provided in this application, thus reducing hardware implementation costs.
[0041] The imaging component can capture images towards the surface where the lens is located. Since the surface with the lens is close to the user's eyes, an eye image can be obtained through imaging. Specifically, this eye image can be an image of the user's eyes obtained by the imaging component shooting towards the eyes when the head-mounted display device is detected being worn. The imaging component can be controlled to shoot towards the eyes when the head-mounted display device is detected, thereby obtaining the eye image. The eye area in the eye image can refer to the area corresponding to the lens, and the eye area in the eye image can also be called the effective area. Since the area outside the lens on the surface is the lens barrel wall, and the lens barrel wall itself is opaque, there is a brightness difference between the eye area and the non-eye area in the eye image obtained by the imaging component shooting towards the eyes. This allows for relatively convenient capture of the eye area in the eye image. The non-eye area can refer to the area of the lens barrel wall on the surface where the lens is located, and the non-eye area can be a black area. The lens barrel wall is the outer shell of the lens barrel, which houses the optical engine and other components, such as batteries and motherboards.
[0042] In this embodiment, the edge information refers to the edge information of the eye region in the eye image. After obtaining the eye image, the edge information of the eye region in the eye image can be extracted. Then, the extracted edge information is matched with preset edge information. The preset edge information can be edge information extracted in advance from a reference eye image, which is also an eye image obtained by the head-mounted display device based on the shooting component in the direction of the eye. Since the head-mounted display device is not equipped with refractive lenses when capturing the reference eye image, the preset edge information can reflect the edge features of the eye region in the eye image captured by the shooting component when the head-mounted display device is not equipped with refractive lenses.
[0043] Furthermore, there may be an angle between the imaging component and the configured refractive lens. For example, if there is an M-degree angle between the plane of the imaging component and the plane where the lens is set, there will often also be at least an M-degree angle between the imaging component and the configured refractive lens. This is influenced by the angle between the imaging component and the configured refractive lens, the effect of the refractive lens on the optical path of the lens area, and the occlusion of the lens area by the edge of the refractive lens. When a refractive lens is configured in the head-mounted display device, the eye area within the eye region will change. For example, the eye region will shift and its area will become smaller, resulting in shorter edges and fewer edge points in the captured eye image, thus causing a difference between the extracted edge information and the preset edge information. Therefore, if the edge information matches the preset edge information, it means that the edge information of the eye image conforms to the edge characteristics of the eye region in the eye image captured by the imaging component when no refractive lens is configured. Accordingly, it can be determined that the head-mounted display device is currently not configured with a refractive lens. Conversely, if the edge information does not match the preset edge information, it indicates that the edge information of the eye image does not conform to the edge features of the eye region in the eye image captured by the imaging component when no refractive corrective lenses are configured. Accordingly, it can be determined that the head-mounted display device is currently configured with refractive corrective lenses.
[0044] In this embodiment, when the wearing of a head-mounted display device is detected, an image of the eye is first captured by the camera component built into the head-mounted display device, pointing towards the eye. Then, the edge information of the eye region in this image is matched with preset edge information. Since the reference eye image is obtained by capturing the image of the eye region in the head-mounted display device without refractive lenses, the preset edge information can characterize the edge information of the eye region in the eye image without refractive lenses. Accordingly, by matching the edge information of the eye region in this image with the preset edge information, if the edge information does not match the preset edge information, it can be determined that the head-mounted display device is currently equipped with refractive lenses, thereby realizing the detection of whether the head-mounted display device is equipped with refractive lenses.
[0045] Furthermore, in this embodiment, when the head-mounted display device is detected to be worn, an image of the eyes is automatically captured to detect whether the head-mounted display device is currently equipped with refractive lenses. This allows for more timely automatic detection of whether refractive lenses are configured, thereby enabling more timely acquisition of the user's refractive information.
[0046] Optionally, the embodiments of this application may further include the following steps:
[0047] Step S21: If it is determined that the head-mounted display device is currently equipped with refractive corrective lenses, a refractive information input interface is displayed; the refractive information input interface is used to prompt the user to input refractive information.
[0048] Step S22: Receive the refractive information input by the user in the refractive information input interface.
[0049] In this embodiment, when it is determined that a refractive corrective lens is currently configured, the head-mounted display device can notify the operating system via a message mechanism to execute the operation of displaying a refractive information input interface, thereby guiding the user to input refractive information. Exemplarily, the processing flow of the above detection method can be implemented based on a processor. When a refractive corrective lens is detected, a message is sent to the upper-level system to notify it that a refractive corrective lens has been detected. The refractive information input interface can be a pre-designed display interface. This display interface may include prompts to guide the user to complete the refractive information. Exemplarily, the refractive information may include refractive power, astigmatism, etc. The refractive power can be myopia or hyperopia. Accordingly, the display interface may include a refractive power input box and an astigmatism input box. The user can input their refractive power and astigmatism respectively in the refractive power input box and the astigmatism input box. After receiving the refractive information input by the user, the interpupillary distance, visual axis, and fixation point can be adjusted based on the refractive information. This allows for more accurate interpupillary distance adjustment and eye tracking, ensuring a better user experience.
[0050] For example, the influence of refractive lenses with different refractive information on the optical path can be simulated in advance through optical simulation to calculate the pupillary distance (PD) corresponding to different refractive information. Alternatively, the deviation in PD after adding refractive lenses with different refractive information compared to the default PD without added lenses can be calculated as the PD compensation value. The different refractive information and their corresponding PD / PD compensation values are recorded to obtain a first correspondence. After receiving the refractive information input by the user, the PD corresponding to the user-input refractive information can be found from the first correspondence as the target PD. Alternatively, the corresponding PD compensation value can be found as the target compensation value, and the target PD can be calculated based on the default PD and the target compensation value. The control motor of the head-mounted display device can automatically adjust the PD according to the target PD value. The influence of refractive lenses with different refractive information on the optical path can be simulated in advance through optical simulation to calculate the eye center compensation position and / or pupil center compensation position corresponding to different refractive information. The different refractive information and their corresponding eye center compensation positions and / or pupil center compensation positions are recorded to obtain a second correspondence. After receiving the refractive information input by the user, the corresponding ocular center compensation position and / or pupil center compensation position can be found from the second correspondence. Based on the ocular center compensation position and / or pupil center compensation position, the target gaze optical axis direction is calculated. The control motor of the head-mounted display device can adjust the line-of-sight axis and gaze point according to this target gaze optical axis direction. Of course, other methods can also be used to adjust the interpupillary distance and the line-of-sight axis and gaze point based on the refractive information; this embodiment does not limit this approach.
[0051] Compared to providing users with a reporting option, where users actively trigger the reporting option to proactively report refractive information, many users are often unaware of the importance of accurate refractive information due to limitations in their understanding. Therefore, users often do not actively trigger the reporting option to complete their refractive information. Consequently, this method often fails to obtain the user's refractive information in a timely manner. In this embodiment, by displaying a refractive information input interface when a refractive corrective lens is detected, the user is proactively prompted to complete their refractive information, thus enabling timely acquisition of the user's refractive information.
[0052] Furthermore, compared to methods that directly display the refractive information input interface to users regardless of whether they have refractive errors or whether they have corrective lenses on the head-mounted display device, this application, upon detecting that the head-mounted display device is being worn, first checks whether the head-mounted display device currently has corrective lenses. If no corrective lenses are detected, the refractive information input interface is not displayed; it is only displayed when corrective lenses are detected. This allows for timely guidance for users with refractive errors to complete their refractive information while avoiding unnecessary interface display operations for users with normal refractive power who do not need corrective lenses, thus saving display resources. Simultaneously, the display operation of the refractive information input interface provides a seamless experience for users with normal refractive power who do not need corrective lenses.
[0053] Optionally, in this embodiment of the application, the eye image and the reference anterior eye image are obtained based on the same shooting parameters. Specifically, the step of obtaining an eye image by shooting in the direction of the eye using the shooting component may include: step 1011, obtaining the eye image by shooting in the direction of the eye using the shooting component according to specified shooting parameters.
[0054] Accordingly, the aforementioned reference eye image can be obtained through the following steps: Step S31, without configuring refractive corrective lenses, the imaging component takes a picture in the direction of the eye according to the specified imaging parameters to obtain the reference eye image.
[0055] In this embodiment, the specified shooting parameters can be pre-set shooting parameters, which can be set to achieve moderate brightness in the captured image. Specifically, the types of parameters included in the specified shooting parameters and the specific values of each type of parameter can be set based on experience. For example, the specified shooting reference may include the exposure time, which can be 200 milliseconds. Further, the specified shooting parameters may also include sensitivity (ISO), etc., but this embodiment does not limit this.
[0056] The head-mounted display device can be pre-controlled to capture images of the eye area using a camera module based on pre-set fixed shooting parameters, thus obtaining a reference eye image. Specifically, the reference eye image can be captured during the device calibration process. When capturing the reference eye image, a solid-color background can be set in the eye direction. For example, the head-mounted display device can be placed on a horizontal surface, and a pure white background can be placed on the surface with lenses. Since the area outside the lens is the lens barrel wall, which is opaque, the camera module will capture the lens barrel wall when shooting towards the eye. Therefore, in the eye image obtained by the camera module shooting towards the eye, the non-eye area will be black. In this way, setting a pure white background in the eye direction when capturing the reference eye image can maximize the difference between the eye area and the non-eye area in the reference eye image, thereby facilitating the extraction of edge information of the eye area in the reference eye image. Furthermore, the fixed shooting parameters used to capture the reference eye image are stored as the aforementioned specified shooting parameters in a fixed directory of the head-mounted display device. Accordingly, when it is detected that a head-mounted display device is being worn, the specified shooting parameters can be read from a fixed directory, and then the eye image can be obtained by taking a picture in the direction of the eye based on the shooting component according to the specified shooting parameters.
[0057] In this embodiment, both the eye image and the reference eye image are captured using specified shooting parameters. By using the same shooting parameters to capture both the eye image and the reference eye image, the influence of different shooting parameters on edge information can be avoided. This, to a certain extent, improves the accuracy of subsequent detection of whether refractive corrective lenses are configured by matching the edge information extracted from the eye image with preset edge information.
[0058] Optionally, in this embodiment, the edge information of the eye region in the captured eye image and the preset edge information are obtained from the eye image and the reference anterior eye image respectively using the same acquisition method. Specifically, before matching the edge information of the eye region in the eye image with the preset edge information, this embodiment may further include the following steps:
[0059] Step S41: Binarize the eye image according to a preset pixel value threshold.
[0060] Step S42: Based on a preset edge detection algorithm, obtain the pixel coordinates of the edge pixels in the eye region of the eye image after binarization, and obtain the edge information.
[0061] Accordingly, the preset edge information can be obtained through the following steps:
[0062] Step S51: Binarize the reference eye image according to the preset pixel value threshold.
[0063] Step S52: Based on the preset edge detection algorithm, obtain the pixel coordinates of the edge pixels of the eye region in the reference eye image after binarization, and obtain the preset edge information.
[0064] In this embodiment, edge information may include the pixel coordinates of edge pixels. The preset pixel value threshold can be set according to actual conditions; for example, the preset pixel value threshold can be 24. Binarization processing refers to converting the image into an image with only two pixel values: 0 and 255. The image after binarization is a black and white image. Specifically, binarizing an eye image can involve setting pixels with values not less than the preset pixel value threshold to 255 and pixels with values less than the preset pixel value threshold to 0. This binarization process increases the difference between the eye region and non-eye regions in the eye image, making the edges between them clearer and facilitating subsequent edge information extraction. The preset edge detection algorithm can be selected according to actual needs; for example, the preset edge detection algorithm can be the Canny edge detection algorithm, the Sobel edge detection algorithm, the differential edge detection algorithm, etc.
[0065] Edge points are often located at locations with significant brightness changes. After binarizing the eye image, a preset edge detection algorithm can be used to identify points at locations with significant brightness changes in the eye image. Further, the points identified by the preset edge detection algorithm can be iterated through one by one, and their pixel coordinates can be obtained, thus obtaining a set of pixel coordinates. Edge information is determined based on this set of pixel coordinates. Specifically, when determining edge information based on this set of pixel coordinates, pixel coordinates whose distance from the upper edge of the image is less than a preset distance threshold can be determined first. The preset distance threshold can represent the distance between pixels near the upper edge of the lens and the upper edge of the image. These pixel coordinates are determined as edge information. Alternatively, a first number of pixel coordinates can be selected from these pixel coordinates, and a second number of pixel coordinates can be selected from the remaining pixel coordinates. The selected pixel coordinates are determined as edge information. The first number is greater than the second number. This allows the edge information to include the pixel coordinates of more edge points on the upper edge. Since the upper edge is less affected by reflected light and is often clearer, including the pixel coordinates of more edge points on the upper edge in the edge information can improve the accuracy of subsequent edge comparison.
[0066] Accordingly, after obtaining the reference eye image, edge information in the reference eye image can be pre-acquired as preset edge information. Specifically, the reference eye image can be binarized first. Pixels with pixel values not less than a preset pixel value threshold can be set to 255, and pixels with pixel values less than the preset pixel value threshold can be set to 0. This binarization process increases the difference between the eye region and non-eye region in the reference eye image, making the edges between them clearer and facilitating subsequent edge information extraction. After binarizing the reference eye image, a preset edge detection algorithm can be used to identify points in locations with significant brightness changes in the reference eye image. Further, the points identified by the preset edge detection algorithm can be iterated through one by one, and the pixel coordinates of each point can be obtained, thus obtaining a set of pixel coordinates. The reference edge information is then determined based on this set of pixel coordinates.
[0067] Specifically, when determining baseline edge information based on a set of pixel coordinates, pixel coordinates whose distance from the top edge of the image is less than a preset distance threshold can be identified first. These pixel coordinates are then used as the baseline edge information. Alternatively, a first number of pixel coordinates can be selected from these, and a second number can be selected from the remaining pixel coordinates. The selected pixel coordinates are then used as the baseline edge information. The first number is greater than the second number. This ensures that the baseline edge information includes pixel coordinates of more edge points on the top edge. Since the top edge is less affected by reflected light and is often clearer, including pixel coordinates of more edge points on the top edge in the baseline edge information improves the accuracy of subsequent edge comparison.
[0068] It should be noted that since the eye region is often displayed as black after binarization, while other areas of the eye region are displayed as white, edge points also exist within the eye region. Therefore, in this embodiment of the invention, a connected region composed of all white areas can be identified, and the pixel coordinates of points located within this connected region can be removed from the edge information. This allows the edge information to accurately represent the edge features between the eye region and non-eye regions. Furthermore, a connected region with an area smaller than a preset area threshold can be designated as a target connected region, and the pixel coordinates of the edge points of the target connected region can be removed from the edge information. This allows the edge information to accurately represent the edge features between the eye region and non-eye regions.
[0069] Figure 2 is a schematic diagram of a reference eye image provided in an embodiment of this application. As shown in Figure 2, the black area corresponds to the lens barrel wall, and the white area corresponds to the area where the lens is located. The white area is the eye area. It should be noted that for head-mounted display devices, the installation position, processing technology, and installation process of the shooting component can cause the left and right eye areas in the captured eye image to be not completely symmetrical. At the same time, the built-in shooting component reflects infrared light when shooting. After the infrared light passes through the lens area and reaches the user's eye, the shooting component receives the infrared light reflected by the user's eye to form an eye image. Since some light is reflected to other places when passing through the lens, the boundary of the white area is not regular. Figure 3 is a schematic diagram of another reference eye image provided in an embodiment of this application. As shown in Figure 3, in the reference eye image after binarization, the edge between the eye area (white area) and the non-eye area (black area) is clearer. Further, Figure 4 is a schematic diagram of an eye image provided in an embodiment of this application. As shown in Figure 4, when the head-mounted display device is detected to be worn, a specified shooting parameter can be used to shoot, thereby obtaining the image shown in Figure 4. Figure 5 is a schematic diagram of another eye image provided in an embodiment of this application. As shown in Figure 5, this eye image is an eye image after binarization processing. Edge information can be extracted from the binarized eye image using the same method.
[0070] It should be noted that compared to the eye region in the baseline eye image, the eye region in the image with refractive lenses is smaller and its position is shifted. The higher the refractive power of the refractive lens, the smaller the eye region and the greater the shift in its position. For example, in the three eye images obtained with 300-degree, 500-degree, and 700-degree refractive lenses, the smaller the eye region and the greater the shift in its position.
[0071] In this embodiment, when extracting preset edge information, the reference eye image is first binarized according to a preset pixel value threshold. Then, based on a preset edge detection algorithm, the pixel coordinates of the edge pixels of the eye region in the binarized reference eye image are obtained as preset edge information. When extracting edge information, the image is also first binarized according to the preset pixel value threshold, and then, based on the same preset edge detection algorithm, the pixel coordinates of the edge pixels of the eye region in the binarized eye image are obtained as edge information. By using the same method to extract edge information and preset edge information, the influence of different edge information acquisition methods on the edge information can be avoided, thereby improving the accuracy of subsequent detection of whether refractive corrective lenses are configured by matching edge information and preset edge information.
[0072] Optionally, after obtaining the preset edge information, this embodiment may further include: step S61, storing the preset edge information in a designated directory of the head-mounted display device. Correspondingly, before the step of matching the edge information of the eye region in the eye image with the preset edge information, this embodiment may further include: step S71, loading the preset edge information from the designated directory.
[0073] The designated directory can be set as needed. For example, a fixed target whose content will not be overwritten can be selected as the designated directory. Accordingly, preset edge information is obtained in advance and then stored in the designated directory of the head-mounted display device. In this way, when the head-mounted display device is detected to be worn and it is necessary to detect whether the head-mounted display device is equipped with refractive lenses, the preset edge information can be obtained directly by loading from the designated directory, thereby improving the detection efficiency of refractive lenses to a certain extent.
[0074] Optionally, the step of matching the edge information of the eye region in the eye image with preset edge information may specifically include:
[0075] Step 1021: Determine the pixel coordinates included in the preset edge information as the first coordinates, and determine the pixel coordinates included in the edge information as the second coordinates.
[0076] Step 1022: For any first coordinate, if there is no second coordinate that matches the first coordinate, then the first coordinate is determined as the target coordinate.
[0077] Step 1023: If the number of target coordinates is greater than a preset number threshold, determine that the edge information does not match the preset edge information.
[0078] Step 1024: If the number of target coordinates is not greater than the preset number threshold, determine that the edge information matches the preset edge information.
[0079] In this embodiment, X represents the number of pixel coordinates included in the preset edge information, and these X pixel coordinates are the first coordinates. Y represents the number of pixel coordinates included in the edge information, and these Y pixel coordinates are the second coordinates. X and Y can be equal or unequal. The first coordinates are iterated over. For any first coordinate encountered, it is checked whether a second coordinate exists that matches the first coordinate. If it exists, it can be determined that there is an edge point in the eye image corresponding to the edge point represented by the second coordinate. Conversely, if it does not exist, it means that there is no edge point in the eye image corresponding to the edge point represented by the second coordinate, and the first coordinate can be used as the target coordinate. Accordingly, the number of target coordinates can represent the number of edge points in the reference eye image that do not match a corresponding edge point. N represents the number of target coordinates. The initial value of N can be 0, and N can be incremented by 1 after each target coordinate is determined. If the value of N is greater than a preset threshold, even if there are still untraceded first coordinates, it can be determined that the edge information does not match the preset edge information. Here, the untraversed first coordinate refers to the first coordinate for which it has not yet been determined whether a second coordinate matching it exists. This avoids performing unnecessary determination operations. After traversing all first coordinates, if N is not greater than a preset threshold, it can be determined that the extracted edge information matches the preset edge information.
[0080] The preset threshold number can be a pre-set empirical value; for example, it can be 15. If the number of target coordinates is greater than the preset threshold number, it indicates that the extracted edge information differs significantly from the preset edge information, which may be due to the currently configured refractive corrective lenses. Therefore, it can be determined that the edge information does not match the preset edge information. If the number of target coordinates is not greater than the preset threshold number, it indicates that the extracted edge information does not differ significantly from the preset edge information, or the difference is small. This difference may be due to shooting errors or edge information acquisition errors. Therefore, it can be determined that the edge information matches the preset edge information.
[0081] In this embodiment, the pixel coordinates included in the preset edge information are first determined as first coordinates, and the pixel coordinates included in the edge information are determined as second coordinates. For any first coordinate, if there is no second coordinate that matches the first coordinate, then the first coordinate is determined as the target coordinate. Then, if the number of target coordinates is greater than a preset threshold, it is determined that the edge information does not match the preset edge information. If the number of target coordinates is not greater than the preset threshold, it is determined that the edge information matches the preset edge information. In this way, by counting the number of target coordinates and based on the relationship between the number of target coordinates and the preset threshold, it is possible to determine whether the edge information matches the preset edge information, which can ensure matching efficiency and thus ensure the detection efficiency of refractive correction lenses.
[0082] Optionally, embodiments of this application may further include:
[0083] Step S81: For any of the first coordinates, take the pixel point corresponding to the first coordinate in the eye image as the center pixel point, and determine a pixel area of a preset size centered on the center pixel point as the reference pixel area.
[0084] Step S82: If there is no second coordinate belonging to the reference pixel region, then it is determined that there is no second coordinate matching the first coordinate.
[0085] Step S83: If there is a second coordinate belonging to the reference pixel region, then it is determined that there is a second coordinate that matches the first coordinate.
[0086] In this embodiment, the preset size can be pre-set, and the preset size may include a preset pixel region width and a preset pixel region height. For example, both the preset pixel region width and preset pixel region height can be 5 pixels. Accordingly, the resulting reference pixel region is a 5×5 pixel region, which includes a total of 25 pixels.
[0087] For example, assuming the first coordinate of the current traversal is (a, b), the pixel at coordinate (a, b) in the eye image can be used as the center pixel. After determining the center pixel, a pixel region with a preset pixel region width and a preset pixel region height can be divided around this center pixel as the reference pixel region corresponding to the first coordinate of the current traversal. For example, assuming the first coordinate of the current traversal is (a, b), a 5×5 neighborhood of (a, b) in the eye image can be used as the reference pixel region.
[0088] Then, each second coordinate is compared with the coordinates of the pixels included in the reference pixel region. If at least one second coordinate belongs to the coordinates of a pixel included in the reference pixel region, then it can be determined that a second coordinate belonging to the reference pixel region exists, and the eye image contains an edge pixel corresponding to the edge pixel represented by the first coordinate. Here, "the second coordinate belongs to the coordinates of a pixel included in the reference pixel region" means that among the coordinates of the pixels included in the reference pixel region, there is a coordinate that matches the second coordinate. Conversely, if no second coordinate belongs to the reference pixel region, it can be determined that there is no second coordinate belonging to the reference pixel region, and the eye image does not contain an edge pixel corresponding to the edge pixel represented by the first coordinate. Accordingly, N can specifically represent the sum of the number of edge pixels in the reference eye image that do not have a corresponding edge pixel in the corresponding reference pixel region of the eye image.
[0089] In this embodiment of the invention, for any first coordinate, the pixel point corresponding to the first coordinate in the eye image is taken as the center pixel point, and a pixel region of a preset size centered on the center pixel point is determined as a reference pixel region. By determining whether a second coordinate belonging to the reference pixel region exists, it is determined whether a second coordinate matching the first coordinate exists. Since the reference pixel region is larger, the probability of the second coordinate hitting the reference pixel region is higher. This avoids errors caused by shooting or edge information extraction errors that prevent edge points from completely matching, thereby improving the accuracy of matching.
[0090] Figure 6 is a schematic diagram of a processing flow provided in an embodiment of this application. As shown in Figure 6, during the device calibration stage, a reference eye image is captured according to specified shooting parameters. Then, edge information in the reference eye image is extracted as preset edge information according to a specified acquisition method. The specified acquisition method can be the acquisition method represented by steps S51 to S52 above. Next, the preset edge information is stored in a specified directory. When the head-mounted display device is detected to be worn, an eye image is captured according to specified shooting parameters. Next, edge information in the eye image is extracted according to the specified acquisition method. It is determined whether the extracted edge information is consistent with the preset edge information. That is, the extracted edge information is matched with the preset edge information. If they match, it means the edges are consistent, and the process can end. Otherwise, if they do not match, it means the edges are inconsistent, and the refractive information input interface can be displayed.
[0091] Referring to Figure 7, this application embodiment provides a detection device for refractive corrective lenses, applied to a head-mounted display device. The head-mounted display device has a built-in imaging component, and the device includes:
[0092] The first imaging module 201 is used to capture an image of the eyes based on the imaging component when the head-mounted display device is detected to be worn.
[0093] The matching module 202 is used to match the edge information of the eye region in the eye image with preset edge information; the preset edge information is the edge information of the eye region in the reference eye image, which is obtained by the shooting component taking a picture of the eye direction without the head-mounted display device being equipped with refractive corrective lenses;
[0094] The first determining module 203 is used to determine that the head-mounted display device is currently equipped with refractive corrective lenses if the edge information does not match the preset edge information.
[0095] Optionally, the device is further used for:
[0096] If it is determined that the head-mounted display device is currently equipped with refractive corrective lenses, a refractive information input interface is displayed; the refractive information input interface is used to prompt the user to input refractive information.
[0097] Receives refractive information input by the user in the refractive information input interface.
[0098] Optionally, the first shooting module 201 is specifically used to: take a picture of the eye in the direction of the eye according to the specified shooting parameters based on the shooting component, and obtain the eye image;
[0099] The reference eye image is obtained through the following module:
[0100] The second imaging module is used to capture images of the reference eye in the direction of the eye according to the specified imaging parameters based on the imaging component, without the configuration of refractive corrective lenses, to obtain the reference eye image.
[0101] Optionally, the device further includes:
[0102] The first processing module is used to perform binarization processing on the eye image according to a preset pixel value threshold.
[0103] The second acquisition module is used to acquire the pixel coordinates of the edge pixels of the eye region in the eye image after binarization based on a preset edge detection algorithm, and obtain the edge information.
[0104] The preset edge information is obtained through the following modules: a second processing module, used to perform binarization processing on the reference eye image according to the preset pixel value threshold; and a second acquisition module, used to acquire the pixel coordinates of the edge pixels of the eye region in the reference eye image after binarization processing based on the preset edge detection algorithm, thereby obtaining the preset edge information.
[0105] Optionally, the device further includes: a storage module for storing the preset edge information in a designated directory of the head-mounted display device;
[0106] A loading module is used to load the preset edge information from the specified directory.
[0107] Optionally, the matching module 202 is specifically used for:
[0108] The pixel coordinates included in the preset edge information are determined as the first coordinates, and the pixel coordinates included in the edge information are determined as the second coordinates;
[0109] For any of the first coordinates, if there is no second coordinate that matches the first coordinate, then the first coordinate is determined as the target coordinate;
[0110] If the number of target coordinates is greater than a preset threshold, it is determined that the edge information does not match the preset edge information;
[0111] If the number of target coordinates is not greater than the preset number threshold, the edge information is determined to match the preset edge information.
[0112] Optionally, the device further includes:
[0113] The second determining module is used to, for any first coordinate, take the pixel point corresponding to the first coordinate in the eye image as the center pixel point, and determine a pixel area of a preset size centered on the center pixel point as a reference pixel area.
[0114] The third determining module is used to determine that there is no second coordinate matching the first coordinate if there is no second coordinate belonging to the reference pixel region.
[0115] The fourth determining module is used to determine, if there is a second coordinate that matches the first coordinate, if there is a second coordinate belonging to the reference pixel region.
[0116] The detection device for refractive corrective lenses described herein has the same advantages over related technologies as the detection method for refractive corrective lenses described in the foregoing embodiments, and will not be repeated here.
[0117] The refractive lens detection device in this application embodiment can be an electronic device or a component within an electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal or other devices besides a terminal. For example, the electronic device can be a mobile phone, tablet computer, laptop computer, PDA, in-vehicle electronic device, mobile internet device (MID), augmented reality (AR) / virtual reality (VR) device, robot, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc. It can also be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This application embodiment does not specifically limit the specific devices. The refractive lens detection device in this application embodiment can be a device with an operating system. The operating system can be Android, iOS, or other possible operating systems, this application embodiment does not specifically limit the specific devices. The refractive lens detection device provided in this application embodiment can realize the various processes implemented in the method embodiment of FIG1 and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0118] In some embodiments, as shown in FIG8, this application embodiment also provides an electronic device M40, including a processor M401 and a memory M402. The memory M402 stores a program or instructions that can be executed on the processor M401. When the program or instructions are executed by the processor M401, they implement the various steps of the above-described refractive lens detection method embodiment and achieve the same technical effect. To avoid repetition, they will not be described again here. It should be noted that the electronic device in this application embodiment includes the mobile electronic device and non-mobile electronic device described above.
[0119] Figure 9 is a schematic diagram of the hardware structure of another electronic device implementing an embodiment of this application. The electronic device 500 includes, but is not limited to, components such as: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, and a processor 510. Those skilled in the art will understand that the electronic device 500 may also include a power supply (such as a battery) to power the various components. The power supply can be logically connected to the processor 510 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The electronic device structure shown in Figure 9 does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated further here.
[0120] The processor 510 is configured to, upon detecting that the head-mounted display device is being worn, take an image of the eyes based on the imaging component in the direction of the eyes to obtain an eye image;
[0121] The edge information of the eye region in the eye image is matched with preset edge information; the preset edge information is the edge information of the eye region in the reference eye image, which is obtained by the shooting component taking a picture of the eye without the head-mounted display device being equipped with refractive corrective lenses;
[0122] If the edge information does not match the preset edge information, it is determined that the head-mounted display device is currently equipped with refractive corrective lenses.
[0123] The processor 510 is further configured to display a refractive information input interface when it is determined that the head-mounted display device is currently configured with refractive corrective lenses; the refractive information input interface is used to prompt the user to input refractive information; and to receive the refractive information input by the user in the refractive information input interface.
[0124] The processor 510 is further configured to capture an image of the eye in the direction of the eye based on the capturing component according to specified capturing parameters, thereby obtaining the reference eye image; the reference eye image is obtained by capturing an image in the direction of the eye in the direction of the eye based on the capturing component according to the specified capturing parameters without configuring a refractive corrective lens.
[0125] The processor 510 is further configured to: before matching the edge information of the eye region in the eye image with preset edge information, binarize the eye image according to a preset pixel value threshold; and obtain the pixel coordinates of the edge pixels of the eye region in the binarized eye image based on a preset edge detection algorithm to obtain the edge information; the preset edge information is obtained by: binarizing the reference eye image according to the preset pixel value threshold; and obtaining the pixel coordinates of the edge pixels of the eye region in the binarized eye image based on the preset edge detection algorithm to obtain the preset edge information.
[0126] The processor 510 is further configured to, after obtaining the preset edge information, store the preset edge information in a designated directory of the head-mounted display device; and load the preset edge information from the designated directory before matching the edge information of the eye region in the eye image with the preset edge information.
[0127] The processor 510 is further configured to determine the pixel coordinates included in the preset edge information as first coordinates, and to determine the pixel coordinates included in the edge information as second coordinates; for any first coordinate, if there is no second coordinate matching the first coordinate, then the first coordinate is determined as a target coordinate; if the number of target coordinates is greater than a preset number threshold, it is determined that the edge information does not match the preset edge information; if the number of target coordinates is not greater than the preset number threshold, it is determined that the edge information matches the preset edge information.
[0128] The processor 510 is further configured to, for any first coordinate, take the pixel point corresponding to the first coordinate in the eye image as the center pixel point, determine a pixel region of a preset size centered on the center pixel point as a reference pixel region; if there is no second coordinate belonging to the reference pixel region, then determine that there is no second coordinate matching the first coordinate; if there is a second coordinate belonging to the reference pixel region, then determine that there is a second coordinate matching the first coordinate.
[0129] The electronic device and the method for detecting refractive corrective lenses described in the foregoing embodiments have the same advantages over related technologies, and will not be repeated here.
[0130] It should be understood that, in this embodiment, the input unit 504 may include a graphics processing unit (GPU) 5041 and a microphone 5042. The GPU 5041 processes image data of still images or videos obtained by an image capture device (such as a camera) in video capture mode or image capture mode. The display unit 506 may include a display panel 5061, which may be configured in the form of a liquid crystal display, an organic light-emitting diode, or the like. The user input unit 507 includes at least one of a touch panel 5071 and other input devices 5072. The touch panel 5071 is also called a touch screen. The touch panel 5071 may include a touch detection device and a touch controller. Other input devices 5072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, power buttons, etc.), trackballs, mice, and joysticks, which will not be described in detail here.
[0131] The memory 509 can be used to store software programs and various data. The memory 509 may primarily include a first storage area for storing programs or instructions and a second storage area for storing data. The first storage area may store the operating system, application programs or instructions required for at least one function (such as sound playback, image playback, etc.). Furthermore, the memory 509 may include volatile memory or non-volatile memory, or both. The non-volatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory can be random access memory (RAM), static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus RAM (DRRAM). The memory 509 in this embodiment includes, but is not limited to, these and any other suitable types of memory.
[0132] Processor 510 may include one or more processing units; in some embodiments, processor 510 integrates an application processor and a modem processor, wherein the application processor mainly handles operations involving the operating system, user interface, and applications, and the modem processor mainly handles wireless communication signals, such as a baseband processor. It is understood that the modem processor may also not be integrated into processor 510.
[0133] This application embodiment also provides a readable storage medium storing a program or instructions. When executed by a processor, the program or instructions implement the various processes of the above-described refractive lens detection method embodiment, achieving the same technical effect. To avoid repetition, further details are omitted here. The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. This application embodiment also provides a chip including a processor and a communication interface coupled to the processor. The processor runs the program or instructions to implement the various processes of the above-described refractive lens detection method embodiment, achieving the same technical effect. To avoid repetition, further details are omitted here. It should be understood that the chip mentioned in this application embodiment can also be called a system-on-a-chip (SoC), system-on-a-chip (SoC), chip system, or system-on-a-chip (SoC). This application embodiment provides a computer program product stored in a storage medium. This program product is executed by at least one processor to implement the various processes of the above-described refractive lens detection method embodiment, achieving the same technical effect. To avoid repetition, further details are omitted here.
[0134] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0135] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0136] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0137] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0138] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0139] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0140] In addition, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0141] It is understood that the embodiments described in this application can be implemented using hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, modules, units, and subunits can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in this disclosure, or combinations thereof.
[0142] For software implementation, the techniques described in the embodiments of this application can be implemented by modules (e.g., procedures, functions, etc.) that perform the functions described in the embodiments of this application. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or externally.
Claims
1. A method for detecting refractive corrective lenses, applied to a head-mounted display device, the head-mounted display device having a built-in imaging component, the method comprising: When it is detected that the head-mounted display device is being worn, an eye image is obtained by taking a picture in the direction of the eyes based on the shooting component; The edge information of the eye region in the eye image is matched with preset edge information; the preset edge information is the edge information of the eye region in the reference eye image, which is obtained by the shooting component taking a picture of the eye without the head-mounted display device being equipped with refractive corrective lenses; If the edge information does not match the preset edge information, it is determined that the head-mounted display device is currently equipped with refractive corrective lenses.
2. The method according to claim 1, wherein, The method further includes: If it is determined that the head-mounted display device is currently equipped with refractive corrective lenses, a refractive information input interface is displayed; the refractive information input interface is used to prompt the user to input refractive information. Receives refractive information input by the user in the refractive information input interface.
3. The method according to claim 1, wherein, The step of capturing an image of the eye in the direction of the eye using the capturing component includes: capturing an image of the eye in the direction of the eye using the capturing component according to specified capturing parameters; The reference eye image was obtained in the following manner: Without the use of refractive lenses, the reference eye image is obtained by taking a picture of the eye in the direction of the eye according to the specified shooting parameters based on the shooting component.
4. The method according to claim 1, wherein, Before matching the edge information of the eye region in the eye image with preset edge information, the method further includes: The eye image is binarized according to a preset pixel value threshold. Based on a preset edge detection algorithm, the pixel coordinates of the edge pixels in the eye region of the eye image after binarization are obtained to obtain the edge information. The preset edge information is obtained by: binarizing the reference eye image according to the preset pixel value threshold; and obtaining the pixel coordinates of the edge pixels of the eye region in the reference eye image after the binarization process based on the preset edge detection algorithm, thereby obtaining the preset edge information.
5. The method according to claim 4, wherein, After obtaining the preset edge information, the method further includes: storing the preset edge information in a designated directory of the head-mounted display device; Before matching the edge information of the eye region in the eye image with preset edge information, the method further includes: loading the preset edge information from the specified directory.
6. The method according to any one of claims 1-5, wherein, The step of matching the edge information of the eye region in the eye image with preset edge information includes: The pixel coordinates included in the preset edge information are determined as the first coordinates, and the pixel coordinates included in the edge information are determined as the second coordinates; For any of the first coordinates, if there is no second coordinate that matches the first coordinate, then the first coordinate is determined as the target coordinate; If the number of target coordinates is greater than a preset threshold, it is determined that the edge information does not match the preset edge information; If the number of target coordinates is not greater than the preset number threshold, the edge information is determined to match the preset edge information.
7. The method according to claim 6, wherein, The method further includes: For any of the first coordinates, the pixel point corresponding to the first coordinate in the eye image is taken as the center pixel point, and a pixel area of a preset size centered on the center pixel point is determined as the reference pixel area; If there is no second coordinate belonging to the reference pixel region, then it is determined that there is no second coordinate matching the first coordinate; If a second coordinate belonging to the reference pixel region exists, then it is determined that a second coordinate matching the first coordinate exists.
8. A detection device for refractive corrective lenses, applied to a head-mounted display device, the head-mounted display device having a built-in imaging component, the device comprising: The first imaging module is used to capture an image of the eyes based on the imaging component when the head-mounted display device is detected to be worn. The matching module is used to match the edge information of the eye region in the eye image with preset edge information; the preset edge information is the edge information of the eye region in the reference eye image, which is obtained by the shooting component taking a picture of the eye without the head-mounted display device being equipped with refractive corrective lenses; The first determining module is used to determine that the head-mounted display device is currently equipped with refractive corrective lenses if the edge information does not match the preset edge information.
9. The apparatus according to claim 8, wherein, The device is also used for: If it is determined that the head-mounted display device is currently equipped with refractive corrective lenses, a refractive information input interface is displayed; the refractive information input interface is used to prompt the user to input refractive information. Receives refractive information input by the user in the refractive information input interface.
10. The apparatus according to claim 8, wherein, The first shooting module is specifically used for: The eye image is obtained by taking a picture of the eye in the direction of the eye according to the specified shooting parameters using the shooting component; The reference eye image is obtained through the following module: The second imaging module is used to capture images of the reference eye in the direction of the eye according to the specified imaging parameters based on the imaging component, without the configuration of refractive corrective lenses, to obtain the reference eye image.
11. The apparatus according to claim 8, wherein, The device further includes: The first processing module is used to perform binarization processing on the eye image according to a preset pixel value threshold. The second acquisition module is used to acquire the pixel coordinates of the edge pixels of the eye region in the eye image after binarization based on a preset edge detection algorithm, and obtain the edge information. The preset edge information is obtained through the following modules: a second processing module, used to perform binarization processing on the reference eye image according to the preset pixel value threshold; and a second acquisition module, used to acquire the pixel coordinates of the edge pixels of the eye region in the reference eye image after binarization processing based on the preset edge detection algorithm, thereby obtaining the preset edge information.
12. The apparatus according to claim 11, wherein, The device further includes: A storage module is used to store the preset edge information in a designated directory of the head-mounted display device; A loading module is used to load the preset edge information from the specified directory.
13. The apparatus according to any one of claims 8-11, wherein, The matching module is specifically used for: The pixel coordinates included in the preset edge information are determined as the first coordinates, and the pixel coordinates included in the edge information are determined as the second coordinates; For any of the first coordinates, if there is no second coordinate that matches the first coordinate, then the first coordinate is determined as the target coordinate; If the number of target coordinates is greater than a preset threshold, it is determined that the edge information does not match the preset edge information; If the number of target coordinates is not greater than the preset number threshold, the edge information is determined to match the preset edge information.
14. The apparatus according to claim 13, wherein, The device further includes: The second determining module is used to, for any first coordinate, take the pixel point corresponding to the first coordinate in the eye image as the center pixel point, and determine a pixel area of a preset size centered on the center pixel point as a reference pixel area. The third determining module is used to determine that there is no second coordinate matching the first coordinate if there is no second coordinate belonging to the reference pixel region. The fourth determining module is used to determine, if there is a second coordinate that matches the first coordinate, if there is a second coordinate belonging to the reference pixel region.
15. An electronic device comprising a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method for detecting refractive corrective lenses as claimed in any one of claims 1-7.
16. A readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method for detecting refractive corrective lenses as described in any one of claims 1-7.
17. A chip comprising a processor and a communication interface coupled to the processor, the processor being configured to run a program or instructions to implement the method as described in any one of claims 1-7.
18. A computer program product stored in a storage medium, the program product being executed by at least one processor to implement the method as claimed in any one of claims 1-7.