Traffic light identification method based on Hough gradient method and intelligent blind guiding stick

The Hough gradient method uses boundary gradient information in traffic light recognition, which solves the problem of low efficiency of Hough circle detection, achieves efficient traffic light positioning and picture cutting, and improves the autonomous navigation capability of the smart guide cane.

CN118658149APending Publication Date: 2024-09-17HARBIN INST OF TECH

Patent Information

Application Number
CN202410818045.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-24
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

The existing traffic light positioning and image cutting methods use Hough ring detection, which is inefficient because a ring requires three parameters to determine, resulting in low computational efficiency.

Method used

The traffic light recognition method based on the Hough gradient method is used to calculate the gradient information of the boundary to improve the calculation efficiency. The specific steps include edge detection of the input image, circular equation coordinate system transformation, traffic light object positioning and picture cutting, and color recognition. .

Benefits of technology

It improves the calculation efficiency of traffic light positioning and image cutting, achieves more efficient recognition results, and is suitable for autonomous navigation and traffic condition identification of smart guide sticks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118658149A
    Figure CN118658149A
Patent Text Reader

Abstract

The invention discloses a traffic light recognition method based on a Hough gradient method and an intelligent blind guiding stick, and relates to the technical field of traffic light recognition. The problem of low efficiency caused by Hough ring detection adopted by traffic light positioning and picture cutting in the prior art is solved. The method comprises the following steps: performing edge detection on an input image to obtain boundary points; transforming the circular general equation coordinate system; the transformed equation is adopted to complete traffic light object positioning and picture cutting; and carrying out color identification on the cut picture. According to the method, the gradient information of the boundary is used by adopting the Hough gradient method, so that the calculation efficiency is improved. The invention further provides an intelligent blind guiding stick, a multifunctional system is integrated on the blind guiding stick, and a traction assembly is arranged at the bottom of the blind guiding stick to form the intelligent blind guiding stick. The intelligent blind guiding stick provided by the invention has the functions of autonomous navigation, obstacle avoidance and the like, guides the blind to walk in a tractor traction mode, and can better realize autonomous travel of the blind. The method is suitable for autonomous travel of low-vision blind people.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of traffic light recognition. Background Art

[0002] The blind are a special social group, and daily travel and independent travel are the biggest problems they face. Traditionally, the blind travel with the help of walking sticks and blind paths on the road. However, due to the occupation of blind paths and unreasonable blind path laying, the actual problem of blind travel cannot be solved well. When there are obstacles approaching from a distance, the blind cannot actively sense them, which poses a great danger.

[0003] Existing guide sticks have added pathfinding and obstacle exploration functions, allowing the blind to avoid obstacles in time. However, due to the control of road traffic lights and the complexity of travel routes, the blind are still unable to travel long distances like ordinary people. Although they have pathfinding functions, they cannot achieve the same travel efficiency as ordinary people, and cannot enable the blind to travel independently.

[0004] In response to the above problems, the existing guide sticks combine the map navigation function with the traditional cane, breaking the inherent thinking. At the same time, the guide stick has the function of traffic light recognition, which enables the traffic conditions to be judged and can better realize the autonomous travel of the blind. However, the existing traffic light positioning and image cutting are mainly implemented by Hough ring detection. That is, the Hough transform is used to detect the ring. A ring requires 3 parameters to determine, so the accumulator for ring detection must be three-dimensional, which will be very inefficient. Summary of the invention

[0005] The present invention provides a traffic light recognition method based on the Hough gradient method, which improves the calculation efficiency by using the gradient information of the boundary, and solves the problem of low efficiency caused by the existing traffic light positioning and image cutting using the Hough ring detection.

[0006] To achieve the above object, the present invention provides the following solutions:

[0007] The present invention provides a traffic light recognition method based on the Hough gradient method, the method comprising:

[0008] S1: Perform edge detection on the input image to obtain boundary points;

[0009] S2: Transform the coordinate system of the general equation of the circle;

[0010] S3: Use the transformed equation to complete the traffic light object positioning and image cutting;

[0011] S4: Perform color recognition on the cut images.

[0012] Furthermore, in another preferred embodiment, the transformed equation in the above step S2 is:

[0013] (ax)2+(by)2=r 2 .

[0014] Furthermore, in another preferred embodiment, the above step S3 is specifically as follows:

[0015] S31: Counting the number of circles at the local intersections, taking each local maximum value, and obtaining the center coordinates (a, b) of the corresponding circle in the original image;

[0016] S32: Set the value range of radius r through cvHoughCircle() function;

[0017] S33: by detecting a circle within the value range of r, a specific value of r is determined;

[0018] S34: Detection is performed using the HoughCircles sub-function according to the circle center coordinates (a, b) and the r value, and the image is cut with the detected circle center as the center.

[0019] Furthermore, in another preferred embodiment, the above step S4 is specifically as follows:

[0020] S41: Use cv2.cvtColor function to convert the segmented image from BGR format to HSV format;

[0021] S42: Use cv2.inRange() function to set the threshold, remove the background, perform median filtering, and finally calculate the number of non-zero pixels. The one with the most pixels is taken as the color recognition result.

[0022] The present invention also provides a smart guide stick for the blind, which is implemented based on any one of the above-mentioned traffic light recognition methods based on the Hough gradient method, and the smart guide stick for the blind includes a guide stick, a multifunctional system and a traction system;

[0023] The multifunctional system is integrated on the guide stick for the blind, and the traction component is arranged at the bottom of the guide stick for the blind;

[0024] The multifunctional system includes an information acquisition component, a data processing module and a positioning module;

[0025] The information acquisition component includes a voice interaction module and an image acquisition module;

[0026] The trigger end of the voice interaction module is arranged at the grip of the guide stick, and is used to collect voice information and send it to the data processing module;

