Method for detecting steering angle of trailer and system for detecting steering angle of trailer

By spraying or fixing the rectangular block calibration plate pattern on the trailer, and using the camera collection and classifier to match the height vector of the rectangular block, the accurate detection of the steering angle of the trailer tractor relative to the trailer is achieved, solving detection problems in the existing technology. , improving transportation safety.

CN115131285BActive Publication Date: 2024-09-06SHENZHEN MAXVISION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210475716.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2024-09-06
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

It is difficult to accurately detect the steering angle of the tractor relative to the trailer while the tractor-trailer is driving, making it difficult to ensure transportation safety.

Method used

Design a trailer steering angle detection method. By spraying or fixing the calibration plate pattern of multiple rectangular blocks on the carriage, using the camera to collect the calibration plate image, extracting the height vector of the rectangular blocks, and matching the classifier to obtain real-time steering angle.

Benefits of technology

It achieves accurate detection of the steering angle of the tractor relative to the trailer when the trailer is driving, improves transportation safety and ensures the effectiveness of panoramic view splicing monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115131285B
    Figure CN115131285B
Patent Text Reader

Abstract

The present application discloses a method for detecting the steering angle of a trailer, which comprises: spraying or fixing a calibration plate pattern including a plurality of rectangular blocks arranged side by side in a transverse manner on a side of a carriage facing the front of a tractor; making a classifier C={γ(H F(r) )}; Real-time acquisition of a calibration plate image J on the trailer during driving, extracting the height of each rectangular block in the image J and forming a height vector H from the heights of multiple rectangular blocks in the image J w ; Through the height vector H w The steering angle corresponding to the calibration plate image J is obtained by matching each height vector in the steering angle classifier C. The present application also provides a steering angle detection system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and more specifically, to a method for detecting a steering angle of a trailer and a system for detecting a steering angle. Background Art

[0002] With the development of the national economy, the number of trailers has increased rapidly, and they are increasingly used in transportation. With the development of society, the intelligence of trailers has gradually attracted people's attention. A trailer consists of a tractor and a trailer, and the tractor's power is transmitted to the trailer through a towing pin. Therefore, the position and direction of the trailer are inconsistent with the tractor when the vehicle turns. In order to ensure the driving safety of the trailer during the transportation of goods, it is necessary to monitor the surrounding environment through panoramic surround stitching to solve the blind spot problem of the trailer. For detachable vehicles like trailers, accurate panoramic surround stitching must be completed during driving, and the steering angle of the tractor relative to the trailer must be detected. Summary of the invention

[0003] In view of the prior art, the technical problem solved by the present application is to provide a method for detecting a steering angle of a trailer and a system for detecting a steering angle of the trailer, which are capable of obtaining the steering angle of the trailer.

[0004] In order to solve the above technical problems, in a first aspect, the present application provides a method for detecting a steering angle of a trailer, which comprises:

[0005] Spray or fix a calibration plate pattern including a plurality of rectangular blocks arranged side by side transversely on the side of the carriage facing the front of the tractor;

[0006] Create a classifier C for steering angle = {γ(H F(r) )}: Control the tractor head to turn and turn at intervals of m degrees each time until the tractor head turns left to α degrees and right to β degrees relative to the trailer, collect the calibration plate image at each turn to obtain the image sequence F(γ), extract the height of each rectangular block of each calibration plate image in the image sequence, and set the height vector H composed of the heights of multiple rectangular blocks of the calibration plate image corresponding to the steering angle γ of the tractor head relative to the trailer F(r) , where γ∈{α…,-2m,-m,0,m,2m,…β};

[0007] A calibration plate image J is obtained in real time on the trailer during driving, the height of each rectangular block in the image J is extracted, and the height vector H is formed by the heights of multiple rectangular blocks in the image J. w ;

[0008] Through the height vector H w The steering angle corresponding to the calibration plate image J is obtained by matching each height vector in the steering angle classifier C.

[0009] In a possible implementation, the height vector H w The step of obtaining the steering angle corresponding to the calibration plate image J by matching each height vector in the steering angle classifier C comprises:

[0010] For each rotation angle γ in the classifier C, the height vector H of multiple rectangular blocks in the calibration plate image is F(r) Perform normalization processing;

[0011] For the height vector H w Perform normalization processing;

[0012] Traverse all the height vectors in classifier C and compare each height vector in classifier C with the height vector H w Calculate Euclidean distance;

[0013] Compare all the Euclidean distances, and take the steering angle of the tractor relative to the trailer corresponding to the height vector in the classifier C with the smallest Euclidean distance as the steering angle corresponding to the calibration plate image J.

