Distance detection method, control method, device, storage medium and electronic device

By determining the imaging sizes of multiple preset parts of the face in the face image to detect the distance between the person and the device, the problem of insufficient accuracy of distance detection in the prior art is solved, and higher accuracy and lower hardware costs are achieved.

CN113920195BActive Publication Date: 2025-03-14GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111172688.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-08
Publication Date
2025-03-14
Estimated Expiration
2041-10-08

AI Technical Summary

Technical Problem

The prior art has limited accuracy when detecting the distance between a person and a device, which limits the application of intelligent functions.

Method used

By acquiring the face image of the target user captured by the image acquisition device, the imaging sizes of at least two preset parts of the face in the face image are determined, and the distance between the target user and the image acquisition device is determined based on these imaging sizes.

Benefits of technology

It improves the accuracy of distance detection, reduces the impact of imaging instability of a single face preset part, and is implemented based on the camera, without the need for special configuration of distance sensors, and is low in hardware cost, which is suitable for mobile scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113920195B_ABST
    Figure CN113920195B_ABST
Patent Text Reader

Abstract

The present disclosure provides a distance detection method, a control method, a distance detection device, a control device, a computer-readable storage medium and an electronic device, and relates to the field of computer vision technology. The distance detection method comprises: acquiring a face image of a target user acquired by an image acquisition device; determining the imaging size of at least two preset face parts in the face image; and determining the distance between the target user and the image acquisition device according to the imaging size of the at least two preset face parts. The present disclosure can improve the accuracy of distance detection and has a lower hardware cost.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] As people's demand for smart electronic devices increases, some smart functions need to be realized by detecting the distance between people and devices. For example, when a mobile phone detects that the user is close to the phone in the off state, it automatically wakes up the screen; when the access control system detects that someone is approaching, it automatically triggers the process of identity authentication or door opening, and so on.

[0003] However, the related technology has limited accuracy when detecting the distance between a person and a device, which limits the application of the above functions.

