Trailer Angle Detection Method, Device and Electronic Equipment

By installing a shooting device on the front of the vehicle, identifying the edge pixels on the side of the trailer and calculating the rotation angle, the problems of aesthetic influence, limited scope of application and high cost of the trailer angle detection method in the prior art are solved, and a wider range of applicable scenarios and cost-reducing effects are achieved.

CN114943836BActive Publication Date: 2025-06-27SUZHOU ZHITU TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210541370.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-17
Publication Date
2025-06-27
Estimated Expiration
2042-05-17

AI Technical Summary

Technical Problem

In the prior art, the trailer angle detection method has problems such as aesthetic influence, limited scope of application and high cost.

Method used

By installing a shooting device on the front of the vehicle, an image containing the trailer is obtained, the pixels occupied by the side edge of the trailer are identified, and the rotation angle of the trailer is calculated based on the edge pixels, the actual size of the trailer and the shooting device parameter information.

Benefits of technology

It has achieved the expansion of applicable scenarios, reduced detection costs, and avoided the scene restriction caused by placing position identification marks in specific locations of the trailer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114943836B_ABST
    Figure CN114943836B_ABST
Patent Text Reader

Abstract

The present application provides a trailer angle detection method, device and electronic device. The method includes: first, capturing an image containing the trailer by a capturing device installed on the vehicle head, and identifying the pixels occupied by the side edge of the trailer from the image; finally, determining the rotation angle of the trailer relative to the vehicle head at the current moment during driving according to the edge pixels, the actual size information of the trailer and the parameter information of the capturing device. The technology of the present application avoids the problem of limited scenarios caused by placing position recognition marks at specific positions of the trailer, and replaces expensive radar devices with cheaper capturing devices, which can expand the applicable scenarios while reducing the detection cost.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of information detection technologies, and in particular, to a method, device, and electronic device for detecting the angle of a trailer. Background Art

[0002] In the prior art, methods for detecting the angle of a trailer include pasting a number of different two-dimensional codes on both sides of the trailer, extracting the pose of the two-dimensional codes in the camera coordinate system according to an algorithm, and determining the angle of the trailer in the vehicle body coordinate system according to the poses of different cameras in the vehicle body coordinate system. Or installing lidar at the rear and rear side to complete the trailer angle detection, and extracting the pose of the trailer through the laser point cloud.

[0003] The first of the above methods not only affects the aesthetics of the trailer, but also affects the applicable range of trailer angle detection because it is impossible to ensure that all trailers are pasted with two-dimensional codes in actual applications. For the trailer angle detection scheme based on lidar, due to the high price of lidar at present, the cost of engineering deployment is relatively high. Summary of the Invention

[0004] In view of this, the purpose of the present application is to provide a method, device, and electronic device for detecting the angle of a trailer, so as to expand the applicable scenarios and reduce the detection cost.

[0005] In a first aspect, an embodiment of the present application provides a method for detecting the angle of a trailer. The method is applied to an electronic device, and the electronic device is communicatively connected to a photographing device installed on the vehicle head. The rear side of the vehicle head is connected to the front side of the trailer, and the vehicle head and the trailer form a target vehicle. The method includes: obtaining a current captured image of the photographing device; wherein, the current captured image is an image captured in a direction perpendicular to the plane formed by the photographing device and the vehicle head with the photographing device as the origin; determining the edge pixels of the trailer according to the current captured image; wherein, the edge pixels are the pixel values occupied by the edge of at least one side of the trailer in the current captured image; determining the current rotation angle of the trailer according to the edge pixels, the actual size of the trailer, and the photographing parameter information of the photographing device; wherein, the current rotation angle is the rotation angle of the trailer relative to the vehicle head at present.

[0006] Further, the step of determining the edge pixels of the trailer according to the current captured image includes: segmenting a segmented image containing only the trailer from the current captured image through an image semantic detection algorithm; determining the edge pixels of the trailer according to the segmented image.

[0007] Further, the actual dimensions of the trailer include the width, height, and length of the trailer. Among them, the width of the trailer is used to represent the distance between the two vertical edges of the front side of the trailer. The left side and the right side of the trailer are adjacent to and perpendicular to the rear side of the trailer. The length of the trailer is used to represent the distance between the two vertical edges of the left side or the right side of the trailer. The shooting parameter information of the shooting device includes: the focal length of the shooting device, the height of the image obtained by the shooting device, and the height of the photosensitive chip in the shooting device from the ground.

[0008] Further, the step of determining the edge pixels of the trailer according to the current captured image includes: determining the current angle range of the trailer according to the historical angle, image frame rate, and angular velocity threshold of the trailer in the previous captured image by the shooting device; determining the edge pixels of the trailer according to the current captured image and the current angle range.

[0009] Further, the step of determining the edge pixels of the trailer according to the current captured image and the current angle range includes: comparing the current angle range with a preset angle range threshold, and determining the target side of the trailer according to the comparison result. Among them, the target side of the trailer includes one of the following: the left side of the trailer, the right side of the trailer, and the front side of the trailer. The left side and the right side of the trailer are respectively adjacent to and perpendicular to the front side of the trailer; calculating the edge pixels corresponding to the two vertical edges of the target side in the current captured image.

[0010] Further, the shooting device is installed on the rear side of the vehicle head, or the shooting device is installed in the middle of the vehicle head and the trailer. The step of comparing the current angle range with a preset angle range threshold and determining the target side according to the comparison result includes: if the current angle range is within the first preset angle range, determining the front side of the trailer as the target side.