[0014] In a possible implementation, α is negative 90 degrees, β is 90 degrees, and m is 1 degree.

[0015] In a possible implementation, each rectangular block is set to include a black area and a rectangular white area surrounded by the black area, wherein the white area is located at the center of the rectangular block and four sides of the rectangular white area are parallel to four sides of the periphery of the rectangular block in a one-to-one correspondence;

[0016] The step of extracting the height of each rectangular block of each calibration plate image in the image sequence or extracting the height of multiple rectangular blocks of the calibration plate image acquired in real time includes:

[0017] The calibration plate image of each rectangular block height to be solved is denoted as image T;

[0018] The calibration plate image T is grayed and binarized so that the gray value of the black rectangular area is 0 and the gray value of the white rectangular area is 255;

[0019] Taking the upper left corner of the image as the coordinate origin, traverse the binary calibration plate image row by row and column by column, and search for the first to the i-th rectangular blocks arranged along the horizontal axis in sequence. During the search process, calculate the center point O1 (C x1 ,C y1 ) to the center point O of the i-th rectangular block i (C xi ,C y1 );

[0020] The binary image is traversed along the Y-axis direction with the center point of each rectangular block as the starting point to obtain the upper and lower black boundaries of the rectangular block in the Y-axis direction. The height of each rectangular block is the difference between the Y-axis coordinate of the lower black boundary and the Y-axis coordinate of the upper black boundary.

[0021] In a possible implementation, the length of each side of the rectangular white area is set to be half the length of the side corresponding to the periphery of the rectangular block, the size of the image T is set to W×H, and the steps of searching for the first rectangular block and solving the center point of the first rectangular block include:

[0022] Traverse the binary calibration plate image T row by row and column by column until the first horizontal black-white-black width ratio of 1:2:1 is encountered when the vertical coordinate y=y0. The first black-white-black width ratio of 1:2:1 is recorded as G1. The left end point coordinate, right end point coordinate and width of region G1 are recorded as 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);

[0023] The horizontal axis (X R +X L ) / 2 as the center and (X R +X L ) / 2+1 form to the right and traverse the image T incrementally until X R The position of the horizontal coordinate (X R +X L ) / 2 as the center and (X R +X L ) / 2-1 form, traverse the image horizontally and decreasingly to the left until X L , and then traverse the pixel points of the calibration plate image in the vertical direction after each horizontal increase and decrease to find all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1, and record the upper endpoints U and lower endpoints D of all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1;

[0024] The solution of the ordinate of the center of the first rectangular block is to average the ordinates of the upper endpoint U obtained by traversing the image T in an increasing manner to the right and traversing the image T in a decreasing manner to the left to obtain U A , calculate the average of the vertical coordinates of the lower endpoint D obtained by traversing the image T in an increasing manner to the right and traversing the image T in a decreasing manner to the left to obtain D A , C y1 =(U A +D A ) / 2;

[0025] The vertical coordinate (U A +D A ) / 2 as the center and (U A +D A ) / 2+1 form to traverse the image T vertically upward until U A The position of the vertical coordinate (U A +D A ) / 2 as the center and (U A +D A ) / 2-1 form, traverse the image T vertically downward until D A , and then traverse the pixel points of the calibration plate image T in the vertical direction after each horizontal increase and decrease to find all the areas in the horizontal direction that meet the black-white-black width ratio of 1:2:1, and record the left endpoint L and right endpoint R of all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1;

[0026] The solution of the horizontal coordinate of the center of the first rectangular block is to average the horizontal coordinates of the left endpoint U obtained by traversing the image T vertically upward and traversing the image T vertically downward to obtain L A , calculate the average of the horizontal coordinates of the right endpoint R obtained by traversing the image T vertically upward and traversing the image T vertically downward to obtain R A , C x1 =(L A +R A ) / 2.

[0027] In a possible implementation, after completing the search of the first rectangular block and solving the center point of the first rectangular block, the second to i-th rectangular blocks are searched in sequence, wherein the second rectangular block is searched on the right side of the first rectangular block and the i-th rectangular block is searched on the right side of the i-1-th rectangular block.

[0028] In a possible implementation, the calibration plate image T is grayed: M(x,y)=0.3*r(x,y)+0.59*g(x,y)+0.11*b(x,y); the calibration plate image is binarized: all pixels of the grayed calibration plate image are traversed, if M(x,y)>t, then bin(x,y)=0, otherwise bin(x,y)=255;

[0029] Wherein, M(x,y) is the grayscale result of the pixel point (x,y) of the calibration plate image, r, g and b are the values ​​of the red channel, green channel and blue channel of the pixel point (x,y) of the calibration plate image respectively; t is the binarization threshold, and bin(x,y) is the binarization result of the pixel point (x,y).