[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to those skilled in the art. Summary of the invention

[0005] The present disclosure provides a distance detection method, a control method, a distance detection device, a control device, a computer-readable storage medium and an electronic device, thereby improving the accuracy of detecting the distance between a person and a device at least to a certain extent.

[0006] According to a first aspect of the present disclosure, a distance detection method is provided, comprising: acquiring a facial image of a target user acquired by an image acquisition device; determining imaging sizes of at least two preset facial parts in the facial image; and determining the distance between the target user and the image acquisition device based on the imaging sizes of the at least two preset facial parts.

[0007] According to a second aspect of the present disclosure, a distance detection method is provided, comprising: acquiring a facial image of a target user acquired by an image acquisition device; determining at least one first preset facial part in the preset facial parts in the facial image; determining at least one second preset facial part in the preset facial parts in the facial image based on an imaging size of the first preset facial part in the facial image; and determining the distance between the target user and the image acquisition device based on the imaging size of the second preset facial part in the facial image.

[0008] According to a third aspect of the present disclosure, a control method is provided, comprising: obtaining a distance between a target user and an image acquisition device, wherein the distance is detected according to the distance detection method of the first or second aspect; and generating a corresponding control instruction according to the distance.

[0009] According to a fourth aspect of the present disclosure, a distance detection device is provided, comprising: an image acquisition module, configured to acquire a facial image of a target user acquired by an image acquisition device; an imaging size determination module, configured to determine the imaging sizes of at least two preset facial parts in the facial image; and a distance determination module, configured to determine the distance between the target user and the image acquisition device based on the imaging sizes of the at least two preset facial parts.

[0010] According to a fifth aspect of the present disclosure, a distance detection device is provided, comprising: an image acquisition module, configured to acquire a facial image of a target user acquired by an image acquisition device; a first facial preset part determination module, configured to determine at least one first facial preset part in the facial preset parts in the facial image; a second facial preset part determination module, configured to determine at least one second facial preset part in the facial preset parts in the facial image based on an imaging size of the first facial preset part in the facial image; and a distance determination module, configured to determine the distance between the target user and the image acquisition device based on an imaging size of the second facial preset part in the facial image.

[0011] According to a sixth aspect of the present disclosure, a control device is provided, comprising: a distance acquisition module, configured to acquire the distance between a target user and an image acquisition device, wherein the distance is detected according to the distance detection method of the first or second aspect above; and a control instruction generation module, configured to generate a corresponding control instruction according to the distance.

[0012] According to a seventh aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the distance detection method of the first or second aspect and its possible implementation method, or implements the control method of the third aspect and its possible implementation method.

[0013] According to an eighth aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the distance detection method of the first or second aspect and its possible implementation method, or execute the control method of the third aspect and its possible implementation method, by executing the executable instructions.

[0014] The technical solution disclosed in this disclosure has the following beneficial effects:

[0015] On the one hand, the distance between the target user and the image acquisition device is determined by combining the imaging sizes of at least two preset face parts in the face image, which can reduce the impact of the imaging instability of a single preset face part, and the face image is less affected by environmental conditions such as lighting, which is conducive to improving the accuracy of distance detection. On the other hand, this solution can be implemented based on image acquisition devices such as cameras, without the need for specially configured distance sensors, with low hardware costs, and is particularly suitable for deployment in mobile scenarios such as mobile phones.

[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.

[0018] Figure 1 A schematic diagram showing a system architecture in this exemplary embodiment;

[0019] Figure 2 A schematic diagram showing the structure of an electronic device in this exemplary embodiment is shown;

[0020] Figure 3 A flow chart of a distance detection method in this exemplary embodiment is shown;

[0021] Figure 4 A schematic diagram showing a face image and imaging sizes of a preset face part in this exemplary embodiment;

[0022] Figure 5 A flowchart of determining the imaging size of a preset part of a face in this exemplary embodiment is shown;

[0023] Figure 6 A schematic diagram showing iris detection by an iris detection model in this exemplary embodiment is shown;

[0024] Figure 7 A schematic diagram showing determination of candidate distances by imaging width of a face in this exemplary embodiment;

[0025] Figure 8 A flow chart showing another distance detection method in this exemplary embodiment;

[0026] Fig. 9 A flow chart showing another distance detection method in this exemplary embodiment is shown;

[0027] Fig.10 A flow chart showing a control method in this exemplary embodiment;

[0028] Fig.11 A schematic structural diagram of a distance detection device in this exemplary embodiment is shown;

[0029] Fig.12 A schematic diagram showing the structure of another distance detection device in this exemplary embodiment is shown;

[0030] Fig.13 A schematic structural diagram of a control device in this exemplary embodiment is shown. DETAILED DESCRIPTION

[0031] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0032] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.

[0033] In the related art, electronic devices are equipped with distance sensors, which realize distance sensing by emitting infrared signals or the like. However, this increases the hardware cost, and the distance sensor is easily affected by the environment, resulting in reduced accuracy.

[0034] In view of the above problems, the exemplary embodiment of the present disclosure first provides a distance detection method. Figure 1 The system architecture and application scenarios of the operating environment of this exemplary embodiment are exemplarily described.

[0035] Figure 1 The schematic diagram of the system architecture is shown, and the system architecture 100 may include an image acquisition device 110 and a processing device 120. The image acquisition device 110 may be a camera, which is used to acquire a facial image of a target user; the processing device 120 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, etc., which is used to execute the distance detection method in this exemplary embodiment, and determine the distance between the target user and the image acquisition device 110 by processing the facial image.

[0036] Figure 1 It is shown that the image acquisition device 110 and the processing device 120 are two independently arranged devices, which can be connected via a wired or wireless communication link to perform data exchange.

[0037] In one embodiment, the image acquisition device 110 and the processing device 120 may also be integrated into one device. Exemplarily, a mobile phone has a built-in camera module, such as a camera module that may include a front camera, which is equivalent to the image acquisition device 110; the mobile phone can acquire the face image of the target user and execute a distance detection method to determine the distance between the target user and the mobile phone; further, when the distance is close, the mobile phone can issue a message to remind the user to pay attention to the distance of the mobile phone and related information to protect the eyes. Alternatively, the access control system includes a surveillance camera and a micro control unit, the surveillance camera is equivalent to the image acquisition device 110, and the micro control unit is equivalent to the processing device 120; the access control system acquires the face image of the target user through the surveillance camera, and executes a distance detection method through the micro control unit to determine the distance between the target user and the access control system; further, when the distance is close, the access control system can trigger the process of identity authentication or door opening.

[0038] The exemplary embodiments of the present disclosure also provide an electronic device for executing the above distance detection method, which may be the above processing device 120. Generally, the electronic device may include a processor and a memory, the memory is used to store executable instructions of the processor, and the processor is configured to execute the above distance detection method by executing the executable instructions.

[0039] Below Figure 2 The mobile terminal 200 in FIG. 1 is taken as an example to exemplify the structure of the electronic device. It should be understood by those skilled in the art that, in addition to the components specifically used for mobile purposes, Figure 2 The construction in can also be applied to fixed type equipment.

[0040] like Figure 2As shown, the mobile terminal 200 may specifically include: a processor 201, a memory 202, a bus 203, a mobile communication module 204, an antenna 1, a wireless communication module 205, an antenna 2, a display screen 206, a sensor module 207, an audio module 208, a power module 209 and a camera module 210.

[0041] Processor 201 may include one or more processing units, for example: processor 210 may include AP (Application Processor), modem processor, GPU (Graphics Processing Unit), ISP (Image Signal Processor), controller, encoder, decoder, DSP (Digital Signal Processor), baseband processor and / or NPU (Neural-Network Processing Unit), etc. In this exemplary embodiment, the distance detection method may be executed by AP, GPU or DSP, etc. When the method involves neural network-related processing, it may be executed by NPU, for example, NPU may load neural network parameters and execute neural network-related algorithm instructions.

[0042] The encoder can encode (i.e. compress) an image or video to reduce the data size for easy storage or transmission. The decoder can decode (i.e. decompress) the encoded data of the image or video to restore the image or video data. The mobile terminal 200 can support one or more encoders and decoders. In this way, the mobile terminal 200 can process images or videos in a variety of encoding formats, such as: JPEG (Joint Photographic Experts Group), PNG (Portable Network Graphics), BMP (Bitmap) and other image formats, MPEG (Moving Picture Experts Group) 1, MPEG2, H.263, H.264, HEVC (High Efficiency Video Coding) and other video formats.

[0043] The processor 201 may be connected to the memory 202 or other components via a bus 203 .

[0044] The memory 202 may be used to store computer executable program codes, which include instructions. The processor 201 executes various functional applications and data processing of the mobile terminal 200 by running the instructions stored in the memory 202. The memory 202 may also store application data, such as images, videos and other files.

[0045] The communication function of the mobile terminal 200 can be realized by the mobile communication module 204, the antenna 1, the wireless communication module 205, the antenna 2, the modulation and demodulation processor, and the baseband processor. The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 204 can provide 2G, 3G, 4G, 5G and other mobile communication solutions applied to the mobile terminal 200. The wireless communication module 205 can provide wireless communication solutions such as wireless LAN, Bluetooth, and near field communication applied to the mobile terminal 200.

[0046] The display screen 206 is used to implement display functions, such as displaying user interfaces, images, videos, etc. The sensor module 207 is used to implement various sensing detection functions, such as pressure sensors, gyroscope sensors, etc., to detect touch pressure and device posture. The audio module 208 is used to implement audio functions, such as playing audio and collecting voice. The power module 209 is used to implement power management functions, such as charging the battery, powering the device, monitoring the battery status, etc.

[0047] The camera module 210 may include components such as a lens 2101, an image sensor 2102, and an optical image stabilization system 2103. The lens 2101 is used for imaging and adjusting the optical path; the image sensor 2102 is used to collect optical signals and convert them into digital signals, which can be further transmitted to the ISP for processing; the optical image stabilization system 2103 is used to stabilize the lens 2101 to prevent imaging jitter and improve image quality. The camera module 210 can be used to collect facial images of target users.

[0048] Combine the following Figure 3 The distance detection method of this exemplary embodiment is described. Figure 3 An exemplary process of the distance detection method is shown, which may include:

[0049] Step S310, obtaining a face image of a target user captured by an image acquisition device;

[0050] Step S320, determining the imaging sizes of at least two preset face parts in the face image;

[0051] Step S330: determining the distance between the target user and the image acquisition device according to the imaging sizes of the at least two preset face parts.

[0052] Based on the above method, on the one hand, the distance between the target user and the image acquisition device is determined by combining the imaging sizes of at least two preset facial parts in the facial image, which can reduce the impact of the imaging instability of a single preset facial part, and the facial image is less affected by environmental conditions such as lighting, which is conducive to improving the accuracy of distance detection. On the other hand, this solution can be implemented based on image acquisition devices such as cameras, without the need to specially configure distance sensors, with low hardware costs, and is particularly suitable for deployment in mobile scenarios such as mobile phones.

[0053] Below Figure 3 Each step in the procedure is described in detail.

[0054] refer to Figure 3 In step S310, a facial image of a target user captured by an image acquisition device is obtained.

[0055] The target user may be a user in front of the lens of the image acquisition device. For example, the image acquisition device may be the front camera of a mobile phone. When a user picks up the mobile phone or uses the mobile phone, the front camera captures the user's face image, and the user is the target user.

[0056] In some specific scenarios, functions related to distance detection require the user to face the device to implement. For example, the automatic wake-up of the screen of the mobile phone, the prompting of the user to pay attention to the distance of the mobile phone, and the triggering of identity authentication of the access control system all need to be executed when the user faces the device. Based on this, the facial image of the target user collected by the image acquisition device can be a frontal facial image. If the image acquisition device collects a non-frontal facial image of a user, the user may not need the above-mentioned related functions, that is, there is no need to detect the distance between the user and the device. For example, the mobile phone captures a top-down facial image of a user, and the user may not be a user who is using a mobile phone. The access control system captures a side face image of a user, and the user may be a passerby passing by the access control system. Therefore, there is no need to process such facial images. In one embodiment, the facial image obtained in step S310 is a frontal facial image. If the image acquisition device collects a non-frontal facial image, the non-frontal facial image is not subsequently processed. The present disclosure does not limit the specific method for detecting whether a facial image is a frontal facial image. Exemplarily, the direction of the eye gaze in the facial image can be detected. If the eye gaze direction is looking straight ahead (i.e., looking toward the image acquisition device), the facial image is judged to be a frontal facial image. The facial key points in the facial image can also be detected to determine whether the facial key points on the left and the facial key points on the right are symmetrically distributed. If they are symmetrically distributed or approximately symmetrically distributed, the facial image is judged to be a frontal facial image.

[0057] In one implementation, the face image may be preprocessed. For example, if the face image includes image content other than the face, such as capturing a portion of the target user's body, the face image may be cropped to retain only the face portion; in order to facilitate subsequent processing, the face image may be converted to a uniform size, such as 480*480, or the face image may be numerically normalized.

[0058] Continue to refer Figure 3 In step S320, imaging sizes of at least two preset face parts are determined in the face image.

[0059] The preset parts of the face refer to parts with relatively fixed sizes that do not vary significantly from person to person. In other words, the size differences of the preset parts of the face of different people are generally small. In this exemplary embodiment, the preset parts of the face include, but are not limited to: face, iris, pupil, etc. Among them, the size of the face includes the width of the face and the height of the face. The width of the face varies less from person to person; the size of the iris generally refers to the diameter of the iris. The shape of the iris is circular or an elliptical shape close to a circle. The iris can be approximated as a circle. The diameter of the circle is the iris diameter. The iris diameter of an adult is usually around 11.8 mm, with very little deviation; the size of the pupil generally refers to the pupil distance (i.e., the distance between the left and right pupils, also known as the pupil distance). The pupil distance of an adult is usually 58 to 61 mm, and the degree of variation from person to person is also relatively low.

[0060] The sizes mentioned above are actual sizes, and the sizes of the preset face parts in the face image are imaging sizes. Due to the perspective relationship, the closer the distance between the target user and the image acquisition device, the larger the imaging size of the preset face parts, and the farther the distance between the target user and the image acquisition device, the smaller the imaging size of the preset face parts. Therefore, the distance between the target user and the image acquisition device can be determined based on the imaging size of the preset face parts.

[0061] refer to Figure 4 As shown in the figure, in the face image, the imaging sizes of three preset face parts can be determined, namely, the imaging width d of the face face , the imaging diameter of the iris d iris , the pupil imaging distance d pupil The imaging size may be the pixel size of the preset face part in the face image, or the projection size of the preset face part on the image plane of the face image. Although the pixel size and the projection size have different dimensions, they represent the same meaning.

[0062] In one embodiment, reference Figure 5 As shown, the above-mentioned determining the imaging sizes of at least two preset face parts in the face image may include the following steps S510 and S520:

[0063] Step S510, determining a preset face part in the face image by detecting key face points in the face image;

[0064] Step S520, determining the imaging size of the preset face part according to the pixel points covered by the preset face part in the face image.

[0065] Among them, the key points of the face can be the key points of preset parts of the face, such as the key points of the facial contour, the key points of the iris, the key points of the pupil, etc.

[0066] In one implementation, a model (such as a neural network) for detecting the above-mentioned facial key points may be pre-trained, a facial image may be input into the model, and the facial key points may be output through the model.

[0067] A general facial key point detection model or algorithm may not be able to detect the iris key points and pupil key points. For example, before inputting a facial image into a facial key point detection model, the facial image needs to be downsampled to the input size set by the facial key point detection model, so that the image loses detail information to a certain extent, making it difficult to detect small parts such as the iris and pupil. In one embodiment, the above-mentioned method of determining the preset face parts in the facial image by detecting the facial key points in the facial image may include the following steps:

[0068] Detecting facial key points in a face image, the facial key points including facial contour key points and eye key points;

[0069] Determine the face in the face image according to the facial contour key points;

[0070] An eye image is captured from a face image based on eye key points, and iris key points and / or pupil key points are detected in the eye image to determine the iris and / or pupil in the face image.

[0071] Exemplarily, the facial contour key points and eye key points in the facial image can be detected by a general facial key point detection model. Exemplarily, the facial image can be converted into a size of 320*320 and input into the facial key point detection model. The model outputs information of 49 facial key points, from which the facial contour key points and eye key points are determined. The face in the facial image is determined according to the facial contour key points, such as the position information of the face can be output. The position of the eye area in the facial image is determined according to the eye key points, and then the eye image is cut out from the facial image. It should be understood that the eye image can be cut out from the original high-resolution facial image so that the eye image also has a high resolution; or when the eye image has a low resolution, it can be upsampled. Furthermore, the iris key points and / or pupil key points in the eye image can be detected by the iris or pupil detection model, so as to obtain the required information of the preset part of the face.

[0072] The preset face part in the face image can be determined based on the face key points. For example, the outer boundary of the preset face part can be determined based on the face key points, and the outer boundary can be used to characterize the position of the preset face part, or a mask of the preset face part can be extracted based on the outer boundary, which can also characterize the position of the preset face part.

[0073] Figure 6 It shows that an eye area image is input into an iris detection model, which is a pre-trained image segmentation network that can output iris information as a mask of the iris area.

[0074] According to the pixel points covered by the preset part of the face in the face image, the size of the preset part of the face can be expressed in the number of pixels to obtain the pixel size of the preset part of the face, or the pixel size can be converted into a projection size. Both sizes are imaging sizes of the preset part of the face, and the present disclosure does not limit which one to use.

[0075] The following is an exemplary description of a method for calculating the imaging size of each preset part of a face.

[0076] In one implementation, when the preset face part includes the face, the determining of the imaging size of the preset face part according to the pixel points covered by the preset face part in the face image may include the following steps:

[0077] Among the pixel points covered by the face in the face image, the minimum coordinate value and the maximum coordinate value along the preset coordinate axis direction are obtained, and the imaging width of the face is determined according to the minimum coordinate value and the maximum coordinate value.

[0078] The preset coordinate axis direction is the width direction of the face, which is generally the horizontal direction in the face image (related to the direction of the face image itself, which is not limited in this disclosure), that is, the x-axis direction. The minimum x-coordinate value and the maximum x-coordinate value of the face pixel points are obtained, and the difference between the two is the imaging width of the face.

[0079] In one implementation, the facial symmetry axis can be determined based on the pixels covered by the face in the face image. For example, a normal can be generated at the pixel points of the facial contour to detect whether the facial pixels are symmetrical with the normal line. If so, the normal line is the facial symmetry axis. Then, the vertical direction of the facial symmetry axis is used as the preset coordinate axis direction, and the minimum coordinate value and the maximum coordinate value are determined in the facial pixels. The difference between the two is the imaging width of the face.

[0080] In one implementation, when the preset face part includes the iris, the determining the imaging size of the preset face part according to the pixel points covered by the preset face part in the face image may include the following steps:

[0081] Determine the imaging area of ​​the iris according to the number of pixels contained in the iris in the face image;

[0082] The imaging diameter of the iris is determined according to the imaging area of ​​the iris.

[0083] Refer to the above Figure 6 As shown in FIG. 1 , the number of pixels contained in the iris in the face image can be counted based on the mask of the iris area, and the number of pixels is the imaging area S of the iris. iris , and then calculate the iris imaging diameter d by the following formula (1): iris :

[0084]

[0085] Imaging diameter d iris It is also equivalent to twice the average value of the major axis and minor axis of the iris oval.

[0086] In one implementation, when the preset face part includes the pupil, determining the imaging size of the preset face part according to the pixel points covered by the preset face part in the face image may include the following steps:

[0087] The center point of the left pupil and the center point of the right pupil are determined according to the pixel points covered by the left pupil and the right pupil in the face image. Specifically, the median of the horizontal coordinate and the median of the vertical coordinate can be found in the pixel points of the left pupil (the median can also be replaced by the average value), and the point where the median of the horizontal and vertical coordinates is located is the center point of the left pupil. Similarly, the center point of the right pupil can be obtained.

[0088] Determine the distance between the center point of the left pupil and the center point of the right pupil, that is, the pupil imaging distance.

[0089] In one implementation, the above-mentioned determining the imaging sizes of at least two preset face parts in the face image may include the following steps:

[0090] Inputting the face image into a pre-trained face size detection model to output the imaging width of the face in the face image;

[0091] The face image and the imaging width of the face are input into a pre-trained iris size detection model or pupil size detection model to output the imaging diameter of the iris or the imaging distance of the pupil in the face image.

[0092] Generally, since the face occupies a large area in a face image, it is less affected by the low resolution of the image, and it is easy to achieve relatively accurate size detection. In contrast, the iris or pupil itself is small in size, occupies a small area in the face image, is less affected by the low resolution of the image, and is not easy to achieve accurate size detection. Therefore, when detecting the iris size or pupil size, the imaging width of the face can be used as a dimensional information and input into the iris size detection model or the pupil size detection model together with the face image to provide a reference, which is conducive to improving the accuracy of the iris size or pupil size.

[0093] In one implementation, the above-mentioned determining the imaging sizes of at least two preset face parts in the face image may include the following steps:

[0094] Determining the imaging width of the face in the face image;

[0095] Determine a first size range for the iris according to the imaging width of the face and the first ratio range;

[0096] An imaging diameter of the iris is determined in the face image, and if the imaging diameter is within a first size range, the imaging diameter is determined to be valid.

[0097] The first ratio range is the ratio range of the face width to the iris diameter. Since the face width and the iris diameter are relatively fixed in size, the ratio of the two is also relatively fixed. The first ratio range is a range determined based on experience, and the ratio of the face width to the iris diameter is usually within this range. Therefore, the imaging width of the face is first determined, and then the first size range of the corresponding iris is calculated through the first ratio range, that is, assuming that the ratio of the face width to the iris diameter is within the first ratio range, the iris diameter should be within the first size range. Furthermore, after determining the imaging diameter of the iris, the first size range is used to determine whether the imaging diameter is accurate. If the imaging diameter is within the first size range, the result of determining the imaging diameter is accurate and valid; conversely, if the imaging diameter is not within the first size range, the result of determining the imaging diameter is inaccurate and may not be retained.

[0098] In one implementation, the above-mentioned determining the imaging sizes of at least two preset face parts in the face image may include the following steps:

[0099] Determining the imaging width of the face in the face image;

[0100] Determine a second size range for the pupil according to the imaging width of the face and the second ratio range;

[0101] The imaging distance of the pupils is determined in the face image, and if the imaging distance is within a second size range, it is determined that the imaging distance is valid.

[0102] Among them, the second ratio range is the ratio range of the face width and the pupil distance. Since the size of the face width and the pupil distance are relatively fixed, the ratio of the two is also relatively fixed. The second ratio range is a range determined based on experience, and the ratio of the face width to the pupil distance is usually within this range. Therefore, the imaging width of the face is first determined, and then the corresponding second size range of the pupil is calculated through the second ratio range, that is, assuming that the ratio of the face width to the pupil distance is within the second ratio range, the pupil distance should be within the second size range. Furthermore, after determining the imaging distance of the pupil, the second size range is used to determine whether the imaging distance is accurate. If the imaging distance is within the second size range, it is determined to be accurate and effective, otherwise it can be not retained.

[0103] Continue to refer Figure 3 In step S330, the distance between the target user and the image acquisition device is determined according to the imaging sizes of the at least two preset face parts.

[0104] The imaging size of each preset face part can be used to determine the distance between the target user and the image acquisition device. However, the imaging of a single preset face part may be unstable, resulting in the inability to accurately obtain its imaging size. For example, a facial image may have closed eyes, occlusion, or dark environment, resulting in the inability to determine one or more preset facial parts (such as the pupil and iris cannot be determined when the eyes are closed, the face cannot be determined when the face is blocked, and the dark environment affects the recognition of the preset facial parts), and its imaging size cannot be obtained; there is a relative angle between the target user's face and the lens of the image acquisition device, so that the acquired facial image is not a completely frontal facial image, resulting in errors in the imaging size of the preset facial parts; when the resolution of the facial image is low or partially unclear, there are errors in the detection of facial key points and the determination of the preset facial parts, which in turn leads to errors in the imaging size of the preset facial parts, especially when the imaging size is expressed in pixel size, the area occupied by smaller preset facial parts such as the iris is often less than 20 pixels, so an error of one pixel will lead to a larger error in the imaging size of such preset facial parts; errors in the imaging size of the preset facial parts caused by defects such as distortion, noise, and distortion in the imaging process, etc. This exemplary embodiment combines the imaging sizes of multiple preset facial parts to determine the distance between the target user and the image acquisition device, which can reduce the impact of the error in the imaging size of a single preset facial part, and is conducive to improving the accuracy of distance detection.

[0105] In one implementation, determining the distance between the target user and the image acquisition device according to the imaging sizes of the at least two preset face parts may include the following steps:

[0106] The candidate distance between the target user and the image acquisition device is determined according to the ratio of the actual size of each preset part of the face to the imaging size and the imaging parameters of the image acquisition device.

[0107] Based on the candidate distances corresponding to the imaging size of each preset face part, the distance between the target user and the image acquisition device is determined.

[0108] refer to Figure 7 As shown, taking the face as an example, D face Indicates the actual width of the face, d face Indicates the imaging width of the face, Z face represents the distance between the target user and the image acquisition device. Since it is determined based on the imaging width of the face, it is called the candidate distance corresponding to the imaging width of the face. z represents the imaging parameter of the image acquisition device. When d face When d is the projection size, the imaging parameter is related to the focal length and field of view of the image acquisition device. face When is the pixel size, the imaging parameter is related to the focal length, field of view, resolution of the face image and size of the image sensor of the image acquisition device. According to the relationship between similar triangles, the following formula (2) is obtained:

[0109]

[0110] From this, the candidate distance Z corresponding to the imaging width of the face can be calculated face Similarly, the candidate distance Z corresponding to the imaging diameter of the iris can be obtained: iris , and the candidate distance Z corresponding to the pupil imaging distance pupil .

[0111] Furthermore, by combining the above two or more candidate distances, the distance between the target user and the image acquisition device can be determined as a result of the distance detection. For example, an average or weighted average value can be calculated for multiple candidate distances to obtain a final distance.

[0112] In one implementation, the determination of the distance between the target user and the image acquisition device based on the candidate distances corresponding to the imaging size of each preset facial part may include the following steps:

[0113] Determining a weight of each preset face part according to an imaging size of at least one preset face part or at least one candidate distance;

[0114] Based on the weight of each preset face part, the candidate distances corresponding to the imaging size of each preset face part are weighted to obtain the distance between the target user and the image acquisition device.

[0115] Generally, the larger the actual size of a preset part of a face, the smaller the error of the image size of the preset part of the face in a low-resolution face image, and the higher the degree to which the actual size of the preset part of the face varies from person to person, that is, the more unstable the actual size of the preset part of the face. For example, according to the actual size, face width> pupil distance> iris diameter, in the case of a low resolution face image, the errors of the image sizes of these three preset parts of the face increase in sequence, and from the perspective of the low resolution factor, decreasing weights can be set for the face, pupil, and iris; however, according to the degree of instability of the actual size, face width> pupil distance> iris diameter, that is, the errors of the actual sizes of these three preset parts of the face decrease in sequence, and from the perspective of the instability of the actual size, increasing weights can be set for the face, pupil, and iris. Therefore, the weight of each preset face part can be determined by balancing these two factors. For example, when any preset face part is selected, the larger the imaging size or the smaller the candidate distance corresponding to the imaging size, the closer the distance between the target user and the image acquisition device is, and it is easy to obtain clearer pupil or iris information in the face image, that is, the influence of low-resolution factors is small, so a higher weight can be set for the pupil or iris; conversely, the smaller the imaging size of the above-mentioned preset face part or the larger the candidate distance corresponding to the imaging size, the farther the distance between the target user and the image acquisition device is, and it is not easy to obtain clearer pupil or iris information in the face image, that is, the influence of low-resolution factors is large, so a higher weight can be set for the face.

[0116] For example, when the face and iris are selected as two preset face parts for distance detection, the weight of each preset face part can be determined by the following formula (3):

[0117]

[0118] Among them, w iris represents the weight of the iris, w face represents the weight of the face; e1 is a linear coefficient, which can be an empirical value. Then, the distance Z between the target user and the image acquisition device can be determined by the following formula (4):

[0119] Z=w iris ·Z iris +w face ·Z face (4)

[0120] When three preset face parts, namely, face, pupil and iris, are selected for distance detection, the weight of each preset face part can be determined by the following formula (5):

[0121]

[0122] Among them, w pupil represents the weight of the pupil; e2 and e3 are both linear coefficients and can be empirical values. Furthermore, the distance Z between the target user and the image acquisition device can be determined by the following formula (6):

[0123] Z=w iris ·Z iris +w pupil ·Z pupil +w face ·Z face (6)

[0124] Therefore, the candidate distances corresponding to the imaging sizes of two or more preset face parts are weighted according to actual factors, and the information of different preset face parts is combined, which is conducive to outputting accurate distance detection results.

[0125] The exemplary embodiments of the present disclosure also provide another distance detection method. Figure 8 An exemplary process of the distance detection method is shown, which may include the following steps S810 to S840:

[0126] Step S810, obtaining a face image of a target user captured by an image capture device.

[0127] For the specific implementation of this step, please refer to the relevant content of step S310.

[0128] Step S820: determining at least one first preset face part among the preset face parts in the face image.

[0129] The preset face part includes but is not limited to: face, pupil, iris, etc. The first preset face part is used to make a preliminary estimate of the distance between the target user and the image acquisition device. Any preset face part can be selected as the first preset face part.

[0130] In one implementation, the preset face part with the largest imaging size in the face image may be determined as the first preset face part. For example, the size of the face is generally larger than the pupil and the iris, so the face may be determined as the first preset face part.

[0131] In one implementation, a preset face part in a face image whose imaging size is greater than a predetermined size threshold may be determined as the first preset face part to ensure that the imaging size of the first preset face part is not too small, thereby reducing errors.

[0132] It should be noted that the present disclosure does not limit the number of preset parts of the first face.

[0133] Step S830: determining at least one second preset face part in the preset face parts in the face image according to the imaging size of the first preset face part in the face image.

[0134] The second preset face part is used to accurately calculate the distance between the target user and the image acquisition device, and can be determined after considering the low-resolution factor and the actual size instability factor. Generally, when the low-resolution factor has a small impact, the preset face part with a smaller actual size and more stability tends to be used as the second preset face part. In this exemplary embodiment, based on the imaging size of the first preset face part in the face image, the distance between the target user and the image acquisition device can be preliminarily estimated, and then the impact of the low-resolution factor can be determined.

[0135] In one implementation, a first threshold may be preset for the imaging width of the face, and step S830 may include:

[0136] When the imaging width of the face in the face image is greater than a first threshold, determining the iris in the face image as the second face preset part;

[0137] When the imaging width of the face in the face image is smaller than the first threshold, the face is determined as the second preset face part.

[0138] Among them, the first threshold can be determined based on experience and the parameters of the image acquisition device. For example, for a certain model of mobile phone, the first threshold can be 110 pixels. When the imaging width of the face in the face image is greater than 110 pixels, it is estimated that the distance between the target user and the image acquisition device is less than 30 cm. At this time, the iris area in the face image is relatively clear, that is, the influence of the low-resolution factor is small, and the iris can be determined as the second face preset part. When the imaging width of the face in the face image is less than 110 pixels, it is estimated that the distance between the target user and the image acquisition device is greater than 30 cm. At this time, the iris area in the face image is not clear, that is, the influence of the low-resolution factor is large, and the face can be determined as the second face preset part.

[0139] In one implementation, a second threshold and a third threshold may be preset for the imaging width of the face, the second threshold is greater than the third threshold, and step S830 may include:

[0140] When the imaging width of the face in the face image is greater than a second threshold, determining the iris as the second preset face part;

[0141] When the imaging width of the face in the face image is less than the second threshold value and greater than the third threshold value, determining the pupil as the preset part of the second face;

[0142] When the imaging width of the face in the face image is smaller than the third threshold, the face is determined as the second preset face part.

[0143] The second threshold and the third threshold can be determined based on experience and parameters of the image acquisition device. It can be seen that as the influence of the low-resolution factor decreases, a smaller preset face part tends to be used as the second preset face part.

[0144] It should be noted that the present disclosure does not limit the number of preset parts of the second face.

[0145] Step S840, determining the distance between the target user and the image acquisition device according to the imaging size of the preset part of the second face in the face image.

[0146] Please refer to the above Figure 6 and its related contents, and calculates the distance between the target user and the image acquisition device according to the relationship of similar triangles.

[0147] When multiple preset second face parts are selected, the distance may be determined by referring to the relevant contents of step S330 and combining the imaging sizes of the multiple preset second face parts.

[0148] based on Figure 8 The method shown, on the one hand, preliminarily estimates the distance between the target user and the image acquisition device through the first preset face part, so as to determine the appropriate second preset face part according to actual factors, and then finally determine the distance between the target user and the image acquisition device according to the imaging size of the second preset face part, which can reduce the impact of imaging instability of a single preset face part, and the face image is less affected by environmental conditions such as lighting, which is conducive to improving the accuracy of distance detection. On the other hand, this solution can be implemented based on image acquisition devices such as cameras, without the need to specially configure distance sensors, with low hardware costs, and is particularly suitable for deployment in mobile scenarios such as mobile phones.

[0149] In one embodiment, Figure 8 The distance detection method shown can be Fig. 9 The process implementation shown includes:

[0150] Step S910, inputting a face image, which is a face image of a target user captured by an image capture device;

[0151] Step S920, detecting key points of a human face, with the face being the first preset part of the human face;

[0152] Step S930, determining the imaging width of the face;

[0153] Step S940, determining whether the facial imaging width is greater than a first threshold, if so, executing step S950, if not, executing step S960;

[0154] Step S950, performing iris detection with the iris as the preset part of the second face, and then proceeding to step S970;

[0155] Step S960, taking the face as the second face preset part, and continuing to execute step S970;

[0156] Step S970, determining the imaging size of the preset part of the second face;

[0157] Step S980: Determine the distance between the target user and the image acquisition device according to the imaging size of the preset part of the second face. The process ends.

[0158] The exemplary embodiment of the present disclosure also provides a control method. Fig.10 As shown, the control method may include the following steps S1010 and S1020:

[0159] Step S1010, obtaining the distance between the target user and the image acquisition device, where the distance is detected according to the distance detection method in this exemplary embodiment;

[0160] Step S1020: Generate a corresponding control instruction according to the above distance.

[0161] Among them, the control instruction can be an instruction of any aspect, such as a control instruction for the display screen of an electronic device, a control instruction for a currently running application. In general, the control instruction corresponding to a specific distance or distance range can be pre-configured, and then when it is detected that the distance meets the configured distance or distance range during operation, the corresponding control instruction is triggered to be generated and executed. For example, when the distance between the target user and the image acquisition device is less than 20cm, a control instruction for presenting prompt information can be generated. The prompt information is used to remind the user to pay attention to the distance of the mobile phone and protect the eyes. It can be a text or voice message; when the distance between the target user and the image acquisition device is greater than 40cm, a screen-off control instruction can be generated to control the electronic device to enter the screen-off state.

[0162] In one embodiment, control instructions corresponding to specific distances or distance ranges in specific scenarios can also be pre-configured. The specific scenario can be running a specific application, the electronic device is in a specific operating state, etc. Therefore, in step S1020, corresponding control instructions can be generated according to the above distances and the current operating scenario of the electronic device. For example, in the scenario of playing a video, when the distance between the target user and the image acquisition device is less than 20cm, a control instruction for presenting the above prompt information can be generated; in the scenario of displaying the desktop or when the user has not operated for more than a preset time, when the distance between the target user and the image acquisition device is greater than 40cm, a control instruction for turning off the screen can be generated.

[0163] based on Fig.10 The method shown can execute corresponding control instructions according to the distance between the user and the device, realize automatic and intelligent control, reduce user operations, and improve user experience.

[0164] The exemplary embodiment of the present disclosure also provides a distance detection device. Fig.11 As shown, the distance detection device 1100 may include:

[0165] The image acquisition module 1110 is configured to acquire a face image of a target user acquired by an image acquisition device;

[0166] An imaging size determination module 1120 is configured to determine imaging sizes of at least two preset face parts in a face image;

[0167] The distance determination module 1130 is configured to determine the distance between the target user and the image acquisition device according to the imaging sizes of the at least two preset face parts mentioned above.

[0168] In one embodiment, the determining of the imaging sizes of at least two preset face parts in the face image includes:

[0169] By detecting key points of the face in the face image, a preset part of the face in the face image is determined;

[0170] The imaging size of the preset face part is determined according to the pixel points covered by the preset face part in the face image.

[0171] In one embodiment, the above-mentioned detecting key points of a face in a face image and determining a preset part of a face in the face image includes:

[0172] Detect facial key points in face images, including facial contour key points and eye key points;

[0173] Determine the face in the face image according to the facial contour key points;

[0174] An eye image is captured from a face image based on eye key points, and iris key points and / or pupil key points are detected in the eye image to determine the iris and / or pupil in the face image.

[0175] In one implementation, when the preset face part includes the face, determining the imaging size of the preset face part according to the pixel points covered by the preset face part in the face image includes:

[0176] Among the pixel points covered by the face in the face image, the minimum coordinate value and the maximum coordinate value along the preset coordinate axis direction are obtained, and the imaging width of the face is determined according to the minimum coordinate value and the maximum coordinate value.

[0177] In one implementation, when the preset face part includes the iris, the above-mentioned determining the imaging size of the preset face part according to the pixel points covered by the preset face part in the face image includes:

[0178] Determine the imaging area of ​​the iris according to the number of pixels covered by the iris in the face image;

[0179] The imaging diameter of the iris is determined according to the imaging area of ​​the iris.

[0180] In one embodiment, the determining the distance between the target user and the image acquisition device according to the imaging sizes of the at least two preset face parts includes:

[0181] Determine a candidate distance between the target user and the image acquisition device according to the ratio of the actual size to the image size of each preset part of the face and the imaging parameters of the image acquisition device;

[0182] The distance between the target user and the image acquisition device is determined based on the candidate distances corresponding to the imaging size of each preset face part.

[0183] In one implementation, the determination of the distance between the target user and the image acquisition device based on the candidate distances corresponding to the imaging size of each preset facial part includes:

[0184] Determining a weight of each preset face part according to an imaging size of at least one preset face part or at least one candidate distance;

[0185] Based on the weight of each preset face part, the candidate distances corresponding to the imaging size of each preset face part are weighted to obtain the distance between the target user and the image acquisition device.

[0186] The exemplary embodiment of the present disclosure also provides another distance detection device. Fig.12 As shown, the distance detection device 1200 may include:

[0187] The image acquisition module 1210 is configured to acquire a face image of a target user acquired by an image acquisition device;

[0188] A first preset face part determination module 1220 is configured to determine at least one first preset face part from the preset face parts in the face image;

[0189] The second preset face part determination module 1230 is configured to determine at least one second preset face part from the preset face parts in the face image according to the imaging size of the first preset face part in the face image;

[0190] The distance determination module 1240 is configured to determine the distance between the target user and the image acquisition device according to the imaging size of the preset part of the second face in the face image.

[0191] In one embodiment, the first preset face part includes a face. The above-mentioned determining at least one second preset face part in the preset face part in the face image according to the imaging size of the first preset face part in the face image includes:

[0192] When the imaging width of the face in the face image is greater than a first threshold, determining the iris in the face image as the second face preset part;

[0193] When the imaging width of the face in the face image is smaller than the first threshold, the face is determined as the second preset face part.

[0194] The exemplary embodiment of the present disclosure also provides a control device. Fig.13 As shown, the control device 1300 may include:

[0195] A distance acquisition module 1310 is used to acquire the distance between the target user and the image acquisition device, where the distance is detected according to the distance detection method in this exemplary embodiment;

[0196] The control instruction generating module 1320 is configured to generate a corresponding control instruction according to the above distance.

[0197] The specific details of each part of the above-mentioned device have been described in detail in the implementation method of the method part. The undisclosed details can be found in the implementation method of the method part, so they will not be repeated here.

[0198] The exemplary embodiments of the present disclosure also provide a computer-readable storage medium, which can be implemented in the form of a program product, which includes program code. When the program product is run on an electronic device, the program code is used to enable the electronic device to execute (more specifically, to enable the processor of the electronic device to execute) the steps of the various exemplary embodiments described in the above "Exemplary Method" section of this specification.

[0199] In one embodiment, the program product can be implemented as a portable compact disk read-only memory (CD-ROM) and includes program code, and can be run on an electronic device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0200] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium includes, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) 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 CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0201] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0202] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0203] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).

