CN116843769A - Signal lamp detection method and device for norm space and readable storage medium - Google Patents

Signal lamp detection method and device for norm space and readable storage medium Download PDF

Info

Publication number
CN116843769A
CN116843769A CN202310826822.4A CN202310826822A CN116843769A CN 116843769 A CN116843769 A CN 116843769A CN 202310826822 A CN202310826822 A CN 202310826822A CN 116843769 A CN116843769 A CN 116843769A
Authority
CN
China
Prior art keywords
signal lamp
signal
color
pixel
space
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310826822.4A
Other languages
Chinese (zh)
Inventor
钱基业
梁琰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Electric Power Research Institute of State Grid Chongqing Electric Power Co Ltd
State Grid Corp of China SGCC
Original Assignee
Electric Power Research Institute of State Grid Chongqing Electric Power Co Ltd
State Grid Corp of China SGCC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Electric Power Research Institute of State Grid Chongqing Electric Power Co Ltd, State Grid Corp of China SGCC filed Critical Electric Power Research Institute of State Grid Chongqing Electric Power Co Ltd
Priority to CN202310826822.4A priority Critical patent/CN116843769A/en
Publication of CN116843769A publication Critical patent/CN116843769A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a signal lamp detection method and device of a norm space and a readable storage medium, wherein the method comprises the following steps: the signal lamp image is converted from a first color space to a preset norm space, the value of the pixel in the preset norm space is calculated according to the preset norms of any pixel of the signal lamp image, the preset norms are norms defined based on each color component of the image in the first color space, if the value of the pixel in any pixel of the signal lamp image in the preset norms is in a first preset range, the pixel is determined to be the signal lamp pixel, and whether the candidate signal lamp area is determined to be the signal lamp area is judged according to the signal lamp pixels in the candidate signal lamp area. The invention uses the characteristic of signal lamp color in the norm space, converts the image into the preset norm space by defining the corresponding norm, judges the signal lamp pixel according to the value of the pixel in the preset norm space, judges the signal lamp area, and can improve the detection accuracy.

Description

