Method and apparatus for adjusting the placement angle of a monocular camera

By dividing areas in the image captured by a monocular camera and calculating pixel feature values, the adjustment angle of the monocular camera is quickly determined, which solves the problem of long and inaccurate manual adjustment, and realizes efficient camera placement angle recommendation.

CN114332131BActive Publication Date: 2025-07-11ZHIDAO NETWORK TECH (BEIJING) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111677345.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-31
Publication Date
2025-07-11
Estimated Expiration
2041-12-31

AI Technical Summary

Technical Problem

In the prior art, the installation angle adjustment of a monocular camera relies on manual methods, which takes a long time and is not accurate enough, affecting the data accuracy of autonomous driving vehicles.

Method used

By acquiring the captured image of the monocular camera, dividing it into at least two areas, identifying the key points of the reference object image, calculating the pixel feature value of each area, and comparing the feature value to determine the adjustment angle.

Benefits of technology

It improves the efficiency of adjusting angles of a single-eye camera, and can quickly recommend placement positions under any scene conditions, get rid of the constraints of calibration plates and venues, and ensures the accuracy of camera placement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114332131B_ABST
    Figure CN114332131B_ABST
Patent Text Reader

Abstract

The present application relates to a method and apparatus for adjusting the placement angle of a monocular camera. The method includes: obtaining a captured image of the monocular camera, where the captured image includes a reference object; dividing the captured image into at least two regions, and each region includes an image of the reference object; identifying key points of the reference object image in each region, and respectively obtaining pixel feature values of at least two regions according to the key points of the reference object image; comparing the pixel feature values of at least two regions to determine the adjustment angle of the monocular camera. The solution provided by the present application can assist installers in quickly obtaining the placement angle for adjusting the monocular camera.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of intelligent transportation, and particularly to a method for adjusting the placement angle of a monocular camera. Background Art

[0002] In the related art, in the field of intelligent transportation, several cameras need to be installed on a vehicle to collect image information. When evaluating the shooting accuracy of a camera, the shooting accuracy of the camera is mainly calculated by obtaining the external parameters of the camera. The external parameters of the camera are related to two aspects. One is the installation attitude of the camera, and the other is the installation position of the camera. By installing the camera in different ways, different external parameters can be obtained, and then, according to data such as the size and accuracy of the effective range of the external parameters, relevant data for autonomous driving can be analyzed. If the placement position of the monocular camera is not accurate enough, the autonomous driving data output by the autonomous driving vehicle will not be accurate enough.

[0003] In the prior art, the camera parameters are usually adjusted manually to obtain the installation angle. However, manually adjusting the placement angle of the camera often takes a long time and the adjusted placement angle of the camera is not accurate enough. Therefore, there is an urgent need for an auxiliary method to recommend to the installer the adjustment of the placement angle of the monocular camera. Summary of the Invention

[0004] To solve or partially solve the problems existing in the related art, this application provides an automatic adjustment method for the placement angle of a monocular camera, which can assist the installer in quickly obtaining the adjustment of the placement angle of the monocular camera.

[0005] In a first aspect of this application, a method for adjusting the placement angle of a monocular camera is provided, including:

[0006] Obtain a captured image of the monocular camera, where the captured image includes a reference object;

[0007] Divide the captured image into at least two regions, and each region includes an image of the reference object;

[0008] Identify key points of the reference object image in each region, and respectively obtain pixel feature values of at least two regions according to the key points of the reference object image;

[0009] Compare the pixel feature values of at least two regions to determine the adjustment angle of the monocular camera.

[0010] Optionally, the pixel feature value is a pixel accuracy value, and each pixel point in the reference object image is a region. Obtaining the pixel feature values of at least two regions according to the key points of the reference object image respectively includes:

[0011] According to the key points of the reference object image, determine the pixel points corresponding to the key points;

[0012] Obtain the image data of pixel points and the dimension data of the reference object;

[0013] Calculate the pixel precision value of the key points in each reference object image according to the image data of pixel points and the dimension data of the reference object.

[0014] Optionally, calculate the pixel precision value of the key points in each reference object image according to the image data of pixel points and the dimension data of the reference object, including:

[0015] Determine the pixel distance data between pixel points according to the image data of pixel points;

[0016] Determine the actual length data between key points according to the dimension data of the reference object;

[0017] Obtain the pixel precision value of each key point according to the pixel distance data between pixel points and the actual length data between key points.

[0018] Optionally, compare the pixel feature values of at least two regions to determine the adjustment angle of the monocular camera, including:

[0019] Compare the pixel feature values of at least two regions to determine the pixel point with the highest pixel feature value and the pixel point with the lowest pixel feature value;

[0020] Determine the adjustment angle of the monocular camera according to the direction of the line connecting the pixel point with the lowest pixel feature value and the pixel point with the highest pixel feature value.

[0021] Optionally, divide the captured image into at least two regions, and each region contains a reference object image, including:

