Traffic light zebra crossing alignment technology
Through data preparation and detection technology, combined with methods such as morphology and Hough transformation, the accuracy and real-time problem of traffic light and zebra crossing recognition for visually impaired people in complex traffic scenes has been solved, the accuracy and adaptability of recognition have been improved, and the visual acuity has been ensured. Handicapped people can pass safely.
Patent Information
- Application Number
- CN202410804204.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-20
- Publication Date
- 2024-09-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing traffic light and zebra crossing recognition technologies have problems with accuracy, environmental adaptability, and real-time performance, which may lead to misjudgments and information delays for visually impaired people when safely crossing crosswalks, especially in complex traffic scenarios, low-light conditions, and special scenarios. It is difficult to provide accurate location information.
Adopt technical solutions for data preparation, data preprocessing, traffic light detection, zebra crossing detection, alignment and positioning, and testing and optimization, and combine scene information through steps such as color threshold segmentation, morphological operations, contour search, grayscale conversion, and Hough transformation. Determine the traffic light status and zebra crossing position to improve the accuracy and real-time recognition.
It improves the accuracy of visually impaired people in identifying traffic lights and zebra crossings, reduces misjudgments, enhances adaptability and real-time performance in complex traffic scenarios, ensures safe passage, and improves their traffic efficiency and independence.
Smart Images