[0011] Further, calculate the rotation angle of the trailer according to the following formula: Where f is the focal length of the camera device, M is the height of the current captured image, h is the height of the trailer, w is the width of the trailer, s m is the height of the photosensitive chip in the shooting device, m b,0 and m b,3 are respectively the pixels of the two edges of the front side of the trailer.

[0012] Further, there are at least two of the above-mentioned photographing devices. At least one photographing device is installed on the left side of the vehicle head, and at least one photographing device is installed on the right side of the vehicle head. The step of comparing the current angle range with the preset angle range threshold and determining the target side according to the comparison result includes: if the current angle range is within the second preset angle range, determining the left side of the trailer as the target side; otherwise, determining the right side of the trailer as the target side.

[0013] Further, there are at least three of the above-mentioned photographing devices. At least one photographing device is installed on the left side of the vehicle head, at least one photographing device is installed on the right side of the vehicle head, and at least one photographing device is installed on the rear side of the vehicle head or between the vehicle head and the trailer. The step of comparing the current angle range with the preset angle range threshold and determining the target side according to the comparison result includes: if the current angle range is within the third preset angle range, determining the left side of the trailer as the target side; if the current angle range is within the fourth preset angle range, determining the right side of the trailer as the target side; if the current angle range is outside the third preset angle range and the fourth preset angle range, determining the front side of the trailer as the target side; where the third preset angle range and the fourth preset angle range do not overlap.

[0014] Further, the rotation angle of the trailer is calculated according to the following formula: where f is the focal length of the imaging device, M is the height of the current captured image, h is the height of the trailer, l is the length of the trailer, s m is the height of the photosensitive chip in the photographing device from the ground, m r,1 and m r,0 are the pixels of the two edges of the left side or the right side of the trailer respectively.

[0015] In a second aspect, an embodiment of the present application further provides a trailer angle detection method device. The device is applied to an electronic device, and the electronic device is communicatively connected to a photographing device installed on the vehicle head. The rear side of the vehicle head is connected to the front side of the trailer, and the vehicle head and the trailer form a target vehicle. The device includes: an image acquisition module for acquiring the current captured image of the photographing device; where the current captured image is an image captured along the vertical direction of the plane formed by the photographing device and the vehicle head with the photographing device as the origin; an edge pixel determination module for determining the edge pixels of the trailer according to the current captured image; where the edge pixels are the pixel values occupied by the edges of at least one side of the trailer in the current captured image; an angle determination module for determining the current rotation angle of the trailer according to the edge pixels, the actual size of the trailer, and the photographing parameter information of the photographing device; where the current rotation angle is the rotation angle of the trailer relative to the vehicle head at present.

[0016] In a third aspect, an embodiment of the present application further provides an electronic device, including a processor and a memory. The memory stores computer-executable instructions that can be executed by the processor, and the processor executes the computer-executable instructions to implement the trailer angle detection method in the first aspect above.

[0017] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the trailer angle detection method in the first aspect above.

[0018] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0019] For the trailer angle detection method, device and electronic device provided in the embodiments of the present application, first, an image including the trailer is captured by a photographing device installed on the vehicle head, and the number of pixels occupied by the side edge of the trailer is recognized from the image. Finally, according to the edge pixels, the actual size information of the trailer, and the parameter information of the photographing device, the rotation angle of the trailer relative to the vehicle head at the current moment during driving is determined. The technology of the present application avoids the problem of limited scenarios caused by placing position recognition marks at specific positions on the trailer, and replaces expensive radar devices with cheaper photographing devices, which can expand the applicable scenarios while reducing the detection cost.

[0020] Other features and advantages of the present disclosure will be described in the following specification, or some features and advantages can be inferred from the specification or determined without doubt, or can be learned by implementing the above technologies of the present disclosure.

[0021] To make the above objects, features, and advantages of the present disclosure more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings required for the description of the specific embodiments or the prior art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0023] Figure 1 It is a schematic structural diagram of an electronic system provided by an embodiment of the present application;

[0024] Figure 2 It is a schematic structural diagram of a trailer model;

[0025] Figure 3Flowchart of a trailer angle detection method provided by an embodiment of the present application;

[0026] Figure 4 Flowchart of another trailer angle detection method provided by an embodiment of the present application;

[0027] Figure 5a Schematic structural diagram of a shooting device arranged on the rear side of the vehicle head provided by an embodiment of the present application;

[0028] Figure 5b Schematic structural diagram of shooting devices arranged on both the left side and the right side of the vehicle head provided by an embodiment of the present application;

[0029] Figure 5c Schematic structural diagram of shooting devices arranged on the rear side, the left side, and the right side of the vehicle head provided by an embodiment of the present application;

[0030] Figures 6a - 6b For an embodiment of the present application in Figure 5c Case of shooting a trailer image;

[0031] Figure 7 Schematic structural diagram of a trailer angle detection device provided by an embodiment of the present application;

[0032] Figure 8 Schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0033] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present application belong to the scope of protection of the present application.