[0027] The image acquisition module is used to collect image information around the guide stick and send it to the data processing module;

[0028] The display end of the data processing module is arranged on the rod body of the guide stick;

[0029] The positioning module is used to collect the current position coordinates of the guide stick in real time and send them to the data processing module;

[0030] The data processing module is embedded with a map, which is used to determine the target position coordinates according to the voice information, to formulate different travel routes according to the current position coordinates of the guide stick and send them to the voice interaction module for broadcasting, and to drive the traction component to drive the guide stick to move according to the travel route;

[0031] The data processing module is also embedded with a traffic light recognition method for recognizing traffic light information in the image information, thereby driving the traction component to drive the guide stick to move forward or stop;

[0032] The data processing module is also embedded with a license plate recognition method for identifying vehicle information in the image information, wherein the vehicle information includes the vehicle movement status, license plate information and bus number, and drives the traction component to move or stop the guide stick according to the travel route, and broadcasts the recognition information through the voice interaction module.

[0033] Furthermore, in another preferred embodiment, the above license plate recognition method is:

[0034] S1: After grayscale conversion of the input image, Gaussian filtering is used for denoising;

[0035] S2: After using the Sobel operator to locate the vertical edge, thresholding is used to extract the edge;

[0036] S3: Use closing operation to connect the extracted edges, and remove background interference after finding the connected area;

[0037] S4: After finding the rectangular connected domain using the matrix, use the aspect ratio of the license plate to remove the frame that is not the license plate area;

[0038] S5: After removing the affine transformation caused by shooting, several rectangular areas of the same size are obtained;

[0039] S6: Use the SVM trained with positive and negative samples to classify and identify whether it is a license plate area.

[0040] Furthermore, in a preferred embodiment, the multifunctional system further includes an object recognition module, a gyroscope, an ultrasonic ranging module, a data encryption module, a trajectory information query module and a complex scene perception module;

[0041] The object recognition module is used to recognize object information in the image information and announce it through the voice interaction module;

[0042] The gyroscope is used to monitor in real time whether there is abnormal acceleration;

[0043] The ultrasonic ranging module is used to realize obstacle avoidance and distance measurement functions;

[0044] The data encryption module is used to provide encryption function for the data in the data processing module;

[0045] The track information query module is used to view the guardian's travel route and real-time location in the past 7 days;

[0046] The complex scene perception module is used to perform scene perception on the image information collected by the image acquisition module, and to broadcast the perception results through the voice interaction module.

[0047] The traffic light recognition method based on the Hough gradient method described in the present invention can be fully implemented by computer software. Therefore, correspondingly, the present invention also provides a traffic light recognition system based on the Hough gradient method, and the system includes:

[0048] A storage device for performing edge detection on an input image and obtaining boundary points;

[0049] Storage means for transforming the coordinate system of the general equation of a circle;

[0050] A storage device for completing traffic light object positioning and image cutting using the transformed equations;

[0051] A storage device for color recognition of cut pictures.

[0052] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program executes any one of the above-mentioned traffic light recognition methods based on the Hough gradient method or the above-mentioned license plate recognition method.

[0053] The present invention also provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor runs the computer program stored in the memory, the processor executes any one of the above-mentioned traffic light recognition methods based on the Hough gradient method or the above-mentioned license plate recognition method.

[0054] The beneficial effects of the present invention are:

[0055] 1. Compared with the existing traffic light object positioning and image cutting using Hough ring detection, since a ring requires three parameters to determine, the accumulator for ring detection must be three-dimensional, which will be very inefficient. The present invention provides a traffic light recognition method based on the Hough gradient method, which uses the gradient information of the boundary by adopting the Hough gradient method, thereby improving the efficiency of calculation.

[0056] 2. The smart guide stick of the present invention combines the map navigation function with the traditional blind stick, breaking the inherent thinking and leading a new round of technological iteration; it combines the traditional blind stick with the concept of unmanned driving to achieve autonomous guidance of the blind stick and judgement of traffic conditions; the location information is encrypted and stored to protect user privacy to the greatest extent; monitoring and video call functions are introduced into the blind stick to reduce the need for blind people to carry other communication products when traveling.

[0057] 3. The main function of a traditional blind stick is to find the way and explore obstacles. The smart guide stick provided by the present invention has functions such as autonomous navigation and obstacle avoidance. It can guide the blind to walk by being towed by a tractor, which can better realize the blind's independent travel. The blind can determine the route they need to walk by being towed by the tractor, without the need for subjective identification by themselves. In addition, the use of a tractor can better achieve obstacle avoidance than traditional manual probing or ultrasonic fixed-point monitoring.

[0058] The present invention is suitable for autonomous travel for people with low vision or blindness. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] Figure 1 is a flow chart of the traffic light recognition method based on the Hough gradient method of the present invention;

[0060] Figure 2 It is a diagram of the expression of a straight line in a Cartesian coordinate system according to the present invention;

[0061] Figure 3 It is a schematic diagram of a straight line in a Cartesian coordinate system corresponding to a Hough space according to the present invention;

[0062] Figure 4 It is a schematic diagram of the Hough space corresponding to two points in the Cartesian coordinate system of the present invention;

[0063] Figure 5 It is a schematic diagram of a plurality of straight lines in a Cartesian coordinate system corresponding to a Hough space according to the present invention;

[0064] Figure 6 It is a schematic diagram of the Hough space corresponding to the point formed by multiple straight lines in the Cartesian coordinate system of the present invention;

[0065] Figure 7 It is a rendering of the traffic light recognition method based on the Hough gradient method described in the present invention;

[0066] Figure 8 It is a structural principle diagram of the smart blind guide stick described in the present invention. DETAILED DESCRIPTION