Figure CN118628545A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a traffic light zebra crossing alignment technology. Background Art
[0002] Visually impaired people in cities face many challenges, one of which is safely crossing pedestrian crossings. Although existing assistive tools such as guide dogs and smart canes can help them identify their surroundings to a certain extent, these methods have limitations in identifying the status of traffic lights and the location of zebra crossings. Therefore, it is particularly important to develop a technology that can help visually impaired people cross the streets more safely and confidently.
[0003] Although there is not much information about guide glasses specifically for traffic light and zebra crossing recognition, several technologies and products are moving in this direction, such as: OrCam MyEye: A small device that can be attached to the eye, mainly designed to help the visually impaired read text and recognize faces. Although it is not mainly used for traffic light and zebra crossing recognition, the functions it uses also provide a technical basis. AIRA: Although it is not a physical product, but a service, by wearing smart glasses, visually impaired users can connect to remote visual assistants. These assistants can see the user's field of view through the camera of the glasses and provide navigation and other assistance. This service model also provides a possible solution for traffic light and zebra crossing recognition;
[0004] However, the existing technology has problems with accuracy, environmental adaptability, special scenario limitations and real-time performance. Accuracy problem: The current traffic light and zebra crossing alignment technology may not be able to achieve high-precision accuracy, and there is a possibility of misjudgment, which may mislead users or create dangerous situations. Environmental adaptability: The guide glasses alignment technology may have limited adaptability to different environments. For example, complex traffic scenes, thunderstorms, nighttime or low-light conditions may be affected in visual recognition. Special scenario limitations: Certain special scenes, such as construction sites, road construction areas, etc., may not be able to provide accurate traffic light and zebra crossing location information. Real-time performance: The real-time performance of the alignment technology in guide glasses may be challenging. The current technology may require a certain amount of processing time, resulting in information delays or failure to update in a timely manner. To this end, we propose a traffic light and zebra crossing alignment technology. Summary of the invention
[0005] The purpose of the present invention is to provide a traffic light zebra crossing alignment technology.
[0006] In order to solve the problems raised in the above background technology, the present invention provides the following technical solutions: a traffic light zebra crossing alignment technology, including a data preparation stage, a data preprocessing stage, a traffic light detection stage, a zebra crossing detection stage, an alignment and positioning stage, and a testing and optimization stage, wherein the specific steps are as follows:
[0007] Step 1: Data preparation stage. The data preparation stage includes data collection and data labeling, including:
[0008] 1) Data collection is used to import data. The data here is pictures. The pictures are divided into three categories: red, yellow and green. Some data are visualized in RGB and HSV color spaces.
[0009] 2) Data annotation is used to annotate the collected images and mark the traffic light areas and zebra crossing areas in the images;
[0010] Step 2: Data preprocessing: Preprocess the images imported in step 1. Since the size of each image may be different, standardized input is required to edit the size of each image to the same size, which is convenient for later classification of images.
[0011] Step 3: Traffic light detection stage. The traffic light detection stage includes color threshold segmentation, morphological operation and contour search, among which:
[0012] 1) Color threshold segmentation sets the color threshold in the HSV space according to the color characteristics of the traffic light, and extracts the red, green and yellow areas in the image;
[0013] 2) Morphological operations are used to remove noise. Morphological operations can be applied to the results. Morphological operations include corrosion and dilation.
[0014] 3) Contour search is to select and search the contour of the traffic light in the image, and then filter out the area that may be the traffic light based on the size and shape of the contour;
[0015] Step 4: zebra crossing detection stage, which includes grayscale conversion, edge detection and Hough transform;
[0016] Step 5: Alignment and positioning stage. The alignment and positioning stage includes target positioning and scene understanding. Target positioning is used to locate the precise position of traffic lights and zebra crossings. Scene understanding is to judge whether the state of traffic lights is safe for pedestrians or vehicles to pass by by combining scene information.
[0017] Step 6: Testing and optimization phase: Test the performance in a realistic closed scenario and make necessary adjustments and optimizations based on the test results.
[0018] As a further solution of the present invention: in the data preparation stage of step 1, the imported pictures are pictures from the MIT autonomous driving course.
[0019] As a further solution of the present invention: the color threshold segmentation technology in step three is used to extract the red, green and yellow areas through the cv2.inRange(hsv,lower_red,upper_red) function.
[0020] As a further solution of the present invention: the morphological operation in step three is implemented using cv2.erode() and cv2.dilate() functions.
[0021] As a further solution of the present invention: the contour search in step three is implemented using the cv2.findContours() function.
[0022] As a further solution of the present invention: the grayscale conversion in step 4 utilizes cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) to convert the image into a grayscale image.
[0023] As a further solution of the present invention: the edge detection in step 4 uses the Canny edge detection algorithm cv2.Canny() to detect the edges in the image.
[0024] As a further solution of the present invention: the Hough transform in step 4 utilizes Hough transform cv2.HoughLinesP() to detect straight line segments based on the result of edge detection, and these straight line segments may represent zebra crossings.
[0025] As a further solution of the present invention: the scene understanding in step five needs to be combined with scene information to determine whether the state of the traffic light is a signal for pedestrians or vehicles to pass safely, and at the same time confirm the relationship between the position of the zebra crossing and pedestrians crossing the street.
[0026] By adopting the above technical solution, compared with the prior art, the beneficial effects of the present invention are:
[0027] 1. The present invention can improve the safety of visually impaired people through this technology. This technology can help visually impaired people to more accurately identify traffic lights and zebra crossings, avoid traffic accidents caused by misjudgment, and visually impaired people can walk and cross the road more confidently and safely;
[0028] 2. The present invention can improve the convenience of daily life through this technology. By identifying traffic lights and zebra crossings, visually impaired people can find the right time and place to walk more quickly, which will improve their traffic efficiency, reduce waiting time, and increase their independence and autonomy. The continuous improvement of this technology enables it to cope with more complex traffic scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the steps of the method of the present invention. DETAILED DESCRIPTION
[0030] The specific embodiments of the present invention are further described below in conjunction with the accompanying drawings. It should be noted that the description of these embodiments is used to help understand the present invention, but does not constitute a limitation of the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0031] The present invention provides a traffic light zebra crossing alignment technology, which is characterized in that the alignment technology includes a data preparation stage, a data preprocessing stage, a traffic light detection stage, a zebra crossing detection stage, an alignment and positioning stage, and a testing and optimization stage, wherein the specific steps are as follows:
[0032] Step 1: Data preparation stage. The data preparation stage includes data collection and data labeling, including:
[0033] 3) Data collection is used to import data. The data here is pictures. The pictures are divided into three categories: red, yellow and green. Some data are visualized in RGB and HSV color spaces.
[0034] 4) Data annotation is used to annotate the collected images and mark the traffic light areas and zebra crossing areas in the images;
[0035] Step 2: Data preprocessing: Preprocess the images imported in step 1. Since the size of each image may be different, standardized input is required to edit the size of each image to the same size, which is convenient for later classification of images.
[0036] Step 3: Traffic light detection stage. The traffic light detection stage includes color threshold segmentation, morphological operation and contour search, among which:
[0037] 4) Color threshold segmentation sets the color threshold in the HSV space according to the color characteristics of the traffic light, and extracts the red, green and yellow areas in the image;
[0038] 5) Morphological operations are used to remove noise. Morphological operations can be applied to the results. Morphological operations include corrosion and dilation.
[0039] 6) Contour search is to select and search the contour of the traffic light in the image, and then filter out the area that may be the traffic light based on the size and shape of the contour;
[0040] Step 4: zebra crossing detection stage, which includes grayscale conversion, edge detection and Hough transform;
[0041] Step 5: Alignment and positioning stage. The alignment and positioning stage includes target positioning and scene understanding. Target positioning is used to locate the precise position of traffic lights and zebra crossings. Scene understanding is to judge whether the state of traffic lights is safe for pedestrians or vehicles to pass by by combining scene information.
[0042] Step 6: Testing and Optimization Phase: Test the performance in a realistic closed scenario and make necessary adjustments and optimizations based on the test results.
[0043] In one embodiment of the present invention: in the data preparation stage of step 1, the imported pictures are pictures from the MIT autonomous driving course.
[0044] In one embodiment of the present invention: the color threshold segmentation technology in step three is used to extract the red, green and yellow areas through the cv2.inRange(hsv,lower_red,upper_red) function.
[0045] In one embodiment of the present invention: the morphological operation in step three is implemented using cv2.erode() and cv2.dilate() functions.
[0046] In one embodiment of the present invention: the contour search in step three is implemented using the cv2.findContours() function.
[0047] In one embodiment of the present invention: the grayscale conversion in step 4 utilizes cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) to convert the image into a grayscale image.
[0048] In one embodiment of the present invention: the edge detection in step 4 uses the Canny edge detection algorithm cv2.Canny() to detect the edges in the image.
[0049] In one embodiment of the present invention: the Hough transform in step 4 uses Hough transform cv2.HoughLinesP() to detect straight line segments on the result of edge detection, and these straight line segments may represent zebra crossings.
[0050] In one embodiment of the present invention: the scene understanding in step five needs to be combined with scene information to determine whether the state of the traffic light is a signal for pedestrians or vehicles to pass safely, and at the same time confirm the relationship between the position of the zebra crossing and pedestrians crossing the street.
[0051] Embodiment 1
[0052] First, import the pictures of MIT's autonomous driving course into this technology, then visualize part of the picture data through RGB and HSV color space, then annotate the pictures, mark the red, yellow and green areas, and then start standardizing the pictures. Clip each picture so that the size of each picture is the same, which is convenient for later classification of pictures. Then set the color threshold in HSV space according to the color characteristics of the picture, and use cv2.inRange(hsv,lower_red,upper_red) function to extract the red, green and yellow areas, and then use cv2.erode() and cv2.dilate() to remove noise, and then use cv2.findContours() function to select and find the outline of the traffic light in the picture, and then filter out the possible traffic lights according to the size and shape of the outline. area, and then the zebra crossing needs to be detected and marked. First, cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) is used to convert the image into a grayscale image, and then the Canny edge detection algorithm cv2.Canny() is used to detect the edges in the image, and then the Hough transform cv2.HoughLinesP() is used to detect straight line segments based on the edge detection results. These straight line segments may represent zebra crossings. After detecting the zebra crossing, it is necessary to locate it, and use the bounding box to determine the exact position of the traffic light and zebra crossing in the image. Then, by combining the scene information, it is determined whether the state of the traffic light can be safely passed by pedestrians or vehicles, and at the same time, the relationship between the position of the zebra crossing and the pedestrian crossing is confirmed. Finally, a closed venue is used to simulate the real road conditions to test the system performance, and necessary adjustments and optimizations are made according to the test results.
[0053] Embodiment 2
[0054] First, we import the pictures from the MIT autonomous driving course into the technology, and then visualize part of the picture data through RGB and HSV color space. Then we label the pictures and mark the red, yellow and green areas. Then we start to standardize the pictures and edit each picture so that the size of each picture is the same, which is convenient for later classification. Then we set the color threshold in HSV space according to the color characteristics of the pictures, and mask =
[0055] cv2.bitwise_and(cv2.inRange(hsv,lower_red,upper_red),cv2.inRange(hsv,
[0056] lower_red, upper_red)) function to extract the red, green and yellow areas, then use cv2.erode() and cv2.dilate() to remove noise, then use cv2.findContours() function to select and find the outline of the traffic light in the picture, and then filter out the area that may be the traffic light according to the size and shape of the outline. After that, it is necessary to detect and mark the zebra crossing. First, use cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) to convert the image into a grayscale image, and then use the Canny edge detection algorithm edges=cv2.Sobel(src,cv2.CV_64F,1,0, ksize=3)+cv2.Sobel(src,cv2.CV_64F,0,1,ksize=3) is used to detect the edges in the image, and then Hough transform cv2.HoughLinesP() is used to detect straight line segments on the edge detection results. These straight line segments may represent zebra crossings. After detecting the zebra crossings, they need to be located, and the bounding box is used to determine the exact position of the traffic light and zebra crossing in the image. Then, the state of the traffic light is judged by combining the scene information to determine whether pedestrians or vehicles can pass safely, and the relationship between the position of the zebra crossing and pedestrians crossing the street is confirmed. Finally, a closed venue is used to simulate real road conditions to test the system performance and make necessary adjustments and optimizations based on the test results.
[0057] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. For those skilled in the art, various changes, modifications, substitutions and variations of these embodiments are made without departing from the principles and spirit of the present invention, and still fall within the scope of protection of the present invention.
[0058] In the description of the specification, the description with reference to the terms "one embodiment", "example", "specific example", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0059] The above contents are merely examples and explanations of the present invention. Various modifications or additions to the specific embodiments described or replacements in similar ways by technicians in the technical field shall fall within the protection scope of the present invention as long as they do not deviate from the invention or exceed the scope defined by the claims.
[0060] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A traffic light zebra crossing alignment technology, characterized by: The alignment technology includes a data preparation stage, a data preprocessing stage, a traffic light detection stage, a zebra crossing detection stage, an alignment and positioning stage, and a testing and optimization stage, wherein the specific steps are as follows: Step 1: Data preparation stage. The data preparation stage includes data collection and data labeling, including: 1) Data collection is used to import data. The data here is pictures. The pictures are divided into three categories: red, yellow and green. Some data are visualized in RGB and HSV color spaces. 2) Data annotation is used to annotate the collected images and mark the traffic light areas and zebra crossing areas in the images; Step 2: Data preprocessing: Preprocess the images imported in step 1. Since the size of each image may be different, standardized input is required to edit the size of each image to the same size, which is convenient for later classification of images. Step 3: Traffic light detection stage. The traffic light detection stage includes color threshold segmentation, morphological operation and contour search, among which: 1) Color threshold segmentation sets the color threshold in the HSV space according to the color characteristics of the traffic light, and extracts the red, green and yellow areas in the image; 2) Morphological operations are used to remove noise. Morphological operations can be applied to the results. Morphological operations include corrosion and dilation. 3) Contour search is to select and search the contour of the traffic light in the image, and then filter out the area that may be the traffic light based on the size and shape of the contour; Step 4: zebra crossing detection stage, which includes grayscale conversion, edge detection and Hough transform; Step 5: Alignment and positioning stage. The alignment and positioning stage includes target positioning and scene understanding. Target positioning is used to locate the precise position of traffic lights and zebra crossings. Scene understanding is to judge whether the state of traffic lights is safe for pedestrians or vehicles to pass by by combining scene information. Step 6: Testing and optimization phase: Test the performance in a realistic closed scenario and make necessary adjustments and optimizations based on the test results.
2. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: In the data preparation phase of step 1, the imported images are from the MIT autonomous driving course.
3. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: The color threshold segmentation technology in step three extracts the red, green and yellow areas through the cv2.inRange(hsv,lower_red,upper_red) function.
4. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: The morphological operation in step three is implemented using cv2.erode() and cv2.dilate() functions.
5. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: The contour search in step three is implemented using the cv2.findContours() function.
6. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: The grayscale conversion in step 4 uses cv2.cvtColor(img,cv2.COLOR_BGR2GRAY) to convert the image into a grayscale image.
7. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: The edge detection in step 4 uses the Canny edge detection algorithm cv2.Canny() to detect the edges in the image.
8. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: The Hough transform in step 4 is to detect straight line segments based on the edge detection result using Hough transform cv2.HoughLinesP(), and these straight line segments may represent zebra crossings.
9. The traffic light zebra crossing alignment technology according to claim 1, characterized in that: The scene understanding in step five needs to be combined with scene information to determine whether the state of the traffic light is a signal for pedestrians or vehicles to pass safely, and at the same time confirm the relationship between the position of the zebra crossing and pedestrians crossing the street.