[0204] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.

[0205] It will be appreciated by those skilled in the art that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or implementations combining hardware and software aspects, which may be collectively referred to herein as "circuit", "module" or "system". Those skilled in the art will readily think of other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses or adaptive changes of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and implementation are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.

[0206] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A distance detection method, characterized in that: include: Acquire a face image of a target user captured by an image acquisition device; Determining the imaging sizes of at least two preset parts of the face in the face image; The method of determining the imaging sizes of at least two preset face parts in the face image comprises: detecting key face points in the face image to determine the preset face parts in the face image; determining the imaging size of the preset face parts according to the pixel points covered by the preset face parts in the face image; when the preset face parts include the iris, the method of determining the imaging size of the preset face parts according to the pixel points covered by the preset face parts in the face image comprises: determining the imaging area of ​​the iris according to the number of pixel points covered by the iris in the face image; and determining the imaging diameter of the iris according to the imaging area of ​​the iris; The distance between the target user and the image acquisition device is determined according to the imaging sizes of the at least two preset facial parts.

2. The method according to claim 1, characterized in that The detecting of the key points of the face in the face image and determining the preset parts of the face in the face image includes: Detecting facial key points in the facial image, wherein the facial key points include facial contour key points and eye key points; Determine the face in the face image according to the facial contour key points; An eye image is captured from the face image based on the eye key points, and iris key points and / or pupil key points are detected in the eye image to determine the iris and / or pupil in the face image.