[0067] The specific implementation mode of the present invention is further described in detail below in conjunction with the accompanying drawings and examples. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention.

[0068] Implementation method 1, see Figures 1 to 7 This embodiment describes a traffic light recognition method based on the Hough gradient method. The method is as follows:

[0069] S1: Perform edge detection on the input image to obtain boundary points;

[0070] S2: Transform the coordinate system of the general equation of the circle;

[0071] S3: Use the transformed equation to complete the traffic light object positioning and image cutting;

[0072] S4: Perform color recognition on the cut images.

[0073] In practical application, if Figure 1 As shown, the traffic light recognition method includes locating the traffic light object within a wide-area viewing angle, cutting the image, and performing color recognition on the cut traffic light.

[0074] Among them, the traffic light object positioning and image cutting in the wide-area viewing angle mainly adopt the existing Hough ring detection, that is, the Hough transform is used to detect the ring, but a ring requires 3 parameters to determine, so the accumulator for the ring detection must be three-dimensional, which will be very inefficient. This implementation method uses the Hough gradient method to use the gradient information of the boundary, thereby improving the efficiency of the calculation.

[0075] The working principle of this implementation is:

[0076] According to the basic principle of Hough transform: In the Cartesian coordinate system, a straight line can be uniquely determined by two points (x1, y1) and (x2, y2); on the other hand, the straight line can also be written in the form of y=kx+q, such as Figure 2 As shown, the corresponding transformation can be obtained by Figure 3 Intuitively speaking, Figure 3It can be seen that a straight line in the Cartesian coordinate system corresponds to a point in the Hough space. Let's look at the situation at points A and B, which corresponds to the situation in the Hough space, such as Figure 4 As shown, from Figure 4 It can be seen from the figure that if the points in the Cartesian coordinate system are collinear, the corresponding lines in the Hough space intersect at one point, because there is only one possible value for collinearity. If there is more than one straight line, the situation becomes as follows Figure 5 As shown, therefore, in the post-processing of the Hough transform, we select the point where multiple straight lines converge. Therefore, when we select points A and B, the corresponding Cartesian coordinate system is as follows Figure 6 As shown. It can be seen that the principle of detecting a circle is not much different from that of detecting a line, except that the line is in two-dimensional space, because y = kx + q, there are only two degrees of freedom, k and q. The general equation of a circle is expressed as (xa) 2 +(yb) 2 =r 2 Then there are three degrees of freedom, the center coordinates a, b, and r. This means that more calculations are needed. The cvHoughCircle() function provided by OpenCV can set the range of radius r, which is equivalent to having a priori setting. For each r, it is enough to find a and b in two-dimensional space, which can reduce the amount of calculation and improve the calculation efficiency.

[0077] The specific steps are:

[0078] Step 1: Perform edge detection on the input image to obtain boundary points, i.e. foreground points.

[0079] Step 2: If there is a circle in the image, then its outline must belong to the foreground point.

[0080] Step 3: According to the principle of Hough transform to detect straight lines, the general equation of the circle is expressed in another way and the coordinate transformation is performed. Convert from the xy coordinate system to the ab coordinate system. Write it in the following form (ax) 2 +(by) 2 =r 2 Then a point on the boundary of the circle in the xy coordinate system corresponds to a circle in the ab coordinate system.

[0081] Step 4: There are many points on the boundary of a circle in the xy coordinate system, and there will be many circles in the ab coordinate system. Since these points in the original image are all on the same circle, after the conversion, a and b must also satisfy the equations of all circles in the ab coordinate system. Intuitively, the circles corresponding to these many points will intersect at one point, and this intersection point may be the center of the circle (a, b).

[0082] Step 5: Count the number of circles at the local intersections, take each local maximum value, and you can get the center coordinates (a, b) of the corresponding circle in the original image. Once a circle is detected under a certain r, the value of r is determined accordingly.

[0083] Specific effects such as Figure 7 shown.

[0084] In the process of implementing Hough circle detection, the cv2 function library in Python is used to perform Hough circle detection: cv2.HoughCircles(image, method, dp, minDist, circles = None, param1 = None, param2 = None, minRadius = None, maxRadius = None)

[0085] in:

[0086] Image: 8-bit, single-channel image. If you use a color image, you need to convert it to a grayscale image first.

[0087] Method: defines the method to detect circles in the image. Currently the only implemented method is cv2.HOUGH_GRADIENT.

[0088] dp: The inverse ratio of the accumulator resolution to the image resolution. The larger the dp gets, the smaller the accumulator array becomes.

[0089] minDist: The minimum distance between the centers of detected circles and their (x,y) coordinates. If minDist is too small, multiple adjacent circles may be detected. If minDist is too large, many circles may not be detected.

[0090] param1: The gradient value method used to process edge detection.

[0091] param2: accumulator threshold for cv2.HOUGH_GRADIENT method. The smaller the threshold, the more circles are detected.

[0092] minRadius: The minimum size of the radius in pixels.

[0093] maxRadius: The maximum size of the radius in pixels.

[0094] Based on this, we use python to introduce the cv2 library function, and use the HoughCircles sub-function to detect and use the detected circle center as the center to segment a relatively suitable range.

[0095] Step 6: Perform color recognition on the cut images. The biggest advantage of the RGB color space is that it is intuitive and easy to understand. The disadvantage is that the three components of R, G, and B are highly correlated, that is, if a component of a color changes to a certain extent, then the color is likely to change; the human eye has different sensitivities to the common red, green, and blue colors, so the uniformity of the RGB color space is very poor, and the visual difference between two colors cannot be expressed as the distance between two points in the color space, but using linear or nonlinear transformations, other color feature spaces can be derived from the RGB color space.

