A track recognition and classification method for tracking intelligent vehicles
Through the camera, the camera collects and processes track images, extracts and analyzes the edge features of the track, and solves the problem of smart cars identifying and controlling on special tracks, achieving faster and more stable driving.
Patent Information
- Application Number
- CN202210335928.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2042-03-31
AI Technical Summary
The existing smart car track judgment and control methods cannot effectively identify and process special track elements, such as island roundabouts, intersections, etc., resulting in a high misjudgment rate and it is difficult for smart cars to pass through these tracks smoothly.
The camera module is used to collect track images, and through binarization processing and barrel correction, the track edge is extracted and the slope and inflection point are calculated to determine the track type. The method includes pixel point scanning, edge extraction and feature matching, enabling the rapid identification and classification of track elements.
It realizes fast and efficient track image matching and recognition, can accurately judge the track type and adopt corresponding control strategies, improving the driving stability and speed of smart cars on special tracks.
Smart Images

Figure CN114863387B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent control, and more specifically, to a method for identifying and classifying a track for a tracking intelligent vehicle. Background Art
[0002] In smart car competitions, current track judgment and control methods have been unable to effectively identify and respond to special tracks including roundabouts. They have poor noise resistance and a high misjudgment rate. Smart cars find it difficult to pass through roundabouts with existing technology and often drive off the center line of the track or even hit the shoulders on both sides in actual environments. In this case, the roundabout refers to a quasi-circular lane that branches off from the original main road in a quasi-circular manner on the side of the main road.
[0003] In smart car competitions, there are track elements such as straights, curves, roundabouts, intersections, three-way intersections, garages, etc. The existing track judgment and control methods have not been able to effectively identify and process these special tracks, and the misjudgment rate is high. In actual tracks, the car often leaves the center line of the track or even hits the shoulders on both sides. Accurately identifying and classifying these track elements is a prerequisite for completing the competition.
[0004] The prior art discloses a patent for a perception decision and tracking control method of multi-sensor fusion for an unmanned formula car. In the patent, an industrial computer receives the point cloud of the cone barrel in front of the car collected by the laser radar, the image information with the color and position of the cone barrel collected by the monocular camera, and the acceleration and heading angle of the car collected by the GPS and IMU, and fuses the above data into a track map; a reference trajectory is planned according to the track map, and the reference trajectory is sent to the trajectory tracking controller. The trajectory tracking controller outputs corresponding control commands to the execution control system according to the reference trajectory, and the execution control system then outputs corresponding instructions to the actuator, thereby achieving the track tracking of the car; the patent can be effectively applied to the cone barrel recognition and trajectory tracking of this event, and can be extended to other similar scenarios, improving the development efficiency of unmanned driving of cars. However, the patent does not perform multi-feature extraction and complete image recognition for the images collected from various track elements, which can accurately determine the track type and take corresponding control strategies in time to make the smart car run faster and more smoothly. Summary of the invention
[0005] The present invention provides a track recognition and classification method for a tracking intelligent vehicle. The method can quickly and efficiently complete image matching, is conducive to timely identifying the track type and responding to the road conditions; and can reduce the complexity of implementation while optimizing robustness.
[0006] In order to achieve the above technical effects, the technical solution of the present invention is as follows:
[0007] A method for identifying and classifying a track for a tracking intelligent vehicle comprises the following steps:
[0008] S1: Use a camera module to collect the original grayscale image of the track, perform binarization on the original grayscale image and obtain a black and white image, and then use a barrel correction method to correct the image;
[0009] S2: Scanning pixels of the black-and-white image in step S1, and extracting the edge of the track according to the jump positions of black-and-white pixels in the line-scanning image;
[0010] S3: Calculate the slope of the track edge, whether there is an inflection point at the track boundary, and determine the track type.
[0011] Furthermore, the specific process of step S1 is:
[0012] The MT9V034 Shenyan camera is used to collect 50 original grayscale images of the track per second. The pixel value range of the grayscale image is 0 to 255. The image is stored in the microcontroller in the form of a two-dimensional array. Each pixel in the image corresponds to a specific position in the two-dimensional space. The Otsu method is used to binarize the grayscale image, and then the binary image is filtered to remove salt and pepper noise.
[0013] Furthermore, in step S2, according to the projection perspective law, the width of the white track area in the black and white image gradually decreases from near to far, and the farther the image is, the more serious the distortion is. Therefore, the image is scanned from near to far, and the size of the black and white image is 120*60, from 0 to 60 lines from top to bottom.
[0014] Furthermore, in step S2, both the left and right boundaries exist in the image, and the white boundary is searched to the left and right respectively from the 60th row and the 60th column. Since the track is a white pixel in the image, the position where the white pixel changes to the black pixel is searched, and the position of the jump point in the array is recorded as L n and R n , then the actual centerline position of the image is M n =(L n +R n ) / 2, where n is the number of rows.
[0015] Furthermore, in step S2, when there is no left edge of the track in the image, the camera cannot observe the left line, so interpolation is required. Since the track width is fixed at 45 cm, the number of white pixels in each row of the image is a fixed value, which decreases from near to far and is calibrated in advance as W. n , the track width of the 50th row is 52 white pixels, and the track width of the 30th row is 42 white pixels. Therefore, the left boundary position is equal to the right boundary position minus the track width fixed value, that is, the left boundary position is ln =R n -W n , then the actual centerline position of the image is M n =(l n +R n ) / 2; When there is no right edge of the track in the image, the right edge position is the left edge position plus the track width, that is, R n =L n +W n .
[0016] Furthermore, in step S2, the line is patrolled from the middle to the left and right sides, and then the edge of the track is climbed up to find the transition point of white and black pixels, in a manner similar to "climbing stairs" to find the track boundary; when a white pixel point on the left side of the track satisfies both the white point on the right and the black point on the left, it means that this white pixel point is the left boundary point of the row.
[0017] Furthermore, in step S2, after finding a boundary, the black and white pixel jump points in the 8-neighborhood are traversed using this boundary as a seed to find the boundary point of the track in the next row; when the image scan reaches the image boundary, or the difference in the number of columns between the boundary of the previous row and the boundary of the current row is greater than the set threshold, that is, |L n -L n-1 |>THR, indicating that the effective track information of the image has been extracted. Save the relevant data before extracting the next image information.
[0018] Furthermore, in step S3, if there is a rectangular obstacle on the track, a large block of black pixels will appear on the image, indicating that there is an obstacle on the left half of the track, and that the vehicle cannot pass through the middle and must pass through the right half of the road. The newly planned center line is the average of the old center line and the right boundary;
[0019] The large S-curve and the 90° right-angle curve are processed by finding the left and right boundaries normally. The curve formed by the black pixels in the middle is the expected driving trajectory of the smart car.
[0020] The characteristic of the small S curve is that there are two turning points, and the two turning points are in different lines. At the same time, the curvature of the small S curve at the turning point is greater than the curvature of the large S curve. The smart car does not need to turn in the small S curve, but can go straight through the middle. The black dotted line in the middle is the expected driving trajectory planned by the smart car;
[0021] When the track boundaries on both sides disappear, but the boundaries can be found again when searching upwards, and 4 intersections can be found, it is judged as a crossroad. It is necessary to use the slope calculated by the track boundary in the previous part to interpolate and fill in the line, and then calculate the center line. The dotted line in the middle is the center line calculated by the smart car algorithm. At the crossroad, the smart car needs to go straight and is not allowed to turn. The two dotted lines on the left and right are the calculated track boundaries.
[0022] The most common feature in a roundabout is a triangle. When entering a roundabout, you can find an equilateral triangle with the vertex facing upward and an inverted triangle with the vertex facing downward in the image. There is also an inflection point in the middle of the roundabout. When exiting the roundabout, you can find a lateral triangle with the vertex facing right. For a roundabout with track elements, the smart car needs to go around the roundabout. The dotted lines on the left and right are the left and right boundaries extracted by calculation, and the dotted line in the middle is the actual center line extracted by calculation. The smart car needs to drive left along this center line into the roundabout. When more than 6 rows of black and white pixels are detected with multiple jumps, it is judged as a zebra crossing.
[0023] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0024] The camera image processing and feature extraction algorithm proposed in the present invention can effectively identify and classify track elements. The algorithm is simple and easy to implement, with low complexity. It has a good reference for preparing for the National College Student Intelligent Car Competition and has important theoretical significance and practical value in the field of autonomous driving. It uses preset standard templates for feature matching, which can quickly and efficiently complete the image matching work, which is conducive to timely identifying the track type and responding to road conditions. It can also reduce the complexity of implementation while optimizing robustness. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a binary image of a straight track. The track is white and the array at the left edge of the track is denoted by L n , the array of the right edge of the track is recorded as R n , where n is the number of rows and the actual centerline position of the image is M n =(L n +R n ) / 2;
[0026] Figure 2 This is a schematic diagram of a binary image of a large S-curve. The left edge of the track from row 50 to row 60 is lost, and the position of the left edge of the track needs to be inferred based on the position of the right edge of the track and the track width.
[0027] Figure 3 There is a rectangular obstacle on the left side of the track, and a large block of black pixels will appear in the image;
[0028] Figure 4 It is a binary image of a small S-bend. There are two inflection points in the image, and the two inflection points are not in the same row.
[0029] Figure 5 This is a binary image of a crossroad. At the intersection of the tracks, the white track boundary is lost and needs to be interpolated from the track boundary slope calculated previously to fill in the boundary. The smart car is not allowed to turn at the crossroad and can only go straight.
[0030] Figure 6 To binary the image when entering the roundabout, there is a roundabout on the left side of the track. The recognition matching template is that the right edge of the track in the image can be found completely. On the left, the two sides of a triangle with the vertex angle facing upward can be found first, then an inflection point can be found upward, and then the two sides of a triangle with the vertex angle facing downward can be found upward;
[0031] Figure 7 This is a schematic diagram of a zebra crossing and a parking garage;
[0032] Figure 8 The image is a binary image of a zebra crossing and a parking garage. The parking garage is on the right. The track element matching template can find multiple jumps between black and white pixels. There is a complete boundary on the left, but only a section of the boundary can be found on the right.
[0033] Fig. 9 This is a schematic diagram of a three-way intersection;
[0034] Fig.10 For the binary image of the fork, the matching template of the fork can find the left fork and the right fork, and the slopes of the boundaries on both sides are almost the same. DETAILED DESCRIPTION
[0035] The drawings are for illustrative purposes only and should not be construed as limiting the present patent;
[0036] In order to better illustrate the present embodiment, some parts in the drawings may be omitted, enlarged or reduced, and do not represent the size of the actual product;
[0037] It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0038] The technical solution of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0039] Example 1
[0040] A method for identifying and classifying a track for a tracking intelligent vehicle comprises the following steps:
[0041] S1: Use a camera module to collect the original grayscale image of the track, perform binarization on the original grayscale image and obtain a black and white image, and then use a barrel correction method to correct the image;
[0042] S2: Scanning pixels of the black-and-white image in step S1, and extracting the edge of the track according to the jump positions of black-and-white pixels in the line-scanning image;
[0043] S3: Calculate the slope of the track edge, whether there is an inflection point at the track boundary, and determine the track type.
[0044] The specific process of step S1 is:
[0045] The MT9V034 Shenyan camera is used to collect 50 original grayscale images of the track per second. The pixel value range of the grayscale image is 0 to 255. The image is stored in the microcontroller in the form of a two-dimensional array. Each pixel in the image corresponds to a specific position in the two-dimensional space. The Otsu method is used to binarize the grayscale image, and then the binary image is filtered to remove salt and pepper noise.
[0046] In step S2, according to the projection perspective law, the width of the white track area in the black and white image gradually decreases from near to far, and the farther the image is, the more serious the distortion is. Therefore, the image is scanned from near to far. The size of the black and white image is 120*60, and from top to bottom is 0 to 60 lines.
[0047] In step S2, both the left and right boundaries exist in the image. The white boundary is searched to the left and right from the 60th row and the 60th column respectively. Since the track is a white pixel in the image, the position where the white pixel changes to a black pixel is searched, and the position of the jump point in the array is recorded as L n and R n , then the actual centerline position of the image is M n =(L n +R n ) / 2, where n is the number of rows.
[0048] In step S2, when there is no left edge of the track in the image, the camera cannot observe the left line, so interpolation is required. Since the track width is fixed at 45 cm, the number of white pixels in each row of the image is a fixed value, which decreases from near to far and is calibrated in advance as W. n , the track width of the 50th row is 52 white pixels, and the track width of the 30th row is 42 white pixels. Therefore, the left boundary position is equal to the right boundary position minus the track width fixed value, that is, the left boundary position is L n =R n -W n , then the actual centerline position of the image is M n =(L n +R n ) / 2; When there is no right edge of the track in the image, the right edge position is the left edge position plus the track width, that is, R n =L n +W n .
[0049] In step S2, the line is patrolled from the middle to the left and right sides, and then the line is climbed up along the edge of the track to find the transition point between white and black pixels, in a way similar to "climbing stairs" to find the track boundary; when a white pixel point on the left side of the track satisfies both the white point on the right and the black point on the left, it means that this white pixel point is the left boundary point of the row.
[0050] In step S2, after finding a boundary, use it as a seed to traverse the black and white pixel jump points in the 8-neighborhood to find the track boundary point of the next row; when the image scan reaches the image boundary, or the difference in the number of columns between the previous row boundary and the current row boundary is greater than the set threshold, that is, |L n -L n-1 |>THR, indicating that the effective track information of the image has been extracted. Save the relevant data before extracting the next image information.
[0051] In step S3, if there is a rectangular obstacle on the track, a large block of black pixels will appear on the image, indicating that there is an obstacle on the left half of the track and that the vehicle can no longer pass through the middle, but must pass through the right half of the road. The newly planned center line is the average of the old center line and the right boundary;
[0052] The large S-curve and the 90° right-angle curve are processed by finding the left and right boundaries normally. The curve formed by the black pixels in the middle is the expected driving trajectory of the smart car.
[0053] The characteristic of the small S curve is that there are two turning points, and the two turning points are in different lines. At the same time, the curvature of the small S curve at the turning point is greater than the curvature of the large S curve. The smart car does not need to turn in the small S curve, but can go straight through the middle. The black dotted line in the middle is the expected driving trajectory planned by the smart car;
[0054] When the track boundaries on both sides disappear, but the boundaries can be found again when searching upwards, and 4 intersections can be found, it is judged as a crossroad. It is necessary to use the slope calculated by the track boundary in the previous part to interpolate and fill in the line, and then calculate the center line. The dotted line in the middle is the center line calculated by the smart car algorithm. At the crossroad, the smart car needs to go straight and is not allowed to turn. The two dotted lines on the left and right are the calculated track boundaries.
[0055] The most common feature in a roundabout is a triangle. When entering a roundabout, you can find an equilateral triangle with the vertex facing upward and an inverted triangle with the vertex facing downward in the image. There is also an inflection point in the middle of the roundabout. When exiting the roundabout, you can find a lateral triangle with the vertex facing right. For a roundabout with track elements, the smart car needs to go around the roundabout. The dotted lines on the left and right are the left and right boundaries extracted by calculation, and the dotted line in the middle is the actual center line extracted by calculation. The smart car needs to drive left along this center line into the roundabout. When more than 6 rows of black and white pixels are detected with multiple jumps, it is judged as a zebra crossing.
[0056] Example 2
[0057] A method for identifying and classifying a track for a tracking intelligent vehicle comprises the following steps:
[0058] The original grayscale image of the track is collected by a camera module, and the original grayscale image is binarized to obtain a black and white image; then the image is corrected by a barrel correction method.
[0059] Then, the black-and-white image is pixel-scanned to extract the features of the all-white column in the middle of the black-and-white image; specifically, the jump positions of the black-and-white pixels in the row-scanned image are used to extract the edge of the track.
[0060] Then calculate the slope of the edge of the track, whether there is an inflection point at the track boundary, and save its position.
[0061] Determine the track type based on the extracted feature recognition;
[0062] Control the driving of the smart car according to the track type.
[0063] Compared with the existing technology, this case uses binarization processing of the track image to make the image pixel grayscale only black and white, without the need for preprocessing the track image, which greatly facilitates the edge extraction of the image. In addition, multi-feature extraction and image recognition are performed on the images collected from various track elements, which can accurately determine the track type and take corresponding control strategies in time, making the smart car run faster and more smoothly.
[0064] Furthermore, the track type is determined based on the extracted features, the extracted features are matched using a preset standard template, and the track type is identified and determined based on the feature matching results.
[0065] In the process of identifying track elements in this case, preset standard templates are used for feature matching, which can quickly and efficiently complete the image matching work, facilitate timely identification of track types and response to road conditions; and can reduce the complexity of implementation while optimizing robustness.
[0066] Example 3
[0067] The present invention provides a method for identifying and classifying a track for a tracking smart car, comprising the following steps: (1) image acquisition and preprocessing; (2) image scanning and information extraction; (3) track element identification and classification. The specific steps of the present invention are described below:
[0068] Step 1: Image acquisition and preprocessing:
[0069] The present invention adopts MT9V034 Shenyan camera to collect 50 original grayscale images of the track per second. The pixel value range of the grayscale image is 0 to 255. The image is stored in the single-chip microcomputer in the form of a two-dimensional array, and each pixel in the image corresponds to a specific position in the two-dimensional space. Due to the limited computing power of the single-chip microcomputer, and the binary image is convenient for storage and calculation, and can highlight the outline of the white track, the present invention adopts the Otsu method to binarize the grayscale image, and then filters the binary image to remove the salt and pepper noise.
[0070] Step 2: Image scanning and information extraction:
[0071] The core of smart car image processing is to process the two-dimensional array of images, and use the characteristics of different images to determine the type of track, so as to extract relevant information of the track. According to the projection perspective law, the width of the white track area in the image gradually decreases from near to far, and the farther the image is, the more serious the distortion is, so the image is scanned from near to far. The image size is 120*60, from 0 to 60 lines from top to bottom. According to whether there is a track boundary in the image, it can be discussed in three cases.
[0072] (1) Both left and right boundaries exist in the image, such as Figure 1 As shown. Start from the 60th row and the 60th column and look left and right for the white boundary. Since the track is a white pixel in the image, find the position where the white pixel changes to a black pixel, and record the position of the jump point in the array as L n and R n , then the actual centerline position of the image is M n =(L n +R n ) / 2, where n is the number of rows.
[0073] (2) When there is no left edge of the track in the image, the camera cannot observe the left line, so interpolation is required, such as Figure 2 In the 50th row, the left edge is lost. Since the track width is fixed at 45 cm, the number of white pixels in each row of the image is a fixed value, which decreases from near to far and can be calibrated in advance, denoted as W n .like Figure 2 In the example, the track width of the 50th row is 52 white pixels, and the track width of the 30th row is 42 white pixels. Therefore, the left boundary position is equal to the right boundary position minus the track width fixed value, that is, the left boundary position is L n =R n -W n , then the actual centerline position of the image is M n =(L n +R n ) / 2.
[0074] (3) When there is no right edge of the track in the image, the right edge position is the left edge position plus the track width, that is, R n =L n +W n .
[0075] Figure 3 This is the track boundary extraction algorithm used in the present invention. It starts from the middle and patrols the left and right sides, then climbs up along the edge of the track to find the transition point between white and black pixels, and finds the track boundary in a way similar to "climbing stairs". When a white pixel on the left side of the track satisfies both the white point on the right and the black point on the left, it means that this white pixel is the left boundary point of the row.
[0076] After finding a boundary, use it as a seed to traverse the black and white pixel jump points in the 8-neighborhood to find the boundary point of the next row of tracks. When the image scan reaches the image boundary, or the difference in the number of columns between the previous row boundary and the current row boundary is greater than the set threshold, that is, |L n -L n-1 |>THR, indicating that the effective track information of the image has been extracted. Save the relevant data before extracting the next image information.
[0077] Step 3: Track element identification and classification:
[0078] The images collected by the camera contain rich track information, such as the number and location of turning points at the track boundary, the slope and curvature of the track boundary, etc. The characteristics of various track elements are relatively obvious, and the corresponding algorithms and PID direction loop parameters are selected according to different types of roads.
[0079] (1) If there is a rectangular obstacle on the track, a large block of black pixels will appear in the image. Figure 3 As shown in the figure, there is an obstacle on the left half of the track, and you can no longer pass through the middle, so you need to pass through the right half of the road. The newly planned center line is the average of the old center line and the right boundary.
[0080] (2) The large S-curve and the 90° right-angle curve are processed by finding the left and right boundaries normally. The curve formed by the black pixels in the middle is the expected driving trajectory of the smart car. Figure 2 shown.
[0081] (3) The characteristic of the small S curve is that there are two turning points, and the two turning points are in different lines. At the same time, the curvature of the small S curve at the turning point is greater than the curvature of the large S curve. The smart car does not need to turn in the small S curve, but can go straight through the middle, which can save driving time. The black dotted line in the middle is the expected driving trajectory planned by the smart car, as shown in Figure 4 shown.
[0082] (4) When the track boundaries on both sides disappear, but the boundaries can be found again when searching upwards, and four intersections can be found, it is judged to be a cross road, such as Figure 5 As shown. It is necessary to use the slope calculated by the track boundary in the previous part to interpolate the line and then calculate the center line. Figure 5 In the figure, the middle dotted line is the center line calculated by the smart car algorithm. At the crossroad, the smart car needs to go straight and is not allowed to turn. The left and right dotted lines are the calculated track boundaries.
[0083] (5) The most common feature in a roundabout is a triangle. When entering a roundabout, you can find regular triangles with the vertex pointing upward and inverted triangles with the vertex pointing downward in the image. There is also an inflection point in the middle of the roundabout, such as Figure 6 As shown. When exiting the roundabout, you can find a side triangle with the top corner facing right. For the track element roundabout, the smart car needs to go around the roundabout. The dotted lines on the left and right are the left and right boundaries extracted by calculation, and the dotted line in the middle is the actual center line extracted by calculation. The smart car needs to drive left along this center line to enter the roundabout.
[0084] (6) Figure 7 This is a schematic diagram of zebra crossing and parking garage. Figure 8 For smart cars Figure 7 The camera at the arrow point captures the image of the zebra crossing. When it detects that more than 6 rows have multiple jumps in black and white pixels, it is judged as a zebra crossing and the vehicle is ready to turn right and slow down to enter the parking garage.
[0085] (7) The two-car competition in the smart car competition requires two smart cars to communicate with each other and complete the meeting task. There are two three-way intersections on the track of this smart car competition. The angle between the three entrances and exits of the three-way intersection is 120°. Each time a smart car enters a three-way intersection, it chooses one of the paths to pass through. The smart car will enter and exit the three-way intersection twice. Fig. 9 shown.
[0086] Smart car A stops after entering a fork in the road, and sends a signal to smart car B through the Bluetooth module, and smart car B starts to drive on another fork in the road. When smart car B goes around the track and reaches the fork in the road, it also sends a signal to smart car A, and smart car B stops and smart car A starts to drive. In this process, the two smart cars need to send and receive signals through wireless communication. This design uses Bluetooth modules for dual-car communication.
[0087] When the microcontroller detects a "V" shape at the entrance of the fork through the camera image, with black pixels in the middle and white pixels on both sides, and the slopes of the two boundaries are the same, it is determined that the fork has been reached. At this time, the smart car chooses one of the forks to drive on, and stores whether it is the left or right side this time, and chooses the other side of the fork to drive on next time. Fig.10 Shown is a binary image of the fork.
[0088] Test plan:
[0089] The paved track includes straights, curves, intersections, roadblocks, three-way intersections, garages and two roundabouts, allowing the smart car to follow the track to test whether the track image processing control algorithm on the smart car can accurately identify these track elements and whether it can complete the competition mission.
[0090] Table 1 Track element recognition and classification test
[0091]
[0092] The same or similar reference numerals correspond to the same or similar components;
[0093] The positional relationships described in the drawings are only for illustrative purposes and should not be construed as limiting the present patent.
[0094] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. For those skilled in the art, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the embodiments here. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for identifying and classifying a track for a tracking intelligent vehicle, characterized in that: The following steps are involved: S1: Use a camera module to collect the original grayscale image of the track, perform binarization on the original grayscale image and obtain a black and white image, and then use a barrel correction method to correct the image; S2: Scanning pixels of the black and white image in step S1, and extracting the edge of the track according to the jump positions of black and white pixels in the line scanning image; S3: Calculate the slope of the track edge, whether there is an inflection point at the track boundary, and determine the track type; Among them, in the step S3, if there is a rectangular obstacle on the track, a large block of black pixels will appear on the image, and there is an obstacle on the left half of the track. It is no longer possible to pass through the middle, and it is necessary to pass through the right half of the road. The newly planned center line is the average value of the old center line and the right boundary; The large S-curve and the 90° right-angle curve are processed by finding the left and right boundaries normally. The curve formed by the black pixels in the middle is the expected driving trajectory of the smart car. The characteristic of the small S curve is that it has two turning points, and the two turning points are in different lines. At the same time, the curvature of the small S curve at the turning point is greater than the curvature of the large S curve. The smart car does not need to turn in the small S curve, but can go straight through the middle. The black dotted line in the middle is the expected driving trajectory planned by the smart car; When the track boundaries on both sides disappear, but the boundaries can be found again when searching upwards, and 4 intersections can be found, it is judged as a crossroad; it is necessary to use the slope calculated by the track boundary in the previous part to interpolate the line, and then calculate the center line. The dotted line in the middle is the center line calculated by the smart car algorithm. At the crossroad, the smart car needs to go straight and is not allowed to turn. The two dotted lines on the left and right are the calculated track boundaries.
2. The method for identifying and classifying a track for a tracking smart car according to claim 1, characterized in that: The specific process of step S1 is: The MT9V034 God Eye camera is used to collect 50 original grayscale images of the track per second. The pixel value range of the grayscale image is 0 to 255. The image is stored in the microcontroller in the form of a two-dimensional array. Each pixel in the image corresponds to a specific position in the two-dimensional space. The grayscale image is binarized using the Otsu method, and then the binarized image is filtered to remove salt and pepper noise.
3. The method for identifying and classifying a track for a tracking smart car according to claim 2, characterized in that: In step S2, according to the projection perspective law, the width of the white track area in the black and white image gradually decreases from near to far, and the farther the image is, the more serious the distortion is. Therefore, the image is scanned from near to far, and the size of the black and white image is 120*60, from 0 to 60 lines from top to bottom.
4. The method for identifying and classifying a track for a tracking smart car according to claim 3, characterized in that: In step S2, both the left and right boundaries exist in the image, and the white boundary is searched to the left and right respectively from the 60th row and the 60th column. Since the track is a white pixel in the image, the position where the white pixel changes to a black pixel is searched, and the position of the jump point in the array is recorded as L n and R n , then the actual centerline position of the image is M n =(L n +R n ) / 2, where n is the number of rows.
5. The method for identifying and classifying a track for a tracking smart car according to claim 4, characterized in that: In step S2, when there is no left edge of the track in the image, the camera cannot observe the left line, so it is necessary to interpolate the line. Since the track width is fixed at 45 cm, the number of white pixels in each row of the image is a fixed value, which decreases from near to far and is calibrated in advance as W. n , the track width of the 50th row is 52 white pixels, and the track width of the 30th row is 42 white pixels. Therefore, the left boundary position is equal to the right boundary position minus the track width fixed value, that is, the left boundary position is L n =R n -W n , then the actual centerline position of the image is M n =(L n +R n ) / 2; When there is no right edge of the track in the image, the right edge position is the left edge position plus the track width, that is, R n =L n +W n .
6. The method for identifying and classifying a track for a tracking smart car according to claim 5, characterized in that: In step S2, the line is patrolled from the middle to the left and right sides, and then the track edge is climbed up to find the transition point of white and black pixels, and the track boundary is found in a manner similar to "climbing stairs"; when a white pixel point on the left side of the track satisfies both the white point on the right and the black point on the left, it means that this white pixel point is the left boundary point of the row.
7. The method for identifying and classifying a track for a tracking smart car according to claim 6, characterized in that: In step S2, after finding a boundary, use it as a seed to traverse the black and white pixel jump points in the 8-neighborhood to find the track boundary point of the next row; when the image scan reaches the image boundary, or the difference in the number of columns between the previous row boundary and the current row boundary is greater than the set threshold, that is, |L n -L n-1 |>THR, indicating that the effective track information of the image has been extracted. Save the relevant data before extracting the next image information.
8. The method for identifying and classifying a track for a tracking smart car according to claim 7, characterized in that: In step S3, the most common feature in the roundabout is triangle. When entering the roundabout, an equilateral triangle with the vertex facing upward and an inverted triangle with the vertex facing downward can be found in the image, and there is an inflection point in the middle of the roundabout. When exiting the roundabout, a lateral triangle with the vertex facing right can be found. For the track element roundabout, the smart car needs to go around the roundabout. The dotted lines on the left and right are the calculated and extracted left and right boundaries, and the dotted line in the middle is the calculated and extracted actual center line. The smart car needs to drive left along this center line into the roundabout.
9. The method for identifying and classifying a track for a tracking smart car according to claim 8, characterized in that: In step S3, when it is detected that more than 6 rows have black and white pixels that jump multiple times, it is determined to be a zebra crossing.