[0030] In a possible implementation, the height of each rectangular block in the calibration plate pattern along the Y-axis direction is set to be twice the width along the X-axis direction.

[0031] In a second aspect, the present application provides a detection system for the steering angle of a trailer, comprising a camera for being arranged on the front of a tractor, a calibration plate pattern for being sprayed or fixedly arranged on the side of a carriage facing the front of the tractor, a classifier C acquisition unit and a processor; the classifier C acquisition unit and the processor are arranged on the trailer, and the classifier C acquisition unit and the camera are both connected to the processor; the camera arranged on the front of the tractor faces the center of the calibration plate pattern on the carriage and the camera is used to collect a calibration plate image J containing a calibration plate image during the driving of the trailer; the classifier C acquisition unit is used to acquire a classifier C of the steering angle = {γ(H F(r) )}, where γ is the steering angle of the tractor relative to the trailer, F(r) is the calibration plate image collected by the camera when the steering angle is γ, and H F(r) is a height vector composed of the heights of multiple rectangular blocks in F(r); the processor is used to match the height vectors of multiple rectangular blocks of the calibration plate image J with the height vector in the classifier C to obtain the corresponding steering angle of the calibration plate image J.

[0032] In one possible implementation, the calibration plate pattern includes at least three rectangular blocks, each rectangular block includes a black area and a rectangular white area surrounded by the black area, wherein the white area is located at the center of the rectangular block and the four sides of the rectangular white area correspond to the four sides of the periphery of the rectangular block in parallel one by one.

[0033] In the detection method and the detection system of the steering angle of the trailer, a calibration plate image containing a specially designed calibration plate pattern is collected by a camera, and a classifier C about the steering angle is obtained, wherein the classifier C contains a plurality of steering angles of the tractor relative to the trailer and a height vector composed of the heights of a plurality of rectangular blocks of the calibration plate image captured at each steering angle, and then the height vector H of the calibration plate image J of the tractor obtained in real time during driving is converted into a classifier C of the steering angle. w Matching is performed with multiple height vectors in the classifier to obtain the steering angle corresponding to the calibration plate image J. Therefore, the method for detecting the steering angle of a trailer and the system for detecting the steering angle can detect the steering angle of the tractor relative to the trailer during the driving of the trailer. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0035] Figure 1 This is an overall flow chart of a method for detecting a steering angle of a trailer according to an embodiment of the present application;

[0036] Figure 2 A partial image of a calibration plate image showing a calibration plate pattern on a carriage collected in an embodiment of the present application;

[0037] Figure 3 The height vector H of the embodiment of the present application w A flowchart of the steps of obtaining the steering angle corresponding to the calibration plate image J by matching each height vector in the steering angle classifier C;

[0038] Figure 4 A flowchart of the steps of extracting the height of each rectangular block of each calibration plate image in an image sequence or extracting the height of multiple rectangular blocks of the calibration plate image acquired in real time according to an embodiment of the present application;

[0039] Figure 5 A schematic diagram of some straight lines in the horizontal and vertical directions that are simultaneously penetrated by the black area and the white area of ​​a rectangular block during the rectangular block search process in an embodiment of the present application;

[0040] Figure 6 This is a result diagram of the binarization process of the image 2 in the embodiment of the present application;

[0041] Figure 7 This is a schematic structural diagram of a system for detecting a steering angle of a trailer according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] It should be noted that when an element is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other element or indirectly on the other element. When an element is referred to as being "connected to" another element, it can be directly connected to the other element or indirectly connected to the other element.

[0044] It should be understood that the terms "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply 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 understood as a limitation on the present application.

[0045] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0046] The detection method and detection system of the steering angle of the trailer of the present application will now be described in detail with reference to the accompanying drawings.

[0047] Refer to Figure 1 The embodiment of the present application provides a method for detecting the steering angle of a trailer for detecting the steering angle of a tractor relative to a trailer. Generally, a trailer includes a tractor in front, a trailer towed by the tractor, and a carriage provided on the trailer for carrying goods. The method for detecting the steering angle of a trailer based on vision is used to detect the steering angle of the tractor relative to the trailer during the driving process of the trailer. The method for detecting the steering angle of a trailer includes the following steps:

[0048] Step S100: A calibration plate pattern including a plurality of rectangular blocks arranged side by side in a horizontal direction is sprayed or fixed on the side of the carriage facing the front of the tractor. The specific calibration plate pattern is as follows: Figure 2 A pattern composed of multiple rectangular blocks.