[0096] In the HSV color space, the color parameters are: hue (H), saturation (S), and lightness (V). Hue H is measured by angle, ranging from 0° to 360°. Starting from red and counting counterclockwise, red is 0°, green is 120°, and blue is 240°. Their complementary colors are: yellow is 60°, cyan is 180°, and magenta is 360°. Saturation S indicates the degree to which the color is close to the spectral color. A color can be seen as the result of a mixture of a certain spectral color and white. The greater the proportion of the spectral color, the higher the degree to which the color is close to the spectral color, and the higher the saturation of the color. The higher the saturation, the deeper and brighter the color. The white light component of the spectral color is 0, and the saturation reaches the highest. The value range is usually 0% to 100%. The larger the value, the more saturated the color. Lightness V indicates the brightness of the color. For the light source color, the lightness value is related to the brightness of the light source; for the object color, this value is related to the transmittance or reflectance of the object. The value range is usually from 0% (black) to 100% (white). Compared with the RGB space, the HSV space can very intuitively express the brightness, hue and vividness of the color, which is convenient for contrasting colors. Converting the image from the traditional RGB color space to the HSV model space can greatly improve the anti-interference ability of target recognition and detection, making the detection results more accurate. In this implementation, the traffic light color detection program is the detectColor.py file. In the detectColor.py file, the main task is to detect the color of the light segmented by TLState.py. First, the cv2.cvtColor function in OpenCV is used to convert the image from BGR format to HSV format. Then, the cv2.inRange() function is used to set the threshold, remove the background, perform median filtering, and finally calculate the number of non-zero pixels. The result corresponding to the one with the most pixels is taken as the final result.

[0097] Compared with the existing traffic light object positioning and image cutting using Hough ring detection, since a ring requires three parameters to determine, the accumulator for ring detection must be three-dimensional, which will be very inefficient. This embodiment provides a traffic light recognition method based on the Hough gradient method, which uses the gradient information of the boundary by adopting the Hough gradient method, thereby improving the efficiency of calculation.

[0098] Implementation method 2: This implementation method is to illustrate the transformed equation of step S2 in the traffic light recognition method based on the Hough gradient method described in implementation method 1 by way of example;

[0099] The transformed equation is:

[0100] (bx)2+(by)2=r 2 .

[0101] Implementation method three, see Figure 8 This embodiment is described. This embodiment provides a smart guide stick for the blind. The smart guide stick for the blind is implemented based on any one of the above-mentioned traffic light recognition methods based on the Hough gradient method. The smart guide stick for the blind includes a guide stick, a multifunctional system and a traction system.

[0102] The multifunctional system is integrated on the guide stick for the blind, and the traction component is arranged at the bottom of the guide stick for the blind;

[0103] The multifunctional system includes an information acquisition component, a data processing module and a positioning module;

[0104] The information acquisition component includes a voice interaction module and an image acquisition module;

[0105] The trigger end of the voice interaction module is arranged at the grip of the guide stick, and is used to collect voice information and send it to the data processing module;

[0106] The image acquisition module is used to collect image information around the guide stick and send it to the data processing module;

[0107] The display end of the data processing module is arranged on the rod body of the guide stick;

[0108] The positioning module is used to collect the current position coordinates of the guide stick in real time and send them to the data processing module;

[0109] The data processing module is embedded with a map, which is used to determine the target position coordinates according to the voice information, to formulate different travel routes according to the current position coordinates of the guide stick and send them to the voice interaction module for broadcasting, and to drive the traction component to drive the guide stick to move according to the travel route;

[0110] The data processing module is also embedded with a traffic light recognition module for identifying the traffic light information in the image information, thereby driving the traction component to drive the guide stick to move forward or stop;

[0111] The data processing module is also embedded with a license plate recognition module for identifying vehicle information in the image information, wherein the vehicle information includes the vehicle movement status, license plate information and bus number, and drives the traction component to move or stop the guide stick according to the travel route, and broadcasts the recognition information through the voice interaction module.

[0112] In practical application, if Figure 8 As shown, the smart guide stick includes a guide stick, a multifunctional system and a traction system;

[0113] Among them, the traction system is arranged at the bottom of the guide stick. When in use, the traction system is realized by a tractor, which is fixed at the bottom of the guide stick. The tractor pulls the guide stick to move, thereby driving the blind person forward, making the blind person feel as if they have relatives to guide them to walk, and enabling blind users to adapt to the smart guide stick more quickly; the chassis of the tractor adopts 3mm thick steel plate, the traction wheels adopt 130mm big-foot tires, the traction power adopts JGA25-37012V DC reduction motor, and the drive board adopts L298N drive board, so that the drive board can control the rotation direction and speed of the motor through different PWM signals, so that the tractor can drive the guide stick to move in different directions and speeds. At the same time, the tractor can carry 7kg and can withstand the downward pressure when the blind person holds the guide stick.

[0114] The multifunctional system is integrated on the body of the guide stick for realizing the multifunctionality of the guide stick; the multifunctional system includes an information acquisition component, a data processing module and a positioning module; the information acquisition component includes a voice interaction module and an image acquisition module; wherein the trigger end of the voice interaction module is arranged at the grip of the guide stick, the trigger end includes an activation end and a plurality of button ends, the activation end is used to trigger the start of the voice interaction module, and the plurality of button ends are trigger ends at common positions; the voice interaction module realizes the voice assistant function, and the trigger end realizes the voice assistant button function. When the blind person presses the voice assistant button on the guide stick, the voice assistant will listen to the needs of the blind person, that is, the voice interaction module can In order to collect the travel needs of the blind, the common positions can be set on the button end, the travel needs can be determined by pressing the buttons, and the needs can be sent to the data processing module; when the blind need to travel, a navigation map is embedded in the data processing module, so that the data processing module determines the target position coordinates according to the travel needs of the blind, and the positioning module collects the current position coordinates of the guide stick in real time. The data processing module formulates different travel routes according to the current position coordinates and the target position coordinates of the guide stick, and broadcasts them through the voice assistant, so that the blind can choose the best travel method according to the distance. The data processing module drives the traction system to move according to the travel route, thereby driving the guide stick forward.