[0034] The camera-based trailer angle detection method is an emerging topic for autonomous commercial trailers and a prerequisite for trailer control. Currently, existing technologies for trailer angle detection are based on vision, that is, by pasting a number of different two-dimensional codes on both sides of the trailer, and extracting the pose of the two-dimensional code in the camera coordinate system according to an algorithm, and determining the angle of the trailer in the vehicle body coordinate system based on the poses of different cameras in the vehicle body coordinate system. The defect of this solution is that the premise for this solution to be implemented is that two-dimensional codes must be pasted on the trailer, which will not only affect the aesthetics of the trailer, but also greatly affect the applicable range of trailer angle detection, because in practical applications, it is impossible to ensure that all trailers are pasted with two-dimensional codes. In some other existing technologies, trailer angle detection is completed based on rear and side-rear lidar, and the pose of the trailer is extracted through lidar point clouds. However, this trailer detection solution is based on lidar, and currently, the price of lidar is relatively high, and the cost of engineering deployment is relatively large. Based on this, the embodiments of the present application provide a trailer angle detection method, device, and electronic device to reduce the detection cost while expanding the applicable scenarios.

[0035] Refer to Figure 1 The schematic structural diagram of the electronic system 100 shown. This electronic system can be used to implement the trailer angle detection method and device of the embodiments of the present application.

[0036] As Figure 1 The schematic structural diagram of an electronic system shown. The electronic system 100 includes one or more processing devices 102 and one or more storage devices 104. Optionally, the electronic system 100 may further include one or more image acquisition devices 106. The storage device 104 is communicatively connected to the processing device 102, and the image acquisition device 106 is communicatively connected to the processing device 102. It should be noted that Figure 1 The components and structure of the electronic system 100 shown are only exemplary, not restrictive. According to needs, the electronic system may have Figure 1 Some of the components, or may have other components and structures.

[0037] The processing device 102 can be an intelligent terminal or a device including a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities. It can process the data of other components in the electronic system 100 and can also control other components in the electronic system 100 to execute the trailer angle detection method function.

[0038] The storage device 104 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processing device 102 may run the program instructions to implement the client functions (implemented by the processing device) in the embodiments of the present application below and / or other desired functions. Various application programs and various data may also be stored in the computer-readable storage medium, such as various data used and / or generated by the application programs, etc.

[0039] The image acquisition device 106 may be a camera, a video camera, a sensor, etc. The image acquisition device may acquire an image including the trailer and store the image in the storage device 104 for the processing device 102 to perform image processing.

[0040] Exemplarily, the various devices for implementing the trailer angle detection method, device, and electronic device according to the embodiments of the present application may be integrally provided or separately provided. For example, the processing device 102 and the storage device 104 may be integrally provided, while the image acquisition device 106 is provided at a specified position where an image can be acquired.

[0041] For ease of understanding, first, in combination with Figure 2 the trailer structure to which the trailer angle detection method provided by the embodiments of the present application is applied will be introduced. As Figure 2 shown, it is a trailer model applied in the embodiments of the present application. In this model, it is assumed that the trailer is a non-deformable cube, the connection between the trailer and the vehicle head is a connection point, and the connection point remains stationary relative to the vehicle head. The trailer can only rotate around Figure 2 the rotation axis (z-axis) in the z-axis is a straight line perpendicular to the ground and passing through the connection point, the direction of the z-axis is vertically upward along the rotation axis, the length of the trailer is l, the width of the trailer is w, and the height of the trailer is h. Figure 2 The normal vector of the front plane of the trailer shown is the trailer direction, and the angle between the trailer direction and the x-axis is the rotation angle of the trailer.

[0042] Based on the above trailer model, the embodiments of the present application provide a trailer angle detection method. This method is applied to an electronic device, and the electronic device is communicatively connected to a shooting device installed on the vehicle head. The rear side of the vehicle head is connected to the front side of the trailer, and the vehicle head and the trailer form a target vehicle. As Figure 3 shown, this method includes the following steps:

[0043] S302: Obtain the current captured image of the imaging device; wherein, the current captured image is an image captured in the vertical direction of the plane formed by the imaging device and the vehicle head, with the imaging device as the origin.

[0044] Different installation positions of the imaging device will result in different fields of view included in the images captured by the imaging device. In the embodiments of the present application, the imaging device is installed on the vehicle head or in the middle between the vehicle head and the trailer, and the direction of its lens is along the vertical direction of the plane formed by the imaging device and the vehicle head.

[0045] S304: Determine the edge pixels of the trailer according to the current captured image; wherein, the edge pixels are the pixel values occupied by the edges of at least one side of the trailer in the current captured image.

[0046] The edge pixels are the number of pixels occupied by the straight line of a certain side of the trailer in the current captured image. When the trailer turns, the length of its side in the current captured image will change, that is, when the trailer does not turn and turns at different angles, the straight line of its side in the image will occupy different numbers of pixels. Since the ratio between the current captured image and the actual size of the trailer is fixed, and this ratio can be calculated from the shooting parameters of the imaging device, after obtaining the edge pixels, the actual angle of the trailer can be obtained by converting according to this ratio.

[0047] S306: Determine the current rotation angle of the trailer according to the edge pixels, the actual size of the trailer, and the shooting parameter information of the imaging device; wherein, the current rotation angle is the rotation angle of the trailer relative to the vehicle head at present.

[0048] Among them, the actual size of the trailer is used to represent the absolute size of the trailer, and specifically may include the width of the trailer, the height of the trailer, and the length of the trailer; wherein, the width of the trailer is used to represent the distance between the two vertical edges of the front side of the trailer, the left side and the right side of the trailer are adjacent and perpendicular to the rear side of the trailer, and the length of the trailer is used to represent the distance between the two vertical edges of the left side or the right side of the trailer.