[0049] Step S200: Create a classifier C for the steering angle = {γ(H F(r) )}, which includes: step S210: controlling the tractor head to turn and turning at intervals of m degrees each time until the tractor head turns left to α degrees and right to β degrees relative to the trailer, collecting the calibration plate image at each turn to obtain an image sequence F(γ); step S220: extracting the height of each rectangular block of each calibration plate image in the image sequence; step S230: setting a height vector H composed of the heights of multiple rectangular blocks of the calibration plate image corresponding to the steering angle γ of the tractor head relative to the trailer F(r) , where γ∈{α…,-2m,-m,0,m,2m,…β}.

[0050] Step S300: Acquire a calibration plate image J on the trailer during driving in real time, extract the height of each rectangular block in the image T, and form a height vector H from the heights of multiple rectangular blocks in the image T. w ;

[0051] Step S400: Using the height vector H w The steering angle corresponding to the calibration plate image J is obtained by matching each height vector in the steering angle classifier C.

[0052] It is worth noting that the tractor and trailer are generally connected by a towing pin. When the trailer is placed stably on the ground, the projection point of the center of the sprayed or fixed calibration plate pattern on the ground and the projection point of the towing pin on the ground are in the same straight line, which is more conducive to the accuracy of the detection method. In the above steps, the camera set on the front of the tractor is facing the center of the calibration plate pattern on the car body, which can also further ensure the accuracy of the detection method.

[0053] In the above step S200, each time the tractor head is controlled to turn relative to the trailer, a calibration plate image is collected by the camera. It can be understood that when the central axis of the tractor head and the trailer are in a straight line, the tractor head of the trailer and the trailer are in the same straight line, and the steering angle of the tractor head relative to the trailer is 0 degrees. It can be stipulated that the tractor head turning left is negative and turning right is positive. The left and the right are respectively understood as the left and right of the driver when the driver is driving the vehicle. It can be understood that during the turning process of the tractor head, the camera field of view can always cover the entire calibration plate pattern area.

[0054] It can be understood that in the above steps, the calibration plate image is an image including the calibration plate pattern acquired by a camera.

[0055] In one embodiment of the application, in step S200, α is negative 90 degrees, β is 90 degrees, and m is 1 degree, but it is not limited thereto. In other embodiments, m may be 1.5 degrees.

[0056] In one embodiment of the application, refer to Figure 3 In step S400, the height vector H w The step of obtaining the steering angle corresponding to the calibration plate image J by matching each height vector in the steering angle classifier C comprises:

[0057] Step S410: For each rotation angle γ in the classifier C, the height vectors H of the plurality of rectangular blocks in the calibration plate image are calculated. F(r) Perform normalization processing;

[0058] Step S420: For the height vector H w Perform normalization processing;

[0059] Step S430: traverse all the height vectors in classifier C, and compare each height vector in classifier C with the height vector H w Calculate Euclidean distance;

[0060] Step S440: Compare all Euclidean distances, and take the steering angle of the tractor relative to the trailer corresponding to the height vector in the classifier C with the smallest Euclidean distance as the steering angle corresponding to the calibration plate image J.

[0061] It is worth noting that in step S410-step S440, the height vector H corresponding to the rotation angle γ of the classifier C is set. F(r) =(H F(r)1 ,H F(r)2 ,H F(r)3 ), set H w =(H w1 ,H w2 ,H w3 ), where H F(r)1 ,H F(r)2 ,H F(r)3 are the heights of multiple rectangular blocks arranged from left to right along the X-axis of the calibration plate image when the rotation angle γ is reached, H w1 ,H w2 ,H w3 are the heights of multiple rectangular blocks arranged from left to right along the X-axis of the calibration plate image J; F(r) The normalized result is: H F(r) / max(H F(r)1 ,H F(r)2 ,H F(r)3 );For the height vector H w The normalized result is H w / max(H w1 ,H w2 ,H w3 ); solve H F(r) and H w The Euclidean distance D between them is: D = sqrt((H F(r)1 -H w1 )^2+(H F(r)2 -H w2 )^2+(H F(r)3 -H w3 )^2)).

[0062] In the above steps, each rectangular block is further set to include 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 rectangular white area are parallel to the four sides of the periphery of the rectangular block.

[0063] In one embodiment of the application, refer to Figure 4 The step of extracting the height of each rectangular block of each calibration plate image in the image sequence in step S220 or the step of extracting the height of multiple rectangular blocks of the calibration plate image acquired in real time in step 300 includes:

[0064] Step S500: the calibration plate image for each rectangular block height to be solved is recorded as image T;