[0115] Further, travel modes include walking, bus travel, and taxi travel;

[0116] When walking is chosen, the image acquisition module collects the surrounding image information of the guide stick. The data processing module is embedded with a traffic light recognition method to identify the current state of the traffic light in the image information. While the voice interaction module broadcasts it, it drives the guide stick to move forward or stop, thereby ensuring that the blind can travel more safely and cope with complex urban traffic with ease. The traffic light recognition method is implemented using the above-mentioned traffic light recognition method based on the Hough gradient method.

[0117] When choosing to travel by bus, the data processing module determines the bus stop according to the travel route, and drives the traction system to lead the blind to the bus stop. The image acquisition module collects the bus status at the bus stop. At the same time, the data processing module is embedded with a license plate recognition method, which identifies the bus number and the movement status of the bus. The voice interaction module informs the blind whether it is the bus they want to take, and informs the blind whether they can get on the bus through the vehicle movement status. After getting on the bus, the blind can pay through the display end of the data processing module. When choosing to travel by taxi, the data processing module drives the taxi software to search for nearby online taxis, book taxi travel orders, identify the license plate information through the license plate recognition method, and inform the blind whether the vehicle is the one they booked through the voice interaction module. After arriving at the destination, payment is made through the data processing module.

[0118] When applied, a weather module and a music module can also be added to the multifunctional system, so that blind users can check the weather, time and play music.

[0119] Implementation 4: This implementation is an example of the license plate recognition method in a smart guide stick for the blind described in Implementation 3.

[0120] The license plate recognition method is:

[0121] S1: After grayscale conversion of the input image, Gaussian filtering is used for denoising;

[0122] S2: After using the Sobel operator to locate the vertical edge, thresholding is used to extract the edge;

[0123] S3: Use closing operation to connect the extracted edges, and remove background interference after finding the connected area;

[0124] S4: After finding the rectangular connected domain using the matrix, use the aspect ratio of the license plate to remove the frame that is not the license plate area;

[0125] S5: After removing the affine transformation caused by shooting, several rectangular areas of the same size are obtained;

[0126] S6: Use the SVM trained with positive and negative samples to classify and identify whether it is a license plate area.

[0127] In actual application of this embodiment, license plates mainly include blue plates with white letters, yellow plates with black letters, black plates with white letters, white plates and police cars; if license plate recognition is performed based on edges, if the proportion of the license plate in the image is not very small, ordinary differential or global binarization can achieve good results; for high-definition images or very complex scenes, the proportion of the license plate is very small, or the license plate is in a darker place, while the entire scene is very bright, then differential will not produce good results, and the image contrast can be enhanced, but contrast enhancement may result in a large number of noise points, resulting in no edge detection in the license plate area.

[0128] If based on color feature detection, the background color of each license plate has its own special RGB value. For example, the typical RGB value of the blue-background license plate used in the program is R=28, G=63, B=138; when the RGB values ​​are close, it is considered to be a license plate and the pixel at that point is assigned a value of 255, otherwise 0; using color features, a binary image can be obtained, and most other objects can be removed, but there will be a lot of interference.

[0129] This embodiment uses the color feature and the size feature to perform the preliminary selection, and also uses the shape feature to perform the selection;

[0130] Specifically:

[0131] Step 1: Convert the image to grayscale;

[0132] Step 2: Gaussian filtering for denoising;

[0133] Step 3: Locate the vertical edges using the Sobel operator, because the characters of the license plate are mainly separated in the vertical direction;

[0134] Step 4: Thresholding to extract edges;

[0135] Step 5: The closed operation connects the extracted edges and finds the connected areas to prepare for subsequent positioning;

[0136] Step 6: Remove background interference;

[0137] Step 7: Use the matrix to find the rectangular connected domain. At this time, many rectangular boxes are considered to be possible license plate areas.

[0138] Step 8: Use the length and width of the license plate to remove many frames that are not likely to be the license plate area;

[0139] Step 9: Remove the affine transformation caused by shooting;

[0140] Step 10: Get several rectangular areas of the same size;

[0141] Step 11: Call the SVM that has been trained with positive and negative samples to classify whether it is a license plate area and find the license plate area.

[0142] Among them, rectangularity: After the contour is extracted, the ratio of the area enclosed by the contour to the area of ​​the contour's minimum circumscribed rectangle is called rectangularity. The closer the value is to 1, the greater the probability of a rectangle.

[0143] Aspect ratio: The aspect ratio of a normal license plate is 3:1. The closer the aspect ratio of the smallest circumscribed rectangle is to 1, the greater the probability that it is a license plate.

[0144] The existing license plate recognition based on edge has many noise points, which leads to the problem that the edge of the license plate area cannot be detected. The license plate recognition based on color can remove most other objects, but there will be many interference problems. The license plate recognition method provided in this embodiment uses color features and size features for preliminary selection and shape features for selection, thereby making up for the defects of many noise points caused by edge-based and many interferences caused by color-based.

[0145] Implementation method 5: See Figure 8 This embodiment is described. This embodiment adds an object recognition module, a gyroscope, an ultrasonic ranging module, a data encryption module, a trajectory information query module and a scene perception module to the smart guide stick described in the third embodiment.

[0146] The object recognition module is used to recognize object information in the image information and announce it through the voice interaction module;

[0147] The gyroscope is used to monitor in real time whether there is abnormal acceleration;