Signal lamp detection method and device for norm space and readable storage medium
Technical Field
The invention relates to the field of computer vision, in particular to a signal lamp detection method and device in a norm space. The invention also relates to a computer readable storage medium.
Background
In the field of computer vision, signal light detection is widely required, for example: the running state of the equipment is judged through the signal lamp of the detection equipment, and whether the intersection can pass or not is judged through the detection of the traffic signal lamp. The key tasks of signal lamp detection are determining signal lamp pixels and identifying signal lamp colors. The color of the signal lamp is set to draw attention of human eyes, and three kinds of marking colors of red, yellow and green are widely adopted to represent different signals. The existing signal lamp detection technology is mainly based on HSV, HSI and other color spaces, however, in some applications, the detection accuracy cannot meet the requirements, so that the signal lamp detection method is provided, the detection accuracy can be further improved, and the signal lamp detection method is an urgent need in the technical field.
Disclosure of Invention
The invention aims to provide a signal lamp detection method and device in a norm space, which can improve detection accuracy by detecting signal lamps according to signal lamp images. The invention also provides a computer readable storage medium.
In order to achieve the above purpose, the present invention provides the following technical solutions:
a signal lamp detection method for a norm space, comprising:
converting a signal lamp image from a first color space to a preset norm space, wherein for any pixel of the signal lamp image, the value of the pixel in the preset norm space is calculated according to a preset norm, and the preset norm is defined based on each color component of the image in the first color space;
for any pixel of the signal lamp image in the preset norm space, if the value of the pixel is in a first preset range, determining the pixel as the signal lamp pixel;
and judging whether the candidate signal light area is determined to be a signal light area according to the signal light pixels in the candidate signal light area for the candidate signal light area in the signal light image.
Optionally, the preset norm is a norm defined based on differences of color components of the image in the first color space, and the differences of color components refer to differences of any two color components.
Optionally, the preset norm is expressed as:
wherein m is 1 、m 2 、m 3 Respectively representing a first color component, a second color component, a third color component of a pixel of the image in said first color space, p, q respectively representing parameters.
Alternatively, p=2, q=1.
Optionally, determining whether to determine the candidate signal region as a signal region according to the signal pixels in the candidate signal region includes:
and obtaining the number of pixels which are determined to be signal lamp pixels in the candidate signal lamp area, and determining the candidate signal lamp area as a signal lamp area if the number of signal lamp pixels in the candidate signal lamp area is in a second preset range.
Optionally, the number of signal pixels of the candidate signal area is in a second preset range includes:
the number of signal lamp pixels in the candidate signal lamp area is larger than or equal to a second threshold value, the second threshold value is a value set based on the expected area of the signal lamp area, and the expected area of the signal lamp area refers to a statistical value of the number of pixels included in the signal lamp area in an image.
Optionally, determining the signal area further includes determining a color of the signal pixel of the signal area, including:
for any signal lamp pixel in the signal lamp area, obtaining the distance between the color of the pixel and each target color according to each color component of the pixel in the second color space;
and comparing the distance between the pixel and each target color, and determining the target color with the smallest distance as the color of the pixel.
Optionally, after determining the signal lamp area, determining the color of the signal lamp corresponding to the signal lamp area further includes:
and obtaining the number of pixels corresponding to each target color in the signal lamp area, and taking the target color with the largest number of pixels as the color of the signal lamp corresponding to the signal lamp area.
Optionally, before converting the signal light image from the first color space to the preset norm space, acquiring the signal light image further includes: and (3) adjusting the aperture of the image acquisition device or/and reducing the exposure time of the image acquisition device, and controlling the image acquisition device to acquire the signal lamp image.
A signal lamp detection apparatus of a norm space, comprising:
a conversion module, configured to convert a signal lamp image from a first color space to a preset norm space, where, for any pixel of the signal lamp image, a value of a pixel in the preset norm space is a value calculated according to a preset norm, and the preset norm is a norm defined based on each color component of the image in the first color space;
the first judging module is used for determining any pixel of the signal lamp image in the preset norm space as a signal lamp pixel if the value of the pixel is in a first preset range;
and the second judging module is used for judging whether the candidate signal lamp area is determined to be the signal lamp area according to the signal lamp pixels in the candidate signal lamp area for the candidate signal lamp area in the signal lamp image.
Optionally, the second determining module is configured to determine whether to determine the candidate signal area as a signal area according to the signal pixels in the candidate signal area, including:
the second judging module is configured to obtain the number of pixels determined to be signal pixels in the candidate signal light area, and if the number of signal pixels in the candidate signal light area is in a second preset range, determine the candidate signal light area as a signal light area.
Optionally, the system further comprises a third judging module, configured to determine the color of the signal pixels of the signal area after determining the signal area;
the third determination module includes:
the calculating unit is used for obtaining the distance between the color of the pixel and each target color according to each color component of the pixel in the second color space for any signal lamp pixel in the signal lamp area;
and the judging unit is used for comparing the distance of the pixel corresponding to each target color and determining the target color with the smallest distance as the color of the pixel.
Optionally, the method further includes a fourth determining module, configured to determine, after determining the signal lamp area, a color of a signal lamp corresponding to the signal lamp area, including: and obtaining the number of pixels corresponding to each target color in the signal lamp area, and taking the target color with the largest number of pixels as the color of the signal lamp corresponding to the signal lamp area.
A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the signal detection method of a norm space as claimed in any one of the preceding claims.
As can be seen from the above technical solution, the signal lamp detection method in the norm space provided by the present invention includes: the signal lamp image is converted from a first color space to a preset norm space, the value of the pixel in the preset norm space is calculated according to the preset norms of any pixel of the signal lamp image, the preset norms are norms defined based on each color component of the image in the first color space, the pixel is determined to be the signal lamp pixel if the value of the pixel is in a first preset range for any pixel of the signal lamp image in the preset norms, and further, whether the candidate signal lamp area is determined to be the signal lamp area is determined according to the signal lamp pixels in the candidate signal lamp area for the candidate signal lamp area.
According to the signal lamp detection method, according to the mathematical angle experiments, the extremum can be obtained in the preset norm space by a plurality of colors in the first color space, therefore, the signal lamp image is converted into the preset norm space from the first color space, whether the signal lamp image is the signal lamp pixel is judged according to the value of the signal lamp image pixel in the preset norm space, whether the candidate signal lamp area is the signal lamp area is judged according to the signal lamp pixel condition in the candidate signal lamp area in the image, and compared with the prior art, the detection accuracy can be improved to a certain extent.
The signal lamp detection device in the norm space can achieve the beneficial effects.
The computer readable storage medium provided by the invention can achieve the beneficial effects.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a signal lamp detection method in a norm space according to an embodiment of the present invention;
fig. 2 is a flowchart of a signal lamp detection method in a norm space according to another embodiment of the present invention;
FIG. 3 is an image of a signal light acquired in one embodiment of the invention;
fig. 4 is an image of a signal lamp image converted into a preset norm space according to an embodiment of the present invention.
Detailed Description
In order to make the technical solution of the present invention better understood by those skilled in the art, the technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
Referring to fig. 1, fig. 1 is a flowchart of a signal lamp detection method in a norm space according to an embodiment, as shown in the drawing, the signal lamp detection method in a norm space includes, but is not limited to, the following steps:
s11: the signal lamp image is converted from a first color space to a preset norm space, and for any pixel of the signal lamp image, the value of the pixel in the preset norm space is calculated according to a preset norm, and the preset norm is defined based on each color component of the image in the first color space.
The signal light image refers to an image acquired from which a signal light needs to be detected.
For any pixel of the signal lamp image, according to each color component of the pixel in the first color space, a corresponding norm value is obtained through calculation according to a preset norm. For each pixel of the signal lamp image, a norm value is calculated, respectively, so that the signal lamp image is converted from a first color space to a preset norm space.
S12: and for any pixel of the signal lamp image in the preset norm space, if the value of the pixel is in a first preset range, determining the pixel as the signal lamp pixel.
The signal light pixel is a pixel representing a signal light. For any pixel of the signal lamp image, judging whether the pixel is determined to be the signal lamp pixel or not, and particularly determining the pixel as the signal lamp pixel according to the value of the pixel in a preset norm space if the value of the pixel in the preset norm space is in a first preset range.
S13: and judging whether the candidate signal light area is determined to be a signal light area according to the signal light pixels in the candidate signal light area for the candidate signal light area in the signal light image.
According to the signal detection method, a preset norm is defined according to the color of the signal in the first color space, a signal image is converted from the first color space to the preset norm, whether signal pixels are determined according to the value of signal image pixels in the preset norm, whether the candidate signal region is determined to be the signal region is further determined according to the signal pixel condition in the candidate signal region, and compared with the prior art, detection accuracy can be improved to a certain extent.
In this embodiment, the preset norm is not limited. In practical application, according to the signal lamp color to be detected, through experiments from a mathematical angle, a preset norm is defined based on each color component of the pixel in the first color space, and a definition formula of the preset norm is determined, so that the signal lamp color to be detected in the preset norm space established based on the preset norm can obtain an extremum, and whether the color of the pixel corresponds to the signal lamp color to be detected or not can be accurately judged according to the value of the pixel in the preset norm space, namely whether the pixel is a signal lamp pixel or not is judged.
Optionally, in some embodiments, the preset norm is a norm defined based on differences of respective color components of the image in the first color space, the differences of the color components referring to differences of any two color components. According to experiments, it is known that the plurality of colors in the first color space can obtain extreme values in a preset norm space, wherein the preset norm space corresponds to a norm defined based on differences of respective color components of the image in the first color space, and according to the preset norm, the preset norm adopts a norm defined based on differences of respective color components of the image in the first color space. In this embodiment, a specific definition formula of the preset norm is not limited. Alternatively, the preset norm may be a sum of powers of differences of the color components of the pixels of the image in the first color space, and a norm corresponding to the sum. The corresponding preset norms can be expressed as:
wherein m is 1 、m 2 、m 3 Respectively representing a first color component, a second color component, a third color component of a pixel of the image in said first color space, p, q respectively representing parameters. The values of p and q can be set according to the signal lamp color to be detected and the condition that the signal lamp color takes an extreme value in a corresponding norm space.
It is known from analysis of mathematical optimization methods that six colors of red, green, blue, yellow, dark red and cyan can obtain extreme values in a norm defined based on differences of color components of an RGB color space, and in practical application, colors of a signal lamp widely adopt three kinds of marking colors of red, yellow and green to represent different signals, so that for a signal lamp adopting three kinds of marking colors of red, yellow and green, conversion of an image from the RGB color space to a preset norm space can be applied to detect pixel colors, and the preset norm corresponding to the preset norm space is a norm defined based on differences of color components of the RGB color space. Preferably, the corresponding formula (1) may take p=2, and q=1, in which case the preset norm space may be referred to as a variance space. For three colors of red, yellow and green, selecting a first color space as RGB color space, corresponding to m in formula (1) 1 、m 2 、m 3 R, g, b, r, g, b represent the red, green, and blue components of the pixels of the image in the RGB color space, respectively, and the three colors red, yellow, and green can take the maximum values in the norm space corresponding to p=2, q=1, that is, the variance space, based on which, based on the values of the pixels of the signal lamp image in the norm space, it can be determined whether the colors of the pixels are red, yellow, and green, thereby detecting whether the pixels are signal lamp pixels.
In this embodiment, the first preset range is not limited, and in practical application, the first preset range may be set according to a defined preset norm, a condition that the signal lamp color to be detected takes an extremum in a norm space corresponding to the preset norm, and an accuracy requirement for detecting the pixel color. Optionally, the value of the pixel in the preset norm space being in the first preset range may include: the value of the pixel in the preset norm space is larger than or equal to a first threshold.
In this embodiment, the specific method for determining whether or not to determine the candidate signal light region as the signal light region based on the signal light pixels in the candidate signal light region is not limited to the candidate signal light region in the image. Optionally in some embodiments, determining whether to determine the candidate signal region as a signal region based on signal pixels in the candidate signal region may include: and obtaining the number of pixels which are determined to be signal lamp pixels in the candidate signal lamp area, and determining the candidate signal lamp area as a signal lamp area if the number of signal lamp pixels in the candidate signal lamp area is in a second preset range. In the present embodiment, whether or not to specify the candidate signal region as the signal region is determined based on the number of signal pixels included in the candidate signal region. The second preset range is not limited, and optionally, the number of signal pixels in the candidate signal area being in the second preset range may include: the number of signal lamp pixels in the candidate signal lamp area is larger than or equal to a second threshold value, the second threshold value is a value set based on the expected area of the signal lamp area, and the expected area of the signal lamp area refers to a statistical value of the number of pixels included in the signal lamp area in an image. And if the number of signal pixels included in the candidate signal region is greater than or equal to a second threshold value, judging that the candidate signal region is a signal region. It is understood that in other embodiments, it is within the scope of the present invention to determine whether to determine the candidate signal area as a signal area based on signal pixels in the candidate signal area, such as based on the number of signal pixels in the candidate signal area.
In this embodiment, the method for acquiring the candidate signal lamp area in the image is not limited. Optionally, in some embodiments, an image may be subjected to a target recognition process, and a candidate signal lamp area is located in the image, where a specific algorithm for performing the target recognition process on the image is not limited.
In other embodiments, candidate signal regions may be acquired in the image based on signal pixels determined in the image. Alternatively, candidate signal regions may be located by a method comprising: and (3) carrying out binarization processing on the image based on the signal lamp pixels determined in the image, and obtaining candidate signal lamp areas according to the connected domain in the binarized image. Before the candidate signal lamp area is obtained according to the connected domain in the binarized image, morphological operation can be performed on the binarized image so as to improve the accuracy of obtaining the candidate signal lamp area from the image. The binary image may be subjected to an expansion operation and then to a corrosion operation, for example. Alternatively, when the candidate signal lamp area is obtained according to the connected domain in the binarized image, the candidate signal lamp area can be positioned according to the area, the shape and other characteristics of the connected domain in the binarized image.
In the field of computer vision, signal lamp detection has a wide demand, and in order to draw attention of human eyes to signal lamp colors, some sign colors are widely adopted, such as red, yellow and green colors are used, but the existing signal lamp detection technology uses the characteristics of the signal lamp colors to detect signal lamps less, the signal lamp detection method of the embodiment uses the characteristics of the signal lamp colors in a preset norm space, converts an image from a first color space to the preset norm space by defining corresponding norms, and uses the characteristics of the sign colors of the signal lamps to realize more reliable and accurate detection of signal lamp pixels.
Further, in some embodiments, referring to fig. 2, fig. 2 is a flowchart of a signal detection method in a norm space according to another embodiment, as shown in the drawing, after determining a signal area, the method may further include step S14: and determining the color of the signal lamp pixel of the signal lamp area. The color of the signal lamp corresponding to the signal lamp area can be detected by determining the color of the signal lamp pixel of the signal lamp area. In the present embodiment, the method for determining the color of the signal light pixel of the signal light region is not limited as long as the color of the signal light pixel of the signal light region can be detected. Alternatively, the color of the signal pixels of the signal area may be determined by a method including, but not limited to, the steps of:
s141: and for any signal lamp pixel in the signal lamp area, obtaining the distance between the color of the pixel and each target color according to each color component of the pixel in the second color space.
The color of the signal lamp to be detected is taken as the target color. In a second color space of the image, for any signal lamp pixel in the signal lamp area, according to each color component of the pixel in the second color space, the distance between the color of the pixel and any target color is obtained, and the distance between the color of the pixel and each target color is obtained.
The second color space may be the same color space as the first color space, i.e., the second color space is the same color space as the first color space, or the second color space is another color space different from the first color space.
S142: and comparing the distance between the pixel and each target color, and determining the target color with the smallest distance as the color of the pixel.
And comparing the distance between each signal lamp pixel in the signal lamp area and each target color corresponding to the pixel, and determining the target color corresponding to the smallest distance as the color of the pixel, thereby determining the color of the pixel.
Further in some embodiments, after determining the signal light area, the method may further include step S15: and determining the color of the signal lamp corresponding to the signal lamp area. The color of the signal lamp corresponding to the signal lamp area can be determined according to the color of each signal lamp pixel of the signal lamp area, so that the signal lamp is detected, and the color of the signal lamp is detected.
In the present embodiment, the method of determining the color of the signal lamp corresponding to the signal lamp region is not limited as long as the color of the signal lamp corresponding to the signal lamp region can be detected. Alternatively, determining the color of the signal pixels of the signal area may be performed by a method comprising: and obtaining the number of pixels corresponding to each target color in the signal lamp area, and taking the target color with the largest number of pixels as the color of the signal lamp corresponding to the signal lamp area. It is understood that in other embodiments, it is also possible to determine the color of the signal corresponding to the detected signal area by other methods, which are also within the scope of the present invention.
The method may further comprise, prior to converting the signal image from the first color space to the preset norm space, acquiring the signal image, preferably comprising: and (3) adjusting the aperture of the image acquisition device or/and reducing the exposure time of the image acquisition device, and controlling the image acquisition device to acquire the signal lamp image. When the signal lamp image is collected, the characteristic of active light emission of the signal lamp is utilized, interference background which does not emit light can be restrained by means of adjusting an aperture or/and shortening exposure time and the like, background of the signal lamp image is restrained, the signal lamp in the image is highlighted, and accuracy of detecting the signal lamp is improved.
A specific embodiment of the signal lamp detection method of the present norm space is described in further detail below with a specific example. The signal lamp for detecting red, yellow and green is taken as an example. In this example, r, g, b represent red, green, and blue components of a pixel in an RGB color space, respectively, and the target colors are red (255, 0), yellow (255, 0), and green (0, 255, 0).
First, a signal lamp image is acquired. When the signal lamp image is acquired, the aperture value is adjusted to reduce the light entering quantity so as to inhibit the signal lamp background. The acquired signal lamp image is shown in fig. 3.
Converting the signal lamp image from the RGB color space to a preset norm space, wherein the preset norm adopts a calculation formula:in the present example of the present invention,selecting p=2 and q=1, wherein the norm space is a variance space, and the calculation formula is +.>Mapping the values of pixels of the signal light image in variance space to [0, 255]The interval obtains a corresponding gray level diagram, namely, an image for converting the signal lamp image into a preset norm space, and the display effect is shown in fig. 4.
And judging signal lamp pixels according to the signal lamp images converted into the images of the preset norm space. In an image converted into a preset norm space, the values of the pixels satisfyAnd judging the pixel as a signal lamp pixel, wherein 0 < alpha is less than or equal to 1.
And judging the signal lamp area. For any candidate signal lamp area in the signal lamp image, counting the number N of signal lamp pixels in the candidate signal lamp area S Satisfy N S The candidate signal lamp area which is more than or equal to beta S is a signal lamp area, wherein beta is more than 0 and less than or equal to 1, and S represents the expected area of the signal lamp.
The color of the signal pixels of the signal area is determined. Specifically, the distances from the signal lamp pixels in the signal lamp area to the three target colors of red, yellow and green are calculated respectively, and the distances are replaced by squares of Euclidean distances as long as the distances are compared without specific values, wherein the distances are expressed as: d, d red =(r-255) 2 +g 2 +b 2 ,d yellow =(r-255) 2 +(g-255) 2 +b 2 ,d green =r 2 +(g-255) 2 +b 2 Wherein d is red Representing the distance from the color of the pixel to the red target color, d yellow Representing the distance from the color of the pixel to the yellow target color, d green Representing the distance of the color of the pixel to the green target color. Since only the distance size is compared without a specific distance value, the same term b can be further removed 2 Simplifying the distance calculation to d red =(r-255) 2 +g 2 ,d yellow =(r-255) 2 +(g-255) 2 ,d green =r 2 +(g-255) 2 . Comparison d red 、d yell o w 、d green The three distances are sized, and the target color corresponding to the minimum distance is the color of the pixel.
The color of the signal lamp is determined. Specifically, the number of pixels corresponding to three colors of red, yellow and green in the signal lamp area is counted and recorded as N red 、N yellow 、N green . Comparison N red 、N yellow 、N green The three numbers are sized and the maximum number of corresponding target colors is the color of the signal lamp.
The embodiment also provides a signal lamp detection device in a norm space, which comprises:
a conversion module, configured to convert a signal lamp image from a first color space to a preset norm space, where, for any pixel of the signal lamp image, a value of a pixel in the preset norm space is a value calculated according to a preset norm, and the preset norm is a norm defined based on each color component of the image in the first color space;
the first judging module is used for determining any pixel of the signal lamp image in the preset norm space as a signal lamp pixel if the value of the pixel is in a first preset range;
and the second judging module is used for judging whether the candidate signal lamp area is determined to be the signal lamp area according to the signal lamp pixels in the candidate signal lamp area for the candidate signal lamp area in the signal lamp image.
According to the signal detection device of the embodiment, according to the fact that the extremum can be obtained in the preset norm space by a plurality of colors in the first color space according to mathematical angle experiments, the preset norm is defined according to the colors of the signal lights in the first color space, the signal light image is converted into the preset norm space from the first color space, whether the signal light image is the signal light pixel is judged according to the value of the signal light image pixel in the preset norm space, whether the candidate signal light area is determined to be the signal light area is further judged according to the signal light pixel condition in the candidate signal light area, and compared with the prior art, detection accuracy can be improved to a certain degree.
Optionally, in some embodiments, the second determining module is configured to determine whether to determine the candidate signal area as a signal area according to the signal pixels in the candidate signal area, including: the second judging module is configured to obtain the number of pixels determined to be signal pixels in the candidate signal light area, and if the number of signal pixels in the candidate signal light area is in a second preset range, determine the candidate signal light area as a signal light area.
Further in some embodiments, the signal detection apparatus of the present norm space may further include a third determining module configured to determine a color of the signal pixel of the signal region after determining the signal region;
the third determination module includes:
the calculating unit is used for obtaining the distance between the color of the pixel and each target color according to each color component of the pixel in the second color space for any signal lamp pixel in the signal lamp area;
and the judging unit is used for comparing the distance of the pixel corresponding to each target color and determining the target color with the smallest distance as the color of the pixel.
Further in some embodiments, the signal light detection apparatus in the present norm space may further include a fourth determining module, configured to determine, after determining the signal light area, a color of a signal light corresponding to the signal light area, including: and obtaining the number of pixels corresponding to each target color in the signal lamp area, and taking the target color with the largest number of pixels as the color of the signal lamp corresponding to the signal lamp area.
In this embodiment, specific implementations of the corresponding processes performed by the conversion module, the first determination module, the second determination module, the third determination module, or the fourth determination module may refer to corresponding contents described in the above embodiments of the signal lamp detection method related to the norm space, which are not described herein again.
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the signal detection method of a norm space as described in any one of the above.
According to the mathematical angle experiment, the extremum can be obtained in the preset norm space by a plurality of colors in the first color space, according to the extremum, the computer program stored in the computer readable storage medium can define the preset norm according to the colors of the signal lamps in the first color space when being executed by a processor, the signal lamp image is converted from the first color space to the preset norm space, whether the signal lamp image is the signal lamp pixel is judged according to the value of the signal lamp image pixel in the preset norm space, and whether the candidate signal lamp area is determined as the signal lamp area is further judged according to the signal lamp pixel condition in the candidate signal lamp area.
The signal lamp detection method and device and the readable storage medium of the norm space provided by the invention are described in detail above. The principles and embodiments of the present invention have been described herein with reference to specific examples, the description of which is intended only to facilitate an understanding of the method of the present invention and its core ideas. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.