[0065] Step S600: grayscale the calibration plate image T, and binarize the calibration plate image so that the grayscale value of the black rectangular area is 0 and the grayscale value of the white rectangular area is 255;

[0066] Step S700: Taking the upper left corner of the image as the coordinate origin, traverse the binary calibration plate image row by row and column by column, and search for the first to the i-th rectangular blocks arranged along the horizontal axis in sequence. During the search process, calculate the center point O1 (C x1 ,C y1 ) to the center point O of the i-th rectangular block i (C xi ,C y1 );

[0067] Step S800: traverse the binary image along the Y-axis direction with the center point of each rectangular block as the starting point to obtain the upper and lower black boundaries of the rectangular block in the Y-axis direction. The height of each rectangular block is the difference between the Y-axis coordinate of the lower black boundary and the Y-axis coordinate of the upper black boundary.

[0068] In the above embodiment, the length of each side of the rectangular white area can be further set to be half the length of the side corresponding to the periphery of the rectangular block. In a specific application embodiment, each rectangular block can be a square, the white area is also a square, and the side length of the square white area is half the length of the side length of the rectangular block. For example, A is a side of the white area, B is a side of the periphery of the rectangular block and parallel to A, then the side length of A is half the length of B.

[0069] Further references Figure 5 In step S700, the size of the image T is set to W×H, and the steps of searching for the first rectangular block and solving the center point of the first rectangular block include:

[0070] Step S710: Traverse the binary calibration plate image T row by row and column by column until the first horizontal black-white-black width ratio of 1:2:1 is encountered when the vertical coordinate y=y0. The first black-white-black width ratio of 1:2:1 is recorded as G1. The left end point coordinate, right end point coordinate and width of region G1 are recorded as X, respectively. L1 , X R1 , XR1 -X L1 , the coordinates of the center point O1 of region G1 are O1((X R1 +X L1 ) / 2,y0);

[0071] Step S720: Using the horizontal coordinate (X R +X L ) / 2 as the center and (X R +X L ) / 2+1 form to the right and traverse the image T incrementally until X R The position of the horizontal coordinate (X R +X L ) / 2 as the center and (X R +X L ) / 2-1 form, traverse the image horizontally and decreasingly to the left until X L , and then traverse the pixel points of the calibration plate image in the vertical direction after each horizontal increase and decrease to find all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1, and record the upper endpoints U and lower endpoints D of all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1;

[0072] Step S730: Calculate the ordinate of the center of the first rectangular block: average the ordinates of the upper endpoint U obtained by traversing the image T in a right-handed increasing manner and traversing the image T in a left-handed decreasing manner to obtain U A , calculate the average of the vertical coordinates of the lower endpoint D obtained by traversing the image T in an increasing manner to the right and traversing the image T in a decreasing manner to the left to obtain D A , C y1 =(U A +D A ) / 2;

[0073] Step S740: Using the vertical coordinate (U A +D A ) / 2 as the center and (U A +D A ) / 2+1 form to traverse the image T vertically upward until U A The position of the vertical coordinate (U A +D A ) / 2 as the center and (U A +D A ) / 2-1 form, traverse the image T vertically downward until D A , and then traverse the pixel points of the calibration plate image T in the vertical direction after each horizontal increase and decrease to find all the areas in the horizontal direction that meet the black-white-black width ratio of 1:2:1, and record the left endpoint L and right endpoint R of all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1;

[0074] Step S750: Solving the horizontal coordinate of the center of the first rectangular block: averaging the horizontal coordinates of the left endpoint U obtained by traversing the image T vertically upward and traversing the image T vertically downward to obtain L A , calculate the average of the horizontal coordinates of the right endpoint R obtained by traversing the image T vertically upward and traversing the image T vertically downward to obtain R A , C x1 =(L A +R A ) / 2.

[0075] In the above steps S710 to S750, the left and right directions are based on the left and right on the X-axis, with the direction pointing to the image origin being left and the direction away from the image origin being right; the up and down directions are based on the left and right on the Y-axis, with the direction pointing to the image origin being up and the direction away from the image origin being down.

[0076] In the above steps S710 to S750, when traversing the image, all the areas in the vertical direction that satisfy the black-white-black width ratio of 1:2:1 and all the areas in the horizontal direction that satisfy the black-white-black width ratio of 1:2:1 are found. These areas in the black-white-black width ratio of 1:2:1 are straight line areas. Figure 5 As shown, Figure 5 It illustrates some of the straight lines in the horizontal and vertical directions that are simultaneously penetrated by the black area and the white area 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 during the horizontal increment to determine whether there is a continuous sequence of black area: white area: black area with a width of 1:2:1. The upper endpoint U and the lower endpoint D are the two endpoints when the straight line is truncated by the rectangular block. Other situations are not described in detail.