[0049] The shooting parameter information of the imaging device is used to determine the corresponding relationship between the actual size of the trailer and the image size of the trailer in the current captured image. Different imaging devices will have different ratio relationships between the image and the physical object due to different factors such as their focal lengths and heights. Therefore, it is necessary to determine the ratio relationship between the actual size of the trailer and the size in the image according to the shooting parameter information. Specifically, the shooting parameter information may include: the focal length of the imaging device, the height of the image captured by the imaging device, and the height of the photosensitive chip in the imaging device from the ground.

[0050] In the above-mentioned trailer angle detection method provided by the embodiment of the present application, first, an image containing the trailer is captured by a photographing device installed on the vehicle head, and the pixels occupied by the side edge of the trailer are identified from the image. Finally, according to the edge pixels, the actual size information of the trailer, and the parameter information of the photographing device, the rotation angle of the trailer relative to the vehicle head at the current moment during driving is determined. The technology of the present application avoids the problem of limited scenarios caused by placing position recognition marks at specific positions of the trailer, and replaces expensive radar devices with cheaper photographing devices, which can expand the applicable scenarios while reducing the detection cost.

[0051] After an image containing the trailer is captured by the imaging device, in addition to the trailer, the image often also contains other objects such as the surrounding environment, which will interfere with the accuracy of the detected angle during the trailer angle detection process. Therefore, in the specific implementation process of the above step S304, the step of determining the edge pixels of the trailer according to the currently captured image may specifically be:

[0052] (1) A segmented image containing only the trailer is segmented from the currently captured image through an image semantic detection algorithm;

[0053] (2) Determine the edge pixels of the trailer according to the segmented image.

[0054] Specifically, the above-mentioned image semantic detection algorithm automatically segments and identifies the content in the image. For example, given a photo of a person riding a motorcycle, the machine should be able to identify different objects after judgment. For example, the person is marked in red and the vehicle is marked in green. The image semantic detection algorithm can be an algorithm in the related art. For example, the simplest pixel-level "threshold method" (Thresholding methods), segmentation methods based on pixel clustering (Clustering-based segmentation methods), segmentation methods of "graph partitioning" (Graph partitioning segmentation methods), deep learning (Deep learning, DL), etc. The embodiment of the present application does not limit the specific image semantic detection algorithm.

[0055] Furthermore, since the change in the trailer angle is slow relative to the frequency of the photographing device, the range of the trailer angle in this frame can be estimated based on the trailer angle measured in the previous frame.

[0056] Based on this, in the specific implementation process of the above step S304, the step of determining the edge pixels of the trailer according to the currently captured image may also specifically be:

[0057] (1) Determine the current angle range of the trailer based on the historical angle of the trailer in the image captured by the imaging device last time, the image frame rate, and the angular velocity threshold of the trailer;

[0058] (2) Determine the edge pixels of the trailer based on the current captured image and the current angle range.

[0059] For example, assume that the frame rate of the image is 10HZ, and the upper limit of the angular velocity of the trailer is 50° / s. Then, relative to the previous frame, the change range of the trailer angle is 5°. For example, if the trailer angle in the previous frame is 5°, then the range of the trailer angle in the current frame is 0° to 10°. After identifying the current angle range, if imaging devices at multiple different positions are used to obtain the trailer image, the imaging device that can capture a relatively more accurate image can be determined according to the current angle range, and the angle detection can be performed based on the image captured by this imaging device. In this way, the accuracy of the angle detection can be effectively improved.

[0060] Figure 4 Another trailer angle detection method provided by an embodiment of the present application is shown. This method focuses on describing how to calculate edge pixels. As Figure 4 shown, this method specifically includes the following steps:

[0061] S402: Obtain the current captured image of the imaging device; where the current captured image is an image captured in the vertical direction of the plane formed by the imaging device and the vehicle head with the imaging device as the origin;

[0062] S404: Determine the current angle range of the trailer based on the historical angle of the trailer in the image captured by the imaging device last time, the image frame rate, and the angular velocity threshold of the trailer;

[0063] Steps S402 - S404 are similar to steps S302 - S304 in the above embodiment of the present application, and will not be described in detail here.

[0064] S406: Compare the current angle range with a preset angle range threshold, and determine the target side of the trailer according to the comparison result; where the target side of the trailer includes one of the following: the left side of the trailer, the right side of the trailer, the front side of the trailer, and the left side and the right side of the trailer are adjacent to and perpendicular to the front side of the trailer respectively.

[0065] The preset angle range can be one or multiple, which is specifically determined according to the number and positions of the imaging devices set on the vehicle head. For example, if only one imaging device is set, then the preset angle range is correspondingly set to one angle range, and as long as it is within this angle range, the current angle of the trailer can be detected. If the imaging devices are set at two different positions, then the preset angle range can be set to two angle ranges, with each angle range corresponding to one imaging device. For example, if one imaging device is set on the left side and one imaging device is set on the right side, then the preset angle range can be set to include a first preset angle range and a second preset angle range. The first preset angle range corresponds to the optimal shooting angle of the imaging device on the left side, and the second preset angle range corresponds to the optimal shooting angle of the imaging device on the right side. When the current angle range falls within the first preset angle range, the left side is determined as the target side, and when the current angle range falls within the second preset angle range, the right side is determined as the target side.

[0066] S408: Calculate the edge pixels corresponding to the two vertical edges of the target side in the current captured image;