[0022] Divide the captured image evenly into at least two regions, and each region contains a complete edge of a reference object.

[0023] Optionally, the pixel feature value is the pixel precision value. Identify the key points of the reference object image in each region, and obtain the pixel feature values of at least two regions according to the key points of the reference object image respectively, including:

[0024] Identify the complete edge of the reference object in each region according to the key points of the reference object image, and obtain the pixel length value of the complete edge;

[0025] Read the actual side length data of the complete edge, and determine the pixel feature value of each region according to the actual side length data of the complete edge and the pixel length value of the complete edge.

[0026] Optionally, the number of regions is two. Compare the pixel feature values of at least two regions to determine the adjustment angle of the monocular camera, including:

[0027] Determine the perpendicular line of the boundary line between the two regions;

[0028] Compare the pixel feature values of two regions to determine the direction of the perpendicular line, which points from the region with lower pixel feature value to the region with higher pixel feature value.

[0029] The second aspect of the present application provides a device for adjusting the placement angle of a monocular camera, including:

[0030] An acquisition unit for acquiring a captured image of the monocular camera, where the captured image includes a reference object;

[0031] A first processing unit for dividing the captured image into at least two regions, each region including an image of the reference object;

[0032] A calculation unit for identifying key points of the reference object image in each region and respectively obtaining pixel feature values of at least two regions based on the key points of the reference object image;

[0033] A display unit for comparing the pixel feature values of two regions to determine the adjustment angle of the monocular camera.

[0034] The third aspect of the present application provides an electronic device, including:

[0035] A processor; and

[0036] A memory storing executable code, which, when executed by the processor, causes the processor to execute the above method.

[0037] The fourth aspect of the present application provides a computer-readable storage medium storing executable code, which, when executed by the processor of an electronic device, causes the processor to execute the above method.

[0038] The technical solution provided by the present application may include the following beneficial effects: By dividing the captured image of the monocular camera into at least two regions and obtaining the pixel feature values of each region, the recommended angle of the monocular camera can be quickly obtained by comparing the pixel feature values of two regions, improving the efficiency of obtaining the adjustment angle of the monocular camera.

[0039] On the other hand, when obtaining the regional pixel values, by setting a reference object to replace the traditional camera calibration method, the user can adjust the placement position of the monocular camera through the evaluation score output by the reference system under any scene conditions, thus getting rid of the constraints on the calibration board and the site in the existing monocular camera calibration process.

[0040] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Description of the Drawings

[0041] The above and other objects, features, and advantages of the present application will become more apparent by describing the exemplary embodiments of the present application in more detail with reference to the accompanying drawings. In the exemplary embodiments of the present application, the same reference numerals generally represent the same components.

[0042] Figure 1 is a schematic flowchart of a method for automatically adjusting the placement angle of a monocular camera shown in an embodiment of the present application;

[0043] Figure 2 is a schematic diagram of a method for splitting a captured image shown in an embodiment of the present application

[0044] Figure 3 is another schematic diagram of a method for splitting a captured image shown in an embodiment of the present application;

[0045] Figure 4 is a schematic structural diagram of an automatic adjustment device for the placement angle of a monocular camera shown in an embodiment of the present application;

[0046] Figure 5 is a schematic structural diagram of an electronic device shown in an embodiment of the present application. Detailed Embodiments

[0047] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0048] The terms used in the present application are for the purpose of describing specific embodiments only and are not intended to limit the present application. The singular forms "a", "an", and "the" used in the present application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and includes any and all possible combinations of one or more of the associated listed items.

[0049] It should be understood that although the terms "first", "second", "third", etc. may be used in the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, "a plurality" means two or more unless otherwise specifically defined.

[0050] In the related art, in the field of intelligent transportation, it is necessary to install several cameras on a vehicle to collect image information. When evaluating the shooting accuracy of a camera, the shooting accuracy of the camera is mainly calculated by obtaining the external parameters of the camera. The external parameters of the camera are related to two aspects. One aspect is the installation attitude of the camera, and the other aspect is the installation position of the camera. By installing the camera in different ways, different external parameters can be obtained, and then relevant data for autonomous driving can be analyzed based on data such as the size and accuracy of the effective range of the external parameters. If the placement angle of a monocular camera is not accurate enough, it will lead to inaccurate understanding of the autonomous driving state by the autonomous vehicle.

[0051] In the prior art, the installation angle is usually obtained by manually adjusting parameters, but the parameters adjusted manually often take a long time and are not accurate enough. Therefore, there is an urgent need for an auxiliary method to recommend adjusting the placement angle of a monocular camera to the installer.

[0052] In view of the above problems, an embodiment of the present application provides an automatic adjustment method for the placement angle of a monocular camera, which can assist the installer in quickly obtaining the adjustment of the placement angle of the monocular camera.

[0053] The technical solutions of the embodiments of the present application are described in detail below with reference to the drawings.