[0077] In an application embodiment, in step S700, after completing the search of the first rectangular block and solving the center point of the first rectangular block, the search of the second rectangular block and the i-th rectangular block is performed in sequence. The second rectangular block is searched on the right side of the first rectangular block, so that the influence of the first rectangular block that has been searched on the second rectangular block can be eliminated; and the third rectangular block is searched on the right side of the second rectangular block, and the i-th rectangular block is searched on the right side of the i-1-th rectangular block by analogy, so that the influence of the previous i-1 rectangular blocks that have been searched on the i-th rectangular block can be eliminated. It is worth noting that the search method of the second rectangular block and the search method of the third rectangular block adopt the same method as the first rectangular block, and the solution of the center point of the second rectangular block and the third rectangular block is the same as the solution method of the center point of the first rectangular block, and so on until the i-th rectangular block is searched and the center point of the i-th rectangular block is solved. Therefore, it will not be repeated here, and the search of subsequent rectangular blocks and the solution of the center point adopt the same method as step S700. In an application embodiment, i is more than 3.

[0078] It can be understood that in the above embodiment, the horizontal axis is the X-axis of the image coordinate system, and the vertical axis is the Y-axis of the image coordinate system. The origin of the image coordinate system is in the upper left corner of the image, the vertical axis is the Y-axis, and the horizontal axis is the X-axis.

[0079] In one embodiment of the application, in step S600, the calibration plate image T is grayed: M(x,y)=0.3*r(x,y)+0.59*g(x,y)+0.11*b(x,y); the calibration plate image is binarized: all pixels of the grayed calibration plate image are traversed, if M(x,y)>t, then bin(x,y)=0, otherwise bin(x,y)=255;

[0080] Where M(x,y) is the grayscale result of the pixel point (x,y) of the calibration plate image, r, g and b are the values ​​of the red channel, green channel and blue channel of the pixel point (x,y) of the calibration plate image respectively; t is the binarization threshold, and bin(x,y) is the binarization result of the pixel point (x,y). Figure 6 Shows the Figure 2 The result of binarization.

[0081] In one embodiment of the application, the value of t is 100.

[0082] In the above embodiment, the height of each rectangular block in the calibration plate pattern along the Y-axis direction is set to be twice the width along the X-axis direction. In this way, the accuracy of the detection method can be improved, because the height vector is used when performing the angle matching in step S400 in the detection method, and setting the height of the rectangular block to be larger means that the height occupies more pixels, which is more conducive to the extraction of the height.

[0083] In the method for detecting the steering angle of a trailer, a calibration plate image containing a specially designed calibration plate pattern is collected by a camera, and a classifier C about the steering angle is obtained, wherein the classifier C contains a height vector composed of the steering angles of multiple tractors relative to the trailer and the heights of multiple rectangular blocks of the calibration plate image taken at each steering angle. Then, the height vector H of the calibration plate image J of the tractor obtained in real time during driving is converted into the classifier C. w Matching is performed with multiple height vectors in the classifier to obtain the steering angle corresponding to the calibration plate image J. Therefore, the method for detecting the steering angle of a trailer and the system for detecting the steering angle can detect the steering angle of the tractor relative to the trailer during the driving of the trailer.

[0084] Reference Figure 7 The present application also provides a trailer steering angle detection system including a camera 4 for being arranged on the front of a tractor 3, a calibration plate pattern 2 for being sprayed or fixedly arranged on the side of a carriage 1 facing the front of the tractor, a classifier C acquisition unit and a processor; the classifier C acquisition unit and the processor are arranged on the trailer, and the classifier C acquisition unit and the camera are both connected to the processor.

[0085] Specifically, the camera disposed on the front of the tractor is facing the center of the calibration plate pattern on the carriage and the camera is used to collect the calibration plate image J containing the calibration plate image during the driving of the trailer. The classifier C acquisition unit is used to acquire the classifier C of the calibration steering angle = {γ(H F(r) )}, where γ is the steering angle of the tractor relative to the trailer, F(r) is the calibration plate image collected by the camera when the steering angle is γ, and H F(r) is a height vector composed of the heights of multiple rectangular blocks in F(r); the classifier C acquisition unit executes the method of the above step S200 to acquire the classifier C about the steering angle. The processor is used to match the height vectors of multiple rectangular blocks of the calibration plate image J with the height vector in the classifier C to obtain the corresponding steering angle of the calibration plate image J. It can be understood that the processor executes the method of step S300 and step S400 to obtain the corresponding steering angle of the calibration plate image J, so as to detect the corresponding steering angle of the calibration plate image J in real time during the driving process of the trailer.

