Camera device posture adjustment method, device, electronic equipment and storage medium
By preprocessing and identifying the image data in front of the target vehicle and automatically adjusting the position of the camera device, the problem of manual adjustment is solved, efficiency and safety are improved, and shooting at an approximate frontal angle is achieved.
Patent Information
- Application Number
- CN202111266518.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-28
- Publication Date
- 2024-12-24
- Estimated Expiration
- 2041-10-28
AI Technical Summary
When using AI technology for road collection, due to the limitation of sample space in the labeling process, the camera device needs to manually adjust the shooting angle, which makes the adjustment take a long time, affecting driving safety and efficiency.
By preprocessing the image data in front of the target vehicle collected in real time, identifying the lane track line and acquiring the image reference line, automatically adjusting the position of the imaging device, making the imaging reference line coincide with the image reference line, and shooting at an approximate front view angle is achieved.
It effectively shortens the time-consuming adjustment of the camera device, improves adjustment efficiency and driving safety, and avoids the inefficiency and safety risks of manual adjustment.
Smart Images

Figure CN116055884B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of camera technology, and in particular to a camera device posture adjustment method, device and electronic equipment. Background Art
[0002] With the rapid development of artificial intelligence technology, in order to improve users' driving experience, artificial intelligence (AI) technology has been widely used in vehicles. For example, applying AI technology to road collection of non-fixed vehicles can effectively improve the efficiency and accuracy of road collection.
[0003] However, when using AI technology for road data collection, due to the limitation of sample space in the annotation stage, the samples used are all high-quality pictures, and the shooting angle needs to be close to the front angle. In order to make the shooting angle of the camera device close to the front angle, manual adjustment is usually used to adjust the shooting angle. The adjustment is time-consuming and must be made while the vehicle is moving, which affects the driver's normal driving and has low safety. Therefore, the manual adjustment method will lead to low adjustment efficiency and reduced driving safety. Summary of the invention
[0004] The embodiments of the present invention provide a method, device and electronic equipment for adjusting the posture of a camera device, which can effectively shorten the time consumed in adjusting the camera device, thereby improving the adjustment efficiency and also improving driving safety.
[0005] A first aspect of an embodiment of the present invention provides a method for adjusting the posture of a camera device, the method comprising:
[0006] Performing image preprocessing on the image data collected in real time in front of the target vehicle to obtain a preprocessed image, wherein the image preprocessing includes anti-distortion processing;
[0007] Performing image recognition on the preprocessed image to identify lane trajectory lines in the preprocessed image;
[0008] According to the lane trajectory line, acquiring an image reference line of the preprocessed image;
[0009] According to the image reference line, the camera device in the target vehicle is adjusted from a current posture to a target posture, wherein a camera reference line of the camera device adjusted to the target posture coincides with the image reference line.
[0010] Optionally, performing image recognition on the preprocessed image to identify lane trajectory lines in the preprocessed image includes:
[0011] Performing image recognition on the preprocessed image to obtain lane pixel tracks of lane lines in the preprocessed image;
[0012] The lane pixel trajectory is fitted to obtain the lane trajectory line.
[0013] Optionally, acquiring the image reference line of the preprocessed image according to the lane trajectory line includes:
[0014] According to the lane trajectory, a reference lane line is acquired, wherein the reference lane line at least includes a first lane line and a second lane line that are adjacent to each other;
[0015] Determining a reference center point and a boundary point of the image reference line according to the first lane line and the second lane line;
[0016] A vertical reference line is determined from the preprocessed image according to the reference center point and the boundary point, and the vertical reference line is used as the image reference line.
[0017] Optionally, determining a reference center point and a boundary point of the image reference line according to the first lane line and the second lane line includes:
[0018] Determine a vanishing point according to the first lane line and the second lane line, and use the vanishing point as the reference center point;
[0019] The boundary point is determined according to a first intersection point and a second intersection point, wherein the first intersection point is an intersection point of the first lane line and a bottom edge of the preprocessed image, and the second intersection point is an intersection point of the second lane line and the bottom edge.
[0020] Optionally, determining the boundary point according to the first intersection point and the second intersection point includes:
[0021] Obtaining an angle bisector of an angle formed by the reference center point, the first intersection point, and the second intersection point;
[0022] The boundary point is determined according to the angle bisector.
[0023] Optionally, before adjusting the camera device in the target vehicle from a current posture to a target posture according to the image reference line, the method further includes:
[0024] Determining a vertical center line and a horizontal center line according to an image center point of the preprocessed image;
[0025] The camera reference line is determined according to the vertical center line and the horizontal center line.
[0026] Optionally, adjusting the camera device in the target vehicle from a current posture to a target posture according to the image reference line includes:
[0027] determining, according to the image reference line, a first roll angle, a first yaw angle, a first horizontal position, and a first pitch angle of the camera device, wherein when the camera device is at the first yaw angle, the first lane line and the second lane line have the same length, when the camera device is at the first horizontal position, the image reference line and the vertical center line coincide with each other, and when the camera device is at the first pitch angle, the reference center point coincides with the image center point;
[0028] The target posture is determined according to the first roll angle, the first yaw angle, the first horizontal position and the first pitch angle, and the current posture of the camera device is adjusted to the target posture.
[0029] Optionally, acquiring the image reference line of the preprocessed image according to the lane trajectory line includes:
[0030] According to the lane trajectory, a reference lane line is acquired, wherein the reference lane line at least includes a first lane line and a second lane line that are adjacent to each other;
[0031] A horizontal reference line is acquired according to the first lane line, the second lane line, and the parking line in the preprocessed image, and the horizontal reference line is used as the image reference line.
[0032] Optionally, acquiring a horizontal reference line according to the first lane line, the second lane line, and a stop line in the preprocessed image, and using the horizontal reference line as the image reference line includes:
[0033] Obtaining an intersection connecting line connecting a third intersection and a fourth intersection, wherein the third intersection is an intersection of the first lane line and the stop line, and the fourth intersection is an intersection of the second lane line and the stop line;
[0034] Determining the reference center point according to the first lane line and the second lane line;
[0035] According to the reference center point, a horizontal reference line parallel to the intersection connection line is acquired, and the horizontal reference line is used as the image reference line, wherein the horizontal reference line passes through the reference center point.
[0036] Optionally, adjusting the camera device in the target vehicle from a current posture to a target posture according to the image reference line includes:
[0037] Determine a second roll angle, a second yaw angle, a second pitch angle and a second horizontal position of the camera device according to the image reference line, wherein when the camera device is at the second yaw angle, the first length and the second length are consistent, the first length is the length from the reference center point to the third intersection point, the second length is the length from the reference center point to the fourth intersection point, and when the camera device is at the second pitch angle, the image reference line and the horizontal center line coincide; and when the camera device is at the second horizontal position, the reference center point coincides with the image center point;
[0038] The target posture is determined according to the second roll angle, the second yaw angle, the second pitch angle and the second horizontal position, and the current posture of the camera device is adjusted to the target posture.
[0039] A second aspect of an embodiment of the present invention further provides a device for adjusting the posture of a camera device, the device comprising:
[0040] A preprocessing unit, used for performing image preprocessing on the image data in front of the target vehicle collected in real time to obtain a preprocessed image, wherein the image preprocessing includes anti-distortion processing;
[0041] An image recognition unit, used to perform image recognition on the pre-processed image to identify lane trajectory lines in the pre-processed image;
[0042] A reference line acquisition unit, used for acquiring an image reference line of the preprocessed image according to the lane trajectory line;
[0043] The posture adjustment unit is used to adjust the camera device in the target vehicle from the current posture to the target posture according to the image reference line, wherein the camera reference line of the camera device adjusted to the target posture coincides with the image reference line.
[0044] Optionally, the image recognition unit is used to perform image recognition on the preprocessed image to obtain a lane pixel trajectory of a lane line in the preprocessed image; and perform fitting processing on the lane pixel trajectory to obtain the lane trajectory line.
[0045] Optionally, the reference line acquisition unit is used to acquire a reference lane line based on the lane trajectory line, wherein the reference lane line includes at least an adjacent first lane line and a second lane line; determine a reference center point and a boundary point of the image reference line based on the first lane line and the second lane line; determine a vertical reference line from the preprocessed image based on the reference center point and the boundary point, and use the vertical reference line as the image reference line.
[0046] A third aspect of an embodiment of the present invention provides an electronic device, comprising a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute operation instructions corresponding to the method for adjusting the posture of a camera device as provided in the first aspect.
[0047] A fourth aspect of an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps corresponding to the method for adjusting the posture of a camera device provided in the first aspect.
[0048] The above one or at least one technical solution in the embodiments of the present application has at least the following technical effects:
[0049] Based on the above technical solution, image preprocessing is performed on the image data in front of the target vehicle collected in real time to obtain a preprocessed image; image recognition is performed on the preprocessed image to identify the lane trajectory line in the preprocessed image; according to the lane trajectory line, the image reference line of the preprocessed image is obtained; according to the image reference line, the camera device in the target vehicle is adjusted from the current posture to the target posture; it can be seen that since the image preprocessing includes anti-distortion processing, the preprocessed image is consistent with the human eye observation result, so that the user experience is better; and the image reference line is obtained through the lane trajectory line, and the camera reference line of the camera device adjusted to the target posture is overlapped with the image reference line according to the image reference line, so that when the camera device is in the target posture, the shooting angle of the camera device is approximately the positive angle of view, so that the camera device can be automatically adjusted to the target posture through the image reference line. Compared with manual adjustment, the time consumption of adjusting the camera device is effectively shortened, thereby improving the adjustment efficiency, and the driver can concentrate on driving without manual adjustment, so that driving safety is also improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 A schematic diagram of a flow chart of a method for adjusting the posture of a camera device provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of a structure for performing image recognition on a pre-processed image provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of a first structure for obtaining an image reference line in a preprocessed image provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of a first structure for obtaining a camera reference line in a preprocessed image provided in an embodiment of the present application;
[0054] Figure 5 A second structural schematic diagram of obtaining an image reference line in a preprocessed image provided in an embodiment of the present application;
[0055] Figure 6 A second structural schematic diagram of obtaining a camera reference line in a pre-processed image provided in an embodiment of the present application;
[0056] Figure 7 A block diagram of a camera device posture adjustment device provided in an embodiment of the present application;
[0057] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] The main implementation principles, specific implementation methods and corresponding beneficial effects of the technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0059] Intelligent Traffic System (ITS), also known as Intelligent Transportation System, is an effective and comprehensive application of advanced science and technology (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) to transportation, service control and vehicle manufacturing, strengthening the connection between vehicles, roads and users, thus forming a comprehensive transportation system that ensures safety, improves efficiency, improves the environment and saves energy. Or;
[0060] Intelligent Vehicle Infrastructure Cooperative Systems (IVICS), referred to as IVICS, is a development direction of Intelligent Transportation Systems (ITS). IVICS uses advanced wireless communications and new generation Internet technologies to implement all-round dynamic real-time information interaction between vehicles and roads, and conducts active vehicle safety control and road cooperative management based on the collection and integration of dynamic traffic information in all time and space, fully realizing the effective coordination of people, vehicles and roads, ensuring traffic safety, and improving traffic efficiency, thus forming a safe, efficient and environmentally friendly road traffic system.
[0061] Example
[0062] Please refer to Figure 1 The present application provides a method for adjusting the posture of a camera device, the method comprising:
[0063] S101, performing image preprocessing on the image data in front of the target vehicle collected in real time to obtain a preprocessed image, wherein the image preprocessing includes anti-distortion processing;
[0064] S102, performing image recognition on the preprocessed image to identify lane trajectory lines in the preprocessed image;
[0065] S103, acquiring an image reference line of the preprocessed image according to the lane trajectory line;
[0066] S104. Adjusting a camera device in the target vehicle from a current posture to a target posture according to the image reference line, wherein a camera reference line of the camera device adjusted to the target posture coincides with the image reference line.
[0067] In the embodiments of this specification, a method for adjusting the posture of a camera device can be applied to a vehicle terminal or a server connected to the vehicle terminal. The vehicle terminal is connected to the camera device of the target lane. The server can be, for example, a desktop computer, a tablet computer, and a laptop computer, and the camera device can be, for example, a camera and a still camera. The following takes the application of the method for adjusting the posture of a camera device to a vehicle terminal as an example.
[0068] Among them, in step S101, when the target vehicle is driving, the image data in front of the target vehicle is collected in real time by the camera device in the target vehicle, and the real-time collected image data is transmitted to the vehicle-mounted terminal, so that the vehicle-mounted terminal can obtain the image data in real time, and the vehicle-mounted terminal performs image preprocessing on the real-time acquired image data to obtain a preprocessed image, so that the preprocessed image is also obtained in real time. Since the image preprocessing includes anti-distortion processing, the preprocessed image is consistent with the observation result of the human eye, so that the preprocessed image has a higher matching degree with the human eye, and the user experience is better. Of course, if the above method is applied in a server, after the vehicle-mounted terminal obtains the image data in real time, the real-time acquired image data is transmitted to the server for image preprocessing, so as to obtain a preprocessed image.
[0069] In the embodiments of the present specification, image preprocessing may further include at least one of cleaning processing, upsampling processing, noise elimination processing, mean filtering processing and frequency domain processing, so as to increase the accuracy of the preprocessed image obtained after image preprocessing.
[0070] After the pre-processed image is acquired, step S102 is performed.
[0071] In step S102, since the pre-processed images are acquired in real time, the operation of step S102 is performed after each pre-processed image is acquired.
[0072] In the specific implementation process, after each pre-processed image is obtained, image recognition can be performed on the pre-processed image to obtain the lane pixel trajectory of the lane line in the pre-processed image; the lane pixel trajectory is fitted to obtain the lane trajectory line. Of course, the lane trajectory line can also be directly obtained based on the lane pixel trajectory.
[0073] Specifically, an image recognition model can be pre-trained, wherein the image recognition model can be obtained based on tensorflow training, and the image recognition model can be a convolutional neural network CNN and a deep neural network DNN, etc. After the image recognition model is trained, the pre-processed image is input into the image recognition model to identify the lane pixel trajectory; then the lane pixel trajectory is fitted to obtain the lane trajectory line. Wherein, when the lane pixel trajectory is fitted to obtain the lane trajectory line, if the lane pixel trajectory is the lane pixel trajectory of N lanes, the lane pixel trajectory of each lane in the N lanes is fitted to obtain N lane lines and used as the lane trajectory line, wherein N is an integer greater than 1, such as 2, 3, and 4, etc.
[0074] Furthermore, when fitting the lane pixel trajectory to obtain the lane trajectory line, the lane pixel trajectory can be first filtered to filter out the pixel trajectory in the lane pixel trajectory whose deviation value is greater than the set offset value to obtain the retained pixel trajectory; then the retained pixel trajectory is fitted to use all the lane lines obtained by fitting as the lane trajectory line. The deviation value refers to the distance between each pixel in the lane pixel trajectory and the average line of the lane pixel trajectory. The deviation value can be set according to actual needs, or it can be set manually or by the vehicle terminal itself, and this specification does not impose any specific restrictions.
[0075] Specifically, the training steps of the image recognition model are as follows: obtaining a training sample set, each training sample in the training sample set includes a historical preprocessed image and lane marking information in the historical preprocessed image; using each historical preprocessed image and its lane marking information to train the model, and obtaining a model with a prediction accuracy not less than the set accuracy and other constraints as the image recognition model, so that the prediction accuracy of the image recognition model is high. The set accuracy can be set manually or by equipment, or according to actual needs, for example, it can be 98%, 95%, and 94%.
[0076] For example, see Figure 2, a preprocessed image 20 is obtained in real time during the driving process of the car, the preprocessed image 20 is input into the image recognition model, four lane pixel trajectories, namely lane pixel trajectory 21, lane pixel trajectory 22, lane pixel trajectory 23 and lane pixel trajectory 24, are identified, and then each lane pixel trajectory is fitted respectively to obtain four lane lines corresponding to the four lane pixel trajectories, and the four lane lines are used as lane trajectory lines.
[0077] After the lane trajectory is acquired, step S103 is executed.
[0078] In step S103, a reference lane line may be obtained according to the lane trajectory line, wherein the reference lane line includes at least the adjacent first lane line and the second lane line; then, a reference center point and a boundary point of the image reference line may be determined according to the first lane line and the second lane line; and, according to the reference center point and the boundary point, a vertical reference line may be determined from the preprocessed image, and the vertical reference line may be used as the image reference line. When determining the vertical reference line according to the reference center point and the boundary point, the reference center point and the boundary point may be directly connected and extended, and the extended line may be used as the vertical reference line.
[0079] Specifically, when obtaining the reference lane line, the two lane lines closest to the target vehicle can be obtained from the lane trajectory line as the first lane line and the second lane line, and then the first lane line and the second lane line form the reference lane line. Of course, after obtaining the first lane line and the second lane line, other lane lines can also be obtained from the lane trajectory line, and the first lane line, the second lane line and other lane lines form the reference lane line, which is not specifically limited in this specification.
[0080] In one embodiment of the present specification, when determining the reference center point and the boundary point, a vanishing point can be determined based on the first lane line and the second lane line, and the vanishing point can be used as the reference center point; then the boundary point can be determined based on the first intersection point and the second intersection point, wherein the first intersection point is the intersection point of the first lane line and the bottom edge of the preprocessed image, and the second intersection point is the intersection point of the second lane line and the bottom edge.
[0081] Specifically, when determining the boundary point based on the first intersection and the second intersection, the midpoint of the first intersection and the second intersection can be taken on the bottom edge, and then the boundary point can be determined based on the midpoint. At this time, the midpoint can be directly used as the boundary point, or a boundary value range can be determined on the bottom edge based on the midpoint. A point can be randomly selected from the boundary value range as the boundary point. For example, if the midpoint is 3 cm from the left end of the bottom edge, then 2.5 cm to 3.2 cm, or 2.6 cm to 3.3 cm from the left end of the bottom edge can be used as the boundary value range. This manual does not make any specific restrictions.
[0082] For example, see Figure 3, the intersection point of the first lane line 31 and the bottom edge 301 of the pre-processed image 30 is point B, the intersection point of the second lane line 32 and the bottom edge 301 is point C, and the intersection point of the first lane line 31 and the second lane line 32 is point A, that is, point A is the reference center point; according to point B and point C, the midpoint between point B and point C is taken as point D on the bottom edge 301, and point A and point D are connected to obtain a connecting line AD, and AD is extended to both sides of the pre-processed image 30, and the extended AD is used as a vertical reference line.
[0083] In the embodiments of the present specification, when determining the boundary points, the boundary points can be determined based on multiple first intersection points and multiple second intersection points. Specifically, multiple pre-processed images can be collected, and after each pre-processed image is obtained, the midpoint of the first intersection point and the second intersection point on the bottom edge is obtained from the pre-processed image; the midpoints corresponding to each two adjacent pre-processed images are compared until the difference between the midpoints corresponding to the two adjacent pre-processed images is less than a set threshold, and the midpoint corresponding to any one of the two adjacent pre-processed images is used as the boundary point. In this way, the accuracy of the obtained boundary points is higher.
[0084] The threshold value may be set manually or by the device itself, or may be set according to actual needs. For example, the threshold value may be 0.01, 0.03, 0.005, etc.
[0085] For example, after the camera device acquires the first preprocessed image at the first shooting angle at the first moment, based on the intersection of the first lane line in the first preprocessed image and the bottom edge of the first preprocessed image, and the intersection of the second lane line and the bottom edge of the first preprocessed image, the midpoint in the first processed image is determined to be represented by D20. At the second moment after the first moment, the camera device is rotated to acquire the second preprocessed image. Based on the above midpoint acquisition method, the midpoint D21 in the second preprocessed image is acquired. It is determined whether the midpoint difference between D21 and D20 is less than a set threshold. If not, the third preprocessed image and its midpoint D22 are continuously acquired, and the midpoint difference between D22 and D21 is then determined. When the midpoint difference between the nth preprocessed image and its midpoint D2n and D2(n-1) is less than the set threshold, D2n is used as the boundary point, so that the boundary point is infinitely close to the center point in the preprocessed image. In this way, the accuracy of the acquired boundary point is higher, and the accuracy of the target posture subsequently acquired based on the boundary point will also be improved accordingly.
[0086] Since the vanishing point is used as the reference center point, and the midpoint corresponding to the first intersection point and the second intersection point is used as the boundary point, the reference center point is connected with the boundary point and extended to obtain the vertical reference line, and the vanishing point is based on the intersection of the first lane line and the second lane line, and the first intersection point is the intersection of the first lane line and the bottom edge of the preprocessed image, and the second intersection point is the intersection of the second lane line and the bottom edge. Since the first lane line and the second lane line are usually parallel lines on the actual road surface, the line connecting the intersection point and the midpoint in the preprocessed image, that is, the vertical reference line, is the center line of the first lane line and the second lane line. In this way, the vertical reference line is parallel to the first lane line and the second lane line, so that the accuracy of the obtained vertical reference line is higher, and the accuracy of the target posture subsequently determined based on the vertical reference line will also be improved accordingly.
[0087] In another embodiment of the present specification, when determining the reference center point and the boundary point, the vanishing point can be determined based on the first lane line and the second lane line, and the vanishing point can be used as the reference center point; then the angle bisector of the angle formed by the reference center point, the first intersection point and the second intersection point is obtained; and the boundary point is determined based on the angle bisector. Specifically, the intersection point of the angle bisector and the bottom edge can be used as the boundary point, and then the vertical reference line can be determined with reference to the center point and the boundary point.
[0088] For example, see Figure 3 After obtaining point A, point B and point C, the angle BAC formed by point A, point B and point C is obtained as angle 33, and then the angle average line of angle 33 is made through point A, and the intersection of the angle average line and the bottom edge 301 is used as the boundary point, and then the connecting line connecting point A and the boundary point is extended to both sides of the preprocessed image 30, and the extended connecting line is used as the vertical reference line.
[0089] Since the vanishing point is taken as the reference center point, and the intersection of the angle bisector of the angle formed by the reference center point, the first intersection point and the second intersection point and the bottom edge is taken as the boundary point, the reference center point is connected to the boundary point and extended to obtain the vertical reference line, and the vanishing point is based on the intersection of the first lane line and the second lane line, and the first intersection point is the intersection of the first lane line and the bottom edge of the preprocessed image, and the second intersection point is the intersection of the second lane line and the bottom edge. Since the first lane line and the second lane line are usually parallel lines on the actual road surface, the line connecting the intersection point and the midpoint in the preprocessed image, that is, the vertical reference line, is the center line of the first lane line and the second lane line. In this way, the vertical reference line is parallel to the first lane line and the second lane line, so that the accuracy of the acquired vertical reference line is higher, and the accuracy of the target posture subsequently determined based on the vertical reference line will also be improved accordingly.
[0090] After the image reference line is acquired, step S014 is executed.
[0091] Before step S104, it is also necessary to obtain a camera reference line, and the steps for obtaining the camera reference line are as follows: first, the vertical center line and the horizontal center line can be determined according to the image center point of the preprocessed image; and the camera reference line can be determined according to the vertical center line and the horizontal center line. Specifically, after determining the image center point, a horizontal line passing through the image center point can be obtained as the horizontal center line, and a vertical line passing through the image center point can be obtained as the vertical center line, and then the horizontal center line and the vertical center line can be used as the camera reference line.
[0092] And, after the camera reference line is acquired, step S104 is executed.
[0093] Specifically, the first roll angle, the first yaw angle, the first horizontal position and the first pitch angle of the camera device can be determined according to the image reference line, wherein when the camera device is at the first yaw angle, the lengths of the first lane line and the second lane line are consistent, when the camera device is at the first horizontal position, the image reference line and the vertical center line coincide, and when the camera device is at the first pitch angle, the reference center point coincides with the image center point; then, according to the first roll angle, the first yaw angle, the first horizontal position and the first pitch angle, the target posture is determined, and the current posture of the camera device is adjusted to the target posture.
[0094] In the embodiments of the present specification, the value range of the first roll angle is 0-0.18, for example, it can be 0, 0.01 and 0.02, etc., and of course, it can also be greater than 0.18, such as 0.2, etc.; the value range of the first yaw angle is 0-0.16, for example, it can be 0, 0.01 and 0.02, etc., and of course, it can also be greater than 0.16, such as 0.19, etc.; the value range of the first pitch angle is 0-0.2, for example, it can be 0, 0.01 and 0.08, etc., and of course, it can also be greater than 0.2, such as 0.21, etc.
[0095] Specifically, when adjusting the current posture of the camera device to the target posture, the posture of the camera device can be adjusted by a posture adjustment device connected to the camera device. The posture adjustment device can be, for example, a pan / tilt head and a rotating device.
[0096] In the embodiment of this specification, after the image reference line and the camera reference line are obtained, the camera device is adjusted to the target posture through the adjustment algorithm. Specifically, the reference center point of the image reference line is first overlapped with the image center point in the camera reference line, and then the image reference line is overlapped with the vertical reference line in the camera reference line. After the overlap, the pitch angle, roll angle and yaw angle of the camera device are all 0, thereby achieving the adjustment of the camera device to the target posture. At this time, the perspective of the picture taken by the camera device is more consistent with the perspective of the human eye, and no later correction is required, thereby effectively improving the recognition rate. And because the accuracy of the image reference line is high, the accuracy of the target posture determined based on the image reference line will also be improved.
[0097] For example, see Figure 4 After obtaining point A, point B, point C and point D, the extension line of AD is used as the vertical reference line, and then the image center point of the preprocessed image 30 is obtained as point A11, and the vertical center line 40 and the horizontal center line 41 are determined based on point A11, wherein the intersection of the vertical center line 40 and the bottom edge 301 is point D11.
[0098] In actual application, see Figure 4 Taking the posture adjustment device as a gimbal as an example, the specific method of adjusting the camera device to the target posture by adjusting the algorithm is as follows:
[0099] S1, adjusting the horizontal level of the pan / tilt head so that the first roll angle (roll) of the camera device is 0;
[0100] S2, adjusting the yaw angle (yaw) of the camera device to a first yaw angle, i.e., 0, so that the lengths of the first lane line and the second lane line are consistent, i.e., AB=AC;
[0101] S3, translating the horizontal position of the camera to a first horizontal position so that the vertical reference line and the vertical center line coincide with each other, that is, the vertical center line 40 coincides with AD;
[0102] S4. Adjust the pitch angle to a first pitch angle of 0, so that the center point of the image coincides with the reference center point, that is, A coincides with A11.
[0103] In this way, the camera device is adjusted to the target posture through steps S1 to S4. Of course, after executing steps S1 to S3, the vanishing point can also be fine-tuned. The distance between the vanishing point and the front cover of the car can be fine-tuned by moving up and down and forward and backward to make the front cover of the car enter the field of view as little as possible, further improve the recognition rate, and reach the actual field of view that meets the set field of view condition, and then execute step S4 to adjust the pitch angle. Among them, the field of view condition can be set according to actual needs, or it can be set manually or by a vehicle-mounted terminal. The field of view condition can be set so that the image proportion of the front cover of the car in the pre-processed image is less than the set proportion, such as 1% and 5‰.
[0104] In another embodiment of the present specification, step S103 can also be obtained by the following method, including: obtaining a reference lane line based on a lane trajectory line, wherein the reference lane line includes at least adjacent first lane lines and second lane lines; obtaining a horizontal reference line based on the first lane line, the second lane line and the stop line in the preprocessed image, and using the horizontal reference line as the image reference line.
[0105] Among them, the specific implementation process of the reference lane line can refer to the description of obtaining the reference lane line in the above step S103. For the sake of brevity of the specification, it will not be repeated here.
[0106] Specifically, the stop line can be determined according to the position of the target lane in the preprocessed image. After the stop line is determined, an intersection connection line connecting the third intersection point and the fourth intersection point is obtained, wherein the third intersection point is the intersection point of the first lane line and the stop line, and the fourth intersection point is the intersection point of the second lane line and the stop line; a reference center point is determined according to the first lane line and the second lane line; a horizontal reference line parallel to the intersection connection line is obtained according to the reference center point, and the horizontal reference line is used as the image reference line, wherein the horizontal reference line passes through the reference center point. Among them, the third intersection point of the first lane line and the stop line can be obtained first, and the fourth intersection point of the second lane line and the stop line can be obtained, and then the intersection connection line connecting the third intersection point and the fourth intersection point can be obtained; and the reference center point is determined according to the first lane line and the second lane line; a horizontal reference line parallel to the intersection connection line is obtained according to the reference center point, and the horizontal reference line is used as the image reference line, wherein the horizontal reference line passes through the reference center point.
[0107] Specifically, when determining the reference center point and the boundary point, a vanishing point may be determined according to the first lane line and the second lane line, and the vanishing point may be used as the reference center point.
[0108] Since the intersection connecting line is determined based on the intersection of the parking line and the first lane line and the second lane line, and the parking line is usually a horizontal line, the probability that the intersection connecting line obtained based on the parking line is a horizontal line is higher, and the horizontal reference line is parallel to the intersection connecting line, so the probability that the horizontal reference line is a horizontal line will also increase accordingly. In this way, the accuracy of the obtained horizontal reference line is higher, and the accuracy of the target posture subsequently determined based on the horizontal reference line will also increase accordingly.
[0109] For example, see Figure 5 , image recognition is performed on the preprocessed image 50, and the first lane line 51, the second lane line 52 and the stop line 53 are identified, wherein the intersection point of the stop line 53 and the first lane line 51 is point B1, and the intersection point of the stop line 53 and the second lane line is point C1. According to the first lane line 51 and the second lane line 52, the vanishing point is determined to be point A1, and the intersection connecting line B1C1 is obtained by connecting point B1 and point C1. According to A1, a horizontal reference line EF parallel to B1C1 is obtained, and EF passes through A1.
[0110] After the horizontal reference line is obtained, step S104 is executed.
[0111] In step S104, firstly obtain the camera reference line, and then determine the second roll angle, second yaw angle, second pitch angle and second horizontal position of the camera device according to the image reference line, wherein when the camera device is at the second yaw angle, the first length and the second length are the same, the first length is the length from the reference center point to the third intersection point, and the second length is the length from the reference center point to the fourth intersection point, and when the camera device is at the second pitch angle, the image reference line and the horizontal center line coincide; and when the camera device is in the second horizontal position, the reference center point and the image center point coincide; and, according to the second roll angle, the second yaw angle, the second pitch angle and the second horizontal position, determine the target posture, and adjust the current posture of the camera device to the target posture.
[0112] In the embodiment of this specification, the value range of the second roll angle is 0-0.18, for example, it can be 0, 0.01 and 0.02, etc., and of course, it can also be greater than 0.18, such as 0.2, etc.; the value range of the second yaw angle is 0-0.16, for example, it can be 0, 0.01 and 0.02, etc., and of course, it can also be greater than 0.16, such as 0.19, etc.; the value range of the second pitch angle is 0-0.2, for example, it can be 0, 0.01 and 0.08, etc., and of course, it can also be greater than 0.2, such as 0.21, etc.
[0113] Specifically, when adjusting the current posture of the camera device to the target posture, the posture of the camera device can be adjusted by a posture adjustment device connected to the camera device. The posture adjustment device can be, for example, a pan / tilt head and a rotating device.
[0114] In the embodiments of this specification, after the image reference line and the camera reference line are obtained, the camera device is adjusted to the target posture through an adjustment algorithm. Specifically, the reference center point of the image reference line is first overlapped with the image center point in the camera reference line, and then the image reference line is overlapped with the horizontal reference line in the camera reference line. After the overlap, the pitch angle, roll angle and yaw angle of the camera device are all 0, thereby achieving the adjustment of the camera device to the target posture. At this time, the perspective of the picture taken by the camera device is more consistent with the perspective of the human eye, and no later correction is required, thereby effectively improving the recognition rate. And because the accuracy of the image reference line is high, the accuracy of the target posture determined based on the image reference line will also be improved.
[0115] For example, see Figure 6 After obtaining point A1 and horizontal reference line EF, the image center point of the preprocessed image 50 is obtained as point A21, and the vertical center line 54 and the horizontal center line 55 are determined based on point A21, wherein the intersection points of the horizontal center line 55 and both sides of the preprocessed image 50 are points E1 and F1.
[0116] In actual application, see Figure 6 Taking the posture adjustment device as a gimbal as an example, the specific method of adjusting the camera device to the target posture by adjusting the algorithm is as follows:
[0117] S11, adjusting the horizontal level of the pan / tilt head so that the second roll angle (roll) of the camera device is 0;
[0118] S12, adjusting the yaw angle (yaw) of the camera device to a second yaw angle, i.e., 0, so that the first length and the second length are consistent, i.e., A1B1=A1C1;
[0119] S13, adjusting the pitch angle to a second pitch angle of 0, so that the image reference line coincides with the horizontal center line, that is, EF coincides with the horizontal center line 55;
[0120] S14, translate the horizontal position of the camera to a second horizontal position, so that the center point of the image coincides with the reference center point, that is, A1 coincides with A21.
[0121] In this way, the camera device is adjusted to the target posture through steps S1 to S4. Of course, when executing step S13, the vanishing point can also be fine-tuned. The distance between the vanishing point and the front hood of the car can be fine-tuned by moving up and down and forward and backward to make the front hood of the car enter the field of view as little as possible, further improve the recognition rate, and reach the actual field of view that meets the set field of view conditions. Then, step S14 is executed to adjust the pitch angle. Among them, the set field of view conditions can be set according to actual needs, or can be set manually or by a vehicle-mounted terminal. The set field of view conditions can be that the image proportion of the front hood of the car in the pre-processed image is less than the set proportion, such as 1% and 5‰.
[0122] In view of the above-mentioned embodiment, a method for adjusting the posture of a camera device is provided. In the embodiment of the present application, a device for adjusting the posture of a camera device is also provided. Figure 7 , the device comprises:
[0123] The preprocessing unit 701 is used to perform image preprocessing on the image data in front of the target vehicle collected in real time to obtain a preprocessed image, wherein the image preprocessing includes anti-distortion processing;
[0124] An image recognition unit 702 is used to perform image recognition on the pre-processed image to identify lane track lines in the pre-processed image;
[0125] A reference line acquisition unit 703, configured to acquire an image reference line of the pre-processed image according to the lane trajectory line;
[0126] The posture adjustment unit 704 is used to adjust the camera device in the target vehicle from the current posture to the target posture according to the image reference line, wherein the camera reference line of the camera device adjusted to the target posture coincides with the image reference line.
[0127] In an optional implementation, the image recognition unit 702 is used to perform image recognition on the preprocessed image to obtain a lane pixel trajectory of the lane line in the preprocessed image; and perform fitting processing on the lane pixel trajectory to obtain the lane trajectory line.
[0128] In an optional embodiment, the reference line acquisition unit 703 is used to acquire a reference lane line based on the lane trajectory line, wherein the reference lane line includes at least an adjacent first lane line and a second lane line; determine a reference center point and a boundary point of the image reference line based on the first lane line and the second lane line; determine a vertical reference line from the preprocessed image based on the reference center point and the boundary point, and use the vertical reference line as the image reference line.
[0129] In an optional embodiment, the reference line acquisition unit 703 is used to determine a vanishing point based on the first lane line and the second lane line, and use the vanishing point as the reference center point; determine the boundary point based on a first intersection point and a second intersection point, wherein the first intersection point is the intersection point of the first lane line and the bottom edge of the preprocessed image, and the second intersection point is the intersection point of the second lane line and the bottom edge.
[0130] In an optional implementation, the reference line acquisition unit 703 is used to acquire the angle bisector of the angle formed by the reference center point, the first intersection point and the second intersection point; and determine the boundary point according to the angle bisector.
[0131] In an optional implementation, it also includes:
[0132] A camera reference line acquisition unit is used to determine a vertical center line and a horizontal center line according to the image center point of the preprocessed image before adjusting the camera device in the target vehicle from the current posture to the target posture according to the image reference line; and determine the camera reference line according to the vertical center line and the horizontal center line.
[0133] In an optional embodiment, the posture adjustment unit 704 is used to determine a first roll angle, a first yaw angle, a first horizontal position and a first pitch angle of the camera device according to the image reference line, wherein when the camera device is at the first yaw angle, the first lane line and the second lane line are of the same length, when the camera device is at the first horizontal position, the image reference line and the vertical center line coincide, and when the camera device is at the first pitch angle, the image center point coincides with the image center point; determine the target posture according to the first roll angle, the first yaw angle, the first horizontal position and the first pitch angle, and adjust the current posture of the camera device to the target posture.
[0134] In an optional embodiment, the reference line acquisition unit 703 is used to acquire a reference lane line based on the lane trajectory line, wherein the reference lane line includes at least an adjacent first lane line and a second lane line; acquire a horizontal reference line based on the first lane line, the second lane line and the stop line in the preprocessed image, and use the horizontal reference line as the image reference line.
[0135] In an optional embodiment, the posture adjustment unit 704 is used to determine the second roll angle, the second yaw angle, the second pitch angle and the second horizontal position of the camera device according to the image reference line, wherein when the camera device is at the second yaw angle, the lengths of the first lane line and the second lane line are consistent, when the camera device is at the second pitch angle, the image reference line and the horizontal center line coincide; and when the camera device is in the second horizontal position, the image center point coincides with the image center point; according to the second roll angle, the second yaw angle, the second pitch angle and the second horizontal position, the target posture is determined, and the current posture of the camera device is adjusted to the target posture.
[0136] 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 here.
[0137] Figure 8 1 is a block diagram of an electronic device 800 for a method for adjusting the posture of a camera device according to an exemplary embodiment. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0138] Reference Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / display (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0139] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0140] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0141] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0142] The multimedia component 808 includes a screen that provides a display interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0143] The audio component 810 is configured to present and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for presenting audio signals.
[0144] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0145] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0146] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network according to a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0147] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0148] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0149] A non-transitory computer-readable storage medium, when the instructions in the storage medium are executed by a processor of a mobile terminal, enables the mobile terminal to execute a method for adjusting the posture of a camera device, the method comprising:
[0150] Performing image preprocessing on the image data collected in real time in front of the target vehicle to obtain a preprocessed image, wherein the image preprocessing includes anti-distortion processing;
[0151] Performing image recognition on the preprocessed image to identify lane trajectory lines in the preprocessed image;
[0152] According to the lane trajectory line, acquiring an image reference line of the preprocessed image;
[0153] According to the image reference line, the camera device in the target vehicle is adjusted from a current posture to a target posture, wherein a camera reference line of the camera device adjusted to the target posture coincides with the image reference line.
[0154] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed in this disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0155] It should be understood that the present invention is not limited to the precise structure described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
[0156] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for adjusting the posture of a camera device, characterized in that: The method comprises: Performing image preprocessing on the image data collected in real time in front of the target vehicle to obtain a preprocessed image, wherein the image preprocessing includes anti-distortion processing; Performing image recognition on the preprocessed image to identify lane trajectory lines in the preprocessed image; According to the lane trajectory line, acquiring an image reference line of the preprocessed image; According to the image reference line, adjusting the camera device in the target vehicle from a current posture to a target posture, wherein a camera reference line of the camera device adjusted to the target posture coincides with the image reference line; The step of acquiring the image reference line of the preprocessed image according to the lane trajectory line includes: According to the lane trajectory, a reference lane line is acquired, wherein the reference lane line at least includes a first lane line and a second lane line that are adjacent to each other; Acquire a horizontal reference line according to the first lane line, the second lane line, and a stop line in the preprocessed image, and use the horizontal reference line as the image reference line; The acquiring a horizontal reference line according to the first lane line, the second lane line, and the stop line in the pre-processed image, and using the horizontal reference line as the image reference line, comprises: Obtaining an intersection connecting line connecting a third intersection and a fourth intersection, wherein the third intersection is an intersection of the first lane line and the stop line, and the fourth intersection is an intersection of the second lane line and the stop line; Determining a reference center point according to the first lane line and the second lane line; According to the reference center point, a horizontal reference line parallel to the intersection connection line is acquired, and the horizontal reference line is used as the image reference line, wherein the horizontal reference line passes through the reference center point.
2. The method according to claim 1, characterized in that The performing image recognition on the preprocessed image to identify the lane trajectory line in the preprocessed image includes: Performing image recognition on the preprocessed image to obtain lane pixel tracks of lane lines in the preprocessed image; The lane pixel trajectory is fitted to obtain the lane trajectory line.
3. The method according to claim 2, characterized in that The step of acquiring the image reference line of the preprocessed image according to the lane trajectory line includes: According to the lane trajectory, a reference lane line is acquired, wherein the reference lane line at least includes a first lane line and a second lane line that are adjacent to each other; Determining a reference center point and a boundary point of the image reference line according to the first lane line and the second lane line; A vertical reference line is determined from the preprocessed image according to the reference center point and the boundary point, and the vertical reference line is used as the image reference line.
4. The method according to claim 3, characterized in that The determining, according to the first lane line and the second lane line, a reference center point and a boundary point of the image reference line includes: Determine a vanishing point according to the first lane line and the second lane line, and use the vanishing point as the reference center point; The boundary point is determined according to a first intersection point and a second intersection point, wherein the first intersection point is an intersection point of the first lane line and a bottom edge of the preprocessed image, and the second intersection point is an intersection point of the second lane line and the bottom edge.
5. The method according to claim 4, characterized in that The step of determining the boundary point according to the first intersection point and the second intersection point includes: Obtaining an angle bisector of an angle formed by the reference center point, the first intersection point, and the second intersection point; The boundary point is determined according to the angle bisector.
6. The method according to any one of claims 1 to 5, characterized in that: Before adjusting the camera device in the target vehicle from a current posture to a target posture according to the image reference line, the method further includes: Determining a vertical center line and a horizontal center line according to the image center point of the preprocessed image; The camera reference line is determined according to the vertical center line and the horizontal center line.
7. The method according to claim 6, characterized in that The step of adjusting the camera device in the target vehicle from a current posture to a target posture according to the image reference line includes: determining, according to the image reference line, a first roll angle, a first yaw angle, a first horizontal position, and a first pitch angle of the camera device, wherein when the camera device is at the first yaw angle, the first lane line and the second lane line have the same length, when the camera device is at the first horizontal position, the image reference line and the vertical center line coincide with each other, and when the camera device is at the first pitch angle, the reference center point coincides with the image center point; The target posture is determined according to the first roll angle, the first yaw angle, the first horizontal position and the first pitch angle, and the current posture of the camera device is adjusted to the target posture.
8. The method according to claim 6, characterized in that The step of adjusting the camera device in the target vehicle from a current posture to a target posture according to the image reference line includes: Determine a second roll angle, a second yaw angle, a second pitch angle and a second horizontal position of the camera device according to the image reference line, wherein when the camera device is at the second yaw angle, the first length and the second length are consistent, the first length is the length from the reference center point to the third intersection point, the second length is the length from the reference center point to the fourth intersection point, and when the camera device is at the second pitch angle, the image reference line and the horizontal center line coincide; and when the camera device is at the second horizontal position, the reference center point coincides with the image center point; The target posture is determined according to the second roll angle, the second yaw angle, the second pitch angle and the second horizontal position, and the current posture of the camera device is adjusted to the target posture.
9. A camera device posture adjustment device, characterized in that: The device comprises: A preprocessing unit, used for performing image preprocessing on the image data in front of the target vehicle collected in real time to obtain a preprocessed image, wherein the image preprocessing includes anti-distortion processing; An image recognition unit, used to perform image recognition on the pre-processed image to identify lane trajectory lines in the pre-processed image; A reference line acquisition unit, used for acquiring an image reference line of the preprocessed image according to the lane trajectory line; The reference line acquisition unit is specifically used to: acquire a reference lane line according to the lane trajectory line, wherein the reference lane line at least includes a first lane line and a second lane line that are adjacent to each other; Acquire a horizontal reference line according to the first lane line, the second lane line, and a stop line in the preprocessed image, and use the horizontal reference line as the image reference line; The acquiring a horizontal reference line according to the first lane line, the second lane line, and the stop line in the pre-processed image, and using the horizontal reference line as the image reference line, comprises: Obtaining an intersection connecting line connecting a third intersection and a fourth intersection, wherein the third intersection is an intersection of the first lane line and the stop line, and the fourth intersection is an intersection of the second lane line and the stop line; Determining a reference center point according to the first lane line and the second lane line; According to the reference center point, a horizontal reference line parallel to the intersection connection line is acquired, and the horizontal reference line is used as the image reference line, wherein the horizontal reference line passes through the reference center point; The posture adjustment unit is used to adjust the camera device in the target vehicle from the current posture to the target posture according to the image reference line, wherein the camera reference line of the camera device adjusted to the target posture coincides with the image reference line.
10. The device according to claim 9, characterized in that The image recognition unit is used to perform image recognition on the preprocessed image to obtain a lane pixel trajectory of the lane line in the preprocessed image; The lane pixel trajectory is fitted to obtain the lane trajectory line.
11. The device according to claim 10, characterized in that The reference line acquisition unit is used to acquire a reference lane line according to the lane trajectory line, wherein the reference lane line includes at least an adjacent first lane line and a second lane line; determine a reference center point and a boundary point of the image reference line according to the first lane line and the second lane line; determine a vertical reference line from the preprocessed image according to the reference center point and the boundary point, and use the vertical reference line as the image reference line.
12. An electronic device, characterized in that: It includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors to execute the operation instructions corresponding to the method according to any one of claims 1 to 8 contained in the one or more programs.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps corresponding to the method according to any one of claims 1 to 8 are implemented.