[0054] Figure 1 FIG. is a schematic flowchart of an automatic adjustment method for the placement angle of a monocular camera shown in an embodiment of the present application.

[0055] See Figure 1 , including step S101 to step S104. Specifically, it includes:

[0056] Step S101, obtain the captured image of the monocular camera, and the captured image includes a reference object image.

[0057] The captured image is captured by the monocular camera placed at the current position. The reference object can be a calibration object such as a triangular ruler that can know the actual length of the reference object. The reference object can be set at any position in the shooting angle of the monocular camera, or a reference rectangle can be selected in the shooting angle of the monocular camera, and the reference object can be set at the four vertices of the rectangle.

[0058] Step S102, divide the captured image into at least two regions, and each region includes a reference object image.

[0059] In one embodiment, the region is a pixel. Dividing the captured image into at least two regions includes: identifying the reference object image in the captured image and extracting the pixels of the reference object image.

[0060] Specifically, a pixel coordinate system of the captured image is established, and the pixel coordinates of the captured pixels are obtained in the pixel coordinate system. The reference object image is recognized and the pixel coordinates corresponding to the reference object image are recorded. Recognizing the reference object image in the captured image can also adopt a point cloud algorithm or directly recognize the reference image using a grid algorithm.

[0061] In one embodiment, the captured image is divided into two regions, and the two regions bisect the captured image, and at least one reference object is arranged in each region. The adjustment angle of the monocular camera can be determined by comparing the two regions.

[0062] In one embodiment, the captured image is divided into four regions according to the reference object image, and at least one reference object or a complete edge of a reference object is arranged in each region.

[0063] Step S103: Identify the key points of the reference object image in each region, and respectively obtain the pixel feature values of at least two regions according to the key points of the reference object image.

[0064] In the embodiment of the present invention, the pixel feature value can be an image color grayscale value or a pixel accuracy value. By comparing the pixel feature values between at least two regions, the imaging quality of at least two regions can be evaluated, so as to compare the photographing effects of the regions between at least two regions, and provide a direction for adjusting the angle of the monocular camera.

[0065] In one embodiment, the pixel feature value is a pixel accuracy value. Accuracy is generally used to represent the relationship between the measured value and the actual value, and the pixel accuracy value is generally used to represent the number of pixels required to display the target reference object. When the reference object is closer to the monocular camera (i.e., the lower part of the picture captured by the monocular camera), the reference object will occupy more pixels in the picture captured by the monocular camera (i.e., for the same image, the higher the pixel accuracy value, the shorter the distance of each pixel), while when the reference object is far from the monocular camera, the reference object will occupy fewer pixels in the picture captured by the monocular camera (the distance of each pixel becomes larger). Therefore, for monocular cameras placed in different positions, the pixel accuracy values of the same reference object at the same position are different, and the better the placement position, the higher the pixel accuracy value. According to the matrix expression form of the camera extrinsic parameters, the extrinsic parameters correspond one-to-one with the pixel accuracy values.

[0066] In one embodiment, each pixel point in the captured image is a region. Identifying the key points of the reference object image in each region and respectively obtaining the pixel feature values of at least two regions according to the key points of the reference object image includes: determining the pixel points corresponding to the key points according to the key points of the reference object image; obtaining the image data of the pixel points and the size data of the reference object;

[0067] Calculate the pixel accuracy value of the key points in each reference object image according to the image data of the pixel points and the dimension data of the reference object.

[0068] In this embodiment, the key point can be any point on the edge of the triangular ruler, and it is defined that the pixel accuracy values of the key points on the same edge are the same.

[0069] Specifically, calculating the pixel accuracy value of the key points in each reference object image according to the image data of the pixel points and the dimension data of the reference object includes: determining the pixel distance data between the pixel points according to the image data of the pixel points; determining the actual length data between the key points according to the dimension data of the reference object; and obtaining the pixel accuracy value of each key point according to the pixel distance data between the pixel points and the actual length data between the key points.

[0070] In this embodiment, if there are several reference objects in the captured image, and one point on one edge of each reference object is taken as the key point, comparing the pixel accuracy values of several regions is to compare the pixel accuracy values of several key points. Since the key points are located on the edges of the reference objects, there is no need to obtain the coordinates corresponding to each key point. Only the side lengths corresponding to each key point need to be obtained, and it is defined that the pixel accuracy values of the pixel points on each side length are the same. By comparing the pixel length of the side length and the actual length corresponding to the side length, the pixel accuracy value of the side length can be obtained, and then the pixel accuracy value of the key point on the side length can be obtained. Among them, if the captured image includes multiple reference object images, and each reference object image includes at least two key points, when comparing the pixel accuracy values of the key points subsequently, it is necessary to traverse the key points of all object images for comparison.

[0071] In one embodiment, the key point can be any position on the reference object, and there can also be two key points with different pixel accuracies corresponding to one edge. Each pixel point in the captured image is a region, and the pixel accuracy value of each pixel point can also be calculated through the coordinates of the pixel point.