[0086] In this embodiment, the calibration plate pattern includes at least three rectangular blocks, each rectangular block includes a black area and a rectangular white area surrounded by the black area, wherein the white area is located at the center of the rectangular block and the four sides of the rectangular white area correspond to the four sides of the periphery of the rectangular block in parallel. Further, each rectangular block is a square, the white area is also a square, and the side length of the white area is half the side length of the rectangular block. The processor is a DSP processor, specifically a DSP processor of AU3822UC82 signal, but not limited to.

[0087] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims

1. A method for detecting a steering angle of a trailer, characterized in that: include: Spray or fix a calibration plate pattern including a plurality of rectangular blocks arranged side by side transversely on the side of the carriage facing the front of the tractor; Create a classifier C for steering angle = {γ(H F(r) )}: Control the tractor head to turn and turn at intervals of m degrees each time until the tractor head turns left to α degrees and right to β degrees relative to the trailer, collect the calibration plate image at each turn to obtain the image sequence F(γ), extract the height of each rectangular block of each calibration plate image in the image sequence, and set the height vector H composed of the heights of multiple rectangular blocks of the calibration plate image corresponding to the steering angle γ of the tractor head relative to the trailer F(r) , where γ∈{α…,-2m,-m,0,m,2m,…β}; where the upper left corner of the image is the origin of the image coordinate system, and the height of each rectangular block is the height in the Y-axis direction of the image coordinate system; A calibration plate image J is obtained in real time on the trailer during driving, the height of each rectangular block in the image J is extracted, and the height vector H is formed by the heights of multiple rectangular blocks in the image J. w ; Through the height vector H w The steering angle corresponding to the calibration plate image J is obtained by matching each height vector in the steering angle classifier C.

2. The method for detecting the steering angle of a trailer according to claim 1, characterized in that: Through the height vector H w The step of obtaining the steering angle corresponding to the calibration plate image J by matching each height vector in the steering angle classifier C comprises: For each rotation angle γ in the classifier C, the height vector H of multiple rectangular blocks in the calibration plate image is F(r) Perform normalization processing; For the height vector H w Perform normalization processing; Traverse all the height vectors in classifier C and compare each height vector in classifier C with the height vector H w Calculate Euclidean distance; Compare all the Euclidean distances, and take the steering angle of the tractor relative to the trailer corresponding to the height vector in the classifier C with the smallest Euclidean distance as the steering angle corresponding to the calibration plate image J.

3. The method for detecting the steering angle of a trailer according to claim 1, characterized in that: α is negative 90 degrees, β is 90 degrees, and m is 1 degree.

4. The method for detecting the steering angle of a trailer according to claim 1, characterized in that: Each rectangular block is set to include a black area and a rectangular white area surrounded by the black area, wherein the white area is located at the center of the rectangular block and four sides of the rectangular white area correspond to four sides of the periphery of the rectangular block in parallel one by one; the step of extracting the height of each rectangular block of each calibration plate image in the image sequence or extracting the height of multiple rectangular blocks of the calibration plate image obtained in real time includes: The calibration plate image of each rectangular block height to be solved is denoted as image T; The calibration plate image T is grayed and binarized so that the gray value of the black rectangular area is 0 and the gray value of the white rectangular area is 255; Taking the upper left corner of the image as the coordinate origin, traverse the binary calibration plate image row by row and column by column, and search for the first to the i-th rectangular blocks arranged along the horizontal axis in sequence. During the search process, calculate the center point O1 (C x1 ,C y1 ) to the center point O of the i-th rectangular block i (C xi ,C y1 ); The binary image is traversed along the Y-axis direction with the center point of each rectangular block as the starting point to obtain the upper and lower black boundaries of the rectangular block in the Y-axis direction. The height of each rectangular block is the difference between the Y-axis coordinate of the lower black boundary and the Y-axis coordinate of the upper black boundary.