[0148] The ultrasonic ranging module is used to realize obstacle avoidance and distance measurement functions;

[0149] The data encryption module is used to provide encryption function for the data in the data processing module;

[0150] The track information query module is used to view the guardian's travel route and real-time location in the past 7 days;

[0151] The complex scene perception module is used to perform scene perception on the image information collected by the image acquisition module, and to broadcast the perception results through the voice interaction module.

[0152] In practical application, if Figure 8 As shown in the figure, the image information collected by the image acquisition module is sent to the object recognition module for recognition. The object recognition module sends the recognition results to the data processing module, and then broadcasts them through the voice interaction module to facilitate the blind to recognize objects. The object recognition module can be implemented using the existing K210 chip module. The K210 chip module is based on a dual-core RISC-V 64-bit processor, which is simple and efficient. The dual-core main frequency is up to 600MHZ, which can cope with various business scenarios and computing tasks. Hardware floating-point instruction acceleration: Both cores support double-precision instruction acceleration, which can make simple rendering up to 100fps. This chip also developed a KPU for edge computing for neural network acceleration. The official Demo provides some visual tasks such as face detection, image recognition, and image classification. The classification task can reach a classification network inference speed of up to 240fps; the detection task is under the QVGA network, and the model frame rate can reach up to 35fps.

[0153] Among them, the object recognition module is equipped with an object recognition method. The existing convolutional neural network is selected as the object recognition method. The principle is: the convolutional neural network ensures that more features are learned and the network performance is improved by ensuring the appropriate number of channels. However, too many channels will increase the number of training parameters and training time. The convolutional neural network ensures better scalability by designing a very deep number of layers, and can better handle complex classification problems. However, if there are too many layers, the network performance reaches saturation, and overfitting is prone to occur. The model needs to reduce the value of the loss function as much as possible during training. When the value of this function is small enough, overfitting is prone to occur. This phenomenon is manifested in that the loss function value of the model on the training set is small, which amplifies the influence of noise. When calculated on the validation set or test set, the loss function value is large, showing that the model has poor generalization performance. The convolutional neural network forward propagates information from the input layer to the output layer. The process of weight update is to backpropagate the error gradient from the output layer to the input layer layer by layer, and complete the weight update and bias value update through calculation. The gradient decays during the backpropagation process, and the gradient disappearance phenomenon is prone to occur. The gradient vanishing phenomenon usually refers to the gradient of the model decaying at each layer when the error propagates in the reverse direction. Too many layers will cause the gradient to decay and accumulate until it disappears. When using saturated activation functions such as Tanh and Sigmoid functions, the convergence of the network model will become slower and slower.

[0154] Therefore, this embodiment uses the Relu activation function in the convolutional neural network to solve the gradient explosion and gradient vanishing problems. The nonlinear Relu function improves the training speed of the network, simplifies the calculation process, and reduces the calculation cost. This embodiment aims at the overfitting problem of the network by expanding the training set size and the random dropout method to avoid overfitting.

[0155] In the pooling layer of the convolutional neural network model, this embodiment proposes overlapping maximum pooling to improve the richness of features. By setting the step size smaller than the convolution kernel, the output feature map of this layer is overlapped and covered, making the displayed information richer. Different pooling operations achieve different model compression effects, and average pooling brings a blurring effect. Using maximum pooling can effectively improve the blurring effect. Therefore, the object recognition method described in this embodiment can not only recognize general objects, but also realize the detection and recognition of traffic lights.

[0156] Furthermore, the object recognition method described in this embodiment also adds YOLOv5 target detection. YOLOv5 target detection belongs to end-to-end detection, has a fast detection speed, and is suitable for real-time target detection. The features of the input image are mainly extracted through the backbone network, and the position and category of the target to be detected are directly generated. The YOLOv5 target detection network includes a backbone network, a neck and a head; the backbone network is used to extract features. By mixing or combining features of the neck, more complex features are obtained. Finally, the head is used to complete feature prediction and generate detection frames while predicting categories. CBL, Focus, CSP1_x, CSP2_x and SPP modules are specifically designed in the YOLOv5 network. YOLOv5 extracts 5 feature layers, P1, P2, P3, P4, and P5, through the backbone network. Among them, P3, P4, and P5 extract rich feature information. The three layers are passed to the neck for further feature extraction. The neck of YOLOv5 completes feature fusion, combines semantic information at different levels, and uses the FPN+PAN structure. The FPN+PAN structure upsamples high-level features and fuses low-level information. Among them, the CBL module is the standard convolution module of the model, including the convolution layer (Conv) and the normalization layer of batch samples, which is used to implement normalization processing and accelerate the convergence of the network. The Focus layer module structure diagram slices the input image and combines it. The change from the input feature map dimension [B, C, W, H] to the output feature map dimension [B, 4C, W / 2, H / 2] is realized, that is, the length and width of the image become half of the original, the number of channels becomes 4 times the original, and the number of images remains unchanged. The output feature map is subsequently sent to the CBL module for convolution operation. The Focus layer is designed mainly to reduce training time and increase speed. The CSP1_x module designed in the backbone network of YOLOv5 uses the residual network structure module by default, and the residual network structure module is not used in the CSP2_1 structure in the neck. The Resunit module is the residual network structure module, which uses the residual network structure for residual connection. A 1×1 convolution is used to achieve dimensionality reduction, followed by a 3×3 convolution for feature extraction to reduce the amount of calculation, and addition is used instead of concatenation for feature fusion. The SPP module uses spatial pyramid pooling as the core to achieve feature fusion at different scales. The use of this module greatly expands the receptive field range without reducing the network's running speed too much. After the module is convolved with a 1×1 convolution kernel, pooling kernels of sizes 5, 9, and 13 are used to implement the maximum pooling method. In order to ensure that the input dimensions of the three pooling results and the unpooled results are the same when connected, zero padding is used. After concatenation, the number of channels becomes 4 times the original number, and the convolution is completed again through a standard convolution module, which doubles the number of channels. This module avoids information loss and distortion.

