An image processing method and device based on signal lights

By obtaining the distance and height difference of the signal light in real time, combined with the HSV color space segmentation and iteration method, the problems of inaccurate extraction of the region of interest of the signal light and light interference are solved, and efficient and accurate identification of the signal light is achieved.

CN115063780BActive Publication Date: 2025-07-08BEIJING ITARGE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210754237.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2025-07-08
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

In the prior art, different intersection size designs lead to inaccurate extraction of signal lights in areas of interest, inaccurate extraction under the influence of factors such as parking position and driving speed, and difficulty in identifying signal lights.

Method used

By obtaining the distance and height difference between the signal light and the detection unit in real time, combining the V channel segmentation and iteration method of the HSV color space, selecting the appropriate image area division coefficient and number of pixels, performing threshold segmentation and color segmentation, and identifying the signal light position.

Benefits of technology

It realizes accurate identification of signal lights under different backgrounds and states, improves recognition accuracy and avoids the influence of light interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115063780B_ABST
    Figure CN115063780B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of image processing, and particularly to an image processing method and device based on signal lights. It includes: Step S1: Obtain image information including signal lights, determine the region of interest in the image information, perform grayscale processing on the image information, and perform threshold segmentation on the image information to obtain first image information; Step S2: Perform color segmentation on the image information to obtain second image information; Step S3: Identify the signal lights based on the first image information and the second image information. The present invention has high efficiency and accuracy, can effectively identify the position of the signal lights, and can accurately and specifically determine the red, yellow, and green lights in the signal lights.
Need to check novelty before this filing date? Find Prior Art

Description

Background Art

[0002] Road traffic signal lights are a category of traffic safety products. They are an important tool for strengthening road traffic management, reducing the occurrence of traffic accidents, improving road use efficiency, and improving traffic conditions. They are applicable to intersections such as crossroads and T-junctions, and are controlled by road traffic signal controllers to guide vehicles and pedestrians to pass safely and orderly. Traffic signal lights are the main indication signals for intelligent vehicles driving in the urban environment and play an indispensable role in urban traffic safety. Traffic signal lights are usually installed at intersections and can provide the orientation information of intelligent vehicles. Checking and identifying the status of traffic signal lights is an important task for intelligent vehicle perception.

[0003] However, in the prior art, due to different designs of the sizes of crossroads, when extracting the region of interest in the signal lights in the image, due to factors such as the parking position or driving speed, there will be inaccurate problems in the extraction of the region of interest. In addition, in sunny days, rainy days, etc., light will also cause certain interference to the recognition of signal lights. Therefore, how to provide an image processing method based on signal lights is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the Invention

[0004] The purpose of the present invention is to provide an image processing method and device based on signal lights. The present invention has high efficiency and accuracy, can effectively identify the position of signal lights, and can accurately and specifically judge the red, yellow, and green lights in the signal lights.

[0005] The present invention improves the prior art. Due to different designs of the sizes of crossroads, when extracting the region of interest in the signal lights in the image, due to factors such as the parking position or driving speed, there will be inaccurate problems in the extraction of the region of interest. The present invention obtains the distance parameter between the detection unit and the signal light in real time, etc., selects a suitable image region division coefficient according to different parameters, and obtains the region of interest in the image, and there will be no inaccurate extraction problems caused by the position of the parking distance from the signal light and the driving state, etc.

[0006] The present invention improves the problem of interference caused by light to the recognition of signal lights in the prior art. The present invention divides the V channel in the HSV color space and combines the iterative method to perform color segmentation on the image, avoiding the problem of signal light recognition caused by light.

[0007] In order to achieve the above purpose, the present invention provides the following technical solutions:

[0008] An image processing method based on signal lights, including:

[0009] Step S1: Obtain the image information including the traffic signal, determine the region of interest in the image information, perform grayscale processing on the image information, and perform threshold segmentation on the image information to obtain the first image information;

[0010] Step S2: Perform color segmentation on the image information to obtain the second image information;

[0011] Step S3: Identify the traffic signal based on the first image information and the second image information;

[0012] In the step S1, when obtaining the image information including the traffic signal, the detection unit detects the straight-line length L0 between the traffic signal and the detection unit in real time, and calculates the difference K0 between the horizontal height of the traffic signal and the detection unit in real time;

[0013] Based on the straight-line distance L0 and the difference K0 of the horizontal height, the processing unit determines the region of interest in the image information.

