A camera ranging method based on face shape profile

By constructing and correcting a standardized coordinate image of the target person's facial features, the problem of being unable to quickly measure distances when the face is tilted is solved, enabling fast and accurate distance calculation and expanding the measurement range.

CN116128952BActive Publication Date: 2026-06-26PHOTONICS INTEGRATION (WENZHOU) INNOVATION RES INST

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PHOTONICS INTEGRATION (WENZHOU) INNOVATION RES INST
Filing Date
2023-01-18
Publication Date
2026-06-26

Smart Images

  • Figure CN116128952B_ABST
    Figure CN116128952B_ABST
Patent Text Reader

Abstract

The application discloses a camera ranging method based on face shape contour, comprising the following steps: constructing a standard coordinate image of a front face feature of a target person; intercepting a face picture of the target person in a measurement range, and establishing a face coordinate image on the face picture; correcting the face coordinate image through the standard coordinate image, and obtaining an interocular distance in the corrected face coordinate image; and calculating an actual distance between the target person and a camera according to the interocular distance. The application pre-establishes a database, standardizes a target person image, and restores face features by using a simple algorithm when a target person face in a measurement range has a certain inclination angle, so that the actual distance is quickly and accurately obtained, and valuable time is saved for a specific occasion. The application uses a coordinate image of a face feature, so that the ranging method is not simply realized by direct measurement of the interocular distance, the interocular distance can be indirectly obtained through a proportional relationship between face features, and the measurement range is expanded.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention discloses a camera ranging method based on facial contours, belonging to the field of image processing technology. Background Technology

[0002] When a camera captures a facial image, analysis of the image can determine facial information, including facial recognition and distance measurement. Current technologies for facial distance measurement use monocular or binocular ranging methods to detect the distance between the midpoint of the user's pupils and the camera. However, in practice, it cannot be guaranteed that the image captured by the camera is a frontal view of the face. If the face is tilted, the distance between the midpoints of the pupils will be significantly distorted within the camera's view, leading to measurement failure.

[0003] Existing facial recognition correction technologies primarily rely on training faces in various poses. This requires extensive pose variations and extensive training to develop complex algorithms, which take considerable time to obtain measurement results. However, in specific scenarios such as target monitoring, once a target is identified, a rapid response is needed to quickly measure the target and the distance between the target and the camera. Summary of the Invention

[0004] The purpose of this application is to provide a camera ranging method based on facial contours, to solve the technical problem in existing technologies where extensive algorithmic calculations are required to obtain facial features when the face is tilted, making it impossible to quickly measure distances. To achieve the above objective, this invention proposes a camera ranging method based on facial contours, the specific solution of which is as follows:

[0005] A camera ranging method based on facial contours, comprising:

[0006] Construct a standardized coordinate image of the frontal facial features of the target person;

[0007] Capture a facial image of the target person within the measurement range, and establish a facial coordinate image on the facial image;

[0008] The facial coordinate image is corrected using the standardized coordinate image, and the interocular distance is obtained from the corrected facial coordinate image.

[0009] The actual distance between the target person and the camera is calculated based on the interpupillary distance.

[0010] Preferably, constructing a standardized coordinate image of the frontal facial features of the target person specifically includes:

[0011] Establish a basic facial feature database and construct a basic coordinate image of the frontal facial features of a person;

[0012] Obtain the frontal facial features of the target person, and construct an initial coordinate image based on the frontal facial features of the target person;

[0013] The initial coordinate image is corrected based on the base coordinate image to obtain the corrected frontal facial features of the target person;

[0014] The standardized coordinate image is established based on the corrected frontal facial features of the target person;

[0015] The standardized coordinate image and standardized facial feature data are stored in a standardized image database.

[0016] Preferably, correcting the initial coordinate image based on the base coordinate image specifically includes:

[0017] Calculate the facial features of the person in the initial coordinate image;

[0018] The measurement error value between the initial coordinate image and the base coordinate image is obtained based on the ratio of the facial features of the person to the facial feature data in the base coordinate image.

[0019] The initial coordinate image is corrected based on the measurement error value.

[0020] Preferably, the facial features include: the distance between the eyes and the distance between the ears.

[0021] Preferably, the facial coordinate image is corrected using the standardized coordinate image, and the interocular distance is obtained from the corrected facial coordinate image, specifically including:

[0022] The facial coordinate image is subjected to image skewing processing to obtain a frontal image of the facial coordinate image;

[0023] The frontal image is proportionally restored using the standardized image to obtain a facial image with normal proportions;

[0024] The interocular distance is obtained from the facial image of the normal proportions.

[0025] Preferably, the facial coordinate image is subjected to image skewing processing to obtain a frontal image of the facial coordinate image, specifically as follows:

[0026] The face image is horizontally sliced ​​to make the Y-axis vertical, based on the Y-axis determined by the facial coordinate image.

[0027] The X-axis of the face image, determined based on the facial coordinate image, is made horizontal by vertically slicing the image.

[0028] Preferably, the interocular distance is obtained from the normal-proportion facial image, specifically as follows:

[0029] Obtain the distance between the ears in the normal proportion facial image, and obtain the distance between the eyes based on the proportion of facial features.

[0030] Preferably, the actual distance between the target person and the camera is calculated based on the interocular distance, specifically as follows:

[0031] Based on the interpupillary distance, the actual distance between the target person and the camera is calculated using a binocular ranging method.

[0032] Preferably, the vertical axis of the coordinate image is on the line connecting the tip of the nose and the chin, and the horizontal axis is on the line connecting the distance between the eyes or the center points of the ears.

[0033] Preferably, the face image includes information about both eyes or both ears.

[0034] Beneficial effects: This invention pre-establishes a database and standardizes target person images. When the face of a target person entering the measurement range has a certain tilt angle, a simple algorithm is used to reconstruct facial features, quickly and accurately obtaining the actual distance, thus saving valuable time in specific situations. This invention uses a coordinate image of facial features, so that the distance measurement method does not rely solely on the direct measurement of interocular distance. It can indirectly obtain the interocular distance through the proportional relationship between facial features, thereby expanding the measurement range. Attached Figure Description

[0035] Figure 1 A schematic diagram illustrating face distance measurement using the principle of similar triangles to measure the interocular distance;

[0036] Figure 2 This is the initial coordinate image of target R in this embodiment of the invention;

[0037] Figure 3 This is the facial coordinate image of target R in this embodiment of the invention;

[0038] Figure 4 This is a schematic diagram of the ranging method in an embodiment of the present invention. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the scope of protection of the invention.

[0040] A camera ranging method based on facial contours, such as Figure 4 As shown, it includes the following steps:

[0041] Step 1: Establish a basic facial feature database. This database obtains facial feature data corresponding to various groups of people in reality. For example, the average interpupillary distance (IPD) for adult males is 64 mm, and for adult females it is 62 mm. In this embodiment, the median value of 63 mm is used. Based on the basic facial feature database, construct a basic coordinate image of the frontal facial features of a person. Establish the relationship between interpupillary distance, camera magnification, and actual distance. The relationship between interpupillary distance, camera magnification, and actual distance is obtained through interpupillary distance measurement or the principle of triangle similarity. Specifically, the formula for actual distance is: d = (f*W) / w, where f is the focal length, w is the pixel width of the human eye after imaging, W is the interpupillary distance in reality, and d is the distance between the person and the camera in reality. Figure 1 As shown.

[0042] Step 2: Establish a standardized facial feature database for the target population. Obtain frontal facial photos of the target population and use facial recognition methods to identify facial features, including five elements: ears, eyes, mouth, nose, and chin. Establish a coordinate system on the frontal facial photos of the target population. The vertical axis of the coordinate system is on the line connecting the tip of the nose and the chin, and the horizontal axis is on the line connecting the center points of the eyes or ears. In this embodiment, the line connecting the centers of the eyes is used as the X-axis, and the line connecting the centers of the nose tip and the chin is used as the Y-axis. The center of the coordinate system is the center of the eyes. The initial coordinate image constructed based on the target population is as follows: Figure 2 As shown, the coordinates of the facial features are as follows:

[0043] Let the center of the eye be point M, and the coordinate of the left eye be (M). L The right eye coordinate is marked as (M, 0), and the right eye coordinate is marked as (M). R Let S be the center of the bridge of the nose, and its position coordinates be (0, S). C )

[0044] Let the center of the mouth be point X, and its position coordinates be (0, X). C )

[0045] Let the center of the chin be point Z, and its position coordinates be (0, Z). C )

[0046] Let the center of the ear be point E, and the coordinate of the left ear be (E). XL E YL The coordinates of the right ear are marked as (E). XR E YR ).

[0047] The initial coordinate image is corrected based on the base coordinate image to obtain the corrected frontal facial features of the target person. Specifically, this includes: calculating the facial features of the person in the initial coordinate image, i.e., the distance between the eyes or the distance between the ears; obtaining the measurement error value between the initial coordinate image and the base coordinate image based on the ratio of the facial features of the person to the facial feature data in the base coordinate image; and correcting the initial coordinate image based on the measurement error value.

[0048] Specifically, in this embodiment, the distance between the centers of the two eyes in the initial coordinate image constructed from the target population is measured, i.e., vector M. R M L absolute value Based on the established basic facial feature database, the standard interocular center distance for adults is obtained. Use formula The K-value is derived, representing the error between the standard value and the photographic measurement. Multiplying the K-value by the corresponding coordinate value in the initial coordinate image yields the standardized coordinate image of the target population. The corrected coordinates of the facial features are then as follows:

[0049]

[0050] Standardized coordinate images were created based on the corrected frontal facial features of the target population. These standardized coordinate images and standardized facial feature data were stored in a standardized image database, which contained standardized coordinate images and standardized facial feature data for all members of the target population.

[0051] Step 3: When the target person enters the recognition range, the actual test stage begins. Based on the face recognition system, the facial features of the person are compared with those in the standardized image database to quickly identify the person's information, mark the target person as target R, and retrieve the frontal facial features of target R from the comparison database.

[0052] A facial image of the target R within the measurement range is captured. This facial image includes information about both eyes or both ears. A facial coordinate image is established on the facial image. When the target R enters the measurement range, a facial photo with a certain angle is typically captured. When the distance is too far to capture an image of both eyes, a facial image including information about both ears is used. A coordinate system is established on the captured facial image of the target R, constructing a facial coordinate image. The vertical axis of the coordinate system is on the line connecting the tip of the nose and the chin, and the horizontal axis is on the line connecting the center points of both eyes or both ears. In this embodiment, the line connecting the centers of both eyes is specifically used as the X-axis, and the line connecting the centers of the tip of the nose and the chin is used as the Y-axis.

[0053] Step 4, as follows Figure 3As shown, specifically, because the captured face image has a certain angle, to restore the frontal position of the face image, firstly, the facial coordinate image is subjected to image beveling. The Y-axis of the face image, determined by the facial coordinate image, is horizontally beveled to make the Y-axis vertical. Similarly, the X-axis of the face image, determined by the facial coordinate image, is vertically beveled to make the X-axis horizontal. This results in a frontal image with facial coordinates.

[0054] The frontal image is reconstructed to a normal proportion using standardized coordinate images to obtain a facial image. The interocular distance is then obtained from this normal proportion facial image. The above-described obliquely-cut facial coordinate image is reconstructed based on the standardized image data of the target R. The specific steps are as follows:

[0055] Step 1: Index the standardized coordinate image and standardized facial feature data of target R in the standardized image database.

[0056] Step 2: Obtain the position of the target ear E in the standardized coordinate image, and calculate the ratio K between the Y-axis and X-axis directions. ESRC .

[0057] Step 3: Calculate the ear position in the facial coordinate image after beveling, and calculate the ratio K between the Y-axis and X-axis directions. ECAL .

[0058] Step 4, when K ECAL Less than K ESRC At that time, the facial coordinate image after beveling is stretched in the Y direction until K. ECAL equals K ESRC When K ECAL Greater than K ESRC At that time, the target image is stretched in the X direction until K. ECAL equals K ESRC .

[0059] Step 5: After completing the above steps, a facial coordinate image with normal proportions is obtained. The interocular distance is obtained in the facial coordinate image with normal proportions. In the above steps, when the distance is too far to directly obtain the interocular distance, the distance between the ears is obtained. The interocular distance is calculated by the relationship between the distance between the ears and the interocular distance in the facial coordinate image when the proportions are restored.

[0060] The actual distance between the target person and the camera is calculated based on the interpupillary distance. Specifically, the actual distance corresponding to the interpupillary distance is obtained from the algorithm that establishes the relationship between the interpupillary distance, the camera magnification, and the actual distance.

[0061] This embodiment establishes a standardized image database beforehand. When a target person's face enters the measurement range at a certain angle, a simple algorithm is used to reconstruct facial features based on the standardized image database, quickly and accurately obtaining the actual distance and saving valuable time in specific situations. This invention uses coordinate images of facial features, allowing the distance measurement method to go beyond simply measuring the interocular distance. It indirectly obtains the interocular distance through the proportional relationships between facial features, thereby expanding the measurement range.

[0062] The above embodiments illustrate only one implementation of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this patent should be determined by the appended claims.

Claims

1. A camera ranging method based on facial contours, characterized in that, include: Construct a standardized coordinate image of the frontal facial features of the target person; Establish a basic facial feature database, construct a basic coordinate image of the frontal facial features of a person, and obtain facial feature data corresponding to various groups of people in reality; The relationship between interocular distance, camera magnification, and actual distance is established. This relationship is obtained through interocular distance measurement or the principle of triangle similarity. Specifically, the formula for actual distance is: ,in Focal length The width of a human eye in pixels after the image is captured by the camera. This refers to the distance between the eyes of a person in real life. This refers to the actual distance between a person and the camera. Obtain the frontal facial features of the target person, and construct an initial coordinate image based on the frontal facial features of the target person; The initial coordinate image is corrected based on the base coordinate image to obtain the corrected frontal facial features of the target person; The standardized coordinate image is established based on the corrected frontal facial features of the target person; The standardized coordinate image and standardized facial feature data are stored in a standardized image database; Specifically, correcting the initial coordinate image based on the base coordinate image includes: Calculate the facial features of the person in the initial coordinate image; The measurement error value between the initial coordinate image and the base coordinate image is obtained based on the ratio of the facial features of the person to the facial feature data in the base coordinate image. The initial coordinate image is corrected based on the measurement error value; Capture a facial image of the target person within the measurement range, and establish a facial coordinate image on the facial image; The facial coordinate image is corrected using the standardized coordinate image, and the interocular distance is obtained from the corrected facial coordinate image. The facial coordinate image is corrected using the standardized coordinate image, and the interocular distance is obtained from the corrected facial coordinate image, specifically including: The facial coordinate image is subjected to image skewing processing to obtain a frontal image of the facial coordinate image; The frontal image is proportionally restored using the standardized image to obtain a facial image with normal proportions; Obtain the interocular distance in the normal-proportion facial image; The actual distance between the target person and the camera is calculated based on the interpupillary distance.

2. The camera ranging method based on facial contours according to claim 1, characterized in that, The facial features described include the distance between the eyes and the distance between the ears.

3. The camera ranging method based on facial contours according to claim 1, characterized in that, The facial coordinate image is subjected to image skewing processing to obtain a frontal image of the facial coordinate image, specifically as follows: The face image is horizontally sliced ​​to make the Y-axis vertical, based on the Y-axis determined by the facial coordinate image. The X-axis of the face image, determined based on the facial coordinate image, is made horizontal by vertically slicing the image.

4. The camera ranging method based on facial contours according to claim 1, characterized in that, The interocular distance is obtained from the normal-proportion facial image, specifically as follows: Obtain the distance between the ears in the normal proportion facial image, and obtain the distance between the eyes based on the proportion of facial features.

5. The camera ranging method based on facial contours according to claim 1, characterized in that, The actual distance between the target person and the camera is calculated based on the interpupillary distance, specifically as follows: Based on the interpupillary distance, the actual distance between the target person and the camera is calculated using a binocular ranging method.

6. The camera ranging method based on facial contours according to claim 1, characterized in that, The vertical axis of the coordinate graph lies on the line connecting the tip of the nose and the chin, while the horizontal axis lies on the line connecting the distance between the eyes or the center points of the ears.

7. The camera ranging method based on facial contours according to claim 1, characterized in that, The facial image includes information about both eyes or both ears.