Claims (14)

1. A signal lamp detection method for a norm space, comprising:
converting a signal lamp image from a first color space to a preset norm space, wherein for any pixel of the signal lamp image, the value of the pixel in the preset norm space is calculated according to a preset norm, and the preset norm is defined based on each color component of the image in the first color space;
for any pixel of the signal lamp image in the preset norm space, if the value of the pixel is in a first preset range, determining the pixel as the signal lamp pixel;
and judging whether the candidate signal light area is determined to be a signal light area according to the signal light pixels in the candidate signal light area for the candidate signal light area in the signal light image.
2. The signal lamp detecting method according to claim 1, wherein the preset norm is a norm defined based on differences of respective color components of the image in the first color space, the color component differences being differences of any two color components.
3. The signal lamp detection method of the norm space according to claim 1, wherein the preset norm is expressed as:
wherein m is 1 、m 2 、m 3 Respectively representing a first color component, a second color component, a third color component of a pixel of the image in said first color space, p, q respectively representing parameters.
4. A signal lamp detection method in a norm space according to claim 3, wherein p = 2 and q = 1.
5. The signal detection method of a norm space according to claim 1, wherein determining whether to determine the candidate signal region as a signal region based on the signal pixels in the candidate signal region comprises:
and obtaining the number of pixels which are determined to be signal lamp pixels in the candidate signal lamp area, and determining the candidate signal lamp area as a signal lamp area if the number of signal lamp pixels in the candidate signal lamp area is in a second preset range.
6. The signal detection method of a norm space according to claim 5, wherein the number of signal pixels of the candidate signal region is within a second preset range comprises:
the number of signal lamp pixels in the candidate signal lamp area is larger than or equal to a second threshold value, the second threshold value is a value set based on the expected area of the signal lamp area, and the expected area of the signal lamp area refers to a statistical value of the number of pixels included in the signal lamp area in an image.
7. The method of signal detection in a norm space of claim 1, further comprising determining a color of the signal pixels of the signal region after determining the signal region, comprising:
for any signal lamp pixel in the signal lamp area, obtaining the distance between the color of the pixel and each target color according to each color component of the pixel in the second color space;
and comparing the distance between the pixel and each target color, and determining the target color with the smallest distance as the color of the pixel.
8. The method of signal detection in a norm space of claim 7, further comprising determining a color of a signal corresponding to the signal region after determining the signal region, comprising:
and obtaining the number of pixels corresponding to each target color in the signal lamp area, and taking the target color with the largest number of pixels as the color of the signal lamp corresponding to the signal lamp area.
9. The signal lamp detection method according to any one of claims 1 to 8, wherein before converting the signal lamp image from the first color space to the preset norm space, further comprising acquiring the signal lamp image, comprising: and (3) adjusting the aperture of the image acquisition device or/and reducing the exposure time of the image acquisition device, and controlling the image acquisition device to acquire the signal lamp image.
10. A signal lamp detection apparatus for a norm space, comprising:
a conversion module, configured to convert a signal lamp image from a first color space to a preset norm space, where, for any pixel of the signal lamp image, a value of a pixel in the preset norm space is a value calculated according to a preset norm, and the preset norm is a norm defined based on each color component of the image in the first color space;
the first judging module is used for determining any pixel of the signal lamp image in the preset norm space as a signal lamp pixel if the value of the pixel is in a first preset range;
and the second judging module is used for judging whether the candidate signal lamp area is determined to be the signal lamp area according to the signal lamp pixels in the candidate signal lamp area for the candidate signal lamp area in the signal lamp image.
11. The traffic light detection device according to claim 10, wherein the second determination module is configured to determine whether to determine the candidate traffic light area as a traffic light area based on the traffic light pixels in the candidate traffic light area, comprising:
the second judging module is configured to obtain the number of pixels determined to be signal pixels in the candidate signal light area, and if the number of signal pixels in the candidate signal light area is in a second preset range, determine the candidate signal light area as a signal light area.
12. The signal detection apparatus in accordance with claim 10, further comprising a third determination module for determining a color of the signal pixels of the signal region after determining the signal region;
the third determination module includes:
the calculating unit is used for obtaining the distance between the color of the pixel and each target color according to each color component of the pixel in the second color space for any signal lamp pixel in the signal lamp area;
and the judging unit is used for comparing the distance of the pixel corresponding to each target color and determining the target color with the smallest distance as the color of the pixel.
13. The signal lamp detection apparatus according to claim 12, further comprising a fourth determination module for determining a color of a signal lamp corresponding to the signal lamp region after determining the signal lamp region, comprising: and obtaining the number of pixels corresponding to each target color in the signal lamp area, and taking the target color with the largest number of pixels as the color of the signal lamp corresponding to the signal lamp area.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the signal detection method of the norm space according to any one of claims 1 to 9.
CN202310826822.4A 2023-07-06 2023-07-06 Signal lamp detection method and device for norm space and readable storage medium Pending CN116843769A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310826822.4A CN116843769A (en) 2023-07-06 2023-07-06 Signal lamp detection method and device for norm space and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310826822.4A CN116843769A (en) 2023-07-06 2023-07-06 Signal lamp detection method and device for norm space and readable storage medium