[0067] The edge pixels corresponding to the two vertical edges of the target side can specifically be the difference in pixel values of the two vertical edges, and this difference characterizes the length of the horizontal edge of the target side in the image. For example, if the target side is the left side, then the left vertical edge and the right vertical edge of the left side each have their corresponding pixel positions in the image. Subtracting these two pixel positions gives the edge pixels.

[0068] S410: Determine the current rotation angle of the trailer according to the edge pixels, the actual size of the trailer, and the shooting parameter information of the imaging device; wherein, the current rotation angle is the rotation angle of the trailer relative to the vehicle head at present.

[0069] In the above method, first, which side is used as the basis for angle detection is determined within the currently predicted angle range, making the angle detection more accurate.

[0070] In specific implementation, different installation positions of the imaging device often result in different target sides determined according to the image obtained by the imaging device. Generally speaking, the image in front of the trailer is detected by the rearward imaging device, the left image of the trailer is detected by the left imaging device, and the right image of the trailer is detected by the right imaging device. Therefore, in the trailer angle detection method provided in the embodiments of the present application, there are three different installation schemes for the imaging device:

[0071] (1) Scheme 1: As Figure 5a shown, install the imaging device on the rear side of the vehicle head. Figure 5aAmong them, the coordinates of the connection point are (x, y), and the coordinates of the four corners of the trailer are (x0, y0), (x1, y1), (x2, y2), and (x3, y3) in the clockwise direction respectively.

[0072] (2) Solution two: As Figure 5b shown, a photographing device is installed on both the left side and the rear side of the vehicle head, and the coordinates of each point are the same as Figure 5a those;

[0073] (3) Solution three: As Figure 5c shown, a photographing device is installed on the rear side, the left side and the right side of the vehicle head, and the coordinates of each point are the same as Figure 5a those.

[0074] For solution one, please continue to refer to Figure 5a , in this solution, the photographing device is installed in the middle of the vehicle head and the trailer, or installed on the rear side of the vehicle head, where Figure 5a is the perspective of looking down. The photographing device installed on the rear side faces the front of the trailer. The front of the vehicle head corresponds to the positive x-axis direction, and the left side of the vehicle head corresponds to the positive y-axis direction. In this case, the step of "comparing the current angle range with the preset angle range threshold and determining the target side according to the comparison result" in the above step S408 can specifically include:

[0075] If the current angle range is within the first preset angle range, the front side of the trailer is determined as the target side.

[0076] Specifically, if the front side of the trailer is determined as the target side, then the photographing device on the rear side uses an image semantic detection algorithm to segment the pixels in front of the trailer from the entire picture, and then extracts the left and right edge pixels in front of the trailer respectively. The number of pixels of the left and right edges in the image is calculated according to the pixels of the left and right edges in front of the trailer.

[0077] Furthermore, after obtaining the edge pixels, the actual size of the trailer, and the photographing parameter information of the photographing device, the rotation angle of the trailer can be calculated according to the following formula:

[0078]

[0079] Among them, f is the focal length of the camera device, M is the height of the current captured image, h is the height of the trailer, w is the width of the trailer, s m is the height of the photosensitive chip in the photographing device, m b,0 and m b,3 are the pixels of the two edges of the front side of the trailer respectively.

[0080] This solution only uses a shooting device on the rear side, and the shooting device on the rear side does not need to be blocked by other obstacles, so the reliability of trailer angle detection is relatively high and the cost is relatively low.

[0081] For Solution 2: The shooting device on the left side is installed at the front left of the vehicle head, and the shooting device on the right side is installed at the front right of the vehicle head. That is, in some possible implementation manners, the shooting device includes at least two. At least one shooting device is installed on the left side of the vehicle head, and at least one shooting device is installed on the right side of the vehicle head. In this case, comparing the current angle range with the preset angle range threshold in step S408 above and determining the target side according to the comparison result may specifically include:

[0082] (1) If the current angle range is within the second preset angle range, determine the left side of the trailer as the target side;

[0083] (2) Otherwise, determine the right side of the trailer as the target side.

[0084] If the right side is the target side, then the right rear shooting device uses the image semantic detection algorithm to segment the pixels of the right side of the trailer from the entire picture, and then extracts the left edge and right edge pixels of the right side of the trailer. Calculate the number of pixels m of the left and right edges in the image according to the pixels of the left and right edges of the right side of the trailer r,1 and m r,0 . The trailer angle θ is:

[0085]

[0086] where l is the length of the trailer, and the angle range that the right rear shooting device can detect is 0° to 180°.

[0087] If the left side is the target side, then the left rear shooting device uses the image semantic detection algorithm to segment the pixels of the left side of the trailer from the entire picture, and then extracts the left edge and right edge pixels of the left side of the trailer. Calculate the number of pixels m of the left and right edges in the image according to the pixels of the left and right edges of the left side of the trailer l,3 and m l,2 . The trailer angle θ is:

[0088]

[0089] where the angle range that the left rear shooting device can detect is -180° to 0°.

[0090] Based on the above description, in some possible implementation manners, after obtaining the edge pixels, the actual size of the trailer, and the shooting parameter information of the shooting device, the rotation angle of the trailer can be calculated according to the following formula:

[0091]

[0092] Among them, f is the focal length of the imaging device, M is the height of the currently captured image, h is the height of the trailer, l is the length of the trailer, s m is the height of the photosensitive chip in the imaging device from the ground, m r,1 and m r,0 are respectively the pixels of the two edges of the left or right side of the trailer.