[0072] Specifically, it includes: constructing a pixel coordinate system of the image data and obtaining the pixel coordinates of the pixel points; constructing a world coordinate system according to the image data, the dimension data of the reference object, and the pixel coordinates of the pixel points, and obtaining the three-dimensional coordinates of the pixel points in the world coordinate system; and calculating the pixel accuracy value of each pixel point according to the pixel coordinates and the three-dimensional coordinates of the pixel points.

[0073] In one embodiment, the pixel feature value is the pixel precision value, the number of regions is two, and the two regions bisect the captured image. Identify the key points of the reference object image in each region, and obtain the pixel feature values of at least two regions respectively according to the key points of the reference object image, including: identifying the complete edge of each region and obtaining the pixel length value of the complete edge; reading the actual side length data of the complete edge, and determining the pixel feature value of each region according to the actual side length data of the complete edge and the pixel length value of the complete edge.

[0074] Specifically, it includes: constructing the pixel coordinates of the captured image, identifying the complete edge of the reference object, and obtaining the pixel coordinates of the two vertices of the complete edge. According to the pixel coordinates of the two vertices, obtain the pixel length value of the complete edge. In this embodiment, it is also possible not to construct the pixel coordinates of the image, directly identify the complete edge, and obtain the pixel length value of the complete edge.

[0075] Calculate the pixel precision value of the complete edge according to the pixel length value of the complete edge, the actual side length data of the complete edge, and the pixel precision value formula. Among them, the formula for obtaining the pixel precision value is formula (1):

[0076] P1 = D pixel / D real (1);

[0077] Among them, D pixel is used to represent the pixel length value of the complete edge, D real is used to represent the actual side length data of the complete edge, and P1 is used to represent the pixel precision value of the complete edge i. If there are multiple complete edges in the region, then calculate the average value of the pixel precision values of the multiple complete edges as the pixel precision value of the region.

[0078] Step S104, compare the pixel feature values of at least two regions, and determine the adjustment angle of the monocular camera.

[0079] In one embodiment, step S104, compare the pixel feature values of at least two regions, and determine the adjustment angle of the monocular camera, including: comparing the pixel feature values of at least two regions, determining the pixel point with the highest pixel feature value and the pixel point with the lowest pixel feature value; obtaining the direction of the line connecting the pixel point with the lowest pixel feature value and the pixel point with the highest pixel feature value, and determining the adjustment angle of the monocular camera.

[0080] In this embodiment, the adjustment direction can be a rough adjustment direction. For example, the pixel point with the highest precision is generally located at the exact middle position P0 below the monocular camera, and the coordinates P0(u0, v0) of the exact middle position P0 are recorded. The pixel coordinates of the position with the lowest score in the reference object image are P1(u1, v1), then P1 needs to be finely adjusted in the direction of P0. At this time: if u1 > u0 / 2, it is prompted that the installer needs to finely adjust the placement angle of the camera to the right; if u1 < u0 / 2, it is prompted that the installer needs to finely adjust the placement angle of the camera to the left; if the precision of the upper reference object is insufficient, it is prompted to finely adjust the placement angle of the camera upward; if the precision of the lower reference object is insufficient, it is prompted to finely adjust the placement angle of the camera downward.

[0081] In this embodiment, the reference adjustment line can also be determined according to the pixel point with the highest pixel feature value and the pixel point with the lowest pixel feature value, and then the reference adjustment angle can be calculated according to the reference adjustment line and the position of the current monocular camera. As Figure 2 shown, the area is pixel points, point A is the point with the highest feature value, point B is the point with the lowest pixel feature value, and the arrow indicates the adjustment angle determined according to point A and point B.

[0082] In one embodiment, the captured image is divided into at least two regions, and each region contains a reference object image, including: evenly dividing the captured image into at least two regions, and each region contains a complete side of a reference object. Optionally, the number of regions is two, and the pixel feature values of at least two regions are compared.

[0083] Among them, determining the adjustment angle of the monocular camera includes: determining the perpendicular line of the boundary line between the two regions; comparing the pixel feature values of the two regions to determine the direction of the perpendicular line, and the direction of the perpendicular line is from the region with a lower pixel feature value to the region with a higher pixel feature value.

[0084] Specifically, as Figure 3 shown, the captured image is evenly divided into region A and region B, the dotted line is the boundary line between region A and region B, and the arrow is the determined reference adjustment direction according to the pixel feature values of region A and region B. In Figure 3 , since the pixel feature value of region A is less than the pixel feature value of region B, the arrow direction is from region A to region B. If the pixel feature value of region A is greater than the pixel feature value of region B, the arrow direction is from region B to region A.

