Intelligent connected vehicle circular light-emitting signal identification method and system
By using HSI color space and filter template processing in intelligent connected vehicles, the problem of slow recognition speed of circular luminous signals has been solved, achieving fast and accurate recognition results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TRAFFIC MANAGEMENT RES INST OF THE MIN OF PUBLIC SECURITY
- Filing Date
- 2022-11-18
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, intelligent connected vehicles have difficulty quickly and accurately identifying circular luminous signals. Existing signal recognition algorithms are complex and cannot meet computational requirements.
The HSI color space is used to perform color segmentation on the circular luminous signal image. By converting the RGB color space to the HSI color space and combining it with the filtering template for hole filling and minimization processing, the computational complexity is reduced and the circular luminous signal can be quickly identified.
It achieves fast and accurate recognition of circular luminous signals, reduces computational complexity, and meets the computing needs of intelligent connected vehicles.
Smart Images

Figure CN116110021B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent transportation technology, specifically to a method and system for recognizing circular luminous signals for intelligent connected vehicles. Background Technology
[0002] Circular illuminated signals are a common type of traffic signal on roads. They include prohibitory signs, directional signs, traffic lights, and warning lights. There are two types of illumination: active and passive. Passive illumination primarily uses reflective film to emit light, while active illumination uses light sources such as incandescent lamps, low-voltage halogen lamps, and LEDs. The luminous surface of circular illuminated signals has diameters of 200, 300, and 400 millimeters, and their colors include red, yellow, green, blue, and white.
[0003] Intelligent connected vehicles are a new generation of automobiles equipped with advanced sensors, controllers, actuators, and other devices, integrating modern communication and network technologies. Their technological approaches include "vehicle-centric intelligence" and "vehicle-road cooperation." "Vehicle-centric intelligence" achieves autonomous driving primarily through the vehicle itself, while "vehicle-road cooperation" relies on vehicle-to-everything (V2X) networks for this purpose. For "vehicle-centric intelligence" vehicles, cameras mounted on the windshield, in practical applications, identify circular luminous signals and combine this information with lane information, vehicle position, speed, and target information, which is a key factor in assisting the safe passage of intelligent connected vehicles.
[0004] In the existing technology, some technicians are also researching signal recognition technology, such as recognizing signals through machine learning; however, since most of the existing methods are for recognizing specific signals, they cannot be directly applied to the recognition of circular luminous signals. In practical applications, intelligent connected vehicles are required to quickly and accurately identify the color of circular luminous signals, but most of the current recognition methods are relatively complex and involve many image processing steps. In terms of recognition and calculation speed, they are still difficult to meet the computing needs of intelligent connected vehicles. Summary of the Invention
[0005] To address the problem that existing signal recognition algorithms cannot meet the computational requirements of intelligent connected vehicles for recognizing circular luminous signals, this invention provides a method for recognizing circular luminous signals in intelligent connected vehicles. This method can quickly and accurately identify circular luminous signals, thus satisfying the computational needs of intelligent connected vehicles. Simultaneously, this invention also discloses a system for recognizing circular luminous signals in intelligent connected vehicles.
[0006] The technical solution of this invention is as follows: a method for recognizing circular luminous signals in intelligent connected vehicles, characterized by comprising the following steps:
[0007] S1: Acquire a color image of the circular luminous signal, denoted as: the signal image to be identified, and convert the signal image to be identified into the HSI color space;
[0008] S2: Color segmentation of the signal image to be recognized based on the HSI color space;
[0009] Specifically, the following steps are included:
[0010] a1: Confirm the characteristics of the target pixel in the HIS color space;
[0011] The color space of the image of the signal to be identified, which is a circular luminous signal image, is RGB.
[0012] At image coordinates (i,j) of the signal image to be identified, assuming the R, G, and B components of the RGB color space are respectively and The H, S, and I components of the HSI color space are respectively and
[0013] The transformation relationship between RGB color space and HSI color space is as follows:
[0014]
[0015]
[0016]
[0017] Where 1≤i≤W1, 1≤j≤H1, W1 is the width of the signal image to be identified, and H1 is the height of the signal image to be identified;
[0018] a2: Based on the HSI color space, the color components of red, yellow, green, blue and white are defined, and the signal image to be identified is segmented by color to obtain the set of target pixel coordinates;
[0019] The coordinates (p, q) of all five colored target pixels (red, yellow, green, blue, and white) in the signal image to be identified after calculation are denoted as follows:
[0020]
[0021] In this context, R represents red, Y represents yellow, G represents green, B represents blue, and W represents white;
[0022] S3: Segment the signal image to be identified according to the target pixel coordinate set to obtain the target color image; perform binarization processing on the target color image to obtain the target binarized image corresponding to each color;
[0023] S4: Perform hole-filling and size-reducing processing on the target binarized image to remove noise and interference factors from the image;
[0024] S5: Scan each of the target binarized images to find all image blocks in the image, which are denoted as: target image blocks;
[0025] S6: For all the target image blocks corresponding to the signal image to be identified, calculate the region characteristics of each image block, and determine the identification result of the circular luminous signal color based on the region characteristics of the image blocks;
[0026] The feature parameters included in the image block region characteristics are: area, perimeter, roundness, and aspect ratio; the specific calculation steps include:
[0027] e1. Statistically analyze the area features of the target image blocks included in each target binarized image to obtain statistical area feature values; compare the area statistical feature values with a preset area threshold;
[0028] If the area statistical feature value does not meet the range of the area threshold, the target image block is determined to be a non-circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped.
[0029] Otherwise, proceed to step e2;
[0030] e2. Calculate the perimeter features of the target image block to obtain the perimeter feature statistics; compare the perimeter feature statistics with a preset perimeter threshold;
[0031] If the perimeter feature statistical value does not meet the range of the perimeter threshold, the target image block is determined to be a circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped.
[0032] Otherwise, proceed to step e3;
[0033] e3. Calculate the roundness features of the target image block to obtain roundness feature statistics; compare the roundness feature statistics with a preset roundness threshold;
[0034] If the roundness statistical feature value does not meet the range of the roundness threshold, the target image block is determined not to be a circular luminous signal, the target image block is deleted from the target binary image, and subsequent statistical analysis is stopped.
[0035] Otherwise, proceed to step e4;
[0036] e4. Calculate the aspect ratio features of the target image block to obtain the aspect ratio feature statistics; compare the aspect ratio feature statistics of the image block with the preset aspect ratio threshold;
[0037] If the aspect ratio statistical feature value does not meet the threshold range, the target image block is determined not to be a circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped.
[0038] Otherwise, proceed to step e5;
[0039] e5: Repeat steps e1 to e4 until all colors of the target binarized image have been statistically analyzed;
[0040] Determine the final number of the target image patches;
[0041] If the final number of target image blocks is 0, it is determined that there is no valid circular luminous signal in any of the target binarized images;
[0042] If the number of target image blocks obtained in the end is 1, then the color of the target binarized image corresponding to the target image block is confirmed, that is, the recognition result of the color of the circular luminous signal in the signal image to be recognized is obtained;
[0043] Otherwise, if multiple valid circular light signals are detected, a warning message will be issued.
[0044] Its further features are:
[0045] Step S3 includes the following steps in detail:
[0046] b1: Calculate the target color image based on the coordinates of the target pixels;
[0047] At the target pixel coordinates, the pixel value of the target color image is the same as the RGB pixel value of the signal image to be identified; at other coordinates, the pixel value of the target color image is 0; the transformation relationship between the target color image and the signal image to be identified is as follows:
[0048]
[0049]
[0050]
[0051]
[0052]
[0053] in,
[0054] These represent the components of the red target pixel in the R, G, and B channels.
[0055] These represent the components of the yellow target pixel in the R, G, and B channels.
[0056] The components of the green target pixel in the R, G, and B channels;
[0057] The components of the blue target pixel in the R, G, and B channels;
[0058] The components of the white target pixel in the R, G, and B channels;
[0059] b2: Convert the target color image into a grayscale image to obtain the target grayscale image corresponding to each color;
[0060] At (i,j), assume the gray levels of the red, yellow, green, blue, and white target pixels are respectively... The transformation relationship between the target color image and the target grayscale image is as follows:
[0061]
[0062]
[0063]
[0064]
[0065]
[0066] b3: Binarize the target grayscale image to obtain the target binarized image corresponding to each color;
[0067] Assuming the coordinates (i,j) of the signal image to be identified: at (i,j), assuming the binarization results of the red, yellow, green, blue, and white target pixels are respectively... The transformation relationship between the target grayscale image and the target binarized image is as follows:
[0068]
[0069]
[0070]
[0071]
[0072]
[0073] Where threshold_R, threshold_Y, threshold_G, threshold_B, and threshold_W are the target grayscale image binarization thresholds for red, yellow, green, blue, and white, respectively;
[0074] Step S4 includes the following steps:
[0075] c1: Using a preset filter template A, perform the hole-filling process on the target binarized image from left to right and from top to bottom;
[0076] At coordinates (i,j), assume the outputs of the hole-filling processing for the binarized images of red, yellow, green, blue, and white targets are respectively... The transformation relationship of the hole-filling process is as follows:
[0077]
[0078]
[0079]
[0080]
[0081]
[0082] Where B-red represents binarized red pixels, B-yellow represents binarized yellow pixels, B-yellow represents binarized green pixels, B-blue represents binarized blue pixels, B-white represents binarized white pixels, P represents hole filling, and s and t represent the distance from (i,j) row and column, with positive numbers indicating addition and negative numbers indicating subtraction.
[0083] c2: Using the preset filter template A, perform the reduction processing on the target binarized image after the hole filling process from left to right and from top to bottom;
[0084] At coordinates (i,j), assume the output of the binarized image reduction processing for the red, yellow, green, blue, and white targets is... The transformation relationship of the reduction process is as follows:
[0085]
[0086]
[0087]
[0088]
[0089]
[0090] Where B-red represents the binarized red pixel, B-yellow represents the binarized yellow pixel, B-yellow represents the binarized green pixel, B-blue represents the binarized blue pixel, B-white represents the binarized white pixel, F represents the reduction processing operation; s and t represent the distance (i,j) row and column distance, positive numbers are added, and negative numbers are subtracted;
[0091] The filter template A is a 5×5 filter template with its center coordinates at (0,0). A is represented by a matrix as follows:
[0092]
[0093] In step S5, the method for calculating the target image patch is as follows:
[0094] For each pixel in the target binarized image, scan the eight neighborhood points respectively, and mark all pixels that can be connected by 8 as a target image block; scan each target binarized image respectively to find all the target image blocks;
[0095] The specific steps include:
[0096] d1: Initialize the image block counter n = 1;
[0097] d2: Begin scanning the target binarized image in a left-to-right, top-to-bottom order. The pixel coordinates in the image are represented as (i,j);
[0098] When the first image pixel with a value of 255 is scanned, initialization is performed.
[0099] d3: 8-neighborhood image tags;
[0100] Scan pixels All 8 neighboring pixels, the pixel with a value of 255 in the neighborhood is considered to be... Belongs to an image patch; the image patch labeling results of neighboring pixels and The image patch labeling results are the same, both being n, i.e.:
[0101]
[0102] Meanwhile, the pixel marker of the neighboring pixels is 1, that is:
[0103]
[0104] Where s and t represent the row and column distances of (i,j), positive numbers indicate addition and negative numbers indicate subtraction;
[0105] d4: Extended 8-neighborhood image tagging;
[0106] After step d3 is executed, obtain the image block labeling result n and the pixel labeling result 1. Then execute step d3 again on its 8 neighboring pixels. For the neighboring pixels with a value of 255 found in the pixel scan, mark their image block labeling result as n and their pixel labeling result as 1.
[0107] d5: Repeat steps d3 to d4 until all 8 connected pixels in image block n have been marked, then end the marking of image block n;
[0108] The image patch labeling result n = n + 1 is used to initialize the labeling of the next image patch;
[0109] d6: All image patch markers;
[0110] Repeat steps d2 to d5, scanning unmarked pixels from left to right and top to bottom until all pixels with a value of 255 have image block marking results and the pixel marking value is 1, then end the scan;
[0111] The final value of n is the number of target image patches;
[0112] In step S6, the calculation method for each feature parameter in the image patch region characteristics includes:
[0113] The area S(n) is calculated by counting the number of pixels (i,j) in the target image block.
[0114]
[0115] Where W1 and H1 are the widths of the signal image to be identified, and H1 is the height of the signal image to be identified; Label the image patches. The result of the pixel labeling operation;
[0116] The perimeter is calculated as follows: if there is a point with a value of 0 in the eight neighborhoods of a pixel, it is determined to be a boundary point, and the number of all the boundary points is counted to obtain the perimeter P(n);
[0117]
[0118] in, For binarizing the target image, Label the image patches. The result of the pixel marking operation is given by W1 and H1, which represent the width of the signal image to be identified and the height of the signal image to be identified. s and t represent the distance between rows and columns of (i,j), with positive numbers indicating addition and negative numbers indicating subtraction.
[0119] The method for calculating the roundness is as follows:
[0120]
[0121] Where n represents the nth image patch in the binarized image of the target; S(n) is the area of the image patch; P(n) is the perimeter of the image patch; and C(n) is the roundness of the image patch.
[0122] The aspect ratio is calculated as follows:
[0123] The distance between the leftmost and rightmost pixels in the horizontal direction is used as the length of the target image block, and the distance between the topmost and bottommost pixels in the vertical direction is used as the width of the target image block.
[0124]
[0125] Where n represents the nth image patch in the binarized image of the target; Label the image patches. R(n) represents the result of the pixel labeling operation; R(n) represents the aspect ratio of the image block.
[0126] A circular luminous signal recognition system for intelligent connected vehicles is characterized by comprising: an image acquisition unit, a color segmentation unit, a region sorting unit, and a shape recognition unit that are interconnected.
[0127] The image acquisition unit includes: a camera installed on the windshield of the intelligent connected vehicle; the image acquisition unit acquires an image of a colored circular light-emitting signal based on the RGB color space through the camera, and transmits the circular light-emitting signal image as a signal image to be identified to the color segmentation unit;
[0128] The color segmentation unit: converts the signal image to be identified from RGB space to HSI space, and then segments the red, yellow, green, blue, and white targets in the RGB signal image to be identified based on the thresholds of the hue (H), saturation (S), and brightness (I) components of red, yellow, and green in the HSI color image space, and the thresholds of the five colors (red, yellow, green, blue, and white) in the hue (H), saturation (S), and brightness (I) components, to obtain a target color image. During the segmentation process, all colors other than red, yellow, green, blue, and white are removed. Then, the target color image is converted into a grayscale image to obtain target grayscale images corresponding to the five colors red, yellow, green, blue, and white respectively. Then, the target grayscale images are binarized to obtain target binarized images corresponding to the five colors red, yellow, green, blue, and white respectively. Finally, the target binarized images are passed to the region processing unit.
[0129] The region processing unit performs hole filling and size reduction processing on the target binarized image using a preset filter template A.
[0130] The hole-filling process involves filling the empty areas in the binarized image. The specific steps are as follows: using a preset filter template A, the target binarized image is scanned from left to right and from top to bottom; for the current pixel: when the convolution sum of the image pixels covered by filter template A and A is not 0, the output of the hole-filling process is 255; when the convolution sum of the image pixels covered by filter template A and A is 0, the output of the hole-filling process is 0.
[0131] The reduction processing involves eliminating small objects or clutter points in the target binarized image after the hole-filling process; the specific steps are as follows:
[0132] Using the preset filter template A, the target binarized image after the hole-filling process is scanned and filtered again from left to right and from top to bottom; for the current pixel: if any position in filter template A with a value of 1 covers an image pixel of 255, then the output of the reduction process is 255, otherwise the output of the reduction process is 0; the region sorting unit transmits the binarized image obtained after the hole-filling and reduction processes to the shape recognition unit;
[0133] The shape recognition unit: scans the target binarized image to find all image blocks in the image, thus obtaining all target image blocks; for each target image block, it calculates the image block region characteristics; according to the preset threshold range of each parameter in the image block region characteristics, it compares each value of the image block region characteristics corresponding to the target image block with the corresponding threshold range; the image block region characteristics include: area, perimeter, roundness, and aspect ratio;
[0134] If there exists a unique target image block whose region characteristics simultaneously satisfy all the threshold range requirements, then the color corresponding to the target image block that satisfies the requirements is the color recognition result of this circular luminous signal; otherwise, it is determined that no valid color recognition result of the circular luminous signal has been obtained in this recognition.
[0135] The present invention provides a method for recognizing circular luminous signals in intelligent connected vehicles. This method converts the acquired colored circular luminous signal image to the HSI color space, performs color segmentation within the HSI space, ensuring better accuracy and reduced computational complexity in subsequent calculations based on the segmented image. Based on the HSI model, it segments the red, yellow, green, blue, and white targets within the RGB color image of the circular luminous signal to obtain the target color image. During segmentation, colors other than red, yellow, green, blue, and white are removed, ensuring that all pixels involved in subsequent calculations are related to the color of the circular luminous signal. Subsequent calculations only target colors related to the circular luminous signal, reducing computational complexity. Each target color image is then processed separately. Binarization processing yields the target binarized image, and subsequent calculations are performed only within the binary space, further reducing computational complexity and improving computational speed. After removing noise and interference factors from the target binarized image, target image blocks are obtained. Then, the region characteristics of each target image block are calculated, and the values of the obtained region characteristics are compared with a preset threshold range. The color corresponding to the target image block that meets the requirements is the color recognition result of the circular luminous signal. Any target image block can be excluded if any parameter of its region characteristics does not meet the threshold range. The result corresponding to the target image block can be obtained without completing all calculations, further reducing computational complexity and improving computational speed. Based on the calculation scheme of this invention, the recognition of the signal image to be identified can be completed quickly and accurately, meeting the computational needs of intelligent connected vehicles. Attached Figure Description
[0136] Figure 1 This is a schematic diagram of the module structure of the circular luminous signal recognition system for intelligent connected vehicles in this invention;
[0137] Figure 2 An example of converting the image of the signal to be identified acquired by the image acquisition unit from RGB space to HSI space;
[0138] Figure 3 This is an example of a target color image with five colors obtained after segmentation in the HSI color image space;
[0139] Figure 4 for Figure 3 An example of obtaining a binary image of a target after binarization of a target color image;
[0140] Figure 5 for Figure 4 An example of a binary image of a target after hole-filling processing;
[0141] Figure 6 for Figure 5 An example of a binary image of a target after reduction processing;
[0142] Figure 7 This is an example of statistical analysis of image patch features in a binarized image of a red target;
[0143] Figure 8 This is an example of statistical analysis of image patch features in a binarized image of a green target;
[0144] Figure 9 This is an example of statistical analysis of image patch features in a binarized image of a yellow target;
[0145] Figure 10 This is an example of statistical analysis of image patch features in a binarized image of a blue target;
[0146] Figure 11 This is an example of statistical analysis of image patch features in a binary image of a white target. Detailed Implementation
[0147] like Figure 1 As shown, the technical solution of the present invention includes a circular light-emitting signal recognition system for intelligent connected vehicles, which includes: an image acquisition unit, a color segmentation unit, a region sorting unit and a shape recognition unit that are interconnected.
[0148] The image acquisition unit includes a camera mounted on the windshield of the intelligent connected vehicle. The camera acquires a colored circular light-emitting signal image based on the RGB color space and transmits it as the signal image to be identified to the color segmentation unit.
[0149] The color segmentation unit converts the target signal image from RGB space to HSI space. Then, based on the threshold values of the hue (H), saturation (S), and luminance (I) components for red, yellow, green, blue, and white in the HSI color image space, it segments the red, yellow, green, blue, and white targets in the RGB target signal image to obtain the target color image. During the segmentation process, colors other than red, yellow, green, blue, and white are removed to ensure that the pixels involved in the calculation are all related to the color of the circular luminous signal, reducing the overall computational load. Next, the target color image is converted to grayscale, obtaining target grayscale images corresponding to the five colors: red, yellow, green, blue, and white. The target grayscale images are then binarized to obtain target binarized images corresponding to the five colors: red, yellow, green, blue, and white. Finally, the target binarized images are passed to the region processing unit. In the target binarized image, the target value corresponding to 255 is white, and the background value corresponding to 0 is black.
[0150] Region Sorting Unit: Based on the preset filter template A, the target binarized image is processed to fill holes and reduce size.
[0151] Hole filling involves filling empty areas in the binarized image of the target image. The specific steps are as follows:
[0152] Using a preset filter template A, the target binarized image is scanned from left to right and from top to bottom. For the current pixel: when the convolution sum of the image pixels covered by filter template A and A is not 0, the output of the hole-filling process is 255; when the convolution sum of the image pixels covered by filter template A and A is 0, the output of the hole-filling process is 0. Through hole-filling, the holes 0 in the target binarized image are filled with white pixels 255, maintaining the integrity of the circular luminous signal.
[0153] The process of eliminating small objects or clutter in the binarized image of the target after hole filling is called; the specific steps are as follows:
[0154] Using the preset filter template A, the binarized image of the target after the hole filling process is scanned and filtered again from left to right and from top to bottom;
[0155] For the current pixel: if any position in filter template A with a value of 1 covers an image pixel of 255, then the output of the reduction processing is 255; otherwise, the output of the reduction processing is 0. Through reduction processing, some small objects or edges that were magnified during the hole-filling process are removed, eliminating the magnification effect caused by the hole-filling process.
[0156] The region sorting unit passes the binarized image obtained after hole filling and size reduction processing to the shape recognition unit.
[0157] Shape Recognition Unit: The target binarized image after hole filling and size reduction is scanned again to find all image blocks in the image. For each target image block, the image block region characteristics are calculated. Each value of the image block region characteristic corresponding to the target image block is compared with its corresponding threshold range according to the preset threshold range for each parameter in the image block region characteristics. If there exists a unique target image block whose image block region characteristics simultaneously meet all threshold range requirements, then the color corresponding to the target image block that meets the requirements is the color recognition result of this circular luminous signal. Otherwise, it is determined that no valid circular luminous signal color recognition result was obtained in this recognition.
[0158] Image patch region characteristics include: area, perimeter, roundness, and aspect ratio.
[0159] The method for recognizing circular luminous signals for intelligent connected vehicles based on the aforementioned circular luminous signal recognition system for intelligent connected vehicles specifically includes the following steps.
[0160] S1: Acquire a color image of a circular luminous signal, denoted as: the signal image to be identified, and convert the signal image to be identified into the HSI color space.
[0161] In this embodiment, the image acquisition unit acquires a color image of the circular light-emitting signal. The image acquisition unit is a camera installed on the windshield of the intelligent connected vehicle, and the color space of the circular light-emitting signal image it acquires is RGB.
[0162] Assume (i,j) are image coordinates; at (i,j), assume the R (red), G (green), and B (blue) components of the RGB color space are respectively... and
[0163] S2: Color segmentation of the signal image to be recognized based on the HSI color space;
[0164] In the RGB color space, the three components R (red), G (green), and B (blue) have high color correlation; in the HSI color space, the three components H (hue), S (saturation), and I (brightness) have low color correlation. Therefore, in the technical solution of this application, the acquired image is converted from the RGB color space to the HSI color space for color segmentation, which is more conducive to the segmentation result.
[0165] Specifically, the following steps are included:
[0166] a1: Confirm the characteristics of the target pixel in the HIS color space.
[0167] At (i,j), assume that the H (hue), S (saturation), and I (luminance) components of the HSI color space are respectively... and
[0168] The transformation relationship between RGB color space and HSI color space is as follows:
[0169]
[0170]
[0171]
[0172] Where 1≤i≤W1, 1≤j≤H1, W1 is the width of the signal image to be identified, and H1 is the height of the signal image to be identified;
[0173] Table 1 shows the characteristic values of five colors—red, yellow, green, blue, and white—defined according to the characteristics of the HSI color space.
[0174] Table 1. Definition values of five colors (red, yellow, green, blue, and white) in the HIS color space.
[0175]
[0176] Circular luminous signals are a common type of traffic signal on roads. They include prohibitory signs, instruction signs, traffic lights, and warning lights. Their light emission forms are either active or passive. Passive light emission primarily uses reflective film; active light sources include incandescent lamps, low-voltage halogen lamps, and light-emitting diodes (LEDs). Their luminous surface diameters are 200, 300, and 400 mm, and their emission colors include red, yellow, green, blue, and white. This embodiment uses a solar-powered warning light installed in the central green belt of an intersection as an example to illustrate the technical solution of this application. The solar-powered warning light is a circular luminous signal, classified as a warning light, characterized by: active light emission; a light-emitting diode as the light source; a luminous surface diameter of 200 mm; and a yellow emission color. The image acquisition unit acquires images of the warning light, as well as the road traffic environment, including warning posts, trees, motor vehicles, pedestrians, and buildings.
[0177] The image acquisition unit converts the image of the signal to be identified from RGB space to HSI space, and the effect before and after conversion is illustrated in the example below. Figure 2 As shown.
[0178] a2: Based on the HSI color space, the color components of red, yellow, green, blue and white are defined, and color segmentation is performed on the image of the signal to be identified to obtain a set of target pixel coordinates.
[0179] Based on the normalized values of the HSI components of the five colors (red, yellow, green, blue, and white) in Table 1, the coordinates (p, q) of all five colored target pixels in the image to be identified are calculated and denoted as follows:
[0180]
[0181] S3: Segment the signal image to be identified according to the target pixel coordinate set to obtain the target color image; perform binarization processing on the target color image to obtain the target binarized image corresponding to each color.
[0182] The dimensions of the target binarized image are the same as those of the color signal image to be identified. When calculating the target color image, the pixel values at the coordinates of each color (red, yellow, green, blue, white) are the same as the pixel values of the original image, while the pixel values at the coordinates of other colors are 0. Pixels other than red, yellow, green, blue, and white are removed to ensure that subsequent calculations are only performed on pixels of the red, yellow, green, blue, and white colors, thus reducing the overall computational load.
[0183] Step S3 includes the following steps in detail:
[0184] b1: Calculate the target color image based on the coordinates of the target pixels;
[0185] The target color image is a color image output by consisting of target pixels.
[0186] The specific calculation steps are as follows:
[0187] Target color image calculation method: At the target pixel coordinates, the pixel value of the target color image is the same as the RGB pixel value of the acquired image; at other coordinates, the pixel value of the target color image is 0. The transformation relationship between the target color image and the acquired image is as follows:
[0188]
[0189]
[0190]
[0191]
[0192]
[0193] in,
[0194] These represent the components of the red target pixel in the R, G, and B channels.
[0195] These represent the components of the yellow target pixel in the R, G, and B channels.
[0196] The components of the green target pixel in the R, G, and B channels;
[0197] The components of the blue target pixel in the R, G, and B channels;
[0198] These are the components of the white target pixel in the R, G, and B channels.
[0199] like Figure 3 As shown, Figure 3 For based on Figure 2 The embodiment of segmenting the circular luminous signal image to be identified into a target color image based on the characteristics of the five colors red, yellow, green, blue and white in the HSI color image space; in this embodiment, the circular luminous signal image acquired by the image acquisition unit includes four colors: red, yellow, green and white, with virtually no blue.
[0200] From the RGB image of red targets: the red warning patterns on the warning posts, the red tiles on the buildings, and other red targets are segmented out.
[0201] From the RGB image of green targets: green targets such as green belts, roadside trees, and grass leaves are segmented out.
[0202] Looking at the RGB image of the yellow target: the yellow target of the warning light is segmented out. At the same time, due to the influence of sunlight, the leaves of some green belts, roadside trees and grass are yellowish and are also segmented out as yellow targets.
[0203] Looking at the RGB image of the blue target: there are basically no blue target pixels.
[0204] From the RGB image of white targets: white warning patterns on warning posts, white road markings, and other white targets are segmented out.
[0205] b2: Convert the target color image to a grayscale image to obtain the target grayscale image corresponding to each color;
[0206] Target grayscale image calculation method: At (i,j), assume the grayscale values of the red, yellow, green, blue, and white target pixels are respectively... The transformation relationship between the target color image and the target grayscale image is as follows:
[0207]
[0208]
[0209]
[0210]
[0211]
[0212] b3: Binarize the target grayscale image to obtain the target binarized image corresponding to each color;
[0213] Target binarization image calculation method: At (i,j), assume the binarization results of the red, yellow, green, blue, and white target pixels are respectively... The transformation relationship between the grayscale image and the binarized image of the target is as follows:
[0214]
[0215]
[0216]
[0217]
[0218]
[0219] Wherein, threshold_R, threshold_Y, threshold_G, threshold_B, and threshold_W are the binarization thresholds for the target grayscale images of red, yellow, green, blue, and white, respectively. In this embodiment, by setting threshold_R, threshold_Y, threshold_G, threshold_B, and threshold_W, the number of bright spots in the target grayscale image is controlled; the larger the threshold, the fewer the bright spots. In specific implementation, the specific values of the five thresholds are adaptively set according to the required calculation accuracy.
[0220] like Figure 4 As shown, for Figure 3 An example of obtaining a target binary image after binarization of a target grayscale image.
[0221] From the binarized image of the red targets: the red warning pattern on the warning post, the red tiles on the building, and other red segmented targets have their grayscale images binarized to "255", while the grayscale images of the remaining pixels are binarized to "0".
[0222] From the binarized image of green targets: the grayscale images of green belts, roadside trees, grass leaves, and other green segmented targets are binarized to "255", while the grayscale images of the remaining pixels are binarized to "0".
[0223] From the binarized image of the yellow targets: the yellow warning lights, some green belts, roadside trees, and yellowish leaves of grass, etc., are segmented as yellow. Their grayscale images are binarized to "255", while the grayscale images of the remaining pixels are binarized to "0".
[0224] From the binarized image of the blue target: a few blue segmented targets have their grayscale images binarized to "255", while the grayscale images of the remaining pixels are binarized to "0".
[0225] From the binarized image of white targets: the white warning pattern on the warning post and the white markings on the road, etc., are divided into white targets. Their grayscale images are binarized to "255", while the grayscale images of the remaining pixels are binarized to "0".
[0226] In summary, the binarized images of red, green, yellow, green, and white targets all clearly contain "black holes" and "small objects," which affect the subsequent recognition of circular luminous signals. Therefore, it is necessary to perform hole filling and small object reduction processing on the binarized images of the targets.
[0227] S4: Perform hole-filling and size-reducing processing on the binarized image of the target to remove noise and interference factors from the image.
[0228] Step S4 includes the following steps:
[0229] c1: Using the preset filter template A, perform hole filling processing on the target binarized image from left to right and from top to bottom;
[0230] For the current pixel: when the convolution sum of the image pixels covered by filter template A and A is not 0, the output of the hole filling process is 255; when the convolution sum of the image pixels covered by filter template A and A is 0, the output of the hole filling process is 0.
[0231] At coordinates (i,j), assume the outputs of the hole-filling processing for the binarized images of red, yellow, green, blue, and white targets are respectively... The transformation relationships for filling holes are as follows:
[0232]
[0233]
[0234]
[0235]
[0236]
[0237] Wherein, B-red represents binarized red pixels, B-yellow represents binarized yellow pixels, B-yellow represents binarized green pixels, B-blue represents binarized blue pixels, B-white represents binarized white pixels, and P represents hole filling processing.
[0238] In this embodiment, the filter template A has a size of 5×5 and its center coordinates are (0,0).
[0239] s and t represent the row and column distances from (i,j), with positive numbers indicating addition and negative numbers indicating subtraction. For example, when s = 1 and t = 1, (i + s, j + t) means adding 1 to the row and 1 to the column of (i,j) to form a new coordinate; when s = -1 and t = -1, (i + s, j + t) means subtracting 1 from the row and 1 from the column of (i,j) to form a new coordinate.
[0240] A can be represented by a matrix as follows:
[0241]
[0242] In the technical solution of this invention, the 1 in the filter template A is set to a rhombus shape. Compared with the commonly used linear filter template, its coverage of pixels is more dispersed and uniform. At the same time, since the technical solution of this invention is designed for the recognition of circular light-emitting signals, there is no need to recognize other shapes. Using a 5×5 filter template A can reduce the number of calculations. Under the premise of ensuring that the calculation results meet the requirements of calculation accuracy, the amount of calculation is appropriate, which improves the calculation efficiency and does not affect the calculation results. At the same time, it can ensure the accuracy of the results.
[0243] like Figure 5 As shown, this is for Figure 4 The image shows the binarized images of the segmented targets corresponding to various colors of the signal image to be identified after the pattern has been filled with holes.
[0244] Looking at the hole-filling process of the binarized image of red targets: after the red warning pattern on the warning post and the red tiles of the building are first binarized and "filled", the "black hole" pixel becomes the target pixel "255", the "black hole" disappears, and the integrity of the red binarized target is improved. However, at the same time, the red binarized target is enlarged and its area increases.
[0245] From the perspective of hole filling processing of green target binarized images: after the green targets such as green belts, roadside trees, and grass leaves are first binarized and "hole filled", the "black hole" pixel becomes the target pixel "255", the "black hole" disappears, and the integrity of the green binarized target is improved. However, at the same time, the green binarized target is enlarged and its area increases.
[0246] From the hole-filling process of the binarized image of yellow targets: after the yellow warning lights, some green belts, roadside trees, and yellowish leaves of grass are first binarized and "filled", the "black hole" pixel becomes the target pixel "255", the "black hole" disappears, and the integrity of the yellow binarized target is improved. However, at the same time, the yellow binarized target is enlarged and its area increases.
[0247] From the hole-filling process of the binarized image of blue targets: for a few blue segmented targets, after the binarization "hole-filling" process, the "black hole" pixel becomes the target pixel "255", the "black hole" disappears, and the integrity of the blue binarized target is improved. However, at the same time, the blue binarized target is enlarged and its area increases.
[0248] From the perspective of hole-filling processing of white target binarized images: after the white warning pattern on the warning post and the white markings on the road are first binarized and "hole-filled", the "black hole" pixel becomes the target pixel "255", the "black hole" disappears, and the integrity of the white binarized target is improved. However, at the same time, the white binarized target is enlarged and its area increases.
[0249] c2: Using the preset filter template A, perform reduction processing on the target binarized image after hole filling from left to right and from top to bottom;
[0250] During the hole-filling process, some small objects may be magnified, or the edges of the original pattern may be magnified, so a removal process is needed. Similar to the hole-filling process, a 5×5 filter template is used to perform a "smashing" process on the segmented binary image after the hole-filling process, from left to right and from top to bottom, to eliminate "small objects".
[0251] For the current pixel: if any position in filter template A with a value of 1 covers an image pixel of 255, then the output of the reduction processing is 255; otherwise, the output of the reduction processing is 0. The reduction processing will eliminate some small objects or edges that were magnified during the hole-filling process.
[0252] At (i,j), assume the output of the binarized image reduction processing for red, yellow, green, blue, and white targets is... The transformation relationship for the reduction process is as follows:
[0253]
[0254]
[0255]
[0256]
[0257]
[0258] Wherein, B-red represents binarized red pixels, B-yellow represents binarized yellow pixels, B-yellow represents binarized green pixels, B-blue represents binarized blue pixels, B-white represents binarized white pixels, and F represents the reduction processing operation.
[0259] s and t represent the row and column distances from (i,j), with positive numbers indicating addition and negative numbers indicating subtraction. For example, when s = 1 and t = 1, (i + s, j + t) means adding 1 to the row and 1 to the column of (i,j) to form a new coordinate; when s = -1 and t = -1, (i + s, j + t) means subtracting 1 from the row and 1 from the column of (i,j) to form a new coordinate.
[0260] like Figure 6 As shown, this is for Figure 5 The images show the results of minimizing the size of the segmented target binarized images corresponding to various colors. Looking at the minimization process for the red target binarized image: after binarization and minimization, the red warning symbols on the warning post, the red tiles on the building, and other red targets are eliminated, and the area of the red targets is reduced to a size close to their actual size, compensating for the area enlargement caused by the "filling holes" process.
[0261] From the perspective of the reduction processing of green target binarized images: after the green belt, roadside trees, grass leaves and other green targets are binarized and "reduced", the "small objects" are eliminated, and the area of the green targets is reduced to be close to the actual size, which makes up for the adverse effect of area enlargement brought about by the "filling hole" processing.
[0262] From the perspective of the reduction processing of the binarized image of yellow targets: after the reduction processing of yellow warning lights, some green belts, roadside trees, and yellowish leaves of grass, the "small objects" are eliminated, and the area of the yellow targets is reduced to be close to the actual size, which makes up for the adverse effect of area enlargement brought about by the "filling hole" processing.
[0263] From the perspective of the reduction processing of blue target binarized images: after a few blue segmented targets are binarized and "reduced", the "small objects" are eliminated, and the area of the blue targets is reduced to be close to the actual size, which makes up for the adverse effect of area enlargement brought about by the "hole filling" processing.
[0264] From the perspective of the reduction processing of white target binarized images: after the white warning patterns on the warning posts and the white markings on the road are binarized and "reduced in size", the "small objects" are eliminated, and the area of the white targets is reduced to be close to their actual size, which makes up for the adverse effect of area enlargement brought about by the "filling hole" processing.
[0265] Finally, the region sorting unit passes the resulting binarized image to the shape recognition unit.
[0266] S5: Scan each target binarized image to find all image blocks in the image, which are denoted as: target image blocks.
[0267] In step S5, the method for confirming the target image patch is as follows:
[0268] For the binarized target images of red, yellow, green, blue, and white after hole filling and size reduction processing, scan the 8-neighborhood pixels of each pixel with a value of 255 (i.e., 8-neighborhood scan), and mark all pixels with a value of 255 that can be connected in 8-way as a target image block.
[0269] In image processing, any given pixel has eight possible directions adjacent to it. We establish a Cartesian coordinate system centered on the current pixel, defining its eight neighborhoods as the eight directions: directly above, upper right, upper left, directly below, lower left, lower right, left, and right.
[0270] In the technical solution of this invention, when a pixel with a value of 255 also has a pixel with a value of 255 in its 8-neighborhood, the two pixels are considered to exist in a target image block.
[0271] In practice, the target binarized image is scanned from left to right and from top to bottom. The median value is 255 pixels, used in the calculation process. and The two parameters represent the marking results:
[0272] Label the image blocks. Represents pixels It belongs to the nth image patch;
[0273] For pixel markers, Represents pixels It has been marked. Represents pixels It has not been marked.
[0274] Values include:
[0275] Values include:
[0276] Values include:
[0277] The specific steps include:
[0278] d1: Initialize the image block counter n = 1;
[0279] d2: Scan the target binarized image in order from left to right and top to bottom.
[0280] When the first image pixel with a value of 255 is scanned, assuming the pixel coordinates are (i,j), initialize...
[0281] d3: 8-neighborhood image tags:
[0282] Scan pixels All 8 neighboring pixels, the pixel with a value of 255 in the neighborhood is considered to be... Belongs to an image patch; the image patch labeling results of neighboring pixels and The image patch labeling results are the same, both being n, i.e.:
[0283]
[0284] At the same time, the pixel is marked as 1, that is:
[0285]
[0286] Where s and t represent the distance from (i,j) in rows and columns, positive numbers indicate addition and negative numbers indicate subtraction. For example, when s = 1 and t = 1, (i + s, j + t) means adding 1 to the row and 1 to the column of (i,j) to form a new coordinate; when s = -1 and t = -1, (i + s, j + t) means subtracting 1 from the row and 1 from the column of (i,j) to form a new coordinate.
[0287] d4: Extended 8-neighborhood image tagging;
[0288] After step d3 is executed, obtain the pixel whose image block labeling result is n and whose pixel labeling result is 1. Then execute step d3 again on its 8 neighboring pixels. For the neighboring pixel with a value of 255 found in step d3, set its image block labeling result to n and its pixel labeling result to 1.
[0289] d5: Repeat steps d3 to d4 until all 8 connected pixels in image block n have been marked, then end the marking of image block n;
[0290] The image patch labeling result n = n + 1 is used to initialize the labeling of the next image patch;
[0291] d6: All image patch markers;
[0292] Repeat steps d2 to d5, scanning unmarked pixels from left to right and top to bottom until all pixels with a value of 255 have image block marking results and the pixel marking value is 1, then end the scan.
[0293] The final value of n is the number of target image patches.
[0294] right Figure 6 The image shows the labeling effect of each color of the target image block in the signal image to be identified. From the labeling results:
[0295] From the image block markings of the binary image of red targets, after the "filling holes" and "reducing size" processing, there are 153 image blocks that can be connected in 8-way.
[0296] From the image patch labeling of the binary image of green targets, after the "filling holes" and "reducing the size" processing, there are 147 image patches that can be connected in 8-way.
[0297] From the image block markings of the binarized image of yellow targets: after the "filling holes" and "reducing the size" processing, there are 238 image blocks that can be connected in 8-way.
[0298] Based on the image patch labeling of the binary image of the blue target, after the "hole filling" and "small reduction" processing, a small number of blue segmented targets have 17 image patches that can be connected in 8-way.
[0299] From the image block markings of the binary image of white targets: after the white warning patterns on the warning posts and the white markings on the road are processed by "filling holes" and "reducing size", there are 307 image blocks that can be connected in 8s.
[0300] Table 2 below shows the results of image block labeling for the binarized images of red, green, yellow, blue, and white targets in this embodiment.
[0301] Table 2. Results of Image Patch Marking (Example)
[0302] Binarized image of target red green yellow blue White Mark the number of image patches 153 147 238 17 307
[0303] S6: For each target image patch, calculate the region characteristics of the image patch separately;
[0304] In the technical solution of this invention, the characteristics of the image block region include: area, perimeter, roundness, and aspect ratio.
[0305] e1. Statistically analyze the area features of the target image blocks included in each target binarized image to obtain statistical area feature values; compare the area statistical feature values with a preset area threshold;
[0306] If the area statistical feature value does not meet the range of the area threshold, the target image block is determined to be a non-circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped.
[0307] Otherwise, proceed to step e2;
[0308] e2. Statistically analyze the perimeter features of the target image block to obtain the perimeter feature statistics; compare the perimeter feature statistics with the preset perimeter threshold.
[0309] If the perimeter feature statistical value does not meet the perimeter threshold range, the target image block is determined not to be a circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped.
[0310] Otherwise, proceed to step e3;
[0311] e3. Statistically analyze the roundness features of the target image patch to obtain the roundness feature statistics; compare the roundness feature statistics with the preset roundness threshold;
[0312] If the roundness statistical feature value does not meet the range of the roundness threshold, the target image block is determined not to be a circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped.
[0313] Otherwise, proceed to step e4;
[0314] e4. Statistically analyze the aspect ratio features of the target image patch to obtain the aspect ratio feature statistics; compare the aspect ratio feature statistics of the image patch with the preset aspect ratio threshold;
[0315] If the aspect ratio statistical feature value does not meet the threshold range, the target image block is determined not to be a circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped.
[0316] Otherwise, proceed to step e5;
[0317] e5: Repeat steps e1 to e4 until all colors of the target binarized image have been statistically analyzed;
[0318] Determine the number of target image patches obtained in the final result;
[0319] If the number of target image patches obtained in the end is 0, it is determined that there is no valid circular emission signal in any of the target binarized images;
[0320] If the number of target image blocks obtained in the end is 1, then the color of the target binarized image corresponding to the target image block is confirmed, that is, the recognition result of the color of the circular luminous signal in the signal image to be recognized is obtained.
[0321] Otherwise, if multiple valid circular light signals are detected, a warning message will be issued.
[0322] That is, if, among all the target binarized images corresponding to the signal image to be identified, there exists only one target image patch whose region characteristics simultaneously satisfy the requirements for image patch region characteristics in e1 to e4, then the color corresponding to the target image patch that satisfies the requirements is the color of the circular luminous signal in the signal image to be identified; otherwise, if no target image patch's region characteristics simultaneously satisfy the judgment requirements for image patch region characteristics in e1 to e4, then it is determined that there is no valid circular luminous signal in the signal image to be identified. Otherwise, an abnormal situation is determined.
[0323] In step S6, the detailed calculation process of the image patch region characteristics is as follows.
[0324] In the technical solution of this application, it is not necessary to calculate all the area, perimeter, roundness, and aspect ratio parameters of the image block region in each target binarized image. During the calculation, as long as one parameter in the target image block does not meet the threshold range requirement, it can be determined that the image block is not a circular light emission signal region. Based on the method of this invention, image blocks that do not meet the requirements can be quickly eliminated, ensuring that the calculation requirements of intelligent connected vehicles can be met.
[0325] The area is calculated by counting the number of pixels with a value of 255 in the target image block.
[0326]
[0327] Where W1 is the width of the signal image to be identified, and H1 is the height of the signal image to be identified;
[0328] In this embodiment, n represents the target binarized image. The nth image block.
[0329] The results of the image patch labeling include the following values:
[0330] The result of the pixel labeling operation includes the following values:
[0331] S(n) is the area of the image patch, and its values include: S red (n), S yellow(n), S green (n), S blue (n), S white (n).
[0332] In specific calculations, for the target binarized image In the nth image block, the results are labeled with the pixels in it. The number of pixels with a value of 1 is used as... The area statistics of the nth image block are calculated, and the number of area statistics objects is used as the area statistics result.
[0333] Assumption The areas of the nth image patch are S red (n), S yellow (n), S green (n), S blue (n), S white (n). The area calculation algorithm is as follows:
[0334]
[0335]
[0336]
[0337]
[0338]
[0339] Let th1 be the area threshold. In this embodiment, th1∈[500,6000]: If the area of the image block is too small (less than 500) or too large (greater than 6000), the area statistical characteristics of the target image block do not meet the threshold requirements. It is determined that the target image block is not a circular luminous signal region, and the subsequent characteristic calculation of the target image block ends. If the area of the image block is between 500 and 6000, the area statistical characteristics of the target image block meet the threshold requirements and may be a circular luminous signal region. The subsequent characteristic calculation of the target image block continues.
[0340] The perimeter is calculated as follows: if a pixel with a value of 255 exists in the target image block and there is a pixel with a value of 0 in its 8-neighborhood, then the pixel is determined to be a boundary point. The sum of the number of all boundary points is the perimeter P(n) of the target image block.
[0341]
[0342] Where W1 and H1 are the widths of the signal image to be identified, and H1 is the height of the signal image to be identified.
[0343] n represents the target binary image. The nth image block.
[0344] The target is a binarized image, and its values include:
[0345] The results of the image patch labeling include the following values:
[0346] The result of the pixel labeling operation includes the following values:
[0347] P(n) is the perimeter of the image patch, and its values include: P red (n), P yellow (n), P green (n), P blue (n), P white (n).
[0348] s and t represent the row and column distances from (i,j), with positive numbers indicating addition and negative numbers indicating subtraction. For example, when s = 1 and t = 1, (i + s, j + t) means adding 1 to the row and 1 to the column of (i,j) to form a new coordinate; when s = -1 and t = -1, (i + s, j + t) means subtracting 1 from the row and 1 from the column of (i,j) to form a new coordinate.
[0349] In specific calculations, for the target binarized image The nth image patch is labeled with the pixels in it. A black pixel with a value of 1 and an 8-neighborhood containing a value of "0" is considered as... The perimeter statistics of the nth image block (boundary points) are the sum of the number of perimeter statistics objects, which is the perimeter statistics result.
[0350] Assumption The perimeter of the nth image patch is P red (n), P yellow (n), P green (n), P blue (n), P white (n). The perimeter calculation algorithm is as follows:
[0351]
[0352]
[0353]
[0354]
[0355]
[0356] Let th2 be the perimeter threshold. In this embodiment, th2∈[150,300]: If the perimeter of the image block is too small (less than 150) or too large (greater than 300), the perimeter statistical characteristics of the image block do not meet the threshold requirements, the image block is not a circular luminous signal region, and the subsequent characteristic calculation of the target image block ends; if the perimeter of the image block is between 150 and 300, the perimeter statistical characteristics of the image block meet the threshold requirements, the image block may be a circular luminous signal region, and the subsequent characteristic calculation of the target image block continues.
[0357] The method for calculating roundness is as follows:
[0358]
[0359] Where n represents the target binarized image The nth image block.
[0360] S(n) is the area of the image patch, and its values include: S red (n), S yellow (n), S green (n), S blue (n), S white (n).
[0361] P(n) is the perimeter of the image patch, and its values include: P red (n), P yellow (n), P green (n), P blue (n), P white (n).
[0362] C(n) is the roundness of the image patch, and its values include: C red (n), C yellow (n), C green (n), C blue (n), C white (n).
[0363] In specific calculations, for The nth image patch, based on its area statistics S red (n), S yellow (n), S green (n), S blue (n), S white (n) and its perimeter statistics P red (n), P yellow (n), P green (n), Pblue (n), P white (n) Calculate the roundness property of the image patch.
[0364] Assumption The roundness of the nth image patch is C red (n), C yellow (n), C green (n), C blue (n), C white (n). The roundness statistics algorithm is as follows:
[0365]
[0366]
[0367]
[0368]
[0369]
[0370] Let th3 be the roundness threshold. In this embodiment, th3 = 0.6. If the roundness of the image block is less than 0.6, the roundness statistical feature of the image block does not meet the threshold requirement, the image block is not a circular luminous signal region, and the subsequent characteristic calculation of the target image block ends. If the roundness of the image block is greater than 0.6, the roundness statistical feature of the image block meets the threshold requirement, the target image block may be a circular luminous signal region, and the subsequent characteristic calculation of the target image block continues.
[0371] The method for calculating the aspect ratio is as follows:
[0372] The distance between the leftmost and rightmost pixels in the horizontal direction is used as the length of the target image block, and the distance between the topmost and bottommost pixels in the vertical direction is used as the width of the target image block; the ratio of length to width is used as the aspect ratio R(n) statistical value.
[0373]
[0374] Where n represents the target binarized image The nth image block.
[0375] The results of the image patch labeling include the following values:
[0376] The result of the pixel labeling operation includes the following values:
[0377] R(n) is the aspect ratio of the image patch, and its values include: R red (n), R yellow (n), R green (n), R blue (n), R white (n).
[0378] In specific calculations, for In the nth image patch, in the labeling results In the pixels with a value of 1, the distance between the leftmost and rightmost pixels in the horizontal direction is taken as the length of image patch n, and the distance between the topmost and bottommost pixels in the vertical direction is taken as the width of image patch n. The ratio of the length to the width of image patch n is taken as the aspect ratio statistical result. Assume... The roundness of the nth image patch is R. red (n), R yellow (n), R green (n), R blue (n), R white (n). The aspect ratio calculation algorithm is as follows:
[0379]
[0380]
[0381]
[0382]
[0383]
[0384] Let th4 be the aspect ratio threshold. In this embodiment, th4 = 0.8: If the aspect ratio of the image block is less than 0.8, then the aspect ratio statistical characteristics of the image block do not meet the threshold requirements, and the image block is determined not to be a circular luminous signal region, thus ending the calculation of subsequent characteristics of the target image block; if the aspect ratio of the image block is greater than 0.8, then the aspect ratio statistical characteristics of the target image block meet the threshold requirements, and the target image block may be a circular luminous signal region, thus ending the calculation of subsequent characteristics of the target image block.
[0385] like Figure 7 The image shown illustrates the process of statistically analyzing image patch features in the binarized image of the red target in this embodiment. From the statistical characteristics:
[0386] After the first step of area statistical analysis, 12 of the 153 image patches in the binarized image of the red target met the area threshold requirement, while 141 of the image patches did not meet the area threshold requirement. The image patches that did not meet the area threshold requirement were deleted from the binarized image of the red target.
[0387] After the perimeter statistical analysis in step 2, the remaining 12 image blocks with the required area were found to have perimeters that met the threshold requirements. The perimeters of the remaining 9 image blocks did not meet the threshold requirements. The image blocks that did not meet the perimeter threshold requirements were removed from the binarized image of the red target.
[0388] After the roundness statistical analysis in step 3, the remaining 3 image blocks with the required perimeters show that 0 of them meet the roundness threshold, and therefore the aspect ratio statistical analysis in step 4 is not performed. In other words, the aspect ratio statistical calculation in step 4 is unnecessary in actual calculations.
[0389] In summary, the binarized image of red targets does not contain any image blocks that simultaneously meet the statistical threshold requirements for area, perimeter, roundness, and aspect ratio, and therefore does not contain any valid circular luminous signals. That is, red targets such as the red warning patterns on warning posts and the red tiles on buildings are not circular luminous signals.
[0390] like Figure 8 The image shown is an illustration of the effect of statistical analysis of image patch features in the binarized image of the green target in this embodiment. From the statistical features:
[0391] After the first step of area statistical analysis of 147 image blocks in the binary image of green targets, 7 image blocks met the area threshold requirement, and 140 image blocks did not meet the area threshold requirement. The image blocks that did not meet the area threshold requirement were deleted from the binary image of green targets.
[0392] After the perimeter statistical analysis in step 2, the remaining 7 image blocks with the required area are: 1 image block has a perimeter that meets the threshold requirement, and 6 image blocks have a perimeter that does not meet the threshold requirement. The image blocks that do not meet the perimeter threshold requirement are deleted from the green target binarized image.
[0393] After the roundness statistical analysis in step 3, the remaining image block with the required perimeter has 0 image blocks whose roundness meets the threshold requirement, and no further aspect ratio statistical analysis is performed. That is, in actual calculation, step 4, aspect ratio statistical calculation, is not required.
[0394] In summary, the binarized image of green targets does not contain any image patches that simultaneously meet the statistical threshold requirements for area, perimeter, roundness, and aspect ratio, and therefore does not contain any valid circular luminous signals. In other words, green targets such as green belts, roadside trees, and grass leaves are not circular luminous signals.
[0395] like Figure 9 The image shown is an illustration of the effect of statistical analysis of image patch features in the binarized image of the yellow target in this embodiment. From the statistical features:
[0396] After the first step of area statistical analysis of the 238 image blocks in the binarized image of the yellow target, 8 image blocks met the area threshold requirement, and 230 image blocks did not meet the area threshold requirement. The image blocks that did not meet the area threshold requirement were deleted from the binarized image of the yellow target.
[0397] After the perimeter statistical analysis in step 2, the remaining 8 image blocks with the required area are: 4 of them have perimeters that meet the threshold requirements, and 4 of them do not. The image blocks that do not meet the perimeter threshold requirements are deleted from the binarized image of the yellow target.
[0398] After the roundness statistical analysis in step 3, the remaining 4 image blocks with the required perimeter are: 1 image block has a roundness that meets the threshold requirement, and 3 image blocks do not have a roundness that does not meet the threshold requirement. The image blocks that do not meet the roundness threshold requirement are deleted from the yellow target binarized image.
[0399] After the aspect ratio statistical analysis in step 4, the remaining image block with the required perimeter is found to have an aspect ratio that meets the threshold requirement.
[0400] In summary, the binarized image of the yellow target contains image blocks that simultaneously meet the statistical threshold requirements for area, perimeter, roundness, and aspect ratio. That is, the yellow warning light is a circular luminous signal.
[0401] like Figure 10 The image shown is an illustration of the effect of statistical analysis of image patch features in the binarized image of the blue target in this embodiment. From the statistical features:
[0402] After the first step of area statistical analysis of the 17 image blocks in the binarized image of the blue target, 0 image blocks met the threshold requirements, and no further statistical analysis of perimeter, roundness, and aspect ratio was performed.
[0403] In summary, the binarized image of the blue target does not contain any image blocks that simultaneously meet the statistical threshold requirements for area, perimeter, roundness, and aspect ratio, and therefore does not contain any valid circular luminous signals.
[0404] like Figure 11 The image shown is an illustration of the effect of statistical analysis of image patch features in a binarized image of a white target in this embodiment. From the statistical features:
[0405] After the first step of area statistical analysis of 307 image blocks in the binarized image of the white target, 5 image blocks met the area threshold requirement, and 302 image blocks did not meet the area threshold requirement. The image blocks that did not meet the area threshold requirement were deleted from the binarized image of the white target.
[0406] After the perimeter statistical analysis in step 2, the remaining 5 image blocks that meet the area requirements are: 0 of them have perimeters that meet the threshold requirements, and no further roundness and aspect ratio statistical analysis will be performed.
[0407] In summary, the binarized image of white targets does not contain any image blocks that simultaneously meet the statistical threshold requirements for area, perimeter, roundness, and aspect ratio, and therefore does not contain any valid circular luminous signals. In other words, white targets such as white warning patterns on warning posts and white road markings are not circular luminous signals.
[0408] That is, in this embodiment, there exists only one target image block whose regional characteristics simultaneously satisfy the requirements for image block regional characteristics in e1 to e4; the color of the target binarized image corresponding to the target image block is confirmed to be yellow, that is, the recognition result of the circular luminous signal color in the signal image to be recognized is yellow.
[0409] Using the technical solution of this invention, circular luminous signal images are captured by a camera on the windshield of an intelligent connected vehicle. The positions of red, yellow, green, blue, and white objects in the captured image are identified using a color segmentation method. Hole-filling and minimization operations are used to process the color segmentation results, eliminating interference factors in the image that affect the identification of the circular luminous signal. Image block and pixel value marking methods are used to segment and identify targets in the image, improving the accuracy of circular luminous signal recognition. Circular luminous signal regions are identified through image block shape analysis, and the color of the circular luminous signal is identified by combining the color segmentation results. This segmentation of the target shape in the image from different dimensions further improves the accuracy of circular luminous signal region recognition. Finally, the circular luminous signal in the image captured by the intelligent connected vehicle is identified. This technical solution of the invention helps to ensure safe passage for intelligent connected vehicles using a "single-vehicle intelligence" approach, and by combining information such as the current lane direction and location of the intelligent connected vehicle, it enables autonomous driving.
Claims
1. A method for recognizing circular luminous signals in intelligent connected vehicles, characterized in that, It includes the following steps: S1: Acquire a color image of the circular luminous signal, denoted as: the signal image to be identified, and convert the signal image to be identified into the HSI color space; S2: Color segmentation of the signal image to be recognized based on the HSI color space; Specifically, the following steps are included: a1: Confirm the characteristics of the target pixel in the HIS color space; The color space of the circular luminous signal image acquired for the signal to be identified is RGB; At image coordinates (i,j) of the signal image to be identified, assuming the R, G, and B components in the RGB color space are U... R i,j U G i,j and U B i,j The H, S, and I components of the HSI color space are U, S, and I, respectively. H i,j U S i,j and U I i,j ; The transformation relationship between RGB color space and HSI color space is as follows: (1); (2); (3); Where 1≤i≤W1, 1≤i≤H1, W1 is the width of the signal image to be identified, and H1 is the height of the signal image to be identified; a2: Based on the HSI color space, the color components of red, yellow, green, blue and white are defined, and the signal image to be identified is segmented by color to obtain the set of target pixel coordinates; The coordinates (p, q) of all five colored target pixels (red, yellow, green, blue, and white) in the signal image to be identified after calculation are denoted as follows: , , , , ; (4); Where R represents red, Y represents yellow, G represents green, B represents blue, and W represents white; S3: Segment the signal image to be identified according to the target pixel coordinate set to obtain the target color image; perform binarization processing on the target color image to obtain the target binarized image corresponding to each color; S4: Perform hole-filling and size-reducing processing on the target binarized image to remove noise and interference factors from the image; S5: Scan each of the target binarized images to find all image blocks in the image, which are denoted as: target image blocks; S6: For all the target image blocks corresponding to the signal image to be identified, calculate the region characteristics of each image block, and determine the identification result of the circular luminous signal color based on the region characteristics of the image blocks; The feature parameters included in the image block region characteristics are: area, perimeter, roundness, and aspect ratio; the specific calculation steps include: e1. Statistically analyze the area features of the target image blocks included in each target binarized image to obtain statistical area feature values; compare the area statistical feature values with a preset area threshold; If the area statistical feature value does not meet the range of the area threshold, the target image block is determined to be a non-circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped. Otherwise, proceed to step e2; e2. Calculate the perimeter features of the target image block to obtain the perimeter feature statistics; compare the perimeter feature statistics with a preset perimeter threshold; If the perimeter feature statistical value does not meet the range of the perimeter threshold, the target image block is determined to be a circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped. Otherwise, proceed to step e3; e3. Calculate the roundness features of the target image block to obtain roundness feature statistics; compare the roundness feature statistics with a preset roundness threshold; If the roundness statistical feature value does not meet the range of the roundness threshold, the target image block is determined not to be a circular luminous signal, the target image block is deleted from the target binary image, and subsequent statistical analysis is stopped. Otherwise, proceed to step e4; e4. Calculate the aspect ratio features of the target image block to obtain the aspect ratio feature statistics; compare the aspect ratio feature statistics of the image block with the preset aspect ratio threshold; If the aspect ratio statistical feature value does not meet the threshold range, the target image block is determined not to be a circular luminous signal, the target image block is deleted from the target binarized image, and subsequent statistical analysis is stopped. Otherwise, proceed to step e5; e5: Repeat steps e1 to e4 until all colors of the target binarized image have been statistically analyzed; Determine the final number of the target image patches; If the final number of target image blocks is 0, it is determined that there is no valid circular luminous signal in any of the target binarized images; If the number of target image blocks obtained in the end is 1, then the color of the target binarized image corresponding to the target image block is confirmed, that is, the recognition result of the color of the circular luminous signal in the signal image to be recognized is obtained; Otherwise, if multiple valid circular light signals are detected, a warning message will be issued.
2. The method for recognizing circular luminous signals for intelligent connected vehicles according to claim 1, characterized in that: Step S3 includes the following steps in detail: b1: Calculate the target color image based on the coordinates of the target pixels; At the target pixel coordinates, the pixel value of the target color image is the same as the RGB pixel value of the signal image to be identified; at other coordinates, the pixel value of the target color image is 0; the transformation relationship between the target color image and the signal image to be identified is as follows: (5); (6); (7); (8); (9); in, [U red,R i,j U red,G i,j U red,B i,j [This represents the components of the red target pixel in the R, G, and B channels.] [U yellow,R i,j U yellow,G i,j U yellow,B i,j [ ] represents the components of the yellow target pixel in the R, G, and B channels. [U green,R i,j U green,G i,j U green,B i,j [ ] represents the components of the green target pixel in the R, G, and B channels; [U blue,R i,j U blue,G i,j U blue,B i,j [This refers to the components of the blue target pixel in the R, G, and B channels;] [U white,R i,j U white,G i,j U white,B i,j [ ] represents the components of the white target pixel in the R, G, and B channels; b2: Convert the target color image into a grayscale image to obtain the target grayscale image corresponding to each color; At (i,j), assume the gray levels of the red, yellow, green, blue, and white target pixels are U, respectively. G-red i,j U G -yellow i,j U G-green i,j U G-blue i,j U G-white i,j The transformation relationship between the target color image and the target grayscale image is as follows: (10); (11); (12); (13); (14); b3: Binarize the target grayscale image to obtain the target binarized image corresponding to each color; Assuming the coordinates (i,j) of the signal image to be identified: at (i,j), assuming the binarization results of the red, yellow, green, blue, and white target pixels are U... B-red i,j U B-yellow i,j U B-green i,j U B-blue i,j U B-white i,j The transformation relationship between the target grayscale image and the target binarized image is as follows: (15); (16); (17); (18); (19); Where threshold_R, threshold_Y, threshold_G, threshold_B, and threshold_W are the target grayscale image binarization thresholds for red, yellow, green, blue, and white, respectively.
3. The method for recognizing circular luminous signals for intelligent connected vehicles according to claim 1, characterized in that: Step S4 includes the following steps: c1: Using a preset filter template A, perform the hole-filling process on the target binarized image from left to right and from top to bottom; At coordinates (i,j), assume the outputs of the hole-filling processing for the binarized images of red, yellow, green, blue, and white targets are U... B-red,P i,j U B-yellow,P i,j U B-green,P i,j U B-blue,P i,j U B-white,P i,j The transformation relationship of the hole-filling process is as follows: (20); (21); (22); (23); (24); Where B-red represents binarized red pixels, B-yellow represents binarized yellow pixels, B-yellow represents binarized green pixels, B-blue represents binarized blue pixels, B-white represents binarized white pixels, P represents hole filling, and s and t represent the distance from (i,j) row and column, with positive numbers indicating addition and negative numbers indicating subtraction. c2: Using the preset filter template A, perform the reduction processing on the target binarized image after the hole filling process from left to right and from top to bottom; At coordinates (i,j), assume the output of the reduction processing of the binary image of the target (red, yellow, green, blue, white) is U. B-red,F i,j U B-yellow,F i,j U B-green,F i,j U B-blue,F i,j U B-white,F i,j The transformation relationship of the reduction process is as follows: (25); (26); (27); (28); (29); Where B-red represents the binarized red pixel, B-yellow represents the binarized yellow pixel, B-yellow represents the binarized green pixel, B-blue represents the binarized blue pixel, B-white represents the binarized white pixel, F represents the reduction processing operation; s and t represent the distance between the (i,j) rows and columns, positive numbers are added, negative numbers are subtracted, and -2≤s,t≤2.
4. The method for recognizing circular luminous signals for intelligent connected vehicles according to claim 3, characterized in that: The filter template A is a 5×5 filter template with its center coordinates at (0,0). A is represented by a matrix as follows: 。 5. The method for recognizing circular luminous signals for intelligent connected vehicles according to claim 1, characterized in that: In step S5, the method for calculating the target image patch is as follows: For each pixel in the target binarized image, eight neighboring points are scanned, and all pixels that can be connected in eight directions are marked as a target image block; Each binarized image of the target is scanned to find all the target image blocks; The specific steps include: d1: Initialize the image block counter n=1; d2: Begin scanning the target binarized image U in a left-to-right, top-to-bottom order. F i,j The pixel coordinates in the image are represented as (i,j); When the first image pixel with a value of 255 is scanned, the Block is initialized. L1 i,j =n, Sign L2 i,j =1; d3: 8-neighborhood image tags; Scan pixel U F i,j All 8 neighboring pixels, the pixel with the median value of 255 is considered to be related to U. F i,j Belongs to an image patch; the image patch labeling results of neighboring pixels and U F i,j The image patch labeling results are the same, both being n, i.e.: , Meanwhile, the pixel marker of the neighboring pixels is 1, that is: ; Where s and t represent the row and column distances of (i,j), positive numbers indicate addition and negative numbers indicate subtraction; d4: Extended 8-neighborhood image tagging; After step d3 is executed, obtain the image block labeling result n and the pixel labeling result 1. Then execute step d3 again on its 8 neighboring pixels. For the neighboring pixels with a value of 255 found in the pixel scan, mark their image block labeling result as n and their pixel labeling result as 1. d5: Repeat steps d3~d4 until all 8 connected pixels in image block n have been marked, then end the marking of image block n; The image patch labeling result n = n + 1 is used to initialize the labeling of the next image patch; d6: All image patch markers; Repeat steps d2 to d5, scanning unmarked pixels from left to right and top to bottom until all pixels with a value of 255 have image block marking results and the pixel marking value is 1, then end the scan; The final value of n is the number of target image patches.
6. The method for recognizing circular luminous signals for intelligent connected vehicles according to claim 1, characterized in that: In step S6, the calculation method for each feature parameter in the image patch region characteristics includes: The area S(n) is calculated by counting the number of pixels (i,j) in the target image block. ; Where W1 and H1 are the widths of the signal image to be identified, and H1 is the height of the signal image to be identified; Block L1 i,j For the image patch labeling results, Sign L2 i,j The result of the pixel labeling operation; The perimeter is calculated as follows: if there is a point with a value of 0 in the eight neighborhoods of a pixel, it is determined to be a boundary point, and the number of all the boundary points is counted to obtain the perimeter P(n); ; Among them, U F i,j For binarizing the target image, Block L1 i,j Sign is the result of labeling image patches. L2 i,j The result of the pixel marking operation is given by W1 and H1, which represent the width of the signal image to be identified and the height of the signal image to be identified. s and t represent the distance between rows and columns of (i,j), with positive numbers indicating addition and negative numbers indicating subtraction. The method for calculating the roundness is as follows: ; Where n represents the nth image patch in the binarized image of the target; S(n) is the area of the image patch; P(n) is the perimeter of the image patch; and C(n) is the roundness of the image patch. The aspect ratio is calculated as follows: The distance between the leftmost and rightmost pixels in the horizontal direction is used as the length of the target image block, and the distance between the topmost and bottommost pixels in the vertical direction is used as the width of the target image block. ; Where n represents the nth image block in the binarized image of the target; Block L1 i,j Sign is the result of labeling image patches. L2 i,j R(n) represents the result of the pixel labeling operation; R(n) represents the aspect ratio of the image block.
7. A circular luminous signal recognition system for intelligent connected vehicles, characterized in that, It includes: The image acquisition unit, color segmentation unit, region sorting unit, and shape recognition unit are interconnected and communicate with each other. The image acquisition unit includes: a camera installed on the windshield of the intelligent connected vehicle; the image acquisition unit acquires an image of a colored circular light-emitting signal based on the RGB color space through the camera, and transmits the circular light-emitting signal image as a signal image to be identified to the color segmentation unit; The color segmentation unit: converts the signal image to be identified from RGB space to HSI space, and then segments the red, yellow, green, blue, and white targets in the RGB signal image to be identified based on the thresholds of the hue (H), saturation (S), and luminance (I) components of red, yellow, and green in the HSI color image space, and the thresholds of the five colors (red, yellow, green, blue, and white) in the hue (H), saturation (S), and luminance (I) components, to obtain a target color image. During the segmentation process, all colors other than red, yellow, green, blue, and white are removed. Then, the target color image is converted into a grayscale image to obtain target grayscale images corresponding to the five colors red, yellow, green, blue, and white respectively. Then, the target grayscale images are binarized to obtain target binarized images corresponding to the five colors red, yellow, green, blue, and white respectively. Finally, the target binarized images are passed to the region processing unit. The region processing unit performs hole filling and size reduction processing on the target binarized image using a preset filter template A. The hole-filling process involves filling the empty areas in the binarized image. The specific steps are as follows: using a preset filter template A, the target binarized image is scanned from left to right and from top to bottom; for the current pixel: when the convolution sum of the image pixels covered by filter template A and A is not 0, the output of the hole-filling process is 255; when the convolution sum of the image pixels covered by filter template A and A is 0, the output of the hole-filling process is 0. The reduction processing involves eliminating small objects or clutter points in the target binarized image after the hole-filling process; the specific steps are as follows: Using the preset filter template A, the target binarized image after the hole-filling process is scanned and filtered again from left to right and from top to bottom; for the current pixel: if any position in filter template A with a value of 1 covers an image pixel of 255, then the output of the reduction process is 255, otherwise the output of the reduction process is 0; the region sorting unit transmits the binarized image obtained after the hole-filling and reduction processes to the shape recognition unit; The shape recognition unit: scans the target binarized image to find all image blocks in the image, thus obtaining all target image blocks; for each target image block, it calculates the image block region characteristics; according to the preset threshold range of each parameter in the image block region characteristics, it compares each value of the image block region characteristics corresponding to the target image block with the corresponding threshold range; the image block region characteristics include: area, perimeter, roundness, and aspect ratio; If there exists a unique target image block whose region characteristics simultaneously satisfy all the threshold range requirements, then the color corresponding to the target image block that satisfies the requirements is the color recognition result of this circular luminous signal; otherwise, it is determined that no valid color recognition result of the circular luminous signal has been obtained in this recognition.
Citation Information
Patent Citations
Traffic light recognition method and apparatus, vehicle control method and apparatus, and vehicle
CN106909937A
Blurred license plate image identification algorithm based on image fusion and blind deconvolution
CN107103317A