Monocular camera acquisition method and device for high-precision images
By calculating the coordinates and distance differences of the road coordinate system of pixels in the image, determining the target image acquisition area, and calibrating the image, the problem of uneven image pixel accuracy in unmanned vehicles is solved, and the acquisition efficiency of high-precision images is improved and accuracy.
Patent Information
- Application Number
- CN202111675069.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2041-12-31
AI Technical Summary
In autonomous vehicles, uneven image pixel accuracy results in insufficient accuracy of road elements in the image, making it difficult to use for high-precision map acquisition and autonomous driving.
By obtaining the road coordinate system coordinates of pixels in the image, calculating the distance difference between pixels, setting the target accuracy range, determining the target image acquisition area, and calibrating the image based on this area to obtain a high-precision image.
It improves the efficiency and accuracy of acquiring high-precision images, directly obtains the high-precision parts of the image without further processing, and enhances the accuracy of the image acquisition frame.
Smart Images

Figure CN114332130B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of high-precision image acquisition, and in particular to a method and device for acquiring high-precision images with a monocular camera. Background Art
[0002] In the related technology, when an unmanned vehicle is driving, it is necessary to detect road elements such as lane lines and traffic signs on the road. After detecting the road elements, a map is constructed based on the detection results to determine the vehicle's driving route and ensure its driving safety. Specifically, a front camera can be installed on the vehicle to collect images.
[0003] Since the pixel accuracy of the image is not evenly distributed, road elements may appear in locations with insufficient accuracy in the image. However, high-precision map production requires continuous image acquisition, so the same road element will appear in different images. For example, the pixels farther away from the vehicle are generally located in the middle of the image, but the accuracy is very poor. The distance corresponding to one pixel may be tens of meters, which cannot be used for high-precision map acquisition or autonomous driving. Therefore, for selecting high-precision images of road elements, it is necessary to know how to select high-precision areas of the image.
[0004] Therefore, a high-precision image acquisition method is needed in the prior art to quickly calibrate the high-precision image area of the image.
[0005] Application Contents
[0006] In order to solve or partially solve the problems existing in the related art, the present application provides a method and device for acquiring high-precision images with a monocular camera, which can quickly calibrate the high-precision image area of the image.
[0007] The first aspect of the present application provides a method for acquiring high-precision images using a monocular camera, comprising:
[0008] Obtain the road coordinate system coordinates of pixels in the image, and obtain the pixel distance difference between adjacent pixels based on the road coordinate system of the pixels;
[0009] Set the target accuracy range, and obtain the target image acquisition area based on the target accuracy range and pixel distance difference;
[0010] The image is calibrated based on the target image acquisition area to obtain a high-precision image corresponding to the image.
[0011] Optionally, obtaining the road coordinate system coordinates in the image pixels includes:
[0012] Constructing a two-dimensional coordinate system of the image, and obtaining pixel coordinates of pixels based on the two-dimensional coordinate system of the image;
[0013] Get the monocular camera parameters, and based on the monocular camera parameters and pixel coordinates, get the road coordinate system coordinates of the pixels.
[0014] Optionally, the pixel distance difference includes a first pixel distance difference and a second pixel distance difference, and obtaining the pixel distance difference of adjacent pixels based on the road coordinate system of the pixels includes:
[0015] According to the coordinates of the road coordinate system, a first pixel distance difference between adjacent pixels is obtained in the horizontal direction;
[0016] According to the coordinates of the road coordinate system, a second pixel distance difference between adjacent pixels is obtained in the vertical direction.
[0017] Optionally, obtaining a first pixel distance difference between adjacent pixels in a horizontal direction according to the road coordinate system coordinates includes:
[0018] In the horizontal direction, a first pixel distance difference is determined according to an average value of a pixel distance difference between a pixel and a previous pixel and a pixel distance difference between a pixel and a next pixel.
[0019] Optionally, obtaining a second pixel distance difference between adjacent pixels in a vertical direction according to the road coordinate system coordinates includes:
[0020] In the vertical direction, a second pixel distance difference is determined according to an average value of a pixel distance difference between a pixel and a previous pixel and a pixel distance difference between a pixel and a next pixel.
[0021] Optionally, the target accuracy range includes a first target accuracy range and a second target accuracy range, and the target image acquisition area is obtained according to the target accuracy range and the pixel distance difference, including:
[0022] Obtain a first target accuracy range, and obtain a first target image acquisition area according to the first target accuracy range and the first pixel distance difference;
[0023] Acquire a second target accuracy range, and acquire a second target image acquisition area according to the second target accuracy range and the second pixel accuracy difference;
[0024] The first target image acquisition area and the second target image acquisition area are merged to obtain a target image acquisition area.
[0025] Optionally, the first target image acquisition area and the second target image acquisition area are merged to obtain the target image acquisition area, including:
[0026] Acquire an overlapping area of the first target image acquisition area and the second target image acquisition area;
[0027] Based on the overlapping area, the target image acquisition area is obtained.
[0028] The second aspect of the present application provides a high-precision image acquisition device with a monocular camera, comprising:
[0029] A first processing unit is used to obtain the road coordinate system coordinates of pixels in the image, and obtain the pixel distance difference between adjacent pixels based on the road coordinate system of the pixels;
[0030] The second processing unit is used to set the target accuracy range and obtain the target image acquisition area according to the target accuracy range and the pixel distance difference;
[0031] The acquisition unit is used to calibrate the image based on the target image acquisition area to obtain a high-precision image corresponding to the image.
[0032] A third aspect of the present application provides an electronic device, including:
[0033] Processor; and
[0034] The memory stores executable codes, and when the executable codes are executed by the processor, the processor executes the above method.
[0035] A fourth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor executes the above method.
[0036] The technical solution provided by the present application may include the following beneficial effects: obtaining the pixel distance difference between pixels through the road coordinate system coordinates of each pixel in the image, and obtaining the target image acquisition area based on the target accuracy range and the pixel distance difference; calibrating the high-precision image area in the image according to the target image acquisition area. The present application calibrates the image through the target image acquisition area, and can directly obtain the part of the image with high image accuracy without further processing the image, thereby improving the efficiency of obtaining high-precision images.
[0037] The technical solution of the present application can also: convert the pixel coordinates of the image into the coordinates of the road coordinate system through the inherent parameters of the camera, thereby converting the two-dimensional distance between pixels into the three-dimensional distance in the three-dimensional space. The pixel distance difference value obtained based on the three-dimensional space can more accurately represent the image accuracy, thereby further improving the accuracy of obtaining the image acquisition frame.
[0038] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.
[0040] Figure 1 It is a flow chart of a method for acquiring high-precision images with a monocular camera shown in an embodiment of the present application;
[0041] Figure 2 It is another flow chart of the method for acquiring high-precision images using a monocular camera shown in an embodiment of the present application;
[0042] Figure 3 is a schematic diagram of a first target image acquisition area shown in an embodiment of the present application;
[0043] Figure 4 is a schematic diagram of a second target image acquisition area shown in an embodiment of the present application;
[0044] Figure 5 is the target image acquisition area shown in the embodiment of the present application;
[0045] Figure 6 It is a structural schematic diagram of a monocular camera acquisition device for high-precision images shown in an embodiment of the present application;
[0046] Figure 7 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[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 accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described 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 this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0049] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this 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 this 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 as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0050] In the related technology, when an unmanned vehicle is driving, it is necessary to detect road elements such as lane lines and traffic signs on the road, so that a map can be constructed based on the detection results to determine the driving route and ensure its driving safety. Specifically, a front camera can be installed on the vehicle to collect images through the front camera.
[0051] Since the pixel accuracy of the image is not evenly distributed, road elements may appear in the position of the image with insufficient accuracy. However, when making high-precision maps, images need to be collected continuously, so the same road element will appear in different pictures. To select high-precision images for road elements, it is necessary to know the accuracy of different positions in the picture. For example, the pixels farther away from the vehicle are generally located in the middle of the picture, but the pixel accuracy is very poor, and the distance corresponding to one pixel may be tens of meters. Such pictures with poor pixel accuracy cannot be used for high-precision map collection or autonomous driving.
[0052] Therefore, a high-precision image acquisition method is needed in the prior art to quickly calibrate the high-precision image area of the image.
[0053] In order to solve the above problems, an embodiment of the present application provides a method for acquiring high-precision images, which can quickly calibrate the high-precision image area of the image.
[0054] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0055] Figure 1 It is a flow chart of a method for acquiring high-precision images with a monocular camera shown in an embodiment of the present application.
[0056] See also Figure 1 , methods include:
[0057] S101, obtaining road coordinate system coordinates of pixels in at least one image, and obtaining pixel distance differences between adjacent pixels based on the road coordinate system coordinates of the pixels.
[0058] During the driving process of the vehicle, the monocular camera is used to capture the driving conditions of the autonomous driving vehicle. The image in step S101 may be a real-time image captured by the monocular camera, or an image data set captured by the monocular camera in the current time period.
[0059] The road coordinate system in step S101 refers to the road central axis as the y-axis, the horizontal line perpendicular to the central axis on the road plane as the x-axis, and the vertical line through the origin and perpendicular to the road plane as the Z-axis. In step S101, by obtaining the road coordinate system coordinates of the pixels, the three-dimensional distance difference between the pixels can be obtained, and then the pixel distance difference between adjacent pixels can be obtained.
[0060] In one embodiment, the present application also needs to obtain the camera coordinate system and the image two-dimensional coordinate system corresponding to the camera. The camera coordinate system refers to the camera as the center, the forward ray of the camera optical center as the Z axis, the direction directly below the camera as the Y axis, and the right hand direction of the camera as the Z axis. The image two-dimensional coordinate system is the pixel coordinate. The present application converts the image two-dimensional coordinate into the road coordinate through the relationship between the camera coordinate system, the road coordinate system and the image two-dimensional coordinate system, so as to more accurately describe the correspondence between the pixel and the actual distance.
[0061] See also Figure 2 , step S101, obtaining the road coordinate system coordinates in the image pixels, including:
[0062] S201, constructing a two-dimensional coordinate system corresponding to the image, and obtaining pixel coordinates of pixels in the image based on the two-dimensional coordinate system.
[0063] The two-dimensional coordinate system in step S201 is a pixel coordinate system of the image. For example, in the two-dimensional coordinate system, in the coordinates (u, v) of a pixel, u is the number of rows of the recorded pixel, and v is the number of columns of the recorded pixel.
[0064] S202: Obtain monocular camera parameters, and obtain the road coordinate system coordinates of the pixels based on the monocular camera parameters and the pixel coordinates.
[0065] Specifically, the monocular camera parameters include monocular camera intrinsic parameters and monocular camera extrinsic parameters. The intrinsic parameters relate to the memory characteristics of the camera, which are provided by the manufacturer or calibrated. The camera extrinsic parameters relate to the position and posture of the camera in the physical space, mainly including factors such as the rotation angle and the installation height. The present application can obtain the camera's extrinsic parameters through the conversion relationship between the pixel coordinate system and the road coordinate system. In the present application, the camera's intrinsic and extrinsic parameters are represented by matrices. Obtaining the monocular camera parameters includes: constructing a transformation matrix between the pixel coordinate system and the road coordinate system, and obtaining the camera's parameter matrix based on the transformation matrix. The camera's intrinsic and extrinsic parameters can be obtained based on the camera's parameter matrix. Among them, the camera's extrinsic parameters include the conversion matrix (CamRRoad) from the camera coordinate system to the road coordinate system, and the camera height h. The camera's intrinsic parameter matrix K is used to represent the conversion matrix between the imaging coordinates and the real coordinates.
[0066] Specifically, the formula for constructing the relationship between the two-dimensional coordinate system and the road coordinate system is (1), including:
[0067] (1)
[0068] Among them, in the road coordinate system, the relationship between the y coordinate of the road coordinate system and the camera height h is Py=h.
[0069] In this embodiment, using formula (1), since K is the known intrinsic parameter matrix of the camera, (u, v) is the pixel coordinate, and (x, y, z) is the coordinate of the camera coordinate system, the unknowns can be obtained according to the correspondence between the camera coordinate system and the road coordinate system. In formula (1), the unknowns are only Px, Pz and d, a total of 3 equations. By solving the above 3 unknowns, the coordinates of point P in the road coordinate system (Px, Py, Pz) are obtained.
[0070] According to formula (1), the three-dimensional coordinate system coordinates corresponding to each pixel in the image in the road coordinate system can be calculated. According to the three-dimensional coordinate system coordinates corresponding to the pixel, the pixel distance difference corresponding to the pixel in the road coordinate system can be obtained.
[0071] Specifically, the pixel distance difference includes a first pixel distance difference and a second pixel distance difference, and the pixel distance difference of adjacent pixels is obtained based on the road coordinate system of the pixels, including: obtaining the first pixel distance difference between adjacent pixels in the horizontal direction according to the road coordinate system coordinates; obtaining the second pixel distance difference between adjacent pixels in the vertical direction according to the road coordinate system coordinates.
[0072] The first pixel distance difference is the distance difference between adjacent pixels in the same row of the pixel, and the second pixel distance difference is the distance difference between adjacent pixels in the same column of the pixel.
[0073] In one embodiment, P[u, v] represents the coordinate position represented by the pixel with the pixel coordinates [u, v], and the pixel distance in the horizontal direction includes and , the pixel distance in the vertical direction includes and The distances between P[u,v] and its adjacent coordinates are: =P[u,v]-P[u-1,v]; =P[u,v]-P[u+1,v]; =P[u,v]-P[u,v-1]; =P[u,v]-P[u,v+1].
[0074] In one embodiment, obtaining a first pixel distance difference between adjacent pixels in the horizontal direction according to the road coordinate system coordinates includes: determining the first pixel distance difference in the horizontal direction according to a pixel distance difference between a pixel and a previous pixel and a pixel distance difference between a pixel and a next pixel.
[0075] Specifically, the first pixel distance difference is determined according to the average of the pixel distance difference between the pixel and the previous pixel and the pixel distance difference between the pixel and the next pixel. DL represents the first pixel distance difference of the pixel, and Represents the distance difference between a pixel and its adjacent pixels, DL = ( + )*0.5, that is, when the pixel coordinate changes by 1, the distance changes by 1. DL describes the specific accuracy of the pixel position in the horizontal direction by the average value of the horizontal distances of adjacent pixels.
[0076] In one embodiment, obtaining a second pixel distance difference between adjacent pixels in the vertical direction according to the road coordinate system coordinates includes: determining the second pixel distance difference in the vertical direction according to the pixel distance difference between the pixel and the previous pixel and the pixel distance difference between the pixel and the next pixel.
[0077] Specifically, the second pixel distance difference is determined according to the average value of the pixel distance difference between the pixel and the previous pixel and the pixel distance difference between the pixel and the next pixel. DC represents the second pixel distance difference of the pixel, and Represents the distance difference between a pixel and its adjacent pixels, DC = ( + ) * 0.5, these two can be used to describe the specific accuracy of the pixel position. That is, for every change of 1 in the pixel coordinate, the distance changes by 1. The specific accuracy of the pixel position in the vertical direction is described by the average value of the vertical distances of adjacent pixels.
[0078] In one embodiment, the first pixel distance difference is expressed according to the distance range, such as Figure 3 As shown, Figure 3 is a schematic diagram of the first target image acquisition area. Figure 3 In the figure, different intervals represent different accuracy ranges. Different intervals can be represented by different patterns or grayscales. The largest part is the invalid area, which generally includes areas such as the sky that have a weak correlation with map elements.
[0079] In one embodiment, the second pixel distance difference is expressed according to the distance difference range, such as Figure 4 As shown, Figure 4 is the second target image acquisition area, Figure 4 In the figure, different intervals represent different accuracy ranges. Different intervals can be represented by different patterns or grayscales. The largest part is the invalid area, which generally includes areas such as the sky that have a weak correlation with map elements.
[0080] S102, setting a target accuracy range, and obtaining a target image acquisition area according to the target accuracy range and the pixel distance difference.
[0081] In step S102 , the target accuracy range includes a first target accuracy range and a second target accuracy range, the first target accuracy range includes an accuracy range in the horizontal direction, and the second target accuracy range includes an accuracy range in the vertical direction.
[0082] In one embodiment, a target image acquisition area is obtained according to a target accuracy range and a pixel distance difference, including: obtaining a first target accuracy range, and obtaining a first target image acquisition area according to the first target accuracy range and a first pixel distance difference; obtaining a second target accuracy range, and obtaining a second target image acquisition area according to the second target accuracy range and a second pixel accuracy difference; and fusing the first target image acquisition area and the second target image acquisition area to obtain a target image acquisition area.
[0083] Specifically, the first target image acquisition area and the second target image acquisition area are merged to obtain the target image acquisition area, including: obtaining an overlapping area of the first target image acquisition area and the second target image acquisition area; and obtaining the target image acquisition area based on the overlapping area.
[0084] like Figure 5 As shown, Figure 5The figure is a schematic diagram of an embodiment of the target image acquisition area. Specifically, the first target accuracy range is set to 3 cm (i.e., 3 cm accuracy is used in the front), and the second target accuracy range is set to 6 cm (i.e., 6 cm accuracy is used in the side and front). Only the target image acquisition area generated within this range is used to acquire images, so that the accuracy control of 3 cm in the front and 6 cm in the side and front can be achieved.
[0085] In one embodiment, the first target image acquisition area and the second target image acquisition area are fused to obtain the target image acquisition area, including: obtaining the overlapping area of the first target image acquisition area and the second target image acquisition area; and obtaining the target image acquisition area based on the overlapping area.
[0086] In one embodiment, the first target image acquisition area and the second target image acquisition area are fused to obtain the target image acquisition area, including: obtaining the overlapping portion of the first target image acquisition area and the second target image acquisition area, selecting the overlapping portion includes selecting the minimum value of the first pixel distance difference and the second pixel distance difference as the pixel distance difference corresponding to the pixel, and obtaining the target image acquisition area according to the pixel distance difference and the target accuracy range.
[0087] S103: Calibrate the current image based on the target image acquisition area to obtain a high-precision image area corresponding to the current image.
[0088] The target image acquisition area in step S103 may be an image acquisition frame, which is used for the monocular camera to acquire high-precision map elements. Taking lane lines as an example, the monocular camera only acquires lane lines within the target image acquisition area.
[0089] In one embodiment, the step of acquiring the image acquisition frame includes: acquiring edge pixels of the target image acquisition area, and acquiring the image acquisition frame according to the edge pixels.
[0090] The present application obtains the pixel distance between pixels through the road coordinate system coordinates of each pixel in the image, obtains the target image acquisition area based on the target accuracy range and pixel distance, and calibrates the high-precision image area in the image according to the target image acquisition area. The present application calibrates the image through the target image acquisition area, and can directly obtain the high-precision part of the image without further processing the image, thereby improving the efficiency of obtaining high-precision images.
[0091] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a high-precision image monocular camera acquisition device, electronic equipment and corresponding embodiments.
[0092] Figure 6 It is a structural schematic diagram of a high-precision image acquisition device with a monocular camera shown in an embodiment of the present application.
[0093] See also Figure 6 The monocular camera acquisition device for high-precision images includes a first processing unit 601, a second processing unit 602, and an acquisition unit 603.
[0094] The first processing unit 601 is configured to obtain the road coordinate system coordinates of pixels in at least one image, and obtain pixel distance differences between adjacent pixels based on the road coordinate system coordinates of the pixels.
[0095] The road coordinate system refers to the road's central axis as the y-axis, the horizontal line perpendicular to the central axis on the road plane as the x-axis, and the vertical line through the origin and perpendicular to the road plane as the Z-axis. By obtaining the road coordinate system coordinates of the pixels, the three-dimensional distance between the pixels can be obtained, and then the pixel distance difference between adjacent pixels can be obtained.
[0096] The first processing unit 601 also includes a coordinate processing unit, which is used to construct a two-dimensional image coordinate system and obtain pixel coordinates of pixels based on the two-dimensional image coordinate system; obtain monocular camera parameters, and obtain road coordinate system coordinates of pixels based on the monocular camera parameters and pixel coordinates.
[0097] Among them, the two-dimensional coordinate system is the pixel coordinate of the image, and the pixel coordinate (u, v) records the number of rows and columns of the pixel through u and v. Specifically, the monocular camera parameters include the monocular camera intrinsic parameters and the monocular camera extrinsic parameters. Obtaining the monocular camera parameters includes: constructing a transformation matrix between the pixel coordinate system and the road coordinate system, and obtaining the camera parameter matrix according to the transformation matrix. The intrinsic and extrinsic parameters of the camera can be obtained according to the camera parameter matrix. Among them, the external parameters of the camera include the conversion matrix (CamRRoad) from the camera coordinate system to the road coordinate system, and the camera height h. The camera intrinsic parameter matrix K is used to represent the conversion matrix between the imaging coordinates and the real coordinates, which is related to the focal length of the camera.
[0098] Specifically, the formula for constructing the relationship between the two-dimensional coordinate system and the road coordinate system is (1), including:
[0099] (1)
[0100] Among them, in the road coordinate system, the relationship between the y coordinate of the road coordinate system and the camera height is Py=h. Then, using formula (1), since K is the known intrinsic parameter matrix of the camera, uv is the pixel coordinate, and (x, y, z) is the coordinate of the camera coordinate system, according to the correspondence between the camera coordinate system and the road coordinate system, Py=h. Therefore, in formula (1), the only unknowns are Px, Pz and d, a total of 3 equations, and the above 3 unknowns can be solved to obtain the coordinates of point P in the road coordinate system (Px, Py, Pz).
[0101] According to formula (1), the three-dimensional coordinates corresponding to all pixels on the image can be calculated, and the three-dimensional coordinate system coordinates corresponding to each pixel can be obtained. According to the three-dimensional coordinate system coordinates corresponding to the pixel, the pixel distance difference corresponding to the pixel in the road coordinate system can be obtained.
[0102] In one embodiment, P[u,v] represents the coordinate position represented by the pixel with pixel coordinates [u,v]. The pixel distances in the horizontal direction include D1 and D2, and the pixel distances in the vertical direction include D3 and D4. The distances between P[u,v] and its adjacent coordinates are: D1 = P[u,v]- P[u - 1,v]; D2 = P[u,v]- P[u + 1,v]; D3 = P[u,v]- P[u,v - 1]; D4 = P[u,v]- P[u,v + 1].
[0103] In one embodiment, obtaining a first pixel distance difference between adjacent pixels in the horizontal direction according to the road coordinate system coordinates includes: obtaining an average value of the pixel distance difference between a pixel and a previous pixel and a pixel distance difference between a pixel and a next pixel in the horizontal direction to obtain the first pixel distance difference.
[0104] Specifically, DL represents the first pixel distance difference, DL = (D1+D2)x0.5, that is, the distance changes by 1 when the pixel coordinate changes by 1. DL describes the specific accuracy of the pixel position in the horizontal direction by the average value of the horizontal distances of adjacent pixels.
[0105] In one embodiment, obtaining a second pixel distance difference between adjacent pixels in the vertical direction according to the road coordinate system coordinates includes: obtaining an average value of the pixel distance difference between a pixel and a previous pixel and the pixel distance difference between a pixel and a next pixel in the vertical direction to obtain the second pixel distance difference.
[0106] Specifically, DC represents the second pixel distance difference, DC = (D3 + D4) x 0.5, and these two can be used to describe the specific accuracy of the pixel position. That is, for every change of 1 in the pixel coordinate, the distance changes by 1. The specific accuracy of the pixel position in the vertical direction is described by the average value of the distances of adjacent pixels in the vertical direction.
[0107] In one embodiment, DL and DC are represented according to the distance range, such as Figure 3 ,4,Different color block intervals represent different accuracy ranges.
[0108] The second processing unit 602 is used to set a target accuracy range and determine a target image acquisition area according to the target accuracy range and the pixel distance difference.
[0109] The target accuracy range includes a first target accuracy range and a second target accuracy range. The first target accuracy range includes an accuracy range in a horizontal direction, and the second target accuracy range includes an accuracy range in a vertical direction.
[0110] In one embodiment, a target image acquisition area is obtained according to a target accuracy range and a pixel distance difference, including: obtaining a first target accuracy range, and obtaining a first target image acquisition area according to the first target accuracy range and a first pixel distance difference; obtaining a second target accuracy range, and obtaining a second target image acquisition area according to the second target accuracy range and a second pixel accuracy difference; and fusing the first target image acquisition area and the second target image acquisition area to obtain a target image acquisition area.
[0111] Specifically, the first target image acquisition area and the second target image acquisition area are merged to obtain the target image acquisition area, including: obtaining an overlapping area of the first target image acquisition area and the second target image acquisition area; and obtaining the target image acquisition area based on the overlapping area.
[0112] In one embodiment, for example, the first target accuracy range is set to 3 cm (i.e., 3 cm accuracy is used in the front) and the second target accuracy range is set to 6 cm (i.e., 6 cm accuracy is used in the side and front), then the shape is as follows: Figure 4 By only using the target image acquisition area generated within this range to acquire images, the precision control of 3 cm in front and 6 cm in the side and front can be achieved.
[0113] In one embodiment, the first target image acquisition area and the second target image acquisition area are fused to obtain the target image acquisition area, including: obtaining the overlapping area of the first target image acquisition area and the second target image acquisition area; and obtaining the target image acquisition area based on the overlapping area.
[0114] The acquisition unit 603 is used to calibrate the current image based on the target image acquisition area to obtain a high-precision image area corresponding to the current image.
[0115] The target image acquisition area may be an image acquisition frame, which is used for the monocular camera to acquire high-precision map elements. Taking lane lines as an example, the monocular camera only acquires lane lines within the target image acquisition area.
[0116] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.
[0117] Figure 7 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.
[0118] See also Figure 7, the electronic device 700 includes a memory 710 and a processor 720 .
[0119] The processor 720 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0120] The memory 710 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage. Among them, ROM may store static data or instructions required by the processor 720 or other modules of the computer. The permanent storage may be a readable and writable storage device. The permanent storage may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In 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 a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 710 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 710 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and transient electronic signals transmitted wirelessly or wired.
[0121] The memory 710 stores executable codes, and when the executable codes are processed by the processor 720 , the processor 720 can execute part or all of the methods described above.
[0122] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0123] 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.), the processor executes part or all of the steps of the above-mentioned method according to the present application.
[0124] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A method for acquiring high-precision images using a monocular camera, characterized in that: include: Acquire the road coordinate system coordinates of pixels in at least one image, and obtain pixel distance differences between adjacent pixels based on the road coordinate system coordinates of the pixels; Setting a target accuracy range, and determining a target image acquisition area according to the target accuracy range and the pixel distance difference; Calibrate the current image based on the target image acquisition area to obtain a high-precision image area corresponding to the current image; The pixel distance difference includes a first pixel distance difference and a second pixel distance difference, the first pixel distance difference is a distance difference between adjacent pixels in the same row of the pixel, and the second pixel distance difference is a distance difference between adjacent pixels in the same column of the pixel; the step of obtaining the pixel distance difference between adjacent pixels based on the road coordinate system coordinates of the pixels includes: obtaining a first pixel distance difference between adjacent pixels in the horizontal direction according to the road coordinate system coordinates; and obtaining a second pixel distance difference between adjacent pixels in the vertical direction according to the road coordinate system coordinates; Among them, the target accuracy range includes a first target accuracy range and a second target accuracy range, the first target accuracy range includes an accuracy range in the horizontal direction, and the second target accuracy range includes an accuracy range in the vertical direction; according to the target accuracy range and the pixel distance difference, determining the target image acquisition area, including: obtaining the first target accuracy range, and obtaining the first target image acquisition area according to the first target accuracy range and the first pixel distance difference; obtaining the second target accuracy range, and obtaining the second target image acquisition area according to the second target accuracy range and the second pixel accuracy difference; merging the first target image acquisition area and the second target image acquisition area to obtain the target image acquisition area.
2. The method according to claim 1, characterized in that The step of obtaining the road coordinate system coordinates of pixels in at least one image includes: Constructing a two-dimensional coordinate system corresponding to the image, and obtaining pixel coordinates of pixels in the image based on the two-dimensional coordinate system; Obtaining monocular camera parameters, and determining the road coordinate system coordinates of the pixels based on the monocular camera parameters and the pixel coordinates of the pixels.
3. The method according to claim 1, characterized in that The step of obtaining a first pixel distance difference between adjacent pixels in a horizontal direction according to the road coordinate system coordinates includes: In the horizontal direction, the first pixel distance difference is determined according to a pixel distance difference between the pixel and a previous pixel and a pixel distance difference between the pixel and a next pixel.
4. The method according to claim 1, characterized in that: The obtaining, in a vertical direction according to the road coordinate system coordinates, a second pixel distance difference between adjacent pixels comprises: In the vertical direction, the second pixel distance difference is determined according to a pixel distance difference between the pixel and a previous pixel and a pixel distance difference between the pixel and a next pixel.
5. The method according to claim 1, characterized in that The step of fusing the first target image acquisition area with the second target image acquisition area to determine the target image acquisition area includes: Acquire an overlapping area of the first target image acquisition area and the second target image acquisition area; Based on the overlapping area, the target image acquisition area is determined.
6. A high-precision image acquisition device with a monocular camera, characterized in that: include: A first processing unit, configured to obtain a road coordinate system coordinate of a pixel in at least one image, and obtain a pixel distance difference between adjacent pixels based on the road coordinate system coordinate of the pixel; A second processing unit is used to set a target accuracy range, and obtain a target image acquisition area according to the target accuracy range and the pixel distance difference; An acquisition unit, used for calibrating the image based on the target image acquisition area to obtain a high-precision image corresponding to the image; The pixel distance difference includes a first pixel distance difference and a second pixel distance difference, the first pixel distance difference is a distance difference between adjacent pixels in the same row of the pixel, and the second pixel distance difference is a distance difference between adjacent pixels in the same column of the pixel; the step of obtaining the pixel distance difference between adjacent pixels based on the road coordinate system coordinates of the pixels includes: obtaining a first pixel distance difference between adjacent pixels in the horizontal direction according to the road coordinate system coordinates; and obtaining a second pixel distance difference between adjacent pixels in the vertical direction according to the road coordinate system coordinates; Among them, the target accuracy range includes a first target accuracy range and a second target accuracy range, the first target accuracy range includes an accuracy range in the horizontal direction, and the second target accuracy range includes an accuracy range in the vertical direction; according to the target accuracy range and the pixel distance difference, determining the target image acquisition area, including: obtaining the first target accuracy range, and obtaining the first target image acquisition area according to the first target accuracy range and the first pixel distance difference; obtaining the second target accuracy range, and obtaining the second target image acquisition area according to the second target accuracy range and the second pixel accuracy difference; merging the first target image acquisition area and the second target image acquisition area to obtain the target image acquisition area.
7. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium having executable codes stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 5.