[0014] In some embodiments of the present application, a preset image region division coefficient matrix P0 and a preset length matrix A are set in the processing unit. For the preset length matrix A, A(A1, A2, A3, A4) is set, where A1 is the first preset length, A2 is the second preset length, A3 is the third preset length, A4 is the fourth preset length, and A1 < A2 < A3 < A4; for the preset image region division coefficient matrix P0, P0(P01, P02, P03, P04) is set, where P01 is the first preset image region division coefficient, P02 is the second preset image region division coefficient, P03 is the third preset image region division coefficient, P04 is the fourth preset image region division coefficient, and 1 / 3 < P01 < P02 < P03 < P04 < 1 / 2;

[0015] The processing unit is configured to select the corresponding image region division coefficient according to the relationship between L0 and the preset length matrix A to perform region division on the image information and determine the region of interest in the image information;

[0016] When L0 < A1, the first preset image region division coefficient P01 is selected as the image region division coefficient for the processing unit to perform region division on the image information;

[0017] When A1 ≤ L0 < A2, the second preset image region division coefficient P02 is selected as the image region division coefficient for the processing unit to perform region division on the image information;

[0018] When A2 ≤ L0 < A3, select the third preset image region division coefficient P03 as the image region division coefficient for the processing unit to divide the image information;

[0019] When A3 ≤ L0 < A4, select the fourth preset image region division coefficient P04 as the image region division coefficient for the processing unit to divide the image information.

[0020] In some embodiments of the present application, in step S2, when performing color segmentation on the image information, convert the image information into the HSV color space, separate the V channel in the HSV color space, and calculate the number of pixels X corresponding to each gray value of the image information through a calculation unit. Based on the number of pixels X, perform normalization processing on the image information through a gray transformation function, and calculate the number of pixels in the equalized image;

[0021] Set a preset pixel number matrix M and a preset equalized pixel number matrix N0 in the calculation unit. For the preset pixel number matrix M, set M(M1, M2, M3, M4), where M1 is the first preset pixel number, M2 is the second preset pixel number, M3 is the third preset pixel number, M4 is the fourth preset pixel number, and 0 < M1 < M2 < M3 < M4 < 15000; for the preset equalized pixel number matrix N0, set N0(N01, N02, N03, N04), where N01 is the first preset equalized pixel number, N02 is the second preset equalized pixel number, N03 is the third preset equalized pixel number, N04 is the fourth preset equalized pixel number, and < N01 < N02 < N03 < N04;

[0022] The calculation unit is used to select the corresponding equalized pixel number as the number of pixels in the equalized image of the calculation unit according to the relationship between X and the preset pixel number matrix M;

[0023] When X < M1, select the first preset equalized pixel number N01 as the number of pixels in the equalized image of the calculation unit for the image information;

[0024] When M1 ≤ X < M2, select the second preset equalized pixel number N02 as the number of pixels in the equalized image of the calculation unit for the image information;

[0025] When M2 ≤ X < M3, select the third preset equalized pixel number N03 as the number of pixels in the equalized image of the calculation unit for the image information;

[0026] When M3 ≤ X < M4, select the fourth preset equalized pixel count N04 as the pixel count in the image after the computing unit equalizes the image information.

[0027] In some embodiments of the present application, in step S3, extract the first signal light contour information in the first image information and the second signal light contour information in the second image information, compare the position of all pixel points in the first signal light contour information with the position of all pixel points in the second signal light contour information to obtain the point position distance. When the point position distance is less than a preset threshold, determine the position of the signal light in the image information.

[0028] Step S3 further includes: based on the position of the signal light in the image information, use the control unit to set an external rectangular border for the signal light in the image information.

[0029] When the concentrated area of the position of the pixel points is greater than 2 / 3 of the length of the rectangular border, determine that the signal light is green.

[0030] When the concentrated area of the position of the pixel points is greater than 1 / 3 of the length of the rectangular border and less than or equal to 2 / 3, determine that the signal light is yellow.

[0031] When the concentrated area of the position of the pixel points is less than 1 / 3 of the length of the rectangular border, determine that the signal light is red.

[0032] To achieve the above object, the present invention also correspondingly provides an image processing device based on a signal light, including:

[0033] An acquisition unit, which is used to acquire image information including a signal light.

[0034] A threshold segmentation unit, which is used to perform grayscale processing on the image information and perform threshold segmentation on the image information to obtain first image information.

[0035] A color segmentation unit, which is used to perform color segmentation on the image information and obtain second image information.

[0036] An identification unit, which is used to identify the signal light based on the first image information and the second image information.

[0037] A detection unit, which is used to detect the straight-line length L0 between the signal light and the detection unit in real time and calculate the difference K0 between the horizontal height of the signal light and the detection unit in real time.

[0038] A processing unit, which is configured to determine a region of interest in the image information based on the difference K0 between the straight-line distance L0 and the horizontal height.

