Method and device for determining camera device position and posture, storage medium, and electronic device
By using the combination of GNSS, IMU and high-precision maps, combined with the sensory information of the camera equipment, the automatic calibration of the camera equipment's pose is realized, which solves the time-consuming, labor-intensive and low-precision problems in the existing technology, and improves the accuracy of the pose information. degree and positioning accuracy.
Patent Information
- Application Number
- CN202011423106.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-08
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-12-08
AI Technical Summary
Existing methods for determining the pose of camera equipment are time-consuming and labor-intensive, require high professional requirements, require high personnel participation, are complex to install, and require manual annotation and manual calibration, making it difficult to achieve high-precision pose calibration.
Using GNSS, IMU and high-precision maps, combined with the sensory information of the camera equipment, through pose search and multi-hypothesis matching algorithms, the pose of the camera device is automatically determined and the accuracy of the pose information is improved.
It realizes the automatic calibration of the camera equipment's posture, improves the accuracy of the posture information, reduces manual participation and installation complexity, and improves the positioning accuracy.
Smart Images

Figure CN112529957B
Abstract
Description
Technical Field
[0001] The present disclosure relates to a device posture determination technology, and in particular to a method and device for determining a camera device posture, a computer-readable storage medium, and an electronic device. Background Art
[0002] When using roadside cameras to locate objects, the goal is to perceive the location information of the object and align it with the real map information. Therefore, the camera's posture needs to be calibrated. Currently, monocular cameras usually locate objects through IPM projection, which requires accurate calibration of the six degrees of freedom of the camera's posture (roll, pitch, yaw, x-axis, y-axis, z-axis). Summary of the invention
[0003] In order to solve the above technical problems, the present disclosure is proposed. The embodiments of the present disclosure provide a method and apparatus for determining the position and posture of a camera device, a computer-readable storage medium, and an electronic device.
[0004] According to one aspect of an embodiment of the present disclosure, a method for determining a position and posture of a camera device is provided, comprising:
[0005] Using camera equipment to collect road surface images;
[0006] Obtaining initial position information of the camera device;
[0007] Determine a related posture set based on the initial posture information; wherein the related posture set includes a plurality of related posture information;
[0008] Based on each relevant position information of the plurality of relevant position information, determining a plurality of sets of first road information in the high-precision map;
[0009] Based on the multiple sets of first road information and the road surface image, target position information of the camera device is determined.
[0010] According to another aspect of an embodiment of the present disclosure, there is provided an apparatus for determining a position and posture of a camera device, comprising:
[0011] An image acquisition module, used to acquire road surface images using a camera device;
[0012] An initial posture determination module, used to obtain initial posture information of the camera device;
[0013] A related posture determination module, used to determine a related posture set based on the initial posture information determined by the initial posture determination module; wherein the related posture set includes a plurality of related posture information;
[0014] A related road acquisition module, used to determine multiple sets of first road information in the high-precision map based on each piece of related posture information among the multiple pieces of related posture information determined by the related posture determination module;
[0015] The posture optimization module is used to determine the target posture information of the camera device based on the multiple groups of first road information determined by the relevant road acquisition module and the road surface image obtained by the image acquisition module.
[0016] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the method for determining the position and posture of a camera device described in the above embodiment.
[0017] According to another aspect of the embodiments of the present disclosure, an electronic device is provided, the electronic device comprising:
[0018] processor;
[0019] a memory for storing instructions executable by the processor;
[0020] The processor is used to read the executable instructions from the memory and execute the instructions to implement the method for determining the position and posture of the camera device described in the above embodiment.
[0021] Based on a method and apparatus for determining the posture of a camera device, a computer-readable storage medium, and an electronic device provided in the above-mentioned embodiments of the present disclosure, multiple first road information are obtained from a high-precision map through a related posture set, and the target posture information is obtained by projecting the first road information onto a road surface image collected by a camera device. Since the high-precision map records road information with higher precision, more accurate first road information can be obtained based on the high-precision map, thereby greatly improving the accuracy of the posture information of the camera device.
[0022] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0024] Figure 1 It is a flowchart of a method for determining the position and posture of a camera device provided by an exemplary embodiment of the present disclosure.
[0025] Figure 2a It is a schematic diagram of multi-hypothesis matching in a method for determining the posture of a camera device provided by an exemplary embodiment of the present disclosure.
[0026] Figure 2b It is another schematic diagram of multi-hypothesis matching in a method for determining the position and posture of a camera device provided by an exemplary embodiment of the present disclosure.
[0027] Figure 3 It is a flowchart of a method for determining the position and posture of a camera device provided by another exemplary embodiment of the present disclosure.
[0028] Figure 4 This disclosure Figure 3 A schematic flow chart of step 303 in the embodiment shown.
[0029] Figure 5 This disclosure Figure 3 A flowchart of step 304 in the embodiment shown is shown.
[0030] Figure 6 This disclosure Figure 3 A schematic flow chart of step 305 in the illustrated embodiment.
[0031] Figure 7 This disclosure Figure 6 A flowchart of step 3053 in the embodiment shown.
[0032] Figure 8 It is a structural schematic diagram of an apparatus for determining the position and posture of a camera device provided by an exemplary embodiment of the present disclosure.
[0033] Fig. 9 It is a structural schematic diagram of an apparatus for determining the position and posture of a camera device provided by another exemplary embodiment of the present disclosure.
[0034] Fig.10 is a structural diagram of an electronic device provided by an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] Below, the exemplary embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0036] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
[0037] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0038] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0039] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0040] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0041] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0042] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0043] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0044] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0045] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0046] The disclosed embodiments can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0047] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0048] Application Overview
[0049] In the process of implementing the present disclosure, the inventors found that the existing method for determining the position and posture of a camera device usually adopts a manual labeling method, which requires installing markers (Marker) in the calibration area in advance, and then determining the mapping relationship through manual calibration. After that, the parameter calibration matrix is calculated by solving the fitting equation group; however, the existing technology has at least the following problems: time-consuming and labor-intensive, high professional requirements, high level of personnel participation, and complex installation.
[0050] Exemplary Systems
[0051] The present disclosure uses the latitude and longitude and altitude provided by the positioning system (for example, GNSS, GPS, etc.) to determine the initial coordinate information (including: x-axis coordinates, y-axis coordinates and z-axis coordinates) of the camera device's attitude, and provides roll (roll angle) and pitch (pitch angle) information in the camera device's attitude through the accelerometer in the inertial measurement unit (IMU) set on the camera device, and the magnetometer provides the yaw (yaw angle) information of the camera device; the initial posture is obtained, and the posture in the present disclosure includes the following 6 degrees of freedom information: x-axis coordinates, y-axis coordinates, z-axis coordinates, roll, pitch and yaw. Subsequently, a plurality of related postures are obtained by performing a posture search near the initial posture, and the reprojection error is calculated for each related posture by matching with a high-precision map, and finally the calibration result is determined to be valid by whether the minimum reprojection error is less than a threshold. The matching process mainly uses the lane lines and road signs identified from the road image collected by the camera device to match the lane lines and road signs in the high-precision map.
[0052] Figure 1 FIG. 1 is a flow chart of a method for determining the position and posture of a camera device provided by an exemplary embodiment of the present disclosure. Figure 1 As shown, the following steps are included:
[0053] Step 101, initialization of posture: The initial posture of the camera device can be obtained by combining the longitude, latitude and altitude provided by the GNSS (Global Navigation Satellite System), the reading of the accelerometer set on the camera device, and the reading of the magnetometer set on the camera device.
[0054] Step 102, posture search: with initial posture With the point as the center, pose search is performed in the four degrees of freedom of x-axis, y-axis, z-axis and yaw angle, and the searched relevant poses are stored in the relevant pose set {T}.
[0055] Step 103, performing image segmentation on the road surface image captured by the camera device, obtaining the straight line equation of at least one lane line and the midpoint of at least one road surface mark according to the image segmentation result, and obtaining the relative position relationship between at least one lane line and at least one road surface mark to obtain second road information.
[0056] Step 104, road information projection: For each relevant pose T in the relevant pose set {T} i , take a bounding box (boundingbox) with a set length, width and height (for example, 50m, etc.) as the center with the relative posture, obtain the first road information in the high-precision map within the boundingbox, project the first road information into the road surface image to obtain the third road information, and obtain the relative position relationship between the lane line and the road surface marking in the third road information in the road surface image.
[0057] Step 105, road information matching: using a heuristic multi-hypothesis matching algorithm, multiple possible matches are obtained. Figure 2a is a schematic diagram of multi-hypothesis matching in a method for determining the position and posture of a camera device provided by an exemplary embodiment of the present disclosure, Figure 2b FIG. 1 is another schematic diagram of multi-hypothesis matching in a method for determining the position and posture of a camera device provided by an exemplary embodiment of the present disclosure. Figure 2a and Figure 2b As shown in the figure: the black arrows and black dots represent the lane lines and road signs in the collected road image respectively; the gray arrows and hollow circles represent the projections of the lane lines and road signs in the high-precision map obtained based on a related pose in the road image respectively, and the dotted lines represent possible matching relationships. Figure 2a and Figure 2b These are two matching relationships between the same lane line and road surface markings. Based on the position of the road surface markings, various possible matching relationships are traversed. For each possible matching relationship, matching is performed according to the relative position relationship between each lane line and road surface marking to obtain a reprojection error. The traversal process is a trial and error process.
[0058] Step 106, minimizing the reprojection error: for each matching relationship among multiple matching relationships corresponding to a relevant posture, an updated posture is obtained by solving through nonlinear optimization.
[0059] Step 107, threshold judgment: determine whether the reprojection error corresponding to the updated posture with the smallest reprojection error is less than or equal to the set threshold, where the set threshold can be set according to the actual application scenario, for example, 10 pixels, etc.; if it exists, the updated posture with the smallest reprojection error is used as the target posture information; otherwise, expand the set range in the posture search, and re-execute step 102 with the expanded set range.
[0060] The disclosed embodiment is based on a high-precision map, combined with GNSS and IMU information, and uses the semantic segmentation results of the camera to match and locate through the high-precision map, so as to achieve sub-meter global positioning of the object. The above embodiment uses the high-precision map and the perception of the camera device itself to realize the automatic calibration of the camera device's posture; uses posture search and multi-hypothesis matching to associate elements to achieve posture optimization; and also uses the GNSS IMU magnetometer to provide the initial posture, which improves the accuracy of the initial posture and further improves the accuracy of the final posture information.
[0061] Exemplary Methods
[0062] Figure 3FIG. 1 is a flow chart of a method for determining the position and posture of a camera device provided by another exemplary embodiment of the present disclosure. This embodiment can be applied to electronic devices, such as Figure 3 As shown, the following steps are included:
[0063] Step 301: Use a camera to acquire a road surface image.
[0064] The imaging device may be a camera or other device capable of capturing images. Optionally, the imaging device may be arranged on the roadside in order to capture road surface images.
[0065] Step 302: Obtain initial posture information of the camera device.
[0066] In one embodiment, the above Figure 1 As shown in step 101 of the provided embodiment, the initial posture information of the camera device is determined; specifically, the longitude, latitude and altitude provided by the GNSS are used as the initial values of the spatial coordinates in the camera posture, wherein the initial values of the spatial coordinates include: x-axis coordinates, y-axis coordinates and z-axis coordinates; the roll and pitch angles of the camera device relative to the ground are determined using an accelerometer provided on the camera device according to formulas (1) and (2); the yaw angle of the camera device is determined using a magnetometer according to the roll and pitch angles and formulas (3), (4) and (5); and the initial posture of the camera device is obtained.
[0067] roll = atan2(a y , a z ) Formula (1)
[0068]
[0069] m′ x =m x *cos(pitch)+m y *sin(roll)*sin(pitch)+m z *cos(roll)*cos(pitch) Formula (3)
[0070] m′ y =m y *cos(roll)-m z *sin(roll) formula (4)
[0071] yaw=-atan2(m′ y , m′ x ) Formula (5)
[0072] Among them, a x , a y , az is the accelerometer reading. The accelerometer obtains the acceleration of the camera at this time. When the camera is in a static state, it is basically the reading of gravity acceleration in the IMU. If the IMU is placed flat, the reading is basically (0, 0, 9.8) m / s2. If it is not placed flat, there will be some reading deviations. Then, based on this reading, we can calculate how the IMU is not placed flat, that is, get the roll and pitch angles; m x , m y , m z are the magnetometer readings, which respectively represent the data of the three-axis magnetic components of the magnetometer; atan is the inverse tangent function.
[0073] Step 303: determine a set of related postures based on the initial posture information.
[0074] Among them, the related posture set includes multiple related posture information.
[0075] Alternatively, refer to the above Figure 1 As shown in step 102 in the provided embodiment, a plurality of relevant posture information is obtained by searching in four degrees of freedom, namely, the x-axis, the y-axis, the z-axis and the yaw angle, based on the initial posture information.
[0076] Step 304: Determine multiple sets of first road information in the high-precision map based on each relevant posture information in the multiple relevant posture information.
[0077] Alternatively, refer to the above Figure 1 As shown in the first half of step 104 in the provided embodiment, a corresponding bounding box is obtained from the high-precision map with each relevant posture information, and the first road information in the high-precision map within the bounding box is obtained.
[0078] Step 305: Determine target position information of the camera device based on multiple sets of first road information and road surface images.
[0079] In this embodiment, multiple groups of corresponding first road information are obtained from the high-precision map in combination with multiple groups of related posture information, each group of first road information is projected onto the road surface image, and the related posture information corresponding to each group of first road information is adjusted based on the road information on the road surface image, so as to obtain the target posture information of the camera device.
[0080] The above-mentioned embodiment of the present disclosure provides a method for determining the posture of a camera device, which obtains multiple first road information from a high-precision map through a related posture set, and obtains target posture information by projecting the first road information onto a road surface image collected by the camera device. Since the high-precision map records road information with higher precision, more accurate first road information can be obtained based on the high-precision map, which greatly improves the accuracy of the posture information of the camera device.
[0081] like Figure 4 As shown in the above Figure 3 Based on the illustrated embodiment, step 303 may include the following steps:
[0082] Step 3031, taking the initial pose information as the center, searching the three coordinate axis directions in the world coordinate system within a set range at a first set interval to obtain a first pose set.
[0083] The initial pose information includes the coordinate position in the world coordinate system (including: x-axis coordinate, y-axis coordinate and z-axis coordinate). This embodiment searches the center of the coordinate position in the initial pose in the world coordinate system, realizing the search of three degrees of freedom in the pose information (x-axis, y-axis and z-axis). The specific search process can be referred to Figure 1 As shown in step 102 in the provided embodiment; optionally, for the translation part, a search is performed at a first set interval, that is, a pose information is obtained at each first set interval in the x-axis, y-axis and z-axis directions, wherein the first set interval can be set according to the specific scenario, for example, any value between 1-5 meters, such as 2m, etc.; the pose search is performed within a set range, and the set range can be a range determined by a set value as a radius, wherein the set value can be set according to the specific scenario, for example, 20m, etc.
[0084] Step 3032, taking the initial pose information and each pose information in the first pose set as the center, search for the yaw angle in the local three-dimensional coordinate system where the camera device is located within the set angle and at a second set interval to obtain a related pose set.
[0085] In this embodiment, for the rotating part, the roll angle and pitch angle in the initial posture are kept unchanged, and the yaw angle is searched at a second set interval, that is, a posture information is obtained at every second set interval of the yaw angle, wherein the second set interval can be set according to the specific scenario, for example, 5 degrees, etc.; the search is performed within the set angle, wherein the set angle can be set according to the specific scenario, for example, any value between 10 and 30 degrees; and the posture search in four degrees of freedom (including: x-axis, y-axis, z-axis and yaw angle) is realized.
[0086] In this embodiment, the fourth degree of freedom (yaw angle) is searched for each posture in the first posture set obtained by searching in three degrees of freedom to obtain more posture information, and when searching the fourth degree of freedom, the roll angle and pitch angle corresponding to each first posture in the first posture set remain unchanged. By searching in four degrees of freedom, this embodiment obtains more relevant posture information that may be the posture of the camera device, avoiding the problem of omission or inaccurate positioning due to incomplete search.
[0087] like Figure 5 As shown in the above Figure 3 Based on the illustrated embodiment, step 304 may include the following steps:
[0088] Step 3041: Perform a segmentation operation on the road surface image to obtain second road information in the road surface image.
[0089] Optionally, the segmentation operation of the road surface image can refer to Figure 1 As shown in step 103 of the provided embodiment, the determined second road information includes a straight line equation of at least one lane line in the road surface image, coordinates of at least one road surface mark, and a relative position relationship between at least one lane line and at least one road surface mark.
[0090] Step 3042: determine a corresponding bounding box based on each piece of relevant pose information in the plurality of relevant pose information to obtain a plurality of bounding boxes.
[0091] Optionally, the bounding box can be obtained by referring to Figure 1 As shown in step 104 of the embodiment provided, each relevant position information corresponds to a bounding box, and the bounding box is centered on the relevant position information. The first road information includes: all lane lines and all road surface signs within the bounding box on the high-precision map; according to T i The process of projecting the first road information into the road surface image according to the internal parameters of the camera device and obtaining the third road information may include: converting the first road information from the high-precision map coordinate system to the camera device coordinate system, and then converting the first road information from the camera device coordinate system to the image coordinate system according to the internal parameters of the camera device, so as to realize projecting the first road information into the road surface image; wherein the internal parameters of the camera device include: the focal length of the camera device, the coordinates of the optical center, etc.
[0092] Step 3043: Perform an area search based on multiple bounding boxes in the high-precision map to obtain multiple groups of first road information corresponding to the multiple bounding boxes in the high-precision map.
[0093] Each bounding box corresponds to a group of first road information.
[0094] This embodiment can obtain multiple area maps by searching in a high-precision map based on a bounding box, each area map includes first road information consisting of at least one lane line and at least one road surface mark, and each group of first road information includes a straight line equation of at least one lane line in the corresponding area map, the coordinates of at least one road surface mark, and the relative position relationship between at least one lane line and at least one road surface mark; this embodiment obtains multiple groups of first road information with higher accuracy in combination with the high-precision map, thereby improving the accuracy of the final determined position and posture of the camera device.
[0095] Optionally, step 3041 in the above embodiment may include:
[0096] A deep neural network is used to perform a segmentation operation on the road surface image to determine pixel coordinates corresponding to at least one lane line and at least one road surface mark included in the road surface image.
[0097] Optionally, the category of each pixel point in the road surface image can be determined based on a deep neural network, and the pixel coordinates corresponding to at least one lane line can be determined based on all pixel points classified as lane lines; the pixel coordinates corresponding to at least one road surface sign can be determined based on all pixel points classified as road surface signs.
[0098] A straight line fitting is performed on the pixel coordinates corresponding to each lane line in at least one lane line to obtain a straight line equation corresponding to each lane line.
[0099] Among them, straight line fitting is to determine the discrete pixel points of the lane line as the category, and determine a straight line so that the sum of the squares of the distances from all pixel points to this straight line is minimized. Then this straight line is the fitting straight line of the lane line, and the straight line equation of each lane line in the road surface image can be obtained.
[0100] Based on the pixel coordinates corresponding to each road surface marker of the at least one road surface marker, the coordinates corresponding to each road surface marker are determined.
[0101] Optionally, when each road surface mark corresponds to multiple pixel points, the average value of the pixel coordinates corresponding to these pixel points is used as the midpoint of the road surface mark, and the midpoint is used as the coordinate corresponding to the road surface mark.
[0102] Based on the straight line equation corresponding to each lane line and the coordinates corresponding to each road surface mark, a relative positional relationship between at least one lane line and at least one road surface mark in the road surface image is determined.
[0103] Optionally, based on the coordinates corresponding to each road surface marking and the straight line equation corresponding to each lane line obtained above, the relative position relationship between at least one lane line and at least one road surface marking in the road surface image can be determined, for example, between which two lane lines a road surface marking is located.
[0104] Based on the straight line equation of the lane line, the coordinates of the road surface marking and the relative position relationship between the lane line and the road surface marking, the second road information in the road surface image is determined.
[0105] The second road information obtained in this embodiment includes the straight line equation of the lane line, the coordinates of the road surface markings and the relative position relationship between the lane line and the road surface markings. The category of each pixel point is determined by a deep neural network, and the second road information is determined based on the coordinates of the pixel points of the determined category, thereby realizing fully automatic determination of road information, improving the accuracy of road information, and being more efficient and quick.
[0106] like Figure 6 As shown in the above Figure 3 Based on the illustrated embodiment, step 305 may include the following steps:
[0107] Step 3051: Project multiple sets of first road information into a road surface image to obtain multiple sets of third road information in the road surface image.
[0108] Optionally, the projection of the first road information may refer to Figure 1 As shown in step 104 in the provided embodiment, the third road information is obtained through two coordinate conversions.
[0109] Step 3052: Match multiple sets of third road information with the second road information to obtain multiple reprojection errors.
[0110] Wherein, each reprojection error corresponds to a third road information.
[0111] In this embodiment, the reprojection error can be calculated by referring to Figure 1 In step 105 of the embodiment provided, at least one matching relationship corresponding to each set of third road information is calculated to obtain at least one reprojection error corresponding to each set of third road information, for example, Figure 2a and Figure 2b Based on two matching relationships of a set of third road information, two reprojection errors can be calculated.
[0112] Step 3053, determining the target pose information of the camera device based on each of the multiple reprojection errors.
[0113] This embodiment uses a multi-hypothesis matching algorithm to determine at least one matching relationship in which each group of third road information may match the second road information, and calculates the distance between the same lane lines (which lane lines in the two road information are the same are determined based on the relative position relationship) and the distance between the same road surface markings in each matching relationship, and takes the sum of all distances as the reprojection error; this embodiment determines the target posture information based on the reprojection error, and avoids the problem of missing the target posture information because it uses multiple related posture information to determine the reprojection error separately. Moreover, since the differences between multiple related posture information are small, the target posture information is determined based on the reprojection error corresponding to each related posture information, which avoids the problem of missing a better result due to the large difference between two related posture information, thereby improving the accuracy of the obtained target posture information.
[0114] like Figure 7 As shown in the above Figure 6 Based on the illustrated embodiment, step 3053 may include the following steps:
[0115] Step 701: Based on each reprojection error among a plurality of reprojection errors, relevant posture information corresponding to the reprojection error is adjusted to obtain updated posture information.
[0116] Among them, the reprojection error determined based on the updated pose information is the smallest.
[0117] Optionally, refer to Figure 1 As shown in step 106 of the provided embodiment, multiple sets of updated posture information are obtained by minimizing the reprojection error; specifically, with the goal of minimizing the reprojection error, an updated posture is obtained by nonlinear optimization so that the reprojection error obtained based on the new posture is minimized, wherein the optimization variable of the nonlinear optimization is the posture of the camera device.
[0118] Step 702: determine the updated pose information with the smallest reprojection error from multiple updated pose information.
[0119] Optionally, multiple updated pose information may be sorted according to corresponding reprojection errors (for example, sorted from small to large or from large to small according to the reprojection errors), and the updated pose information with the smallest reprojection error may be obtained based on the sorted sequence.
[0120] Step 703: Determine the target pose information of the camera device based on the updated pose information with the smallest reprojection error.
[0121] Optionally, step 703 may include the following steps:
[0122] Determine whether the reprojection error corresponding to the updated pose information with the smallest reprojection error is less than or equal to a preset threshold.
[0123] Optionally, the size of the preset threshold can be set according to actual application scenarios, for example, 10 pixels.
[0124] In response to a reprojection error corresponding to the updated pose information with the smallest reprojection error being less than or equal to a preset threshold, target pose information is determined based on the updated pose information with the smallest reprojection error.
[0125] When the reprojection error is less than or equal to the preset threshold, it can be considered that the road image is collected by the camera device under the updated pose information with the smallest reprojection error, that is, the updated pose information with the smallest reprojection error can be used as the target pose information of the camera device.
[0126] In response to the reprojection error corresponding to the updated posture information with the smallest reprojection error being greater than a preset threshold, the set range is expanded, the relevant posture set is regained, and multiple groups of fourth road information in the road surface image are obtained; new updated posture information is determined based on the multiple groups of fourth road information, and the target posture information is determined based on the new updated posture information.
[0127] In this embodiment, a threshold is set to determine whether the updated pose information with the smallest reprojection error can replace the initial pose information. The specific judgment process can be referred to Figure 1 As shown in step 107 of the provided embodiment, if the judgment is not satisfied, return to re-search the relevant posture information to obtain more relevant posture information, so as to obtain a new updated posture information with the minimum reprojection error less than or equal to the set threshold. This embodiment solves the problem of expanding the scope to obtain more accurate posture information when the target posture information cannot be obtained in one search.
[0128] This embodiment uses a high-precision map and the perception of the camera device itself to realize automatic calibration of the position and posture of the camera device, thereby realizing high-precision determination of the position and posture of the camera device.
[0129] In the above Figure 6 Based on the illustrated embodiment, step 3042 may include the following steps:
[0130] The plurality of sets of third road information are screened based on the relative position relationship between the lane lines and the road surface markings in the second road information to obtain the screened plurality of sets of third road information.
[0131] When determining the matching relationship between each group of third road information and the second road information, the matching can be performed first based on the relative position relationship. When the relative position relationship does not match, it means that the third road information and the second road information cannot be matched, that is, the relative posture information corresponding to the third road information cannot be collected no matter how it is adjusted. The present embodiment improves processing efficiency by first using the relative position relationship to screen the third road information.
[0132] For each set of the filtered plurality of sets of third road information, at least one matching relationship corresponding to the third road information is determined.
[0133] Each set of third road information may have at least one matching relationship with the second road information, for example, Figure 2a and Figure 2b Shown are two matching relationships between a set of third road information and second road information.
[0134] Based on each matching relationship in at least one matching relationship, a first error between the road surface mark coordinates in the third road information and the road surface mark coordinates in the second road information is determined, and a second error between the straight line equation of the lane line in the third road information and the straight line equation of the lane line in the second road information is determined.
[0135] Optionally, the distance between the road surface mark coordinates in the third road information and the road surface mark coordinates in the second road information may be calculated as the first error, and the second error may be determined based on the distance between every two corresponding straight line equations in the matching relationship.
[0136] Based on the first error and the second error, a reprojection error corresponding to a matching relationship in the third road information is determined.
[0137] Optionally, the reprojection error corresponding to the matching relationship may be obtained based on the sum of all first errors and all second errors, or by performing weighted summation on all first errors and all second errors according to importance.
[0138] This embodiment uses at least one matching relationship corresponding to each group of third road information to respectively calculate the reprojection error, thereby avoiding the problem that the correct road information is misjudged due to matching errors, resulting in the camera device being unable to obtain accurate posture information, and reduces the amount of calculation by matching based on relative position relationships, thereby improving processing efficiency.
[0139] Any method for determining the position and posture of a camera device provided in the embodiments of the present disclosure may be performed by any appropriate device with data processing capabilities, including but not limited to: a terminal device and a server, etc. Alternatively, any method for determining the position and posture of a camera device provided in the embodiments of the present disclosure may be performed by a processor, such as the processor executing any method for determining the position and posture of a camera device mentioned in the embodiments of the present disclosure by calling corresponding instructions stored in a memory. This will not be described in detail below.
[0140] Exemplary Devices
[0141] Figure 8FIG. 1 is a schematic diagram of a structure of an apparatus for determining the position and posture of a camera device provided by an exemplary embodiment of the present disclosure. Figure 8 As shown, the device provided in this embodiment includes:
[0142] The image acquisition module 81 is used to acquire road surface images using a camera device.
[0143] The initial posture determination module 82 is used to obtain the initial posture information of the camera device.
[0144] The related posture determination module 83 is used to determine a related posture set based on the initial posture information determined by the initial posture determination module 82.
[0145] Among them, the related posture set includes multiple related posture information.
[0146] The relevant road acquisition module 84 is used to determine multiple groups of first road information in the high-precision map based on each relevant posture information in the multiple relevant posture information determined by the relevant posture determination module 83.
[0147] The target posture determination module 85 is used to determine the target posture information of the camera device based on the multiple groups of first road information determined by the relevant road acquisition module 84 and the road surface image obtained by the image acquisition module 81.
[0148] The above-mentioned embodiment of the present disclosure provides a device for determining the posture of a camera device. A plurality of first road information are obtained from a high-precision map through a related posture set, and the target posture information is obtained by projecting the first road information onto a road surface image collected by the camera device. Since the high-precision map records road information with higher precision, more accurate first road information can be obtained based on the high-precision map, thereby greatly improving the accuracy of the posture information of the camera device.
[0149] Fig. 9 FIG. 1 is a schematic diagram of a structure of an apparatus for determining the position and posture of a camera device provided by another exemplary embodiment of the present disclosure. Fig. 9 As shown, the device provided in this embodiment includes:
[0150] The relevant posture determination module 83 includes:
[0151] The first search unit 831 is used to search the three coordinate axis directions in the world coordinate system within a set range and at a first set interval with the initial pose information as the center to obtain a first pose set.
[0152] The second search unit 832 is used to search for the yaw angle in the local three-dimensional coordinate system where the camera device is located at a second set interval within a set angle, with the initial pose information and each pose information in the first pose set as the center, to obtain a related pose set.
[0153] The relevant road acquisition module 84 includes:
[0154] The image segmentation unit 841 is used to perform a segmentation operation on the road surface image to obtain second road information in the road surface image.
[0155] The bounding box determination unit 842 is used to determine a corresponding bounding box based on each relevant pose information in the multiple relevant pose information to obtain multiple bounding boxes.
[0156] The area search unit 843 is used to perform an area search based on multiple bounding boxes in the high-precision map to obtain multiple groups of first road information corresponding to the multiple bounding boxes in the high-precision map, wherein each bounding box corresponds to a group of first road information.
[0157] The image segmentation unit 841 is specifically used to perform a segmentation operation on the road surface image using a deep neural network to determine the pixel coordinates corresponding to at least one lane line and at least one road surface mark included in the road surface image; perform straight line fitting on the pixel coordinates corresponding to each lane line in the at least one lane line to obtain the straight line equation corresponding to each lane line; based on the pixel coordinates corresponding to each road surface mark in the at least one road surface mark, determine the coordinates corresponding to each road surface mark; based on the straight line equation corresponding to each lane line and the coordinates corresponding to each road surface mark, determine the relative position relationship between at least one lane line and at least one road surface mark in the road surface image; based on the straight line equation of the lane line, the road surface mark coordinates and the relative position relationship between the lane line and the road surface mark, determine the second road information in the road surface image.
[0158] The posture optimization module 85 includes:
[0159] The information projection unit 851 is used to project multiple sets of first road information into the road surface image to obtain multiple sets of third road information in the road surface image.
[0160] The error determination unit 852 is used to match multiple sets of third road information with the second road information to obtain multiple reprojection errors; wherein each set of third road information corresponds to at least one reprojection error.
[0161] The posture adjustment module 853 is used to determine the target posture information of the camera device based on each reprojection error of the multiple reprojection errors.
[0162] The posture adjustment module 853 is specifically used to adjust the relevant posture information corresponding to each reprojection error in multiple reprojection errors to obtain updated posture information; wherein the reprojection error determined based on the updated posture information is the minimum; the updated posture information with the minimum reprojection error is determined from multiple updated posture information; and the target posture information of the camera device is determined based on the updated posture information with the minimum reprojection error.
[0163] Optionally, when the posture adjustment module 853 determines the target posture information of the camera device for the initial posture information based on the updated posture information with the smallest reprojection error, it is specifically used to determine whether the reprojection error corresponding to the updated posture information with the smallest reprojection error is less than or equal to a preset threshold; in response to the reprojection error corresponding to the updated posture information with the smallest reprojection error being less than or equal to the preset threshold, the target posture information is determined based on the updated posture information with the smallest reprojection error; in response to the reprojection error corresponding to the updated posture information with the smallest reprojection error being greater than the preset threshold, the set range is expanded, the relevant posture set is re-obtained, and multiple groups of fourth road information in the road surface image are obtained; new updated posture information is determined based on the multiple groups of fourth road information, and the target posture information is determined based on the new updated posture information.
[0164] The error determination unit 852 is specifically used to filter multiple groups of third road information based on the relative position relationship between the lane line and the road surface marking in the second road information to obtain multiple groups of filtered third road information; for each group of third road information in the filtered multiple groups of third road information, determine at least one matching relationship corresponding to the third road information; based on each matching relationship in the at least one matching relationship, determine a first error between the road surface marking coordinates in the third road information and the road surface marking coordinates in the second road information, and determine a second error between the straight line equation of the lane line in the third road information and the straight line equation of the lane line in the second road information; based on the first error and the second error, determine a reprojection error corresponding to a matching relationship in the third road information.
[0165] Exemplary Electronic Devices
[0166] Below, reference Fig.10 The electronic device according to the embodiment of the present disclosure is described. The electronic device may be any one or both of the first device 100 and the second device 200, or a stand-alone device independent of them, and the stand-alone device may communicate with the first device and the second device to receive the collected input signals from them.
[0167] Fig.10 A block diagram of an electronic device according to an embodiment of the present disclosure is illustrated.
[0168] like Fig.10 As shown, the electronic device 10 includes one or more processors 11 and a memory 12 .
[0169] The processor 11 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
[0170] The memory 12 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 11 may run the program instructions to implement the method for determining the posture of the camera device and / or other desired functions of the various embodiments of the present disclosure described above. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0171] In one example, the electronic device 10 may further include: an input device 13 and an output device 14, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0172] For example, when the electronic device is the first device 100 or the second device 200, the input device 13 may be the microphone or microphone array described above, for capturing input signals from a sound source. When the electronic device is a stand-alone device, the input device 13 may be a communication network connector, for receiving collected input signals from the first device 100 and the second device 200.
[0173] In addition, the input device 13 may also include, for example, a keyboard, a mouse, and the like.
[0174] The output device 14 can output various information to the outside, including determined distance information, direction information, etc. The output device 14 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0175] Of course, to simplify, Fig.10 Only some of the components related to the present disclosure in the electronic device 10 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 10 may also include any other appropriate components.
[0176] Exemplary computer program products and computer-readable storage media
[0177] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the method for determining the posture of a camera device according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.
[0178] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0179] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enables the processor to execute the steps of the method for determining the posture of a camera device according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0180] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0181] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0182] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0183] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0184] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0185] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0186] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0187] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for determining the position and posture of a camera device, comprising: Using camera equipment to collect road surface images; Obtaining initial position information of the camera device; Determine a related posture set based on the initial posture information; wherein the related posture set includes a plurality of related posture information; Based on each of the plurality of relevant posture information, determining a plurality of sets of first road information in the high-precision map, comprising: obtaining a corresponding bounding box from the high-precision map with each of the relevant posture information, and obtaining first road information in the high-precision map within the bounding box; Based on the multiple groups of first road information and the road surface image, the target posture information of the camera device is determined, including: projecting each group of the first road information onto the road surface image, and adjusting the relevant posture information corresponding to each group of the first road information based on the road information on the road surface image to obtain the target posture information of the camera device.
2. The method according to claim 1, wherein: The determining of a related posture set based on the initial posture information comprises: Taking the initial pose information as the center, searching the three coordinate axis directions in the world coordinate system within a set range at a first set interval to obtain a first pose set; Taking the initial posture information and each posture information in the first posture set as the center, the yaw angle in the local three-dimensional coordinate system where the camera device is located is searched within a set angle at a second set interval to obtain the related posture set.
3. The method according to claim 1 or 2, wherein: The obtaining of multiple sets of first road information in the high-precision map based on each relevant position information in the multiple relevant position information includes: Performing a segmentation operation on the road surface image to obtain second road information in the road surface image; Determine a corresponding bounding box based on each relevant pose information in the plurality of relevant pose information to obtain a plurality of bounding boxes; An area search is performed in the high-precision map based on the multiple bounding boxes to obtain multiple groups of first road information corresponding to the multiple bounding boxes in the high-precision map, wherein each of the bounding boxes corresponds to a group of first road information.
4. The method according to claim 3, wherein: The performing a segmentation operation on the road surface image to obtain second road information in the road surface image includes: Performing a segmentation operation on the road surface image using a deep neural network to determine pixel coordinates corresponding to at least one lane line and at least one road surface mark included in the road surface image; Performing straight line fitting on the pixel coordinates corresponding to each lane line of the at least one lane line to obtain a straight line equation corresponding to each lane line; Determining coordinates corresponding to each of the pavement markings based on pixel coordinates corresponding to each of the pavement markings in the at least one pavement marking; Determining a relative positional relationship between the at least one lane line and the at least one road surface mark in the road surface image based on a straight line equation corresponding to each lane line and a coordinate corresponding to each road surface mark; Based on the straight line equation of the lane line, the coordinates of the road surface marking and the relative position relationship between the lane line and the road surface marking, second road information in the road surface image is determined.
5. The method according to claim 3, wherein: The determining, based on the multiple sets of first road information and the road surface image, target position information of the camera device includes: Projecting the multiple sets of first road information into the road surface image to obtain multiple sets of third road information in the road surface image; Matching the multiple sets of third road information with the second road information to obtain multiple reprojection errors; wherein each set of the third road information corresponds to at least one reprojection error; Based on each of the plurality of reprojection errors, target pose information of the imaging device is determined.
6. The method according to claim 5, wherein: The step of determining target pose information of the camera device based on each of the plurality of reprojection errors comprises: Based on each of the multiple reprojection errors, the relevant posture information corresponding to the reprojection error is adjusted to obtain updated posture information; wherein the reprojection error determined based on the updated posture information is the smallest; Determining the updated pose information with the smallest reprojection error from the multiple updated pose information; The target pose information of the camera device is determined based on the updated pose information with the smallest reprojection error.
7. The method according to claim 5, wherein: The matching the multiple sets of third road information with the second road information to obtain multiple reprojection errors includes: Filtering the plurality of sets of third road information based on the relative position relationship between the lane lines and the road surface markings in the second road information to obtain the filtered plurality of sets of third road information; For each set of the filtered plurality of sets of third road information, determining at least one matching relationship corresponding to the third road information; Based on each matching relationship in the at least one matching relationship, determining a first error between the coordinates of a road surface mark in the third road information and the coordinates of a road surface mark in the second road information, and determining a second error between a straight line equation of a lane line in the third road information and a straight line equation of a lane line in the second road information; Based on the first error and the second error, a reprojection error corresponding to a matching relationship in the third road information is determined.
8. A device for determining the position and posture of a camera device, comprising: An image acquisition module, used to acquire road surface images using a camera device; An initial posture determination module, used to obtain initial posture information of the camera device; A related posture determination module, used to determine a related posture set based on the initial posture information determined by the initial posture determination module; wherein the related posture set includes a plurality of related posture information; A related road acquisition module, used to determine multiple sets of first road information in the high-precision map based on each of the multiple related posture information determined by the related posture determination module; the related road acquisition module is specifically used to obtain a corresponding bounding box from the high-precision map with each of the related posture information, and obtain the first road information in the high-precision map within the bounding box; A target posture determination module is used to determine the target posture information of the camera device based on multiple groups of first road information determined by the relevant road acquisition module and the road surface image obtained by the image acquisition module; the target posture determination module is specifically used to project each group of the first road information onto the road surface image, and adjust the relevant posture information corresponding to each group of the first road information based on the road information on the road surface image to obtain the target posture information of the camera device.
9. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the method for determining the position and posture of a camera device as described in any one of claims 1 to 7.
10. An electronic device, comprising: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method for determining the posture of the camera device as described in any one of claims 1-7.