5. The method for detecting the steering angle of a trailer according to claim 4, characterized in that: The length of each side of the white area of ​​the rectangle is set to be half the length of the side corresponding to the periphery of the rectangular block, the size of the image T is set to be W×H, and the steps of searching for the first rectangular block and solving the center point of the first rectangular block include: Traverse the binary calibration plate image T row by row and column by column until the first horizontal black-white-black width ratio of 1:2:1 is encountered when the vertical coordinate y=y0. The first black-white-black width ratio of 1:2:1 is recorded as G1. The left end point coordinate, right end point coordinate and width of region G1 are recorded as 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); The horizontal axis (X R +X L ) / 2 as the center and (X R +X L ) / 2+1 form to the right and traverse the image T incrementally until X R The position of the horizontal coordinate (X R +X L ) / 2 as the center and (X R +X L ) / 2-1 form, traverse the image horizontally and decreasingly to the left until X L , and then traverse the pixel points of the calibration plate image in the vertical direction after each horizontal increase and decrease to find all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1, and record the upper endpoints U and lower endpoints D of all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1; The solution of the ordinate of the center of the first rectangular block is to average the ordinates of the upper endpoint U obtained by traversing the image T in an increasing manner to the right and traversing the image T in a decreasing manner to the left to obtain U A , calculate the average of the vertical coordinates of the lower endpoint D obtained by traversing the image T in an increasing manner to the right and traversing the image T in a decreasing manner to the left to obtain D A , C y1 =(U A +D A ) / 2; The vertical coordinate (U A +D A ) / 2 as the center and (U A +D A ) / 2+1 form to traverse the image T vertically upward until U A The position of the vertical coordinate (U A +D A ) / 2 as the center and (U A +D A ) / 2-1 form, traverse the image T vertically downward until D A , and then traverse the pixel points of the calibration plate image T in the vertical direction after each horizontal increase and decrease to find all the areas in the horizontal direction that meet the black-white-black width ratio of 1:2:1, and record the left endpoint L and right endpoint R of all the areas in the vertical direction that meet the black-white-black width ratio of 1:2:1; The solution of the horizontal coordinate of the center of the first rectangular block is to average the horizontal coordinates of the left endpoint U obtained by traversing the image T vertically upward and traversing the image T vertically downward to obtain L A , calculate the average of the horizontal coordinates of the right endpoint R obtained by traversing the image T vertically upward and traversing the image T vertically downward to obtain R A , C x1 =(L A +R A ) / 2.

6. The method for detecting the steering angle of a trailer according to claim 5, characterized in that: After completing the search of the first rectangular block and solving the center point of the first rectangular block, the search of the second to i-th rectangular blocks is performed in sequence, wherein the second rectangular block is searched on the right side of the first rectangular block and the i-th rectangular block is searched on the right side of the i-1-th rectangular block.

7. The method for detecting the steering angle of a trailer according to claim 4, characterized in that: Grayscale the calibration plate image T: M(x,y) = 0.3*r(x,y) + 0.59*g(x,y) + 0.11*b(x,y); Binarize the calibration plate image: traverse all pixels of the grayscale calibration plate image, 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 plate image, r, g and b are the values ​​of the red channel, green channel and blue channel of the pixel point (x,y) of the calibration plate image respectively; t is the binarization threshold, and bin(x,y) is the binarization result of the pixel point (x,y).

8. The method for detecting the steering angle of a trailer according to any one of claims 1 to 7, characterized in that: The height of each rectangular block in the calibration plate pattern along the Y-axis direction is set to be twice the width along the X-axis direction.

9. A system for detecting a steering angle of a trailer, characterized in that: The invention comprises a camera for being arranged on the head of a tractor, a calibration plate pattern for spraying or fixing on the side of a carriage facing the head of the tractor, a classifier C acquisition unit and a processor; the classifier C acquisition unit and the processor are arranged on a trailer, and the classifier C acquisition unit and the camera are both connected to the processor; the camera arranged on the head of the tractor faces the center of the calibration plate pattern on the carriage and the camera is used to collect a calibration plate image J containing the calibration plate pattern during the driving of the trailer; the classifier C acquisition unit is used to acquire a classifier C of a steering angle = {γ(H F(r) )}, where γ is the steering angle of the tractor relative to the trailer, F(r) is the calibration plate image collected by the camera when the steering angle is γ, and H F(r) is a height vector composed of the heights of multiple rectangular blocks in F(r); the processor is used to match the height vectors of multiple rectangular blocks of the calibration plate image J with the height vector in the classifier C to obtain the corresponding steering angle of the calibration plate image J; Wherein, the calibration plate pattern is a pattern of a plurality of rectangular blocks arranged side by side in a horizontal direction; The upper left corner of the image is taken as the origin of the image coordinate system, and the height of each rectangular block is the height in the Y-axis direction of the image coordinate system.

10. The trailer steering angle detection system according to claim 9, characterized in that: The calibration plate pattern includes at least three rectangular blocks, each rectangular block includes a black area and a rectangular white area surrounded by the black area, wherein the white area is located at the center of the rectangular block and the four sides of the rectangular white area correspond to the four sides of the periphery of the rectangular block in parallel.