[0039] In some embodiments of the present application, a preset image region division coefficient matrix P0 and a preset length matrix A are set in the processing unit. For the preset length matrix A, A(A1, A2, A3, A4) is set, where A1 is the first preset length, A2 is the second preset length, A3 is the third preset length, A4 is the fourth preset length, and A1 < A2 < A3 < A4; for the preset image region division coefficient matrix P0, P0(P01, P02, P03, P04) is set, where P01 is the first preset image region division coefficient, P02 is the second preset image region division coefficient, P03 is the third preset image region division coefficient, P04 is the fourth preset image region division coefficient, and 1 / 3 < P01 < P02 < P03 < P04 < 1 / 2;

[0040] The processing unit is configured to perform region division on the image information by selecting a corresponding image region division coefficient according to the relationship between L0 and the preset length matrix A, and determine the region of interest in the image information;

[0041] When L0 < A1, the first preset image region division coefficient P01 is selected as the image region division coefficient for the processing unit to perform region division on the image information;

[0042] When A1 ≤ L0 < A2, the second preset image region division coefficient P02 is selected as the image region division coefficient for the processing unit to perform region division on the image information;

[0043] When A2 ≤ L0 < A3, the third preset image region division coefficient P03 is selected as the image region division coefficient for the processing unit to perform region division on the image information;

[0044] When A3 ≤ L0 < A4, the fourth preset image region division coefficient P04 is selected as the image region division coefficient for the processing unit to perform region division on the image information.

[0045] In some embodiments of the present application, a calculation unit is provided in the color segmentation unit,

[0046] The calculation unit is configured to convert the image information into the HSV color space when performing color segmentation on the image information, separate the V channel in the HSV color space, calculate the number of pixels X corresponding to each gray value of the image information, perform normalization processing on the image information through a gray transformation function based on the number of pixels X, and calculate the number of pixels in the equalized image;

[0047] A preset pixel number matrix M and a preset balanced pixel number matrix N0 are set in the calculation unit. For the preset pixel number matrix M, M(M1, M2, M3, M4) is set, where M1 is the first preset pixel number, M2 is the second preset pixel number, M3 is the third preset pixel number, M4 is the fourth preset pixel number, and 0 < M1 < M2 < M3 < M4 < 15000; for the preset balanced pixel number matrix N0, N0(N01, N02, N03, N04) is set, where N01 is the first preset balanced pixel number, N02 is the second preset balanced pixel number, N03 is the third preset balanced pixel number, N04 is the fourth preset balanced pixel number, and < N01 < N02 < N03 < N04;

[0048] The calculation unit is further configured to select a corresponding balanced pixel number as the pixel number in the image after equalization of the calculation unit according to the relationship between X and the preset pixel number matrix M;

[0049] When X < M1, the first preset balanced pixel number N01 is selected as the pixel number in the image after the calculation unit equalizes the image information;

[0050] When M1 ≤ X < M2, the second preset balanced pixel number N02 is selected as the pixel number in the image after the calculation unit equalizes the image information;

[0051] When M2 ≤ X < M3, the third preset balanced pixel number N03 is selected as the pixel number in the image after the calculation unit equalizes the image information;

[0052] When M3 ≤ X < M4, the fourth preset balanced pixel number N04 is selected as the pixel number in the image after the calculation unit equalizes the image information.

[0053] In some embodiments of the present application, the recognition unit is configured to extract the first signal light contour information in the first image information and the second signal light contour information in the second image information, compare the position of all pixel points in the first signal light contour information and the position of all pixel points in the second signal light contour information, and when the point position distance is less than a preset threshold, determine the position of the signal light in the image information;

[0054] A control unit is provided in the recognition unit, and the control unit is configured to set an external rectangular frame for the signal light in the image information based on the position of the signal light in the image information;

[0055] When the concentrated area of the positions of the pixel points is greater than 2 / 3 of the length of the rectangular border, it is determined that the signal lamp is green;

[0056] When the concentrated area of the positions of the pixel points is greater than 1 / 3 and less than or equal to 2 / 3 of the length of the rectangular border, it is determined that the signal lamp is yellow;

[0057] When the concentrated area of the positions of the pixel points is less than 1 / 3 of the length of the rectangular border, it is determined that the signal lamp is red.

[0058] The present invention provides an image processing method and device based on signal lamps. Compared with the prior art, the beneficial effects are as follows:

[0059] The present invention provides an image processing method and device based on signal lamps. By obtaining the region of interest in real time according to parameters such as distance, images containing signal lamps can be effectively extracted according to different positions and different driving states. By performing equalization processing on the V channel in the HSV image and comparing the images processed by combining threshold segmentation and color segmentation, effective recognition of traffic signal lamps in any background or any state can be achieved, and the accuracy of recognizing traffic signal lamps is improved. Description of the Drawings

[0060] Figure 1 is a flowchart of the image processing method based on signal lamps of the present invention;

[0061] Figure 2 is a functional block diagram of the image processing device based on signal lamps of the present invention. Detailed Embodiments

[0062] The following combines the drawings and embodiments to further describe in detail the specific embodiments of the present invention. The following embodiments are used to illustrate the present invention, but are not used to limit the scope of the present invention.

[0063] In the description of the present application, it should be understood that the orientation or positional relationship indicated by the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc. is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present application and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present application.

[0064] The terms "first" and "second" are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of this application, unless otherwise stated, the meaning of "a plurality" is two or more.

[0065] In the description of this application, it should be noted that, unless otherwise clearly defined and limited, the terms "install", "connect", and "couple" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the communication between the inner sides of two components. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific situations.

[0066] In the prior art, according to the different designs of the sizes of crossroads, when extracting the region of interest of the signal lights in an image, due to factors such as the parking position or the driving speed, there will be a problem that the extraction of the region of interest is inaccurate. In addition, due to the sunlight on sunny days and the gloom on rainy days, the light will also cause certain interference to the recognition of the signal lights. Therefore, how to provide an image processing method based on signal lights is a technical problem urgently to be solved by those skilled in the art.

[0067] Therefore, the present invention provides an image processing method and device based on signal lights. The present invention has high efficiency and accuracy, can effectively identify the positions of signal lights, and can accurately and specifically judge the red, yellow, and green lights in the signal lights.

[0068] Refer to Figure 1 As shown, the disclosed embodiment of the present invention provides an image processing method based on signal lights, including:

[0069] Step S1: Obtain the image information including signal lights, determine the region of interest in the image information, perform graying processing on the image information, and perform threshold segmentation on the image information to obtain the first image information;

[0070] Step S2: Perform color segmentation on the image information and obtain the second image information;

[0071] Step S3: Identify the signal lights based on the first image information and the second image information;

[0072] In step S1, when obtaining the image information including signal lights, the detection unit detects the straight-line length L0 between the signal light and the detection unit in real time, and calculates the difference K0 between the horizontal height of the signal light and the detection unit in real time;

[0073] Based on the difference K0 between the straight-line distance L0 and the horizontal height, the region of interest in the image information is determined by a processing unit.

[0074] In some embodiments of the present application, a preset image region division coefficient matrix P0 and a preset length matrix A are set in the processing unit. For the preset length matrix A, A(A1, A2, A3, A4) is set, where A1 is the first preset length, A2 is the second preset length, A3 is the third preset length, A4 is the fourth preset length, and A1 < A2 < A3 < A4; for the preset image region division coefficient matrix P0, P0(P01, P02, P03, P04) is set, where P01 is the first preset image region division coefficient, P02 is the second preset image region division coefficient, P03 is the third preset image region division coefficient, P04 is the fourth preset image region division coefficient, and 1 / 3 < P01 < P02 < P03 < P04 < 1 / 2;

[0075] The processing unit is used to select the corresponding image region division coefficient according to the relationship between L0 and the preset length matrix A to divide the image information into regions, and determine the region of interest in the image information;

[0076] When L0 < A1, the first preset image region division coefficient P01 is selected as the image region division coefficient for the processing unit to divide the image information.

[0077] When A1 ≤ L0 < A2, the second preset image region division coefficient P02 is selected as the image region division coefficient for the processing unit to divide the image information.

[0078] When A2 ≤ L0 < A3, the third preset image region division coefficient P03 is selected as the image region division coefficient for the processing unit to divide the image information.

[0079] When A3 ≤ L0 < A4, the fourth preset image region division coefficient P04 is selected as the image region division coefficient for the processing unit to divide the image information.

[0080] In some embodiments of the present application, in step S2, when performing color segmentation on the image information, the image information is converted into the HSV color space, the V channel is separated in the HSV color space, and the number of pixels X corresponding to each gray value of the image information is calculated by a calculation unit. Based on the number of pixels X, the image information is normalized through a gray transformation function, and the number of pixels in the equalized image is calculated.