[0093] Based on this, for the installation scheme of the left and right rear-facing imaging devices, when the trailer angle is 0° to 180°, the formula (2) is used to calculate the trailer angle. At this time, m r,1 and m r,0 are respectively the pixels of the two edges of the left side of the trailer; when the trailer angle is -180° to 0°, the formula (2) is used to calculate the trailer angle. At this time, m r,1 and m r,0 are respectively the pixels of the two edges of the right side of the trailer.

[0094] This scheme uses the imaging devices on the left and right sides. Since the imaging devices on the left and right sides can detect not only the trailer but also the side and rear obstacles, the cost of this scheme is relatively low. In addition, due to the relatively large length of the trailer on the side, the accuracy of the detection angle obtained by the imaging devices on the left and right sides is relatively high.

[0095] For Solution 3: The imaging device on the left side is installed at the front left of the vehicle head, the imaging device on the right side is installed at the front right of the vehicle head, and the imaging device on the rear side is installed between the vehicle head and the trailer, or the imaging device on the rear side is installed on the rear side of the vehicle head. That is, the imaging device includes at least three. At least one imaging device is installed on the left side of the vehicle head, at least one imaging device is installed on the right side of the vehicle head, and at least one imaging device is installed on the rear side of the vehicle head or between the vehicle head and the trailer; Based on this, the step of "comparing the current angle range with the preset angle range threshold and determining the target side according to the comparison result" in the above step S408 can specifically include:

[0096] (1) If the current angle range is within the third preset angle range, the left side of the trailer is determined as the target side;

[0097] (2) If the current angle range is within the fourth preset angle range, the right side of the trailer is determined as the target side;

[0098] (3) If the current angle range is outside the third preset angle range and the fourth preset angle range, the front side of the trailer is determined as the target side; among them, the third preset angle range and the fourth preset angle range do not overlap.

[0099] Such asFigure 6a and Figure 6b As shown in Figure 6b , the imaging device on the rear side is on the x-axis, facing the front of the trailer directly, the imaging plane is parallel to the front of the trailer, and the angle of the trailer is denoted as θ. Based on the angle calculation methods described in the above two cases, for the case of installing the imaging device using Solution 3, when the predicted trailer angle is -45° to 45°, the front side of the trailer is determined as the target side, and then Formula (1) is used to calculate the trailer angle; when the predicted trailer angle is 45° to 180°, the left side of the trailer is determined as the target side, and then Formula (2) is used to calculate the trailer angle; when the trailer angle is -180° to -45°, the right side of the trailer is determined as the target side, and then Formula (2) is used to calculate the trailer angle.

[0100] This solution uses the most imaging devices and can capture images with a relatively large field of view of each side of the trailer. Therefore, through this solution, the accuracy and reliability of the detected trailer angle can be further improved. At the same time, since there are imaging devices in all directions, it is avoided that the imaging device in one direction is blocked by other obstacles, which affects the reliability of trailer detection.

[0101] Based on the above method embodiments, an embodiment of the present application further provides a trailer angle detection method device, which is applied to an electronic device. The electronic device is communicatively connected to an imaging device installed on the vehicle head. The rear side of the vehicle head is connected to the front side of the trailer, and the vehicle head and the trailer form a target vehicle. Referring to Figure 7 shown in Figure 7 , the device includes:

[0102] An image acquisition module 702, configured to acquire a current captured image of the imaging device; wherein, the current captured image is an image captured along the vertical direction of the plane formed by the imaging device and the vehicle head with the imaging device as the origin;

[0103] An edge pixel determination module 704, configured to determine the edge pixels of the trailer according to the current captured image; wherein, the edge pixels are the pixel values occupied by the edges of at least one side of the trailer in the current captured image;

[0104] An angle determination module 706, configured to determine the current rotation angle of the trailer according to the edge pixels, the actual size of the trailer, and the shooting parameter information of the imaging device; wherein, the current rotation angle is the rotation angle of the trailer relative to the vehicle head at present.

[0105] The above-mentioned trailer angle detection device provided by the embodiment of the present application first captures an image containing the trailer through a photographing device installed on the vehicle head, and identifies the pixels occupied by the side edge of the trailer from the image. Finally, according to the edge pixels, the actual size information of the trailer, and the parameter information of the photographing device, the rotation angle of the trailer relative to the vehicle head at the current moment during driving is determined. The technology of the present application avoids the problem of limited scenarios caused by placing position recognition marks at specific positions of the trailer, and uses a cheaper photographing device to replace an expensive radar device, which can expand the applicable scenarios while reducing the detection cost.

[0106] The above-mentioned edge pixel determination module 704 is further configured to segment a segmented image containing only the trailer from the currently captured image through an image semantic detection algorithm; and determine the edge pixels of the trailer according to the segmented image.

[0107] The actual size of the above-mentioned trailer includes the width, height, and length of the trailer; wherein, the width of the trailer is used to represent the distance between the two vertical edges of the front side of the trailer, the left side and the right side of the trailer are adjacent to and perpendicular to the rear side of the trailer, and the length of the trailer is used to represent the distance between the two vertical edges of the left side or the right side of the trailer; the shooting parameter information of the above-mentioned shooting device includes: the focal length of the shooting device, the height of the image captured by the shooting device, and the height of the photosensitive chip in the shooting device from the ground.