[0085] In one embodiment, the captured image is divided into four regions, and the reference object is placed at the four vertices of a rectangle within the shooting range of the monocular camera. According to the characteristics of the rectangle, the triangular ruler is grouped separately by left - right and up - down. Based on the image data and actual data of the reference object, the pixel accuracy value P(left) of the left - hand group, the pixel accuracy value P(right) of the right - hand group; the pixel accuracy value P(up) of the upper group, and the pixel accuracy value P(bottom) of the lower group are obtained respectively. According to the preset pixel accuracy value formula and the pixel accuracy values corresponding to the four groups, the score score(left) of the left - hand group, the score score(right) of the right - hand group; the score score(up) of the upper group, and the score score(bottom) of the lower group are calculated respectively. If score(left)>score(right), the placement angle of the camera is slightly adjusted to the right; if score(left)<score(right), it needs to be slightly adjusted to the left; if score(left) = score(right), the left - right direction remains unchanged. If score(up)>score(bottom), the placement angle of the camera is slightly adjusted downward; if score(up)<score(bottom), it needs to be slightly adjusted upward; if score(up) = score(bottom), the direction remains unchanged.

[0086] Among them, the preset evaluation quantization formula is Formula (2), and Formula (2) includes:

[0087]

[0088] Among them, p and pi represent the pixel accuracy values of each side, and i represents the i - th side. According to Formula (2), the score corresponding to each side length can be calculated. Based on the evaluation scores corresponding to each side, the average score of the characteristic sides of the reference object is obtained, and the average score is used as the evaluation score of the camera, or the average value of the evaluation scores of several reference objects is used as the evaluation score of the camera. The range of this score is from 0 to 100 points. The score can be displayed on the camera shooting interface. According to the score displayed in real - time, the user can determine the direction of the adjustment angle in a timely manner.

[0089] Corresponding to the foregoing application function implementation method embodiments, the present application also provides a device, an electronic device, and corresponding embodiments for adjusting the placement angle of a monocular camera.

[0090] Figure 4 It is a schematic structural diagram of a device for adjusting the placement angle of a monocular camera shown in the embodiments of the present application.

[0091] See Figure 4, the device includes: an acquisition unit 401, a first processing unit 402, a calculation unit 404, and a display unit 404.

[0092] The acquisition unit 401 is configured to acquire a captured image of a monocular camera, and the captured image includes a reference object.

[0093] The captured image is captured by the monocular camera at the current position. The reference object can be a calibration object such as a triangular ruler whose actual reference object length can be known. The reference object can be set at the four vertices of the shooting angle of the monocular camera, and the reference object images are distributed at the four vertices of the captured image.

[0094] The first processing unit 402 is configured to divide the captured image into at least two regions, and each region includes a reference object image.

[0095] In one embodiment, the region is a pixel. Dividing the captured image into at least two regions includes: identifying the reference object image in the captured image and extracting the pixels of the reference object image.

[0096] Specifically, establish the pixel coordinates of the captured image, and obtain the pixel coordinates of the captured pixels according to the pixel coordinates, identify the reference object image and record the coordinates of the reference object image. Identifying the reference object image in the captured image can also use a point cloud algorithm or directly identify the reference image using a grid algorithm.

[0097] In one embodiment, the captured image is divided into two regions, and the two regions divide the captured image equally, and at least one reference object is set in each region.

[0098] In one embodiment, the captured image is divided into four regions, and the four regions divide the captured image equally, and only one reference object is set in each region.

[0099] The calculation unit 403 is configured to identify the key points of the reference object image in each region, and respectively obtain the pixel feature values of at least two regions according to the key points of the reference object image.

[0100] In the embodiments of the present invention, the pixel feature value can be an image color gray value or a pixel accuracy value. By comparing the pixel feature values between at least two regions, the imaging quality of at least two regions can be evaluated, thereby comparing the photographing effects between at least two regions, and providing a direction for adjusting the angle of the monocular camera.

[0101] In one embodiment, the pixel feature value is the pixel accuracy value. Accuracy is generally used to represent the relationship between the measured value and the actual value. The pixel accuracy value is generally used to represent the number of pixels required to display the target reference object. At the position where the reference object is closer to the monocular camera (i.e., the lower part of the picture taken by the monocular camera), the reference object will occupy more pixels in the picture taken by the monocular camera (i.e., for the same image, the higher the pixel accuracy value, the shorter the distance of each pixel). While at the position where the reference object is far from the monocular camera, the reference object occupies fewer pixels in the picture taken by the monocular camera (the distance of each pixel becomes larger). Therefore, for monocular cameras placed at different positions, the pixel accuracy values of the same reference object at the same position are different, and the better the placement position, the higher the pixel accuracy value. According to the matrix expression form of the camera extrinsic parameters, the extrinsic parameters and the pixel accuracy value are in one-to-one correspondence.

[0102] In one embodiment, each pixel point in the captured image is a region. Identify the key points of the reference object image in each region, and respectively obtain the pixel feature values of at least two regions according to the key points of the reference object image, including: according to the key points of the reference object image, determine the pixel points corresponding to the key points; obtain the image data of the pixel points and the size data of the reference object;