3. The method according to claim 1, characterized in that When the preset face part includes the face, determining the imaging size of the preset face part according to the pixel points covered by the preset face part in the face image includes: Among the pixel points covered by the face in the face image, the minimum coordinate value and the maximum coordinate value along the preset coordinate axis direction are obtained, and the imaging width of the face is determined according to the minimum coordinate value and the maximum coordinate value.

4. The method according to claim 1, characterized in that The determining the distance between the target user and the image acquisition device according to the imaging sizes of the at least two preset face parts includes: Determine a candidate distance between the target user and the image acquisition device according to the ratio of the actual size to the image size of each preset face part and the imaging parameters of the image acquisition device; The distance between the target user and the image acquisition device is determined based on the candidate distances corresponding to the imaging size of each preset part of the face.

5. The method according to claim 4, characterized in that The determining the distance between the target user and the image acquisition device based on the candidate distance corresponding to the imaging size of each preset part of the face includes: Determining a weight of each of the preset face parts according to at least one imaging size of the preset face part or at least one candidate distance; Based on the weight of each preset face part, the candidate distances corresponding to the imaging size of each preset face part are weighted to obtain the distance between the target user and the image acquisition device.

6. A distance detection method, characterized in that: include: Acquire a face image of a target user captured by an image acquisition device; Determining at least one first preset face part among the preset face parts in the face image; Determining at least one second preset face part in the preset face parts in the face image according to the imaging size of the first preset face part in the face image; The distance between the target user and the image acquisition device is determined according to the imaging size of the preset part of the second face in the face image.