[0108] The above-mentioned edge pixel determination module 704 is further configured to determine the current angle range of the trailer according to the historical angle of the trailer in the image captured by the shooting device last time, the image frame rate, and the angular velocity threshold of the trailer; and determine the edge pixels of the trailer according to the currently captured image and the current angle range.

[0109] The process of determining the edge pixels of the trailer according to the currently captured image and the current angle range includes: comparing the current angle range with a preset angle range threshold, and determining the target side of the trailer according to the comparison result; wherein, the target side of the trailer includes one of the following: the left side of the trailer, the right side of the trailer, the front side of the trailer, and the left side and the right side of the trailer are respectively adjacent to and perpendicular to the front side of the trailer; calculate the edge pixels corresponding to the two vertical edges of the target side in the currently captured image.

[0110] The above-mentioned shooting device is installed on the rear side of the vehicle head, or the shooting device is installed in the middle of the vehicle head and the trailer; the process of comparing the current angle range with a preset angle range threshold and determining the target side according to the comparison result includes: if the current angle range is within the first preset angle range, determine the front side of the trailer as the target side.

[0111] The rotation angle of the above-mentioned trailer is calculated according to the following formula: Wherein, f is the focal length of the imaging device, M is the height of the currently captured image, h is the height of the trailer, w is the width of the trailer, s m is the height of the photosensitive chip in the imaging device, m b,0 and m b,3 are the pixels of the two edges of the front side of the trailer respectively.

[0112] The above imaging device includes at least two. At least one imaging device is installed on the left side of the vehicle head, and at least one imaging device is installed on the right side of the vehicle head. The process of comparing the current angle range with the preset angle range threshold and determining the target side according to the comparison result includes: if the current angle range is within the second preset angle range, the left side of the trailer is determined as the target side; otherwise, the right side of the trailer is determined as the target side.

[0113] The above imaging device includes at least three. At least one imaging device is installed on the left side of the vehicle head, at least one imaging device is installed on the right side of the vehicle head, and at least one imaging device is installed on the rear side of the vehicle head or between the vehicle head and the trailer. The process of comparing the current angle range with the preset angle range threshold and determining the target side according to the comparison result includes: if the current angle range is within the third preset angle range, the left side of the trailer is determined as the target side; if the current angle range is within the fourth preset angle range, the right side of the trailer is determined as the target side; if the current angle range is outside the third preset angle range and the fourth preset angle range, the front side of the trailer is determined as the target side; wherein, the third preset angle range and the fourth preset angle range do not overlap.

[0114] The rotation angle of the above trailer is calculated according to the following formula: Wherein, f is the focal length of the imaging device, M is the height of the currently captured image, h is the height of the trailer, l is the length of the trailer, s m is the height of the photosensitive chip in the imaging device from the ground, m r,1 and m r,0 are the pixels of the two edges of the left side or the right side of the trailer respectively.

[0115] The trailer angle detection method and device provided by the embodiments of the present application have the same implementation principle and technical effects as those of the foregoing method embodiments. For brief description, for the parts not mentioned in the embodiments of the above device, reference may be made to the corresponding content in the foregoing trailer angle detection method embodiments.

[0116] The embodiments of the present application also provide an electronic device, such as Figure 8As shown, it is a schematic structural diagram of the electronic device. Among them, the electronic device includes a processor 1501 and a memory 1502. The memory 1502 stores computer-executable instructions that can be executed by the processor 1501, and the processor 1501 executes the computer-executable instructions to implement the above-mentioned trailer angle detection method.

[0117] In Figure 8 the illustrated embodiment, the electronic device further includes a bus 1503 and a communication interface 1504. Among them, the processor 1501, the communication interface 1504, and the memory 1502 are connected through the bus 1503.

[0118] Among them, the memory 1502 may include a high-speed random access memory (RAM, Random Access Memory), and may also include a non-volatile memory, such as at least one disk memory. Through at least one communication interface 1504 (which can be wired or wireless), a communication connection is realized between the system network element and at least one other network element, and the Internet, wide area network, local area network, metropolitan area network, etc. can be used. The bus 1503 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus 1503 can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 8 only a bidirectional arrow is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0119] The processor 1501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in the processor 1501 or the instructions in the form of software. The above-mentioned processor 1501 may be a general-purpose processor, including a central processing unit (CPU for short), a network processor (NP for short), etc.; it may also be a digital signal processor (DSP for short), an application specific integrated circuit (ASIC for short), a field-programmable gate array (FPGA for short), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by a combination of the hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor 1501 reads the information in the memory and combines its hardware to complete the steps of the trailer angle detection method in the foregoing embodiments.

[0120] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the above-mentioned trailer angle detection method. For the specific implementation, reference can be made to the foregoing method embodiments, and details are not described herein again.

[0121] The computer program product of the trailer angle detection method, device, and electronic device provided by the embodiments of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method described in the foregoing method embodiments. For the specific implementation, reference can be made to the method embodiments, and details are not described herein again.

[0122] Unless otherwise specifically stated, the relative steps, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present application.

[0123] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.

[0124] In the description of this application, it should be noted that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing this application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation to this application. In addition, the terms "first", "second", "third" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance.

[0125] Finally, it should be noted that: the above-mentioned embodiments are only specific implementation manners of this application, used to illustrate the technical solutions of this application, rather than limiting it. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed in this application can still modify the technical solutions recorded in the foregoing embodiments or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of this application and should all be covered within the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims

1. A trailer angle detection method, characterized in that, The method is applied to an electronic device, which is communicatively connected to a photographing device installed on the front of a vehicle. The rear side of the front of the vehicle is connected to the front side of a trailer. The front of the vehicle and the trailer form a target vehicle. The method includes: Obtain a current photographed image of the photographing device; wherein, the current photographed image is an image obtained by photographing in a direction perpendicular to the plane formed by the photographing device and the front of the vehicle, with the photographing device as the origin; Determine the edge pixels of the trailer according to the current photographed image; wherein, the edge pixels are the pixel values occupied by the edges of at least one side of the trailer in the current photographed image; Determine the current rotation angle of the trailer according to the edge pixels, the actual size of the trailer, and the photographing parameter information of the photographing device; wherein, the current rotation angle is the rotation angle of the trailer relative to the front of the vehicle at present; The step of determining the edge pixels of the trailer according to the current photographed image includes: Determine the current angle range of the trailer according to the historical angle of the trailer, the image frame rate, and the angular velocity threshold of the trailer in the previous photographed image of the photographing device; Determine the edge pixels of the trailer according to the current photographed image and the current angle range; The step of determining the edge pixels of the trailer according to the current photographed image and the current angle range includes: Compare the current angle range with a preset angle range threshold, and determine the target side of the trailer according to the comparison result; wherein, the target side of the trailer includes one of the following: the left side of the trailer, the right side of the trailer, the front side of the trailer. The left side and the right side of the trailer are adjacent to and perpendicular to the front side of the trailer respectively; Calculate the edge pixels corresponding to the two vertical edges of the target side in the current photographed image; The photographing device is installed on the rear side of the front of the vehicle, or the photographing device is installed between the front of the vehicle and the trailer; The step of comparing the current angle range with a preset angle range threshold and determining the target side according to the comparison result includes: If the current angle range is within a first preset angle range, determine the front side of the trailer as the target side; Calculate the rotation angle of the trailer according to the following formula: where f is the focal length of the imaging device, M is the height of the current captured image, h is the height of the trailer, w is the width of the trailer, s m is the height of the photosensitive chip within the imaging device, m b,0 and m b,3 are respectively the pixels of the two edges of the front side of the trailer.

2. The method according to claim 1, wherein The step of determining the edge pixels of the trailer according to the current photographed image includes: Segment out a segmented image containing only the trailer from the current photographed image through an image semantic detection algorithm; Determine the edge pixels of the trailer according to the segmented image.

3. The method according to claim 1, wherein The actual size of the trailer includes the width, the height, and the length of the trailer; wherein, the width of the trailer is used to represent the distance between the two vertical edges of the front side of the trailer. The left side and the right side of the trailer are adjacent to and perpendicular to the rear side of the trailer. The length of the trailer is used to represent the distance between the two vertical edges of the left side or the right side of the trailer; The shooting parameter information of the shooting device includes: the focal length of the shooting device, the height of the image obtained by the shooting device, and the height of the photosensitive chip in the shooting device from the ground.

4. The method according to claim 1, characterized in that, There are at least two of the shooting devices, at least one shooting device is installed on the left side of the vehicle head, and at least one shooting device is installed on the right side of the vehicle head; The step of comparing the current angle range with a preset angle range threshold and determining the target side according to the comparison result includes: If the current angle range is within the second preset angle range, the left side of the trailer is determined as the target side; Otherwise, the right side of the trailer is determined as the target side.

5. The method according to claim 1, characterized in that There are at least three of the shooting devices, at least one shooting device is installed on the left side of the vehicle head, at least one shooting device is installed on the right side of the vehicle head, and at least one shooting device is installed on the rear side of the vehicle head or between the vehicle head and the trailer; The step of comparing the current angle range with a preset angle range threshold and determining the target side according to the comparison result includes: If the current angle range is within the third preset angle range, the left side of the trailer is determined as the target side; If the current angle range is within the fourth preset angle range, the right side of the trailer is determined as the target side; If the current angle range is outside the third preset angle range and the fourth preset angle range, the front side of the trailer is determined as the target side; wherein, the third preset angle range and the fourth preset angle range do not overlap.

6. A trailer angle detection device, characterized in that, For implementing the trailer angle detection method according to any one of claims 1 to 5, the device is applied to an electronic device, the electronic device is communicatively connected to a shooting device installed on the vehicle head, the rear side of the vehicle head is connected to the front side of the trailer, and the vehicle head and the trailer form a target vehicle. The device includes: An image acquisition module for acquiring the current captured image of the shooting device; wherein, the current captured image is an image obtained by shooting in the vertical direction along the plane formed by the shooting device and the vehicle head with the shooting device as the origin. An edge pixel determination module for determining the edge pixels of the trailer according to the current captured image; wherein, the edge pixels are the pixel values occupied by the edges of at least one side of the trailer in the current captured image. An angle determination module for determining the current rotation angle of the trailer according to the edge pixels, the actual size of the trailer, and the shooting parameter information of the shooting device; wherein, the current rotation angle is the rotation angle of the trailer relative to the vehicle head at present.

7. An electronic device, characterized in that, It includes a processor and a memory, the memory stores computer executable instructions that can be executed by the processor, and the processor executes the computer executable instructions to implement the method according to any one of claims 1 - 5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when called and executed by a processor, cause the processor to implement the method according to any one of claims 1-5.

Citation Information

Patent Citations

  • Method and device for measuring rotation angle of trailer

    CN114494200A