Publications (1)

Publication Number Publication Date
CN116843769A true CN116843769A (en) 2023-10-03

Family

ID=88159671

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310826822.4A Pending CN116843769A (en) 2023-07-06 2023-07-06 Signal lamp detection method and device for norm space and readable storage medium

Country Status (1)

Country Link
CN (1) CN116843769A (en)

Similar Documents

Publication Publication Date Title
US8121400B2 (en) Method of comparing similarity of 3D visual objects
WO2017121018A1 (en) Method and apparatus for processing two-dimensional code image, and terminal and storage medium
CN104168478B (en) Based on the video image color cast detection method of Lab space and relevance function
CN112312001B (en) Image detection method, device, equipment and computer storage medium
CN116721107B (en) Intelligent monitoring system for cable production quality
US20190087674A1 (en) Method and apparatus for detecting braking behavior of front vehicle of autonomous vehicle
CN114926661B (en) Textile surface color data processing and identifying method and system
JP4901229B2 (en) Red-eye detection method, apparatus, and program
CN111311500A (en) Method and device for carrying out color restoration on image
CN111950563A (en) Image matching method and device and computer readable storage medium
CN114066862A (en) Indicator identification method and system based on color gamut and contour characteristics
CN114620030A (en) Parking performance testing method and device, server and product
CN109389132A (en) A kind of mist Concentration Testing method for early warning and system based on image
CN111723805A (en) Signal lamp foreground area identification method and related device
CN113936252A (en) Battery car intelligent management system and method based on video monitoring
WO2024016632A1 (en) Bright spot location method, bright spot location apparatus, electronic device and storage medium
CN109726708B (en) Lane line identification method and device
CN114155179A (en) Light source defect detection method, device, equipment and storage medium
CN116958113A (en) Product detection method, device, equipment and storage medium
CN116758045A (en) Surface defect detection method and system for semiconductor light-emitting diode
CN116843769A (en) Signal lamp detection method and device for norm space and readable storage medium
CN113505860B (en) Screening method and device for blind area detection training set, server and storage medium
TW201419168A (en) A method and system for license plate recognition under non-uniform illumination
CN116503871A (en) Character segmentation preprocessing method, terminal device and computer readable storage medium
CN108010076B (en) End face appearance modeling method for intensive industrial bar image detection

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination