A perspective control method for ultra-wide-angle smart doorbell lens
By adjusting the viewing angle and depth of field control model of the doorbell lens, the imaging deformation problem caused by ultra-wide-angle lens is solved, and accurate face recognition is achieved.
Patent Information
- Application Number
- CN202411034682.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-31
AI Technical Summary
Ultra-wide-angle lenses have a strong perspective effect in doorbell lenses, resulting in large imaging deformation and easily misjudgment of unfamiliar face recognition.
By obtaining the shooting position and perspective image of the doorbell lens, automatically identify the face position, adjust the viewing angle to be parallel to the actual position of the face, establish a depth of field control model, adjust the aperture and focus to control deformation, reacquire the image, and use auxiliary algorithms to optimize the display screen to optimize the display .
Effectively control the face deformation of perspective images, reduce misjudgment, and ensure accurate face recognition.
Smart Images

Figure CN118573999B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of optics, and in particular to a perspective control method of an ultra-wide-angle smart doorbell lens. Background Art
[0002] A wide-angle lens is a photographic lens with a shorter focal length than a standard lens and a larger viewing angle than a standard lens, and a longer focal length than a fisheye lens and a smaller viewing angle than a fisheye lens. Wide-angle lenses are divided into ordinary wide-angle lenses and ultra-wide-angle lenses. In order to obtain a wider field of view, doorbell lenses usually use ultra-wide-angle lenses.
[0003] However, ultra-wide-angle lenses have a strong perspective effect, which will cause a large deformation effect on the image. When using the doorbell lens for observation, the errors it produces can easily lead to misjudgment of unfamiliar faces. Summary of the invention
[0004] In order to solve the above technical problems, a perspective control method of an ultra-wide-angle smart doorbell lens is provided. The technical solution solves the problem that the ultra-wide-angle lens proposed in the above background technology has a strong perspective effect, which will cause a large deformation effect in the imaging. When using the doorbell lens for observation, the error generated can easily lead to misjudgment of unfamiliar face recognition.
[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is:
[0006] A perspective control method for an ultra-wide-angle smart doorbell lens, comprising:
[0007] Obtain the shooting position of the doorbell camera, and obtain the perspective image taken by the doorbell camera;
[0008] Automatically identify the facial position of the perspective image to obtain the facial perspective contour;
[0009] Obtaining the actual position of the face based on the position of the facial perspective outline in the perspective image;
[0010] Based on the actual position of the face and the shooting position of the doorbell lens, the shooting angle of the doorbell lens is adjusted to ensure that the shooting angle of the doorbell lens is parallel to the line connecting the actual position of the face and the shooting position of the doorbell lens;
[0011] Based on big data, we obtain a database of average dimensions of actual faces;
[0012] Based on the average size database of actual faces, calculating the deformation degree of the face under the ordinary lens as the first deformation degree;
[0013] Based on the average size database of actual faces, the deformation degree of the face in the perspective image is calculated as the second deformation degree;
[0014] Establish a depth of field control model;
[0015] Determine whether the portion where the second deformation degree exceeds the first deformation degree is greater than a preset deformation value. If not, no processing is performed. If yes, the aperture and focus position of the doorbell lens are adjusted based on the depth of field control model to obtain a target depth of field. The target depth of field is used to perform perspective control of the doorbell lens. The doorbell lens reacquires an image to obtain a perspective-controlled image.
[0016] An auxiliary algorithm is optimized for the perspective control image to obtain an optimized display image.
[0017] Preferably, the automatic recognition of the facial position on the perspective image to obtain the facial perspective contour comprises the following steps:
[0018] Acquire at least one perspective facial image based on the big data, wherein the at least one perspective facial image includes facial images in all perspective situations, and the perspective facial image only includes facial images;
[0019] Calculating the pixel value difference between adjacent pixel points in the perspective image, when the pixel value difference between adjacent pixel points is greater than a preset pixel value, the adjacent pixel points are regarded as contour points;
[0020] Aggregating at least one contour point to form at least one contour to be identified;
[0021] Acquire a characteristic contour to be identified and a characteristic perspective facial image, wherein the characteristic contour to be identified satisfies that the difference between the contour in the characteristic perspective facial image and that in the characteristic perspective facial image after scaling is less than a preset value, wherein the characteristic contour to be identified is one of the at least one contour to be identified, and the characteristic perspective facial image is one of the at least one perspective facial image;
[0022] The feature to-be-recognized contour is scaled to a value where the difference between the contour in the feature perspective facial image and the contour to be recognized is less than a preset value, thereby obtaining the target to-be-recognized contour;
[0023] The image in the target contour to be identified is compared with the characteristic perspective facial image. When the difference between the two is less than the preset pixel value, the target contour to be identified is a human face contour and the target contour to be identified is used as a facial perspective contour. Otherwise, no processing is performed. The difference between the image in the target contour to be identified and the characteristic perspective facial image is the sum of the differences in the pixel values of the pixel points at the corresponding positions.
[0024] Preferably, the step of obtaining the actual position of the face based on the position of the facial perspective contour in the perspective image comprises the following steps:
[0025] In the field of view of the doorbell camera, three edges of the corner are selected as the x-axis, y-axis and z-axis to establish a three-dimensional coordinate system, and the vertex of the corner is the origin of the three-dimensional coordinate system;
[0026] Get the actual coordinates of the doorbell camera in the three-dimensional coordinate system, and get the actual coordinates of the marker point in the three-dimensional coordinate system;
[0027] In the perspective image, obtain the distance from the marked point to the vertex of the corner as the first distance;
[0028] Divide the actual distance from the marked point to the vertex of the corner by the first distance to obtain the scaling ratio;
[0029] Get the center position of the facial perspective outline as the recognition point;
[0030] In the perspective image, straight lines are drawn through the identification point and parallel to the three edges of the corner, intersecting the three edges of the corner at a first point, a second point and a third point, respectively. The first point, the second point and the third point are on the x-axis, the y-axis and the z-axis, respectively.
[0031] Obtain the distances from the first point, the second point and the third point to the vertex of the corner respectively, and combine them to form the coordinates of the identification point in the perspective image;
[0032] The coordinates of the recognition point in the perspective image are multiplied by the scaling ratio to obtain the actual coordinates of the recognition point, and the actual coordinates of the recognition point are used as the actual position of the face.
[0033] Preferably, adjusting the shooting angle of the doorbell camera based on the actual position of the face and the shooting position of the doorbell camera comprises the following steps:
[0034] Obtain a straight line passing through the actual coordinates of the doorbell lens and the actual position of the face as a feature straight line;
[0035] Adjust the doorbell camera's shooting angle to be parallel to the characteristic line.
[0036] Preferably, the step of calculating the deformation degree of the face under a common lens as the first deformation degree comprises the following steps:
[0037] In the average size database of actual faces, an actual distance between the eyes is obtained as a first actual distance, and an actual distance between the eyes and the nose is obtained as a second actual distance;
[0038] Recognize the facial image under the ordinary lens to obtain the position of the eyes and the nose;
[0039] Obtain an image distance between the two eyes as a first image distance, and obtain an image distance from the two eyes to the nose as a second image distance;
[0040] The second image spacing is divided by the first image spacing to obtain a first deformation degree.
[0041] Preferably, the calculating and obtaining the deformation degree of the face in the perspective image as the second deformation degree comprises the following steps:
[0042] Recognize the facial image of the perspective image to obtain the positions of the eyes and the nose;
[0043] Obtain the perspective distance between the two eyes as the first perspective distance, and obtain the perspective distance from the two eyes to the nose as the second perspective distance;
[0044] The second perspective distance is divided by the first perspective distance to obtain a second deformation degree.
[0045] Preferably, the establishing of the depth of field control model comprises the following steps:
[0046] Obtain a value range of the aperture size of the doorbell lens, divide the value range of the aperture size into equal intervals, and obtain at least one aperture size point;
[0047] Acquire the moving range of the focus position, divide the moving range of the focus position into equal intervals, and obtain at least one displacement point;
[0048] combining at least one aperture size point and at least one displacement point to obtain at least one test group;
[0049] Under the conditions of the test group, facial imaging images are obtained;
[0050] Based on the average size database of actual faces, the deformation degree of the face of the facial imaging image is calculated to obtain a third deformation degree, and the steps are the same as the steps of calculating the deformation degree of the face of the perspective image;
[0051] The test group and the third deformation degree are fitted to obtain a depth of field control function, wherein the aperture size point and the displacement point in the test group are independent variables, and the third deformation degree is a dependent variable.
[0052] Preferably, the adjusting the aperture and focus position of the doorbell lens to obtain the target depth of field comprises the following steps:
[0053] The first deformation degree is added to half of the preset deformation value to obtain the target deformation degree;
[0054] In the depth of field control model, the third deformation degree with the smallest difference from the target deformation degree is obtained as the target third deformation degree;
[0055] Substitute the third deformation degree of the target into the depth of field control function, and inversely solve the aperture size value and displacement value;
[0056] Adjust the aperture of the doorbell lens to match the aperture size value and adjust the focus position to the position at the displacement value.
[0057] Preferably, the step of performing auxiliary algorithm optimization on the perspective control image to obtain an optimized display image comprises the following steps:
[0058] The perspective control image is subjected to noise reduction processing, and a median filter and a Gaussian low-pass filter are used for processing;
[0059] An image with a higher resolution among the images processed by the median filter and the Gaussian low-pass filter is obtained as an optimized display image.
[0060] Compared with the prior art, the present invention has the following beneficial effects:
[0061] By adjusting the shooting angle of the doorbell lens, the deformation conditions of the face in the perspective image are guaranteed to be consistent. Then, the deformation degree of the face in the perspective image can be calculated according to the average size database of the actual face, and this can be used as the basis for deformation judgment to control the perspective of the doorbell lens. The control depends on the depth of field control model, and the second deformation degree caused by the perspective of the doorbell lens is controlled within an allowable range, thereby ensuring that when the target depth of field is used to control the perspective of the doorbell lens, the deformation of the face in the image re-acquired by the doorbell lens is small and will not interfere with the judgment. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 It is a flow chart of the perspective control method of the ultra-wide-angle smart doorbell lens of the present invention;
[0063] Figure 2 A schematic diagram of the process of automatically identifying the facial position of a perspective image and obtaining the facial perspective contour according to the present invention;
[0064] Figure 3 It is a schematic diagram of a process of obtaining the actual position of a face based on the position of the facial perspective contour in a perspective image according to the present invention;
[0065] Figure 4 It is a schematic diagram of a process of adjusting the shooting angle of the doorbell lens based on the actual position of the face and the shooting position of the doorbell lens of the present invention;
[0066] Figure 5 A schematic diagram of a process of calculating the deformation degree of a face under a common lens as a first deformation degree according to the present invention;
[0067] Figure 6 A schematic diagram of a process of calculating and obtaining the deformation degree of the face of a perspective image as a second deformation degree according to the present invention;
[0068] Figure 7 A schematic diagram of a process for establishing a depth of field control model of the present invention;
[0069] Figure 8A schematic diagram of a process of adjusting the aperture and focus position of a doorbell lens to obtain a target depth of field according to the present invention;
[0070] Fig. 9 The present invention is a flowchart of performing auxiliary algorithm optimization on a perspective control image to obtain an optimized display image. DETAILED DESCRIPTION
[0071] The following description is used to disclose the present invention so that those skilled in the art can implement the present invention. The preferred embodiments described below are only examples, and those skilled in the art may think of other obvious variations.
[0072] Reference Figure 1 As shown, a perspective control method of an ultra-wide-angle smart doorbell lens includes:
[0073] Obtain the shooting position of the doorbell camera, and obtain the perspective image taken by the doorbell camera;
[0074] Automatically identify the facial position of the perspective image to obtain the facial perspective contour;
[0075] Obtaining the actual position of the face based on the position of the facial perspective outline in the perspective image;
[0076] Based on the actual position of the face and the shooting position of the doorbell lens, the shooting angle of the doorbell lens is adjusted to ensure that the shooting angle of the doorbell lens is parallel to the line connecting the actual position of the face and the shooting position of the doorbell lens;
[0077] Based on big data, we obtain a database of average dimensions of actual faces;
[0078] Based on the average size database of actual faces, calculating the deformation degree of the face under the ordinary lens as the first deformation degree;
[0079] Based on the average size database of actual faces, the deformation degree of the face in the perspective image is calculated as the second deformation degree;
[0080] Establish a depth of field control model;
[0081] Determine whether the portion where the second deformation degree exceeds the first deformation degree is greater than a preset deformation value. If not, no processing is performed. If yes, the aperture and focus position of the doorbell lens are adjusted based on the depth of field control model to obtain a target depth of field. The target depth of field is used to perform perspective control of the doorbell lens. The doorbell lens reacquires an image to obtain a perspective-controlled image.
[0082] An auxiliary algorithm is optimized for the perspective control image to obtain an optimized display image.
[0083] Reference Figure 2As shown, automatically identifying the facial position of the perspective image to obtain the facial perspective contour includes the following steps:
[0084] Acquire at least one perspective facial image based on the big data, wherein the at least one perspective facial image includes facial images in all perspective situations, and the perspective facial image only includes facial images;
[0085] Calculating the pixel value difference between adjacent pixel points in the perspective image, when the pixel value difference between adjacent pixel points is greater than a preset pixel value, the adjacent pixel points are regarded as contour points;
[0086] Aggregating at least one contour point to form at least one contour to be identified;
[0087] Acquire a characteristic contour to be identified and a characteristic perspective facial image, wherein the characteristic contour to be identified satisfies that the difference between the contour in the characteristic perspective facial image and that in the characteristic perspective facial image after scaling is less than a preset value, wherein the characteristic contour to be identified is one of the at least one contour to be identified, and the characteristic perspective facial image is one of the at least one perspective facial image;
[0088] The feature to-be-recognized contour is scaled to a value where the difference between the contour in the feature perspective facial image and the contour to be recognized is less than a preset value, thereby obtaining the target to-be-recognized contour;
[0089] The image in the target contour to be identified is compared with the feature perspective facial image. When the difference between the two is less than the preset pixel value, the target contour to be identified is a face contour and the target contour to be identified is used as the facial perspective contour. Otherwise, no processing is performed.
[0090] The difference between the image in the target contour to be identified and the feature perspective face image is the sum of the differences in the pixel values of the pixels at the corresponding positions;
[0091] The purpose of identifying the perspective outline of the face is to determine the position of the perspective outline of the face in the perspective image. Because the doorbell lens is an ultra-wide-angle lens, the deformation at different positions is different. The closer to the straight line where the viewing angle of the doorbell lens is located, the smaller the deformation degree, and the farther away from the straight line where the viewing angle of the doorbell lens is located, the greater the deformation degree. Therefore, when the position of the perspective outline of the face in the perspective image is different, it will produce different deformation effects, which will interfere with the control of the deformation effect caused by perspective. Therefore, it is necessary to determine the position of the perspective outline of the face in the perspective image, and thus determine the actual position of the face, and then adjust the viewing angle of the doorbell lens so that the face remains in the center position of the doorbell lens.
[0092] Reference Figure 3 As shown, based on the position of the facial perspective contour in the perspective image, obtaining the actual position of the face includes the following steps:
[0093] In the field of view of the doorbell camera, three edges of the corner are selected as the x-axis, y-axis and z-axis to establish a three-dimensional coordinate system, and the vertex of the corner is the origin of the three-dimensional coordinate system;
[0094] Get the actual coordinates of the doorbell camera in the three-dimensional coordinate system, and get the actual coordinates of the marker point in the three-dimensional coordinate system;
[0095] In the perspective image, obtain the distance from the marked point to the vertex of the corner as the first distance;
[0096] Divide the actual distance from the marked point to the vertex of the corner by the first distance to obtain the scaling ratio;
[0097] Get the center position of the facial perspective outline as the recognition point;
[0098] In the perspective image, straight lines are drawn through the identification point and parallel to the three edges of the corner, intersecting the three edges of the corner at a first point, a second point and a third point, respectively. The first point, the second point and the third point are on the x-axis, the y-axis and the z-axis, respectively.
[0099] Obtain the distances from the first point, the second point and the third point to the vertex of the corner respectively, and combine them to form the coordinates of the identification point in the perspective image;
[0100] The coordinates of the recognition point in the perspective image are multiplied by the scaling ratio to obtain the actual coordinates of the recognition point, and the actual coordinates of the recognition point are used as the actual position of the face.
[0101] In the image, to determine the actual position of the face, a reference is needed. Therefore, a coordinate system is established using the corner of the wall. The distance from the marked point to the vertex of the corner is used to obtain the proportional relationship between the image and the actual size. Therefore, when the coordinates of the face in the perspective image are obtained, the actual position of the face can be obtained through the proportional relationship.
[0102] The coordinates of the face in the perspective image are obtained by projecting the facial recognition point onto the straight line where the three edges of the corner lie in the perspective image, and then obtaining the distance to the vertex of the corner. Since the three edges of the corner are not displayed perpendicular to each other in the image, the projection here is completed by making them parallel to the three edges of the corner.
[0103] Reference Figure 4 As shown, based on the actual position of the face and the shooting position of the doorbell lens, adjusting the shooting angle of the doorbell lens includes the following steps:
[0104] Obtain a straight line passing through the actual coordinates of the doorbell lens and the actual position of the face as a feature straight line;
[0105] Adjust the doorbell camera's shooting angle to be parallel to the characteristic line.
[0106] Reference Figure 5 As shown, calculating the deformation degree of the face under a common lens as the first deformation degree includes the following steps:
[0107] In the average size database of actual faces, an actual distance between the eyes is obtained as a first actual distance, and an actual distance between the eyes and the nose is obtained as a second actual distance;
[0108] Recognize the facial image under the ordinary lens to obtain the position of the eyes and the nose;
[0109] Obtain an image distance between the two eyes as a first image distance, and obtain an image distance from the two eyes to the nose as a second image distance;
[0110] The second image spacing is divided by the first image spacing to obtain a first deformation degree.
[0111] After adjusting the shooting angle of the doorbell lens, the face can be kept in the same position in the image taken by the doorbell lens. Therefore, the deformation condition is consistent. Therefore, the deformation degree can be estimated, and the depth of field of the doorbell lens can be adjusted according to the estimation result.
[0112] The first deformation degree is the deformation degree of the face of an ordinary lens. The deformation of the face of an ordinary lens is small and does not have much impact on recognition. Therefore, it can be used as a reference. When the second deformation degree is too different from the first deformation degree, it means that the deformation is too large. Therefore, it needs to be adjusted to a degree where the difference from the first deformation degree is less than the preset deformation value.
[0113] The calculation methods of the first deformation degree and the second deformation degree are the same. The first deformation degree is calculated by estimating the distance between the eyes and the distance from the eyes to the nose. Because the doorbell lens usually stretches the face to both sides, it usually has the effect of being larger in the middle and smaller on both sides. Therefore, the second image spacing is divided by the first image spacing as the first deformation degree. The greater the deformation, the greater the ratio of the second image spacing to the first image spacing.
[0114] Reference Figure 6 As shown, calculating the deformation degree of the face of the perspective image as the second deformation degree includes the following steps:
[0115] Recognize the facial image of the perspective image to obtain the positions of the eyes and the nose;
[0116] Obtain the perspective distance between the two eyes as the first perspective distance, and obtain the perspective distance from the two eyes to the nose as the second perspective distance;
[0117] The second perspective distance is divided by the first perspective distance to obtain a second deformation degree.
[0118] Reference Figure 7 As shown, establishing a depth of field control model includes the following steps:
[0119] Obtain a value range of the aperture size of the doorbell lens, divide the value range of the aperture size into equal intervals, and obtain at least one aperture size point;
[0120] Acquire the moving range of the focus position, divide the moving range of the focus position into equal intervals, and obtain at least one displacement point;
[0121] combining at least one aperture size point and at least one displacement point to obtain at least one test group;
[0122] Under the conditions of the test group, facial imaging images are obtained;
[0123] Based on the average size database of actual faces, the deformation degree of the face of the facial imaging image is calculated to obtain a third deformation degree, and the steps are the same as the steps of calculating the deformation degree of the face of the perspective image;
[0124] The test group and the third deformation degree are fitted to obtain a depth of field control function, wherein the aperture size point and the displacement point in the test group are independent variables, and the third deformation degree is a dependent variable.
[0125] The depth of field control model can estimate the degree of deformation caused by the aperture size point and displacement point of the test group under different conditions. Therefore, the depth of field control model can be used to obtain the conditions required for the target deformation degree, and then make targeted adjustments.
[0126] Reference Figure 8 As shown, adjusting the aperture and focus position of the doorbell lens to obtain the target depth of field includes the following steps:
[0127] The first deformation degree is added to half of the preset deformation value to obtain the target deformation degree;
[0128] In the depth of field control model, the third deformation degree with the smallest difference from the target deformation degree is obtained as the target third deformation degree;
[0129] Substitute the third deformation degree of the target into the depth of field control function, and inversely solve the aperture size value and displacement value;
[0130] Adjust the aperture of the doorbell lens to match the aperture size value and adjust the focus position to the position at the displacement value.
[0131] The purpose of using half of the preset deformation value is to ensure that the difference between the deformation degree of the perspective-controlled image finally adjusted and the first deformation degree does not exceed the preset deformation value. This is because, when the number of test groups is large enough, the corresponding third deformation degree can approach the target deformation degree with arbitrary accuracy, that is, the difference between the target third deformation degree and the target deformation degree is less than half of the preset deformation value, and then the difference between the target third deformation degree and the first deformation degree is less than the preset deformation value. The adjustment used for the target depth of field is the aperture size value and the displacement value obtained by substituting the target third deformation degree into the depth of field control function. Therefore, the deformation degree of the face of the adjusted image meets the requirements.
[0132] Reference Fig. 9 As shown, performing auxiliary algorithm optimization on the perspective control image to obtain an optimized display image includes the following steps:
[0133] The perspective control image is subjected to noise reduction processing, and a median filter and a Gaussian low-pass filter are used for processing;
[0134] An image with a higher resolution among the images processed by the median filter and the Gaussian low-pass filter is obtained as an optimized display image.
[0135] In summary, the advantages of the present invention are: by adjusting the shooting angle of the doorbell lens, the deformation conditions of the face in the perspective image are guaranteed to be consistent, and then the deformation degree of the face in the perspective image can be calculated according to the average size database of the actual face, and this is used as the basis for deformation judgment to control the perspective of the doorbell lens, and the control depends on the depth of field control model, and the second deformation degree caused by the perspective of the doorbell lens is controlled within an allowable range, thereby ensuring that when the target depth of field is used to perform the perspective control of the doorbell lens, the deformation of the face in the image re-acquired by the doorbell lens is small and will not interfere with the judgment.
[0136] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.
Claims
1. A perspective control method for an ultra-wide-angle smart doorbell lens, characterized in that: include: Obtain the shooting position of the doorbell camera, and obtain the perspective image taken by the doorbell camera; Automatically identify the facial position of the perspective image to obtain the facial perspective contour; Obtaining the actual position of the face based on the position of the facial perspective outline in the perspective image; Based on the actual position of the face and the shooting position of the doorbell lens, the shooting angle of the doorbell lens is adjusted to ensure that the shooting angle of the doorbell lens is parallel to the line connecting the actual position of the face and the shooting position of the doorbell lens; Based on big data, we obtain a database of average dimensions of actual faces; Based on the average size database of actual faces, calculating the deformation degree of the face under the ordinary lens as the first deformation degree; Based on the average size database of actual faces, the deformation degree of the face in the perspective image is calculated as the second deformation degree; Establish a depth of field control model; Determine whether the portion where the second deformation degree exceeds the first deformation degree is greater than a preset deformation value. If not, no processing is performed. If yes, the aperture and focus position of the doorbell lens are adjusted based on the depth of field control model to obtain a target depth of field. The target depth of field is used to perform perspective control of the doorbell lens. The doorbell lens reacquires an image to obtain a perspective-controlled image. Perform auxiliary algorithm optimization on the perspective control image to obtain an optimized display image; The step of obtaining the actual position of the face based on the position of the facial perspective contour in the perspective image comprises the following steps: In the field of view of the doorbell camera, three edges of the corner are selected as the x-axis, y-axis and z-axis to establish a three-dimensional coordinate system, and the vertex of the corner is the origin of the three-dimensional coordinate system; Get the actual coordinates of the doorbell camera in the three-dimensional coordinate system, and get the actual coordinates of the marker point in the three-dimensional coordinate system; In the perspective image, obtain the distance from the marked point to the vertex of the corner as the first distance; Divide the actual distance from the marked point to the vertex of the corner by the first distance to obtain the scaling ratio; Get the center position of the facial perspective outline as the recognition point; In the perspective image, straight lines are drawn through the identification point and parallel to the three edges of the corner, intersecting the three edges of the corner at a first point, a second point and a third point, respectively. The first point, the second point and the third point are on the x-axis, the y-axis and the z-axis, respectively. Obtain the distances from the first point, the second point and the third point to the vertex of the corner respectively, and combine them to form the coordinates of the identification point in the perspective image; The coordinates of the recognition point in the perspective image are multiplied by the scaling ratio to obtain the actual coordinates of the recognition point, and the actual coordinates of the recognition point are used as the actual position of the face; The calculating and obtaining the deformation degree of the face in the perspective image as the second deformation degree comprises the following steps: Recognize the facial image of the perspective image to obtain the positions of the eyes and the nose; Obtain the perspective distance between the two eyes as the first perspective distance, and obtain the perspective distance from the two eyes to the nose as the second perspective distance; The second perspective distance is divided by the first perspective distance to obtain a second deformation degree; The establishment of the depth of field control model comprises the following steps: Obtain a value range of the aperture size of the doorbell lens, divide the value range of the aperture size into equal intervals, and obtain at least one aperture size point; Acquire the moving range of the focus position, divide the moving range of the focus position into equal intervals, and obtain at least one displacement point; combining at least one aperture size point and at least one displacement point to obtain at least one test group; Under the conditions of the test group, facial imaging images are obtained; Based on the average size database of actual faces, the deformation degree of the face of the facial imaging image is calculated to obtain a third deformation degree, and the steps are the same as the steps of calculating the deformation degree of the face of the perspective image; Fitting the test group and the third deformation degree to obtain a depth of field control function, wherein the aperture size point and the displacement point in the test group are independent variables, and the third deformation degree is a dependent variable; The step of adjusting the aperture and focus position of the doorbell lens to obtain the target depth of field comprises the following steps: The first deformation degree is added to half of the preset deformation value to obtain the target deformation degree; In the depth of field control model, the third deformation degree with the smallest difference from the target deformation degree is obtained as the target third deformation degree; Substitute the third deformation degree of the target into the depth of field control function, and inversely solve the aperture size value and displacement value; Adjust the aperture of the doorbell lens to match the aperture size value and adjust the focus position to the position at the displacement value.
2. The perspective control method of an ultra-wide-angle smart doorbell lens according to claim 1, characterized in that: The automatic recognition of the facial position on the perspective image to obtain the facial perspective contour comprises the following steps: Acquire at least one perspective facial image based on the big data, wherein the at least one perspective facial image includes facial images in all perspective situations, and the perspective facial image only includes facial images; Calculating the pixel value difference between adjacent pixel points in the perspective image, when the pixel value difference between adjacent pixel points is greater than a preset pixel value, the adjacent pixel points are regarded as contour points; Aggregating at least one contour point to form at least one contour to be identified; Acquire a characteristic contour to be identified and a characteristic perspective facial image, wherein the characteristic contour to be identified satisfies that the difference between the contour in the characteristic perspective facial image and that in the characteristic perspective facial image after scaling is less than a preset value, wherein the characteristic contour to be identified is one of the at least one contour to be identified, and the characteristic perspective facial image is one of the at least one perspective facial image; The feature to-be-recognized contour is scaled to a value where the difference between the contour in the feature perspective facial image and the contour to-be-recognized is less than a preset value, thereby obtaining the target to-be-recognized contour; The image in the target contour to be identified is compared with the characteristic perspective facial image. When the difference between the two is less than the preset pixel value, the target contour to be identified is a human face contour and the target contour to be identified is used as a facial perspective contour. Otherwise, no processing is performed. The difference between the image in the target contour to be identified and the characteristic perspective facial image is the sum of the differences in the pixel values of the pixel points at the corresponding positions.
3. The perspective control method of an ultra-wide-angle smart doorbell lens according to claim 2, characterized in that: The adjusting the shooting angle of the doorbell lens based on the actual position of the face and the shooting position of the doorbell lens comprises the following steps: Obtain a straight line passing through the actual coordinates of the doorbell lens and the actual position of the face as a feature straight line; Adjust the doorbell camera's shooting angle to be parallel to the characteristic line.
4. The perspective control method of an ultra-wide-angle smart doorbell lens according to claim 3, characterized in that: The calculation of the deformation degree of the face under the ordinary lens as the first deformation degree includes the following steps: In the average size database of actual faces, an actual distance between the eyes is obtained as a first actual distance, and an actual distance between the eyes and the nose is obtained as a second actual distance; Recognize the facial image under the ordinary lens to obtain the position of the eyes and the nose; Obtain an image distance between the two eyes as a first image distance, and obtain an image distance from the two eyes to the nose as a second image distance; The second image spacing is divided by the first image spacing to obtain a first deformation degree.
5. The perspective control method of an ultra-wide-angle smart doorbell lens according to claim 4, characterized in that: The auxiliary algorithm optimization of the perspective control image to obtain an optimized display image comprises the following steps: The perspective control image is subjected to noise reduction processing, and a median filter and a Gaussian low-pass filter are used for processing; An image with a higher resolution among the images processed by the median filter and the Gaussian low-pass filter is obtained as an optimized display image.
Citation Information
Patent Citations
Shooting method and terminal
CN105187719A
Camera lens, lens module and electronic equipment
CN115524897A
Imaging device performing focus adjustment based on human face information
US20070280662A1
Video camera
US20090213231A1
Image Processing Method and Electronic Device
US20160110853A1