[0157] In order to make better use of data and avoid overfitting, YOLOv5 also uses data enhancement methods so that the network can learn more features from an enhanced image. Data enhancement methods include Mosaic enhancement and MixUp image blur.

[0158] The loss function defined by YOLOv5 consists of three parts: confidence loss, localization loss, and classification loss. Their sum constitutes the total complex function, which constitutes the loss function.

[0159] The Adam optimization algorithm is used in the YOLOv5 network. SGD has problems such as slow descent, frequent fluctuations and difficulty in stable convergence, but compared with standard gradient descent, it is possible to obtain better convergence results and is often used in online learning. Adam is an adaptive learning rate optimization algorithm. Compared with other adaptive learning algorithms, it performs better in practice, converges faster, and is more effective.

[0160] Blind people are more likely to fall due to poor vision and are more likely to be in danger, so a gyroscope is designed in the guide stick. The host computer remotely receives the gyroscope attitude message, and the web page can remotely obtain the online information of the device, monitor in real time whether there is abnormal acceleration, and obtain the information of the blind falling in time. After the blind falls, an alarm can be issued in time to seek help. The guardian can know that the blind has fallen and can also pay attention to the blind's situation in time.

[0161] The ultrasonic distance measurement module is used to measure whether there is an obstacle in front of the guide stick and the distance of the obstacle, so as to achieve obstacle avoidance and distance measurement functions. The ultrasonic distance measurement module uses the existing HCSR04 ultrasonic sensor, which uses IO to trigger the distance measurement and gives a high-level signal of at least 10us; the module automatically sends 8 40khz square waves to automatically detect whether there is a signal return. If there is a signal return, a high level is output through IO. The duration of the high level is the time from the ultrasonic wave from emission to return. Test distance = (high level time * sound speed (340M / S)) / 2. The ultrasonic sensor mainly adopts the direct reflection detection mode. The object to be detected in front of the sensor transmits part of the emitted sound wave back to the sensor's receiver, so that the sensor detects the object to be detected.

[0162] A data encryption module is added, and a data encryption method is embedded in the module to effectively protect user privacy. The data encryption method adopts the existing Rijndael encryption method.

[0163] A trajectory information query module is added, so that the guardian can view the travel routes of the ward in the past 7 days through the trajectory information query module and realize historical trajectory query; the guardian can also view the real-time location of the ward, the current travel destination and the mode of transportation used through the trajectory information query module, which will help family members find the blind person faster in an emergency; the guardian can also view the data transmitted by the gyroscope through the trajectory information query module, identify the occurrence of abnormal angular velocity, and thus determine whether the blind person has an accident and promptly discover the occurrence of falls and other situations.

[0164] Add a complex scene perception module to achieve indoor navigation tasks, and use Cartographer to build an environmental map. However, as the map size gradually increases, the cumulative error will become larger and larger. At this time, the introduction of loop detection can detect whether the robot has been here before, that is, the posture closed loop, which can eliminate the cumulative error to a certain extent. Specifically:

[0165] The current laser data is matched with all sub-graphs. If the current laser frame pose is close to a pose in a sub-graph, the current laser frame is matched with the sub-graph. If the matching degree meets the requirements, the loop is considered to be successfully detected. In order to improve the search efficiency, Cartographer uses a branch and bound method. Every new laser frame is subjected to loop detection. If the laser frame is determined to be a closed loop, the closed loop constraint is added to the global map constraint. The pose of the sub-graph in the world coordinate system and the pose of the laser frame in the world coordinate system are globally optimized, and finally the optimized global map is obtained.

[0166] In addition to building an environmental map, relocalization based on a known map needs to be implemented using the AMCL (Adaptive Monte Carlo) algorithm. Multiple sensors, such as accelerometers and gyroscopes, are also needed to help determine the direction and acceleration of the device. Sensor fusion technology integrates this data to provide more stable and accurate location and navigation information. It is also necessary to use an inertial navigation system, that is, to measure and track the motion state of the device through inertial sensors to determine the direction, speed and position of the device. First, the raw data collected from various sensors (such as accelerometers, gyroscopes, distance sensors, cameras, etc.) is preprocessed, including calibration, filtering, denoising and other operations, in preparation for fusion. Then, the data from multiple sensors is fused using a fusion algorithm, namely the Kalman filter, to provide a more accurate and stable estimate. At the same time, the weights and parameters of the fusion algorithm are continuously and dynamically adjusted according to environmental conditions and the reliability of sensor data to improve the robustness and accuracy of the system. Finally, the cane uses sensor data to build a model of the indoor environment, including information such as obstacles, channels and landmarks, to assist in location and navigation decisions. Through multi-sensor fusion technology, the cane can better cope with complex indoor environments and provide users with more reliable navigation services.

[0167] Embodiment 6: This embodiment provides a traffic light recognition system based on the Hough gradient method, the system comprising:

[0168] A storage device for performing edge detection on an input image and obtaining boundary points;

[0169] Storage means for transforming the coordinate system of the general equation of a circle;

[0170] A storage device for completing traffic light object positioning and image cutting using the transformed equations;

[0171] A storage device for color recognition of cut pictures.

[0172] Embodiment 7: This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, any one of the above-mentioned traffic light recognition methods based on the Hough gradient method or the above-mentioned license plate recognition method is executed.

[0173] Embodiment 8. This embodiment provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program. When the processor runs the computer program stored in the memory, the processor executes any one of the above-mentioned traffic light recognition methods based on the Hough gradient method or the above-mentioned license plate recognition method.

[0174] The above description is only an embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may be subject to various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the scope of the claims of the present invention.

Claims

1. A traffic light recognition method based on the Hough gradient method, characterized in that: The method is: S1: Perform edge detection on the input image to obtain boundary points; S2: Transform the coordinate system of the general equation of the circle; S3: Use the transformed equation to complete the traffic light object positioning and image cutting; S4: Perform color recognition on the cut images.

2. The traffic light recognition method based on the Hough gradient method according to claim 1 is characterized in that: The transformed equation in S2 is: (a-x)2+(b-y)2=r 2 Among them, a, b are the coordinates of the center of the circle, and r is the radius of the circle.

3. The traffic light recognition method based on Hough gradient method according to claim 1, characterized in that: The S3 is specifically: S31: Counting the number of circles at the local intersections, taking each local maximum value, and obtaining the center coordinates (a, b) of the corresponding circle in the original image; S32: Set the value range of radius r through cvHoughCircle() function; S33: by detecting a circle within the value range of r, a specific value of r is determined; S34: Detection is performed using the HoughCircles sub-function according to the circle center coordinates (a, b) and the r value, and the image is cut with the detected circle center as the center.

4. The traffic light recognition method based on Hough gradient method according to claim 1, characterized in that: The S4 is specifically: S41: Use cv2.cvtColor function to convert the segmented image from BGR format to HSV format; S42: Use cv2.inRange() function to set the threshold, remove the background, perform median filtering, and finally calculate the number of non-zero pixels. The one with the most pixels is taken as the color recognition result.

5. Smart blind guide stick, characterized by: The smart guide stick for the blind is implemented based on the traffic light recognition method based on the Hough gradient method according to any one of claims 1 to 4, and the smart guide stick for the blind comprises a guide stick, a multifunctional system and a traction system; The multifunctional system is integrated on the guide stick for the blind, and the traction component is arranged at the bottom of the guide stick for the blind; The multifunctional system includes an information acquisition component, a data processing module and a positioning module; The information acquisition component includes a voice interaction module and an image acquisition module; The trigger end of the voice interaction module is arranged at the grip of the guide stick, and is used to collect voice information and send it to the data processing module; The image acquisition module is used to collect image information around the guide stick and send it to the data processing module; The display end of the data processing module is arranged on the rod body of the guide stick; The positioning module is used to collect the current position coordinates of the guide stick in real time and send them to the data processing module; The data processing module is embedded with a map, which is used to determine the target position coordinates according to the voice information, to formulate different travel routes according to the current position coordinates of the guide stick and send them to the voice interaction module for broadcasting, and to drive the traction component to drive the guide stick to move according to the travel route; The data processing module is also embedded with a traffic light recognition method for recognizing traffic light information in the image information, thereby driving the traction component to drive the guide stick to move forward or stop; The data processing module is also embedded with a license plate recognition method for identifying vehicle information in the image information, wherein the vehicle information includes the vehicle movement status, license plate information and bus number, and drives the traction component to move or stop the guide stick according to the travel route, and broadcasts the recognition information through the voice interaction module.

6. The smart blind guiding stick according to claim 5, characterized in that: The license plate recognition method is: S1: After grayscale conversion of the input image, Gaussian filtering is used for denoising; S2: After using the Sobel operator to locate the vertical edge, thresholding is used to extract the edge; S3: Use closing operation to connect the extracted edges, and remove background interference after finding the connected area; S4: After finding the rectangular connected domain using the matrix, use the aspect ratio of the license plate to remove the frame that is not the license plate area; S5: After removing the affine transformation caused by shooting, several rectangular areas of the same size are obtained; S6: Use the SVM trained with positive and negative samples to classify and identify whether it is a license plate area.

7. The smart blind guiding stick according to claim 5, characterized in that: The multifunctional system also includes an object recognition module, a gyroscope, an ultrasonic ranging module, a data encryption module, a trajectory information query module and a complex scene perception module; The object recognition module is used to recognize object information in the image information and announce it through the voice interaction module; The gyroscope is used to monitor in real time whether there is abnormal acceleration; The ultrasonic ranging module is used to realize obstacle avoidance and distance measurement functions; The data encryption module is used to provide encryption function for the data in the data processing module; The track information query module is used to view the guardian's travel route and real-time location in the past 7 days; The complex scene perception module is used to perform scene perception on the image information collected by the image acquisition module, and to broadcast the perception results through the voice interaction module.

8. The traffic light recognition system based on Hough gradient method is characterized by: The system comprises: A storage device for performing edge detection on an input image and obtaining boundary points; Storage means for transforming the coordinate system of the general equation of a circle; A storage device for completing traffic light object positioning and image cutting using the transformed equations; A storage device for color recognition of cut pictures.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, which, when executed by a processor, executes the traffic light recognition method based on the Hough gradient method according to any one of claims 1 to 4 or the license plate recognition method according to claim 6.

10. A computer device, characterized in that: The device includes a memory and a processor, wherein a computer program is stored in the memory. When the processor runs the computer program stored in the memory, the processor executes the traffic light recognition method based on the Hough gradient method described in any one of claims 1 to 4 or the license plate recognition method described in claim 6.

Citation Information

Patent Citations

  • General Hough transformation-based method for detecting position of traffic signal lamp

    CN102354457A

  • Blind guiding hand crutch capable of automatically identifying traffic lights

    CN103816031A

  • Traffic signal detection method and system based on GPS positioning and visual image processing

    CN107506760A

  • Traffic light identification method based on OpenCV and comprehensive matching distance

    CN112069906A

  • Intelligent blind guiding stick

    CN223054715U

Cited By

  • Self-adaptive adjustment electric oven temperature control system and method

    CN120928878A