[0103] According to the image data of the pixel points and the size data of the reference object, calculate the pixel accuracy value of the key points in each reference object image.

[0104] In this embodiment, the key point can be any point on the edge of the triangular ruler, and it is defined that the pixel accuracy values of the key points on the same edge are the same.

[0105] Specifically, according to the image data of the pixel points and the size data of the reference object, calculating the pixel accuracy value of the key points in each reference object image includes: according to the image data of the pixel points, determine the pixel distance data between the pixel points; according to the size data of the reference object, determine the actual length data between the key points; according to the pixel distance data between the pixel points and the actual length data between the key points, obtain the pixel accuracy value of each key point.

[0106] In this embodiment, if there are several reference objects in the captured image, one point on one side of each reference object is taken as a key point. Comparing the pixel accuracy values of several regions is equivalent to comparing the pixel accuracy values of several key points. Since the key points are located on the sides of the reference objects, there is no need to obtain the coordinates corresponding to each key point. Instead, only the line segments between the key points need to be obtained. It is defined that the pixel accuracy values of the pixel points on each line segment are the same. By the pixel length of the line segment and the actual length corresponding to the line segment, the pixel accuracy value of the line segment can be calculated, and then the pixel accuracy values of the key points on the reference object image can be obtained. Among them, the captured image includes multiple reference object images, and each reference object image includes at least two key points. When comparing the pixel accuracy values of the key points subsequently, it is necessary to traverse the key points of all object images for comparison.

[0107] In one embodiment, the key point can be any position on the reference object, and there can also be two key points on one side. Each pixel point in the captured image is a region, and the pixel accuracy value of each pixel point can also be calculated through the coordinates of the pixel point. Specifically, it includes: constructing the pixel coordinate system of the image data and obtaining the pixel coordinates of the pixel point; constructing the world coordinate system according to the image data, the size data of the reference object, and the pixel coordinates of the pixel point, and obtaining the three-dimensional coordinates of the pixel point in the world coordinate system; calculating the pixel accuracy value of each pixel point according to the pixel coordinates of the pixel point and the three-dimensional coordinates of the pixel point.

[0108] In one embodiment, the pixel feature value is the pixel accuracy value, the number of regions is two, and the two regions divide the captured image equally. Identify the key points of the reference object images in each region, and obtain the pixel feature values of at least two regions according to the key points of the reference object images, including: identifying the complete sides of each region and obtaining the pixel length values of the complete sides; reading the actual side length data of the complete sides, and determining the pixel feature values of each region according to the actual side length data of the complete sides and the pixel length values of the complete sides.

[0109] Specifically, it includes: constructing the pixel coordinates of the captured image, identifying the complete sides of the reference object, and obtaining the pixel coordinates of the two vertices of the complete side. According to the pixel coordinates of the two vertices, obtain the pixel length value of the complete side. In this embodiment, it is also possible not to construct the pixel coordinates of the image, directly identify the complete side, and obtain the pixel length value of the complete side.

[0110] Calculate the pixel accuracy value of the complete side according to the pixel length value of the complete side, the actual side length data of the complete side, and the pixel accuracy value formula. Among them, the formula for obtaining the pixel accuracy value is formula (1):

[0111] P1 = D pixel / D real (1);

[0112] Among them, D pixel is used to represent the pixel length value of the complete edge, and D real is used to represent the actual side length data of the complete edge. P1 is used to represent the pixel accuracy value of the complete edge i. If there are multiple complete edges in the area, the average value of the pixel accuracy values of the multiple complete edges is obtained as the pixel accuracy value of the area.

[0113] The display unit 404 is used to compare the pixel feature values of two areas and determine the adjustment angle of the monocular camera.

[0114] In one embodiment, comparing the pixel feature values of at least two areas to determine the adjustment angle of the monocular camera includes: comparing the pixel feature values of at least two areas to determine the pixel point with the highest pixel feature value and the pixel point with the lowest pixel feature value; obtaining the direction of the line connecting the pixel point with the lowest pixel feature value and the pixel point with the highest pixel feature value to determine the adjustment angle of the monocular camera.

[0115] In this embodiment, the adjustment direction can be a rough adjustment direction. For example, the pixel point with the highest accuracy is generally located at the exact middle position P0 below the monocular camera, and the coordinates P0(u0, v0) of the exact middle position P0 are recorded. The pixel coordinates of the position with the lowest score in the reference object image are P1(u1, v1), then P1 needs to be finely adjusted in the direction of P0. At this time: if u1 > u0 / 2, it is prompted that the installer needs to finely adjust the placement angle of the camera to the right; if u11 < u0 / 2, it is prompted that the installer needs to finely adjust the placement angle of the camera to the left; if the accuracy of the upper reference object is insufficient, it is prompted to finely adjust the placement angle of the camera upward; if the accuracy of the lower reference object is insufficient, it is prompted to finely adjust the placement angle of the camera downward.

