Vision-based trailer bed tilt angle detection method and detection system
By installing calibration plate patterns and cameras on the trailer, the tilt angle of the trailer can be calculated in real time and alarms can be issued in stages, which solves the problem of detecting the tilt angle of the trailer during operation and improves the stability and safety of the vehicle.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies make it difficult to efficiently and conveniently detect the tilt angle of the trailer during operation, resulting in reduced vehicle stability and safety.
A vision-based detection method is adopted. By setting a calibration plate pattern and a camera on the carriage, the angle between the line connecting the center points of the rectangular blocks and the horizontal axis of the image coordinate system is calculated in real time. Combined with a hierarchical alarm system, the tilt angle of the carriage is detected and alarmed in real time.
It enables real-time detection and alarm of the trailer's tilt angle during operation, improving vehicle stability and safety and helping drivers respond promptly to tilting situations.
Smart Images

Figure CN114993209B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing, and more specifically, to a vision-based method and system for detecting the tilt angle of a trailer trailer. Background Technology
[0002] With the development of the national economy, the number of trailers has increased rapidly, and they are being used more and more in transportation. During use, due to harsh road conditions and cargo loading, issues such as loosening of bottom fixing bolts and wheel hub bearings, and breakage of leaf springs can cause the load-bearing axle to become misaligned. Misalignment of the load-bearing axle causes the vehicle to veer, leading to a decrease in vehicle stability, straight-line driving ability, and anti-skid performance, thus reducing vehicle driving safety. To ensure that trailers are in good technical condition and can transport goods safely and efficiently, minimizing the possibility of traffic accidents, it is necessary to constantly monitor the tilt angle of the trailer's cargo box.
[0003] Excessive trailer body tilt angle poses a significant hazard to trailers, and researchers both domestically and internationally have proposed numerous solutions. Traditional methods for directly detecting trailer body tilt angle require the installation of various devices at the bottom, which is difficult and demands stringent testing conditions. This makes it challenging to perform the detection smoothly while the vehicle is in motion. However, the most direct consequence of trailer body axle misalignment is trailer body tilting. Therefore, a vision-based method for detecting trailer body tilt angle is urgently needed. Summary of the Invention
[0004] In view of the prior art, the technical problem solved by this application is to provide a vision-based method and system for detecting the tilt angle of a trailer trailer. This method and system detect the tilt angle of the trailer trailer based on image processing methods, and can detect the tilt angle of the trailer trailer trailer in real time during the operation of the trailer trailer.
[0005] To address the aforementioned technical problems, in a first aspect, this application provides a vision-based method for detecting the tilt angle of a trailer trailer, used to detect the tilt angle of a trailer trailer towed by a tractor during operation, comprising:
[0006] Create a calibration plate pattern comprising multiple rectangular blocks arranged horizontally side by side, and spray or fix the calibration plate pattern on the side of the vehicle body facing the front of the tractor. Install a camera on the front of the tractor and position the camera directly in front of the center of the calibration plate pattern. Each rectangular block includes a black area and a rectangular white area surrounded by the black area. The white area is located at the center of the rectangular block, and the four sides of the white area of the rectangle correspond to the four sides of the outer perimeter of the rectangular block.
[0007] Calculate the initial tilt angle α of the carriage: acquire the initial calibration plate image captured by the camera, calculate the angle β between the line connecting the center points of multiple rectangular blocks in the initial calibration plate image and the horizontal axis of the image coordinate system, and denote α = β;
[0008] Real-time detection of the tilt angle θ of the trailer being towed by the tractor during operation: Every n seconds, acquire a frame of calibration board image captured by the camera during the tractor's movement, and calculate the angle θ between the line connecting the center points of multiple rectangular blocks in that frame of the calibration board image and the horizontal axis of the image coordinate system; and
[0009] Detection alarm: Acquire the change value γ of the tilt angle of the carriage during the driving process, where γ=|θ-α|. When γ is greater than the set threshold V, remind the driver of the tilt angle of the carriage.
[0010] In one possible implementation, the calibration plate pattern is set to have three rectangular blocks arranged side by side, and the length of each side of the white area of the rectangle is set to be half the length of the corresponding side of the outer perimeter of the rectangle. The steps for real-time detection of the tilt angle θ of the trailer towed by the tractor during driving include:
[0011] A frame of calibration board image captured by the camera during the tractor's movement is processed into grayscale and then binarized so that the grayscale value of the black rectangular area is 0 and the grayscale value of the white rectangular area is 255.
[0012] Using the top left corner of the image as the origin, the binarized calibration board image of that frame is traversed row by row and column by column. The first, second, and third rectangular blocks arranged along the horizontal axis are searched sequentially, and the center point O1(C) of the first rectangular block is calculated. x1 C y1 ), the center point O2 (C) of the second rectangular block x2 C y2 ) and the center point O3(C) of the third rectangular block x3 C y3 );
[0013] Calculate the tilt angle θ: θ = arctan(C y3 -C y1 ) / (C x3 -C x1 ).
[0014] In one possible implementation, the size of each frame of the calibration board image is set to W×H, and the steps of searching for the first rectangular block and solving for the center point of the first rectangular block include:
[0015] Traverse the binarized calibration plate image row by row and column by column until the first horizontal region with a black-to-white width ratio of 1:2:1 is encountered at the ordinate y = y0. Let this first region with a black-to-white width ratio of 1:2:1 be G1. Let the coordinates of the left and right endpoints and the width of region G1 be X, X, and X', respectively. L1 X R1 X R1 -X L1 The coordinates of the center point O1 of region G1 are O1((X R1 +X L1 ) / 2,y0);
[0016] Using the x-axis (X) R +X L Centered on (X) / 2 and with (X) R +X L Traverse the image horizontally in increments to the right in the form of ) / 2+1 until X. R The position, and the x-coordinate (X) R +X L Centered on (X) / 2 and with (X) R +X L Traverse the image horizontally in descending order to the left in the form of ) / 2-1 until X. L The position is determined by sequentially increasing and decreasing the horizontal position and then traversing the vertical position of the pixels in the calibration board image to find all regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1, and recording the upper endpoint U and lower endpoint D of all regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1.
[0017] Finding the ordinate of the center of the first rectangular block: Average the ordinates of the upper endpoints U obtained by traversing the image horizontally in ascending order to the right and horizontally in descending order to the left to obtain U. A The average of the ordinates of the lower endpoints D obtained by traversing the image horizontally in ascending order to the right and horizontally in descending order to the left is used to obtain D. A C y1 =(U A +D A ) / 2;
[0018] Using the ordinate (U) A +D A Centered on (U) / 2 and with (U) A +D A The image is traversed vertically upwards in the form of ) / 2+1 until U. A The position, and plotted on the ordinate (U A +D A Centered on (U) / 2 and with (U) A +D A Traverse the image vertically in descending order of ) / 2-1 until D.A The position is determined by sequentially increasing and decreasing the horizontal position and then traversing the vertical position of the pixels in the calibration board image to find all regions in the horizontal direction that satisfy the black-white-black width ratio of 1:2:1, and recording the left endpoint L and right endpoint R of all regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1.
[0019] To find the x-coordinate of the center of the first rectangular block: average the x-coordinates of the left endpoint U obtained from the upward and downward vertical traversal of the image to obtain L. A The average of the x-coordinates of the right endpoint R obtained by traversing the image vertically upwards and downwards is used to obtain R. A C x1 =(L A +R A ) / 2.
[0020] In one possible implementation, after completing the search of the first rectangular block and solving for the center point of the first rectangular block, the search of the second and third rectangular blocks is performed sequentially, with the second rectangular block being searched to the right of the first rectangular block and the third rectangular block being searched to the right of the second rectangular block.
[0021] In one possible implementation, the calibration board image is converted to grayscale: M(x,y) = 0.3*r(x,y) + 0.59*g(x,y) + 0.11*b(x,y); the calibration board image is then binarized: all pixels of the grayscale calibration board image are traversed, and if M(x,y) > t, then bin(x,y) = 0, otherwise bin(x,y) = 255;
[0022] Where M(x,y) is the grayscale result of pixel (x,y) of the calibration board image, r, g and b are the values of the red, green and blue channels of pixel (x,y) of the calibration board image, respectively; t is the binarization threshold, and bin(x,y) is the binarization result of pixel (x,y).
[0023] In one possible implementation, when there are three rectangular blocks arranged side by side in the calibration board pattern, the installed camera is positioned directly opposite the center point of the second rectangular block.
[0024] In one possible implementation, each rectangular block is a square rectangular block and the white area is a square rectangular block, with the four sides of the square white area corresponding to the four sides of the outer perimeter of the square rectangular block.
[0025] In one possible implementation, the detection alarm is a tiered alarm, specifically:
[0026] The threshold V is set to include a first threshold V1, a second threshold V2, and a third threshold V3, where V1 < V2 < V3;
[0027] When V1≤γ<V2, a Level 1 minor alarm is triggered; when V2≤γ<V3, a Level 2 continuous alarm is triggered; when γ≥V3, a Level 3 piercing alarm is triggered.
[0028] In one possible implementation, V1 = 5, V2 = 10, and V3 = 15.
[0029] Secondly, this application provides a system for detecting the tilt angle of a trailer trailer, used to detect the tilt angle of a trailer trailer towed by a tractor during travel. The system comprises a camera mounted on the tractor, a calibration plate pattern painted or fixedly mounted on the side of the trailer trailer facing the tractor, a processor mounted on the tractor, and an alarm mounted on the tractor. The processor is connected to the camera and the alarm. The camera is directly facing the center of the calibration plate image. The calibration plate pattern comprises multiple horizontally arranged rectangular blocks, each rectangular block consisting of a white rectangular block surrounded by a black area, with the white rectangular block located at the center and the area of the white area being half the area of the rectangular block. The processor is used to execute code to implement the vision-based trailer trailer tilt angle detection method.
[0030] In one possible implementation, the calibration board pattern includes three rectangular blocks arranged side by side. Each rectangular block includes a black area and a rectangular white area surrounded by the black area. The white area is located at the center of the rectangular block, and the four sides of the white area of the rectangle correspond to the four sides of the outer perimeter of the rectangular block.
[0031] The vision-based method and system for detecting the tilt angle of a trailer trailer provided in this application utilizes a specific calibration plate pattern comprising multiple rectangular blocks. Images of the calibration plate are acquired in real-time at n-second intervals. Based on these images, the angle θ between the line connecting the center points of the multiple rectangular blocks and the horizontal axis of the image coordinate system is detected in real-time. Finally, the detected angle θ is compared with the initial tilt angle α of the trailer trailer to determine the degree of tilt. This vision-based method primarily relies on image processing for detection, enabling real-time detection of the trailer trailer's tilt angle during operation and providing real-time alarms based on the detection results. This allows drivers to obtain real-time information about the trailer trailer's tilt status and take timely countermeasures. Attached Figure Description
[0032] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0033] Figure 1 This is a flowchart of a vision-based trailer trailer tilt angle detection method according to an embodiment of this application;
[0034] Figure 2 This is a calibration plate pattern developed for an embodiment of this application;
[0035] Figure 3 This is a flowchart illustrating the steps of real-time detection of the tilt angle θ of a trailer partially towed by a tractor during driving, according to an embodiment of this application.
[0036] Figure 4 This is a schematic diagram showing the angle θ between the line connecting the center points of the three rectangular blocks of the calibration board image in an embodiment of this application and the horizontal axis direction.
[0037] Figure 5 This is a schematic diagram of a horizontal and vertical straight line that is simultaneously penetrated by the black and white areas of a rectangular block during the rectangular block search process in an embodiment of this application.
[0038] Figure 6 This is a schematic diagram of a trailer trailer tilt angle detection system according to an embodiment of this application. Detailed Implementation
[0039] To make the technical problems, technical solutions, and beneficial effects to be solved by this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this application.
[0040] It should be noted that when a component is referred to as being "fixed to" or "set on" another component, it can be directly on or indirectly on that other component. When a component is referred to as being "connected to" another component, it can be directly connected to or indirectly connected to that other component.
[0041] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0042] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0043] The vision-based method and system for detecting the tilt angle of a trailer trailer, as described in this application, will now be described in detail with reference to the accompanying drawings.
[0044] Please refer to Figure 1 This application provides a vision-based method for detecting the tilt angle of a trailer trailer. A trailer typically includes a tractor unit and a trailer trailer towed by the tractor unit. This detection method is used to detect the tilt angle of the trailer trailer towed by the tractor unit during travel and includes:
[0045] Step S100: Create a calibration plate pattern comprising multiple horizontally arranged rectangular blocks and spray-paint or fix this calibration plate pattern on the side of the truck bed facing the tractor unit. Install a camera on the tractor unit, aligning the camera directly with the center of the calibration plate pattern. Each rectangular block includes a black area and a rectangular white area surrounded by the black area. The white area is located at the center of the rectangular block, and the four sides of the white area correspond parallel to the four outer sides of the rectangular block. The calibration plate pattern sprayed or fixed on the truck bed is as follows: Figure 2 As shown.
[0046] Step S200: Calculate the initial tilt angle α of the carriage: acquire the initial calibration plate image captured by the camera, calculate the angle β between the line connecting the center points of multiple rectangular blocks in the initial calibration plate image and the horizontal axis of the image coordinate system, and denote α = β;
[0047] Step S300: Real-time detection of the tilt angle θ of the trailer half-trailed by the tractor during the driving process: every n seconds, a frame of calibration board image captured by the camera during the driving process of the tractor is acquired, and the angle θ between the line connecting the center points of multiple rectangular blocks in the frame of calibration board image and the horizontal axis of the image coordinate system is calculated.
[0048] Step S400: Alarm detection: Obtain the change value γ of the tilt angle of the carriage during the driving process, where γ=|θ-α|. When γ is greater than the set threshold V, remind the driver of the tilt angle of the carriage.
[0049] In the above steps, the initial calibration board image is the first calibration board image taken after the camera is installed and the calibration board pattern is set, but before the trailer starts moving. During the tractor's movement, the angle between the line connecting the center points of multiple rectangular blocks in the calibration board image and the horizontal axis of the image coordinate system represents the tilt angle θ of the trailer half-trailed by the tractor. In one embodiment, in the calibration board pattern, each rectangular block is a square rectangular block, and the white area is also a square rectangular block. The four sides of the square white area correspond one-to-one with the four outer sides of the square rectangular block, such as... Figure 2 The pattern shown is a rectangular block.
[0050] Understandably, in the above steps, the calibration board image is an image containing the calibration board pattern captured by a camera.
[0051] In a vision-based method for detecting the tilt angle of a trailer trailer, a specific calibration plate pattern comprising multiple rectangular blocks is defined. Images of the calibration plate are acquired in real-time at n-second intervals. Based on these images, the angle θ between the line connecting the center points of the rectangular blocks and the horizontal axis of the image coordinate system is detected in real-time. Finally, the detected angle θ is compared with the initial tilt angle α of the trailer trailer to determine the degree of tilt. This vision-based method primarily relies on image processing for detection, enabling real-time detection of the trailer trailer's tilt angle during operation and providing real-time alarms based on the detection results. This allows drivers to obtain real-time information about the trailer trailer's tilt status and take timely countermeasures.
[0052] In one embodiment, acquiring a frame of calibration board image captured by the camera during the tractor's movement every n seconds can be every 1 or 2 seconds. In other embodiments, n can be other values, which can be set according to actual conditions. Understandably, the smaller the value of n, the more timely the driver obtains information about the tilt angle of the carriage.
[0053] In the above steps, the top left corner of the image is set as the origin of the image coordinate system, and the X-axis and Y-axis of the coordinate system are the horizontal and vertical directions, respectively. Three rectangular blocks are arranged side-by-side in the calibration plate pattern. The length of each side of the white area of the rectangle is set to half the length of the corresponding side of the outer perimeter of the rectangle. When there are three rectangular blocks arranged side-by-side in the calibration plate pattern, the installed camera is directly facing the center point of the second rectangular block. In one embodiment, each rectangular block is a square, and the white area is also a square.
[0054] Refer to together Figure 3 and Figure 4 In step S300, after acquiring a frame of calibration board image during the tractor's movement, the step of real-time detection of the tilt angle θ of the trailer partially towed by the tractor during movement includes:
[0055] Step S310: Perform grayscale processing on a calibration board image captured by the camera during the tractor's movement, and perform binarization processing on the calibration board image so that the grayscale value of the black rectangular area is 0 and the grayscale value of the white rectangular area is 255.
[0056] Step S320: Using the top left corner of the image as the origin, traverse the binarized calibration board image of that frame row by row and column by column, sequentially finding the first, second, and third rectangular blocks arranged along the horizontal axis and calculating the center point O1(C) of the first rectangular block. x1 C y1 ), the center point O2 (C) of the second rectangular block x2 C y2 ) and the center point O3(C) of the third rectangular block x3 C y3 );
[0057] Step S330: Calculate the tilt angle θ: θ = arctan(C y3 -C y1 ) / (C x3 -C x1 ).
[0058] In one embodiment of the application, the calibration board image is grayscaled: M(x,y)=0.3*r(x,y)+0.59*g(x,y)+0.11*b(x,y); the calibration board image is binarized: traversing all pixels of the grayscaled calibration board image, if M(x,y)>t, then bin(x,y)=0, otherwise bin(x,y)=255.
[0059] Where M(x,y) is the grayscale result of pixel (x,y) of the calibration board image, r, g, and b are the values of the red, green, and blue channels of pixel (x,y) of the calibration board image, respectively; t is the binarization threshold, and bin(x,y) is the binarized result of pixel (x,y). In one embodiment, t = 100.
[0060] It is worth noting that, for a straight line that runs through both the white and black areas, the ratio of the lengths of the segments of that line cut by a rectangular block to the lengths of the segments cut by the black area, the white area, and the black area in turn is 1:2:1.
[0061] In one embodiment, the size of each frame of the calibration board image is set to W×H, where W is the width along the horizontal axis and H is the height along the vertical axis. (Refer to...) Figure 5 In step S320, the steps of searching for the first rectangular block and solving for the center point of the first rectangular block include:
[0062] Step S321: Traverse the binarized calibration plate image row by row and column by column until the first horizontal black-white width ratio of 1:2:1 is encountered when the vertical coordinate y = y0. Denote the first black-white width ratio of 1:2:1 as G1, and the coordinates of the left endpoint, the right endpoint, and the width of region G1 as X, X, Y ... L1 X R1 X R1 -X L1 The coordinates of the center point O1 of region G1 are O1((X R1 +X L1 ) / 2,y0);
[0063] Step S322: Using the horizontal coordinate (X) R +X L Centered on (X) / 2 and with (X) R +X L Traverse the image horizontally in increments to the right in the form of ) / 2+1 until X. R The position, and the x-coordinate (X) R +X L Centered on (X) / 2 and with (X) R +X L Traverse the image horizontally in descending order to the left in the form of ) / 2-1 until X. L The position is determined by sequentially increasing and decreasing the horizontal position and then traversing the vertical position of the pixels in the calibration board image to find all regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1, and recording the upper endpoint U and lower endpoint D of all regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1.
[0064] Step S323: Calculating the ordinate of the center of the first rectangular block: Calculate the average of the ordinates of the upper endpoint U obtained by traversing the image horizontally increasing to the right and horizontally decreasing to the left to obtain U. A The average of the ordinates of the lower endpoints D obtained by traversing the image horizontally in ascending order to the right and horizontally in descending order to the left is used to obtain D. A C y1 =(U A +D A ) / 2;
[0065] Step S324: Using the ordinate (U) A +D A Centered on (U) / 2 and with (U) A +D A The image is traversed vertically upwards in the form of ) / 2+1 until U. AThe position, and plotted on the ordinate (U A +D A Centered on (U) / 2 and with (U) A +D A Traverse the image vertically in descending order of ) / 2-1 until D. A The position is determined by sequentially increasing and decreasing the horizontal position and then traversing the vertical position of the pixels in the calibration board image to find all regions in the horizontal direction that satisfy the black-white-black width ratio of 1:2:1, and recording the left endpoint L and right endpoint R of all regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1.
[0066] Step S325: Calculating the x-coordinate of the center of the first rectangular block: Average the x-coordinates of the left endpoint U obtained from the upward vertically increasing traversal and the downward vertically decreasing traversal to obtain L. A The average of the x-coordinates of the right endpoint R obtained by traversing the image vertically upwards and downwards is used to obtain R. A C x1 =(L A +R A ) / 2.
[0067] In steps S321-S325 above, the left and right directions are defined on the X-axis, with the direction pointing towards the image origin being left and the direction away from the image origin being right; the up and down directions are defined on the Y-axis, with the direction pointing towards the image origin being up and the direction away from the image origin being down.
[0068] In steps S321-S325 above, during the image traversal, all regions in the vertical direction and all regions in the horizontal direction that satisfy the black-white-black width ratio of 1:2:1 are searched. These regions with a black-white-black width ratio of 1:2:1 are straight-line regions. For example... Figure 5 As shown, Figure 5 The diagram illustrates a horizontal and vertical section of a straight line that is simultaneously traversed by the black and white areas of a rectangular block during the rectangular block search process. In step S322, when the horizontal coordinate is x = m, all pixels on the straight line at x = m are traversed. It is determined whether there exists a black area: white area: black area with a width ratio of 1:2:1. The upper endpoint U and the lower endpoint D are the two endpoints when the straight line is cut off by the rectangular block. Other cases are not described in detail.
[0069] In one embodiment, in step S320, after searching the first rectangular block and solving for its center point, the second and third rectangular blocks are searched sequentially. The second rectangular block is searched to the right of the first rectangular block, thus eliminating the influence of the already searched first rectangular block on the second rectangular block; similarly, the third rectangular block is searched to the right of the second rectangular block, thus eliminating the influence of the already searched first and second rectangular blocks on the third rectangular block. It is worth noting that the search methods for the second and third rectangular blocks are the same as those for the first rectangular block, and the method for solving for the center point of the second and third rectangular blocks is the same as that for the center point of the first rectangular block. This will not be repeated here; the same method as in step S300 is used.
[0070] In one embodiment of the application, in step S400, the detection alarm is a graded alarm, specifically:
[0071] The threshold V is set to include a first threshold V1, a second threshold V2, and a third threshold V3, where V1 < V2 < V3;
[0072] When V1≤γ<V2, a Level 1 minor alarm is triggered; when V2≤γ<V3, a Level 2 continuous alarm is triggered; when γ≥V3, a Level 3 piercing alarm is triggered.
[0073] It is worth noting that the tiered alarm system can implement different levels of alarms according to the different degrees of tilt of the carriage to alert the driver of the tilt, so that the driver can take timely action. Level 1, a slight alarm, provides a soft and intermittent audible alert, reminding the driver that the carriage is slightly tilted; Level 2, a continuous alarm, provides a continuous but not piercing audible alert, with a decibel level that is generally comfortable for the human ear, reminding the driver that the tilt angle is significant and requires attention; Level 3, a piercing alarm, emits a piercing sound, prompting the driver to pay close attention. In a specific embodiment, V1 = 5, V2 = 10, and V3 = 15.
[0074] In the above embodiment, in step S200, calculating the center points of the multiple rectangular blocks of the initial calibration plate image can be done using the same method as in step S320, calculating the angle between the connecting line of the three centers and the horizontal axis of the image coordinate system. Alternatively, it can be done through a physical measurement method, i.e., the initial tilt angle α can be measured in advance by equipment before the trailer travels.
[0075] Understandably, in the above embodiments, the horizontal axis is the X-axis of the image coordinate system, the vertical axis is the Y-axis of the image coordinate system, the origin of the image coordinate system is at the upper left corner of the image, the vertical axis is the Y-axis, and the horizontal axis is the X-axis.
[0076] Reference Figure 6This application also provides a trailer trailer tilt angle detection system for detecting the tilt angle of a trailer trailer 1 towed by a tractor 3 during operation. The detection system includes a camera 4 mounted on the tractor 3, a calibration plate pattern 2 painted or fixed on the side of the trailer trailer 1 facing the front of the tractor 3, a processor mounted on the tractor 3, and an alarm mounted on the tractor 3. The processor is connected to the camera 4 and the alarm. The camera 4 faces the center of the calibration plate image. The calibration plate pattern 2 comprises multiple horizontally arranged rectangular blocks, each rectangular block including a black area and a rectangular white area surrounded by the black area. The white area is located at the center of the rectangular block, and the four sides of the white area correspond parallel to the four sides of the outer perimeter of the rectangular block. The processor executes executable code to implement the vision-based trailer trailer tilt angle detection method.
[0077] Understandably, the camera 4 is used to capture images of the calibration board, the processor is used to process the images of the calibration board captured by the camera 4 to obtain the tilt angle of the carriage, and the alarm is used to perform alarm processing based on the processing result of the processor.
[0078] In one embodiment of the application, the calibration board pattern 2 includes three rectangular blocks arranged side by side, each rectangular block being a square and the white area being a square.
[0079] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A vision-based method for detecting the tilt angle of a trailer trailer, used to detect the tilt angle of a trailer trailer towed by a tractor during travel, characterized in that, The method comprises the following steps: A calibration board pattern comprising a plurality of rectangular blocks arranged side by side in the transverse direction is prepared and is sprayed or fixed on the side of the carriage facing the tractor head, a camera is installed on the tractor head and is directed at the center of the calibration board pattern, wherein each rectangular block comprises a black region and a rectangular white region surrounded by the black region, and the white region is located at the center of the rectangular block and the four edges of the rectangular white region are parallel to the four edges of the periphery of the rectangular block; An initial inclination angle α of the carriage is calculated: an initial calibration board image captured by the camera is obtained, an angle β between a line connecting the center points of the plurality of rectangular blocks of the initial calibration board image and the horizontal axis of the image coordinate system is calculated, and α = β; An inclination angle θ of the carriage during driving is detected in real time: a calibration board image captured by the camera during driving of the tractor is obtained every n seconds, and an angle θ between a line connecting the center points of the plurality of rectangular blocks in the calibration board image and the horizontal axis of the image coordinate system is calculated; and An alarm is detected: a change value γ of the inclination angle of the carriage during driving is obtained, wherein γ = |θ - α|, and when γ is greater than a set threshold value V, the driver is reminded of the inclination angle of the carriage.
2. The vision-based trailer bed pitch angle detection method of claim 1, wherein, The plurality of rectangular blocks arranged side by side in the calibration board pattern is set to three, the length of each side of the rectangular white region is set to half of the length of the corresponding side of the periphery of the rectangular block, and the step of detecting the inclination angle θ of the carriage during driving in real time comprises: The calibration board image captured by the camera during driving of the tractor is subjected to grayscale processing, and the calibration board image is subjected to binary processing so that the grayscale value of the black rectangular region is 0 and the grayscale value of the white rectangular region is 255; Taking the upper left corner of the image as the coordinate origin, the binarized frame calibration plate image is traversed row by row and column by column, the first, second and third rectangular blocks arranged along the horizontal axis direction are searched in turn, and the center point O1(C x1 ,C y1 ) of the first rectangular block, the center point O2(C x2 ,C y2 ) of the second rectangular block and the center point O3(C x3 ,C y3 ) of the third rectangular block are calculated. x1 y1 x2 y2 x3 y3 Calculate the tilt angle θ: θ = arctan (B / A) arctan (C y3 -C y1 ) / (C x3 -C x1 ).
3. The vision-based trailer bed pitch angle detection method of claim 2, wherein, The size of each calibration board image is set to W x H, and the steps of searching for the first rectangular block and solving the center point of the first rectangular block comprise: Traverse the binarized calibration plate image row by row and column by column until the first time the black-white-black width ratio is 1:2:1 region is encountered when the vertical coordinate y=y0, record the first time the black-white-black width ratio is 1:2:1 region as G1, record the left end point coordinate, right end point coordinate and width of the region G1 as X L1 , X R1 , X R1 -X L1 , the center point O1 coordinate of the region G1 is O1((X R1 +X L1 ) / 2,y0); with the horizontal coordinate (X R +X L ) / 2 as the center and in the form of (X R +X L ) / 2+1 traverses the image rightward and incrementally until the position of X R , and with the horizontal coordinate (X R +X L ) / 2 as the center and in the form of (X R +X L ) / 2-1 traverses the image leftward and decrementally until the position of X L , and each time traverses the pixel points of the image of the calibration board in the vertical direction after traversing rightward and leftward to find all the regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1, and records the upper endpoint U and the lower endpoint D of all the regions in the vertical direction that satisfy the black-white-black width ratio of 1:2:1; The solution of the ordinate of the center of the first rectangular block: average the ordinates of the upper end point U obtained by traversing the image rightward and leftward to obtain U A average the ordinates of the lower end point D obtained by traversing the image rightward and leftward to obtain D A , C y1 = (U A + D A ) / 2; with the ordinate (U A +D A ) / 2 as the center and in the form of (U A +D A ) / 2+1 vertically increasing upwards until the position of U A , and with the ordinate (U A +D A ) / 2 as the center and in the form of (U A +D A ) / 2-1 vertically decreasing downwards until the position of D A , each time the pixel points of the calibration plate image are sequentially traversed in the horizontal direction after increasing and decreasing to find all black-white-black regions in the horizontal direction with a width ratio of 1:2:1, and record the left end point L and the right end point R of all black-white-black regions in the vertical direction with a width ratio of 1:2:1; The solution of the horizontal coordinate of the center of the first rectangular block: average the horizontal coordinates of the left end point U obtained by traversing the image upward vertically and downward vertically to obtain L A , average the horizontal coordinates of the right end point R obtained by traversing the image upward vertically and downward vertically to obtain R A , C x1 = (L A + R A ) / 2.
4. The vision-based trailer bed pitch angle detection method of claim 3, wherein, After the search for the first rectangular block and the solution of the center point of the first rectangular block are completed, the search for the second rectangular block and the third rectangular block is sequentially performed, and the second rectangular block is searched on the right side of the first rectangular block and the third rectangular block is searched on the right side of the second rectangular block.
5. The vision-based trailer bed pitch angle detection method of claim 2, wherein, The calibration board image is subjected to grayscale processing: M(x, y) = 0.3 * r(x, y) + 0.59 * g(x, y) + 0.11 * b(x, y); and the calibration board image is subjected to binary processing: all pixels of the grayscale calibration board image are traversed, if M(x, y) > t, then bin(x, y) = 0, otherwise bin(x, y) = 255; wherein M(x, y) is the grayscale result of the pixel point (x, y) of the calibration board image, r, g and b are respectively the values of the red channel, the green channel and the blue channel of the pixel point (x, y) of the calibration board image; t is a binary threshold value, and bin(x, y) is the binary result of the pixel point (x, y).
6. The vision-based trailer bed tilt angle detection method of any one of claims 2 to 5, wherein, When the plurality of rectangular blocks arranged side by side in the calibration board pattern is three, the camera is installed to be directed at the center point of the second rectangular block.
7. The vision-based trailer bed pitch angle detection method of claim 1, wherein, The detection alarm is a hierarchical alarm, specifically: The threshold value V comprises a first threshold value V1, a second threshold value V2 and a third threshold value V3, wherein V1 < V2 < V3; When V1≤γ<V2, a first level slight alarm is performed, when V2≤γ<V3, a second level continuous alarm is performed; and when γ≥V3, a third level piercing alarm is performed.
8. The vision-based trailer bed pitch angle detection method of claim 1, wherein, V1=5, V2=10, V3=15.
9. A detection system for detecting the tilt angle of a trailer bed towed by a towing vehicle during travel, the system comprising: a first sensor for detecting the tilt angle of the trailer bed; a second sensor for detecting the tilt angle of the towing vehicle; and a controller for receiving signals from the first and second sensors and determining the tilt angle of the trailer bed based on the signals received from the first and second sensors. The system comprises a camera arranged on the tractor, a calibration plate pattern sprayed or fixed on a side of a carriage head facing the tractor, a processor arranged on the tractor, and an alarm arranged on the tractor; the processor is connected to the camera and the alarm, the camera is directly opposite a center of the calibration plate pattern, the calibration plate pattern comprises a plurality of rectangular blocks arranged in transverse side-by-side, each rectangular block comprises a black area and a rectangular white area surrounded by the black area, the white area is located in the center of the rectangular block, and four edges of the rectangular white area are parallel to four edges of the periphery of the rectangular block; and the processor is used to execute executable code to realize the visual-based detection method of a tilt angle of a trailer carriage according to any one of claims 1 to 8.
10. A trailer bed tilt angle detection system as claimed in claim 9, wherein, The calibration plate pattern comprises three rectangular blocks arranged in side-by-side, each rectangular block is a square, and the white area is a square.
Citation Information
Patent Citations
High-precision calibration plate and calibration method
CN111402343A
Steering angle detection method, device and system
CN111572633A