7. The method according to claim 6, characterized in that The first preset face part includes a face; and determining at least one second preset face part in the preset face parts in the face image according to the imaging size of the first preset face part in the face image comprises: When the imaging width of the face in the face image is greater than a first threshold, determining the iris in the face image as a second preset face part; When the imaging width of the face in the face image is smaller than the first threshold, the face is determined as a second preset face part.

8. A control method, characterized in that: include: Acquire the distance between the target user and the image acquisition device, wherein the distance is detected by the distance detection method according to any one of claims 1 to 7; A corresponding control instruction is generated according to the distance.

9. A distance detection device, characterized in that: include: An image acquisition module is configured to acquire a face image of a target user acquired by an image acquisition device; An imaging size determination module is configured to determine the imaging sizes of at least two preset face parts in the face image; the determining the imaging sizes of at least two preset face parts in the face image is configured to: detect key face points in the face image to determine the preset face parts in the face image; determine the imaging size of the preset face parts according to the pixel points covered by the preset face parts in the face image; when the preset face parts include irises, the determining the imaging size of the preset face parts according to the pixel points covered by the preset face parts in the face image is configured to: determine the imaging area of ​​the iris according to the number of pixel points covered by the iris in the face image; determine the imaging diameter of the iris according to the imaging area of ​​the iris; The distance determination module is configured to determine the distance between the target user and the image acquisition device according to the imaging sizes of the at least two preset face parts.

10. A distance detection device, characterized in that: include: An image acquisition module is configured to acquire a face image of a target user acquired by an image acquisition device; A first preset face part determination module is configured to determine at least one first preset face part among the preset face parts in the face image; A second preset face part determination module is configured to determine at least one second preset face part from the preset face parts in the face image according to the imaging size of the first preset face part in the face image; The distance determination module is configured to determine the distance between the target user and the image acquisition device according to the imaging size of the second preset face part in the face image.

11. A control device, characterized in that: include: a distance acquisition module, configured to acquire the distance between the target user and the image acquisition device, wherein the distance is detected by the distance detection method according to any one of claims 1 to 7; The control instruction generating module is configured to generate a corresponding control instruction according to the distance.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

13. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 8 by executing the executable instructions.

Citation Information

Patent Citations

  • Image processing method and device, computer equipment and storage medium

    CN111104909A