[0116] In this embodiment, the reference adjustment line can also be determined according to the pixel point with the highest pixel feature value and the pixel point with the lowest pixel feature value, and then the reference adjustment angle is calculated according to the reference adjustment line and the position of the current monocular camera. As Figure 2 shown, the area is pixel points, point A is the point with the highest feature value, point B is the point with the lowest pixel feature value, and the arrow indicates the adjustment angle determined according to point A and point B.

[0117] In one embodiment, dividing the captured image into at least two areas, each area containing a reference object image, includes: evenly dividing the captured image into at least two areas, and each area contains a complete edge of a reference object. Optionally, the number of areas is two, comparing the pixel feature values of at least two areas,

[0118] Among them, determining the adjustment angle of the monocular camera includes: determining the perpendicular line of the boundary line between the two areas; comparing the pixel feature values of the two areas to determine the direction of the perpendicular line, and the direction of the perpendicular line is from the area with a lower pixel feature value to the area with a higher pixel feature value.

[0119] In one embodiment, the device further includes a display unit for displaying the adjustment angle on the monocular camera plane.

[0120] Specifically, as Figure 3 shown, the captured image is evenly divided into area A and area B. The dotted line is the boundary line between area A and area B, and the arrow is the determined reference adjustment direction according to the pixel feature values of area A and area B. In Figure 3 , since the pixel feature value of area A is less than that of area B, the arrow direction is from area A to area B. If the pixel feature value of area A is greater than that of area B, the arrow direction is from area B to area A.

[0121] In one embodiment, the captured image is divided into four areas, and the reference object is placed at the four vertices of a rectangle within the shooting range of the monocular camera. According to the characteristics of the rectangle, the triangular rulers are grouped into left and right groups and upper and lower groups respectively. According to the reference object image data and the actual data of the reference object, the pixel accuracy values P(left) of the left group and P(right) of the right group; and the pixel accuracy value P(up) of the upper group and the pixel accuracy value P(bottom) of the lower group are obtained respectively. According to the preset pixel accuracy value formula and the pixel accuracy values corresponding to the four groups, the scores score(left) of the left group and score(right) of the right group; and the score score(up) of the upper group and the score score(bottom) of the lower group are calculated respectively. If score(left)>score(right), the camera placement angle is finely adjusted to the right; if score(left)<score(right), it needs to be finely adjusted to the left; if score(left)=score(right), the left and right directions remain unchanged. If score(up)>score(bottom), the camera placement angle is finely adjusted downward; if score(up)<score(bottom), it needs to be finely adjusted upward; if score(up)=score(bottom), the direction remains unchanged.

[0122] Among them, the preset evaluation quantization formula is formula (2), and formula (2) includes:

[0123]

[0124] Among them, p and pi represent the pixel precision values of each edge, where i represents the i-th edge. According to formula (2), the score corresponding to each side length can be calculated. The average score of the reference object's feature edges is obtained based on the evaluation scores corresponding to each edge, and this average score is used as the evaluation score of the camera, or the average value of the evaluation scores of several reference objects is used as the evaluation score of this camera. The range of this score is from 0 to 100 points. The score can be displayed on the camera shooting interface. According to the score shown in real time, the user can timely determine the direction of adjusting the angle.

[0125] The technical solution provided by this application may include the following beneficial effects: By dividing the captured image of the monocular camera into at least two regions and obtaining the pixel feature values of each region, this application can quickly recommend the angle of the monocular camera by comparing the pixel feature values of the two regions, improving the efficiency of obtaining the adjustment angle of the monocular camera.

[0126] On the other hand, when obtaining the regional pixel values, by setting a reference object to replace the traditional camera calibration method, the user can adjust the placement position of the monocular camera according to the evaluation score output by the reference system under any scene conditions, thus getting rid of the constraints on the calibration board and the site in the existing monocular camera calibration process.

[0127] Regarding the device in the above embodiments, the specific manner in which each module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.

[0128] Figure 5 It is a schematic structural diagram of the electronic device shown in the embodiments of this application.

[0129] See Figure 5 , the electronic device 500 includes a memory 510 and a processor 520.

[0130] The processor 520 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0131] The memory 510 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, the ROM may store static data or instructions required by the processor 520 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device uses a mass storage device (such as a magnetic or optical disk, flash memory) as the permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory. The system memory may store some or all of the instructions and data required by the processor during operation. In addition, the memory 510 may include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and magnetic disks and / or optical disks may also be used. In some embodiments, the memory 510 may include a removable storage device that is readable and / or writable, such as a compact disc (CD), read-only digital versatile disc (such as DVD-ROM, dual-layer DVD-ROM), read-only Blu-ray disc, super density disc, flash memory card (such as SD card, min SD card, Micro-SD card, etc.), magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and instantaneous electronic signals transmitted wirelessly or by wire.