[0081] Set a preset pixel number matrix M and a preset balanced pixel number matrix N0 in the calculation unit. For the preset pixel number matrix M, set M(M1, M2, M3, M4), where M1 is the first preset pixel number, M2 is the second preset pixel number, M3 is the third preset pixel number, M4 is the fourth preset pixel number, and 0 < M1 < M2 < M3 < M4 < 15000; for the preset balanced pixel number matrix N0, set N0(N01, N02, N03, N04), where N01 is the first preset balanced pixel number, N02 is the second preset balanced pixel number, N03 is the third preset balanced pixel number, N04 is the fourth preset balanced pixel number, and < N01 < N02 < N03 < N04;

[0082] The calculation unit is used to select the corresponding balanced pixel number as the pixel number in the image after equalization of the calculation unit according to the relationship between X and the preset pixel number matrix M;

[0083] When X < M1, select the first preset balanced pixel number N01 as the pixel number in the image after equalizing the image information by the calculation unit;

[0084] When M1 ≤ X < M2, select the second preset balanced pixel number N02 as the pixel number in the image after equalizing the image information by the calculation unit;

[0085] When M2 ≤ X < M3, select the third preset balanced pixel number N03 as the pixel number in the image after equalizing the image information by the calculation unit;

[0086] When M3 ≤ X < M4, select the fourth preset balanced pixel number N04 as the pixel number in the image after equalizing the image information by the calculation unit.

[0087] In some embodiments of the present application, in step S3, extract the first signal light contour information in the first image information and the second signal light contour information in the second image information, compare the position distances of all pixel points in the first signal light contour information and all pixel points in the second signal light contour information, and when the position distance is less than the preset threshold, determine the position of the signal light in the image information;

[0088] Step S3 also includes: based on the position of the signal light in the image information, set an external rectangular frame for the signal light in the image information through the control unit;

[0089] When the concentrated area of the position of the pixel point is greater than 2 / 3 of the length of the rectangular frame, determine that the signal light is green;

[0090] When the concentrated area of the position of the pixel point is greater than 1 / 3 and less than or equal to 2 / 3 of the length of the rectangular frame, determine that the signal light is yellow;

[0091] When the concentrated area of the positions of the pixel points is less than 1 / 3 of the length of the rectangular border, it is determined that the signal lamp is red.

[0092] Based on the same technical concept, referring to Figure 2 as shown, the present invention also correspondingly provides an image processing device based on a signal lamp, including:

[0093] An acquisition unit, which is used to acquire image information including a signal lamp;

[0094] A threshold segmentation unit, which is used to perform grayscale processing on the image information and perform threshold segmentation on the image information to obtain first image information;

[0095] A color segmentation unit, which is used to perform color segmentation on the image information and obtain second image information;

[0096] An identification unit, which is used to identify the signal lamp based on the first image information and the second image information;

[0097] A detection unit, which is used to detect the straight-line length L0 between the signal lamp and the detection unit in real time and calculate the difference K0 between the horizontal height of the signal lamp and the detection unit in real time;

[0098] A processing unit, which is used to determine the region of interest in the image information based on the straight-line distance L0 and the difference K0 in horizontal height.

[0099] In some embodiments of the present application, a preset image region division coefficient matrix P0 and a preset length matrix A are set in the processing unit. For the preset length matrix A, A(A1, A2, A3, A4) is set, where A1 is the first preset length, A2 is the second preset length, A3 is the third preset length, A4 is the fourth preset length, and A1 < A2 < A3 < A4; for the preset image region division coefficient matrix P0, P0(P01, P02, P03, P04) is set, where P01 is the first preset image region division coefficient, P02 is the second preset image region division coefficient, P03 is the third preset image region division coefficient, P04 is the fourth preset image region division coefficient, and 1 / 3 < P01 < P02 < P03 < P04 < 1 / 2;

[0100] The processing unit is used to select the corresponding image region division coefficient to perform region division on the image information according to the relationship between L0 and the preset length matrix A, and determine the region of interest in the image information;

[0101] When L0 < A1, the first preset image region division coefficient P01 is selected as the image region division coefficient for the processing unit to perform region division on the image information;

[0102] When A1 ≤ L0 < A2, select the second preset image region division coefficient P02 as the image region division coefficient for the processing unit to divide the image information into regions;

[0103] When A2 ≤ L0 < A3, select the third preset image region division coefficient P03 as the image region division coefficient for the processing unit to divide the image information into regions;

[0104] When A3 ≤ L0 < A4, select the fourth preset image region division coefficient P04 as the image region division coefficient for the processing unit to divide the image information into regions.

[0105] In some embodiments of the present application, a calculation unit is provided in the color segmentation unit,

[0106] The calculation unit is used to convert the image information into the HSV color space when performing color segmentation on the image information, separate the V channel in the HSV color space, calculate the number of pixels X corresponding to each gray value of the image information, normalize the image information through a gray transformation function based on the number of pixels X, and calculate the number of pixels in the equalized image;

[0107] Set a preset pixel number matrix M and a preset equalized pixel number matrix N0 in the calculation unit. For the preset pixel number matrix M, set M(M1, M2, M3, M4), where M1 is the first preset pixel number, M2 is the second preset pixel number, M3 is the third preset pixel number, M4 is the fourth preset pixel number, and 0 < M1 < M2 < M3 < M4 < 15000; for the preset equalized pixel number matrix N0, set N0(N01, N02, N03, N04), where N01 is the first preset equalized pixel number, N02 is the second preset equalized pixel number, N03 is the third preset equalized pixel number, N04 is the fourth preset equalized pixel number, and < N01 < N02 < N03 < N04;

[0108] The calculation unit is further used to select the corresponding equalized pixel number as the number of pixels in the image equalized by the calculation unit according to the relationship between X and the preset pixel number matrix M;

[0109] When X < M1, select the first preset equalized pixel number N01 as the number of pixels in the image equalized by the calculation unit for the image information;

[0110] When M1 ≤ X < M2, select the second preset equalized pixel number N02 as the number of pixels in the image equalized by the calculation unit for the image information;

[0111] When M2 ≤ X < M3, select the third preset equilibrium pixel count N03 as the number of pixels in the image after equalizing the image information using the calculation unit;

[0112] When M3 ≤ X < M4, select the fourth preset equilibrium pixel count N04 as the number of pixels in the image after equalizing the image information using the calculation unit.

[0113] In some embodiments of the present application, the recognition unit is used to extract the first signal light contour information in the first image information and the second signal light contour information in the second image information, compare the position distances of all pixel points in the first signal light contour information and all pixel points in the second signal light contour information, and when the position distance is less than the preset threshold, determine the position of the signal light in the image information;

[0114] A control unit is provided in the recognition unit, and the control unit is used to set an external rectangular border for the signal light in the image information based on the position of the signal light in the image information;

[0115] When the concentrated area of the positions of the pixel points is greater than 2 / 3 of the length of the rectangular border, determine that the signal light is green;

[0116] When the concentrated area of the positions of the pixel points is greater than 1 / 3 of the length of the rectangular border and less than or equal to 2 / 3, determine that the signal light is yellow;

[0117] When the concentrated area of the positions of the pixel points is less than 1 / 3 of the length of the rectangular border, determine that the signal light is red.

[0118] According to the first concept of the present invention, by obtaining in real time the distance parameter between the detection unit and the signal light, etc., and selecting a suitable image area division coefficient according to different parameters to obtain the region of interest in the image, the problem of inaccurate extraction caused by the position of the vehicle when parking relative to the signal light and the driving state, etc., will not occur.

[0119] According to the second concept of the present invention, by segmenting the V channel in the HSV color space and combining the iterative method to perform color segmentation on the image, the problem of signal light recognition caused by light is avoided.

[0120] In summary, the present invention can effectively extract the image containing the signal light according to different positions and different driving states by obtaining the region of interest in real time according to parameters such as distance. By performing equalization processing on the V channel in the HSV image and comparing the images processed by combining threshold segmentation and color segmentation, it is possible to effectively recognize the traffic signal light in any background or any state, improving the accuracy of traffic signal light recognition.

[0121] The above is only one embodiment of the present invention, but it cannot limit the scope of the present invention. Any structural changes made in accordance with the present invention, as long as the essence of the present invention is not lost, should be regarded as falling within the protection scope of the present invention and being restricted.

[0122] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process and related explanations of the above-described system can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0123] It should be noted that the system provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the modules or steps in the embodiments of the present invention can be further decomposed or combined. For example, the modules in the above embodiment can be combined into one module, or further split into multiple sub-modules to complete all or part of the functions described above. For the names of the modules and steps involved in the embodiments of the present invention, they are only used to distinguish each module or step and are not regarded as an improper limitation of the present invention.

[0124] The term "comprising" or any other similar term is intended to cover non-exclusive inclusion, so that a process, method, article, or device / equipment including a series of elements not only includes those elements but also includes other elements not expressly listed, or also includes elements inherent in these processes, methods, articles, or devices / equipment.

[0125] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

[0126] The above is only the preferred embodiment of the present invention and is not used to limit the protection scope of the present invention.

Claims

1. An image processing method based on signal lights, characterized in that, Including: Step S1: Obtain image information including signal lights, determine the region of interest in the image information, perform grayscale processing on the image information, and perform threshold segmentation on the image information to obtain first image information; Step S2: Perform color segmentation on the image information to obtain second image information; Step S3: Identify the signal lights based on the first image information and the second image information; In step S1, when obtaining the image information including signal lights, the detection unit detects the straight-line length L0 between the signal lights and the detection unit in real time, and calculates the difference K0 between the horizontal height of the signal lights and the detection unit in real time; Based on the straight-line length L0 and the difference K0 in horizontal height, the processing unit determines the region of interest in the image information; In the processing unit, a preset image region division coefficient matrix P0 and a preset length matrix A are set. For the preset length matrix A, A(A1, A2, A3, A4) is set, where A1 is the first preset length, A2 is the second preset length, A3 is the third preset length, A4 is the fourth preset length, and A1 < A2 < A3 < A4; for the preset image region division coefficient matrix P0, P0(P01, P02, P03, P04) is set, where P01 is the first preset image region division coefficient, P02 is the second preset image region division coefficient, P03 is the third preset image region division coefficient, P04 is the fourth preset image region division coefficient, and 1 / 3 < P01 < P02 < P03 < P04 < 1 / 2; The processing unit is used to select the corresponding image region division coefficient according to the relationship between L0 and the preset length matrix A to perform region division on the image information and determine the region of interest in the image information; When L0 < A1, select the first preset image region division coefficient P01 as the image region division coefficient for the processing unit to perform region division on the image information; When A1 ≤ L0 < A2, select the second preset image region division coefficient P02 as the image region division coefficient for the processing unit to perform region division on the image information; When A2 ≤ L0 < A3, select the third preset image region division coefficient P03 as the image region division coefficient for the processing unit to perform region division on the image information; When A3 ≤ L0 < A4, select the fourth preset image region division coefficient P04 as the image region division coefficient for the processing unit to perform region division on the image information.

2. The method for processing an image based on a signal light according to claim 1, wherein In step S2, when performing color segmentation on the image information, the image information is converted into the HSV color space. In the HSV color space, the V channel is separated, and the calculation unit calculates the number of pixels X corresponding to each gray value of the image information. Based on the number of pixels X, the image information is normalized through a gray transformation function, and the number of pixels in the equalized image is calculated; In the calculation unit, a preset pixel number matrix M and a preset equalized pixel number matrix N0 are set. For the preset pixel number matrix M, M(M1, M2, M3, M4) is set, where M1 is the first preset pixel number, M2 is the second preset pixel number, M3 is the third preset pixel number, M4 is the fourth preset pixel number, and 0 < M1 < M2 < M3 < M4 < 15000; for the preset equalized pixel number matrix N0, N0(N01, N02, N03, N04) is set, where N01 is the first preset equalized pixel number, N02 is the second preset equalized pixel number, N03 is the third preset equalized pixel number, N04 is the fourth preset equalized pixel number, and < N01 < N02 < N03 < N04; The calculation unit is used to select the corresponding equalized pixel number as the number of pixels in the equalized image of the calculation unit according to the relationship between X and the preset pixel number matrix M; When X < M1, the first preset equalized pixel number N01 is selected as the number of pixels in the equalized image of the calculation unit for the image information; When M1 ≤ X < M2, the second preset equalized pixel number N02 is selected as the number of pixels in the equalized image of the calculation unit for the image information; When M2 ≤ X < M3, the third preset equalized pixel number N03 is selected as the number of pixels in the equalized image of the calculation unit for the image information; When M3 ≤ X < M4, the fourth preset equalized pixel number N04 is selected as the number of pixels in the equalized image of the calculation unit for the image information.

3. An image processing method based on a signal lamp according to claim 1, wherein, In step S3, the first signal lamp contour information in the first image information and the second signal lamp contour information in the second image information are extracted, and the point position distances of all pixel points in the first signal lamp contour information and all pixel points in the second signal lamp contour information are compared. When the point position distance is less than a preset threshold, the position of the signal lamp in the image information is determined; Step S3 further includes: based on the position of the signal lamp in the image information, an external rectangular frame is set for the signal lamp in the image information through the control unit; When the concentrated area of the positions of the pixel points is greater than 2 / 3 of the length of the rectangular frame, the signal lamp is determined to be a green light; When the concentrated area of the positions of the pixel points is greater than 1 / 3 of the length of the rectangular frame and less than or equal to 2 / 3, the signal lamp is determined to be a yellow light; When the concentrated area of the position of the pixel point is less than 1 / 3 of the length of the rectangular border, it is determined that the signal lamp is red.

4. An image processing device based on signal lights, characterized in that, It includes: An acquisition unit for acquiring image information including a signal lamp; A threshold segmentation unit for grayscale processing the image information and performing threshold segmentation on the image information to obtain first image information; A color segmentation unit for performing color segmentation on the image information and obtaining second image information; An identification unit for identifying the signal lamp based on the first image information and the second image information; A detection unit for detecting in real time the straight-line length L0 between the signal lamp and the detection unit and calculating in real time the difference K0 in the horizontal height between the signal lamp and the detection unit; A processing unit for determining the region of interest in the image information based on the straight-line length L0 and the difference K0 in the horizontal height; A preset image region division coefficient matrix P0 and a preset length matrix A are set in the processing unit. For the preset length matrix A, A(A1, A2, A3, A4) is set, where A1 is the first preset length, A2 is the second preset length, A3 is the third preset length, A4 is the fourth preset length, and A1 < A2 < A3 < A4; for the preset image region division coefficient matrix P0, P0(P01, P02, P03, P04) is set, where P01 is the first preset image region division coefficient, P02 is the second preset image region division coefficient, P03 is the third preset image region division coefficient, P04 is the fourth preset image region division coefficient, and 1 / 3 < P01 < P02 < P03 < P04 < 1 / 2; The processing unit is used to select the corresponding image region division coefficient according to the relationship between L0 and the preset length matrix A to perform region division on the image information and determine the region of interest in the image information; When L0 < A1, the first preset image region division coefficient P01 is selected as the image region division coefficient for the processing unit to perform region division on the image information; When A1 ≤ L0 < A2, the second preset image region division coefficient P02 is selected as the image region division coefficient for the processing unit to perform region division on the image information; When A2 ≤ L0 < A3, the third preset image region division coefficient P03 is selected as the image region division coefficient for the processing unit to perform region division on the image information; When A3 ≤ L0 < A4, the fourth preset image region division coefficient P04 is selected as the image region division coefficient for the processing unit to perform region division on the image information.

5. An image processing device based on a signal lamp according to claim 4, characterized in that A calculation unit is provided in the color segmentation unit. When performing color segmentation on the image information, the calculation unit is configured to convert the image information into the HSV color space, separate the V channel in the HSV color space, calculate the number of pixels X corresponding to each gray value of the image information, normalize the image information through a gray transformation function based on the number of pixels X, and calculate the number of pixels in the equalized image; A preset pixel number matrix M and a preset equalized pixel number matrix N0 are set in the calculation unit. For the preset pixel number matrix M, M(M1, M2, M3, M4) is set, where M1 is the first preset pixel number, M2 is the second preset pixel number, M3 is the third preset pixel number, M4 is the fourth preset pixel number, and 0 < M1 < M2 < M3 < M4 < 15000; for the preset equalized pixel number matrix N0, N0(N01, N02, N03, N04) is set, where N01 is the first preset equalized pixel number, N02 is the second preset equalized pixel number, N03 is the third preset equalized pixel number, N04 is the fourth preset equalized pixel number, and < N01 < N02 < N03 < N04; The calculation unit is further configured to select a corresponding equalized pixel number as the number of pixels in the equalized image of the calculation unit according to the relationship between X and the preset pixel number matrix M; When X < M1, the first preset equalized pixel number N01 is selected as the number of pixels in the equalized image of the calculation unit for the image information; When M1 ≤ X < M2, the second preset equalized pixel number N02 is selected as the number of pixels in the equalized image of the calculation unit for the image information; When M2 ≤ X < M3, the third preset equalized pixel number N03 is selected as the number of pixels in the equalized image of the calculation unit for the image information; When M3 ≤ X < M4, the fourth preset equalized pixel number N04 is selected as the number of pixels in the equalized image of the calculation unit for the image information.

6. The image processing device based on a signal lamp according to claim 4, wherein The recognition unit is configured to extract the first signal lamp contour information in the first image information and the second signal lamp contour information in the second image information, compare the position distances of all pixel points in the first signal lamp contour information and all pixel points in the second signal lamp contour information, and when the position distance is less than a preset threshold, determine the position of the signal lamp in the image information; A control unit is provided in the recognition unit, and the control unit is configured to set an external rectangular border for the signal lamp in the image information based on the position of the signal lamp in the image information; When the concentrated area of the position of the pixel points is greater than 2 / 3 of the length of the rectangular border, it is determined that the signal lamp is a green light; When the concentrated area of the positions of the pixel points is greater than 1 / 3 of the length of the rectangular border and less than or equal to 2 / 3, it is determined that the signal lamp is a yellow light; When the concentrated area of the positions of the pixel points is less than 1 / 3 of the length of the rectangular border, it is determined that the signal lamp is a red light.

Citation Information

Patent Citations

  • Traffic signal lamp identification method based on digital image processing

    CN113989771A