[0132] Executable code is stored on the memory 510, and when the executable code is processed by the processor 520, it can cause the processor 520 to execute some or all of the methods described above.

[0133] In addition, the method according to the present application can also be implemented as a computer program or computer program product, which includes computer program code instructions for executing some or all of the above steps of the method according to the present application.

[0134] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium), on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), it causes the processor to execute some or all of the steps of the above method according to the present application.

[0135] The embodiments of the present application have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to technologies in the market, or to enable other ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A method for adjusting the placement angle of a monocular camera, characterized in that, Including: Obtain the captured image of the monocular camera, where the captured image contains a reference object image; Divide the captured image into at least two regions, and each region contains the reference object image; Identify the key points of the reference object image in each region, and respectively obtain the pixel feature values of the at least two regions according to the key points of the reference object image. Among them, the pixel feature value is a pixel accuracy value, and each pixel point in the reference object image is a region. The step of respectively obtaining the pixel feature values of the at least two regions according to the key points of the reference object image includes: according to the key points of the reference object image, determine the pixel points corresponding to the key points, obtain the image data of the pixel points and the size data of the reference object, and calculate the pixel accuracy value of the key points in each reference object image according to the image data of the pixel points and the size data of the reference object. The pixel accuracy value represents the number of pixels required to display the reference object; Compare the pixel feature values of the at least two regions to determine the adjustment angle of the monocular camera, which includes: compare the pixel feature values of the at least two regions, determine the pixel point with the highest pixel feature value and the pixel point with the lowest pixel feature value, and determine the adjustment angle of the monocular camera according to the direction of the line connecting the pixel point with the lowest pixel feature value and the pixel point with the highest pixel feature value.

2. The method according to claim 1, wherein The step of calculating the pixel accuracy value of the key points in each reference object image according to the image data of the pixel points and the size data of the reference object includes: According to the image data of the pixel points, determine the pixel distance data between the pixel points; According to the size data of the reference object, determine the actual length data between the key points; According to the pixel distance data between the pixel points and the actual length data between the key points, obtain the pixel accuracy value of each key point.

3. The method according to claim 1, wherein The step of dividing the captured image into at least two regions, and each region contains the reference object image, includes: Divide the captured image evenly into at least two regions, and each region contains a complete side of a reference object.

4. The method according to claim 3, characterized in that, The pixel feature value is a pixel accuracy value. The step of identifying the key points of the reference object image in each region and respectively obtaining the pixel feature values of the at least two regions according to the key points of the reference object image includes: According to the key points of the reference object image, identify the complete side of the reference object in each region, and obtain the pixel length value of the complete side; Read the actual side length data of the complete side, and determine the pixel feature value of each region according to the actual side length data of the complete side and the pixel length value of the complete side.

5. The method according to claim 3, wherein The number of regions is two. The step of comparing the pixel feature values of the at least two regions to determine the adjustment angle of the monocular camera includes: Determine the perpendicular line of the boundary line between the two regions; Compare the pixel feature values of the two regions, and determine the direction of the perpendicular line. The direction of the perpendicular line is from the region with a lower pixel feature value to the region with a higher pixel feature value.

6. A device for adjusting the placement angle of a monocular camera, characterized in that, Including: An acquisition unit for acquiring the captured image of the monocular camera, where the captured image contains a reference object; A first processing unit for dividing the captured image into at least two regions, each of which contains the reference object image; A calculation unit for identifying key points of the reference object image in each region, and respectively obtaining pixel feature values of the at least two regions according to the key points of the reference object image. Wherein, the pixel feature value is a pixel accuracy value, each pixel point in the reference object image is a region, and the step of respectively obtaining pixel feature values of the at least two regions according to the key points of the reference object image includes: determining the pixel points corresponding to the key points according to the key points of the reference object image, obtaining the image data of the pixel points and the size data of the reference object, and calculating the pixel accuracy value of the key points in each reference object image according to the image data of the pixel points and the size data of the reference object. The pixel accuracy value represents the number of pixels required to display the reference object; A display unit for comparing the pixel feature values of the two regions to determine the adjustment angle of the monocular camera, including: comparing the pixel feature values of the at least two regions to determine the pixel point with the highest pixel feature value and the pixel point with the lowest pixel feature value, and determining the adjustment angle of the monocular camera according to the direction of the line connecting the pixel point with the lowest pixel feature value and the pixel point with the highest pixel feature value.

7. An electronic device, characterized in that, Comprising: A processor; And A memory storing executable code, which when executed by the processor, causes the processor to execute the method according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that: Storing executable code thereon, which when executed by the processor of the electronic device, causes the processor to execute the method according to any one of claims 1-5.

Citation Information

Patent Citations

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

    CN111182212A

  • Vehicle Installed Camera Extrinsic Parameter Estimation Method and Apparatus

    KR1020130039838A