CN117831000A - Traffic light detection method and device, electronic equipment and storage medium - Google Patents

Traffic light detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117831000A
CN117831000A CN202410004727.0A CN202410004727A CN117831000A CN 117831000 A CN117831000 A CN 117831000A CN 202410004727 A CN202410004727 A CN 202410004727A CN 117831000 A CN117831000 A CN 117831000A
Authority
CN
China
Prior art keywords
image
classifier
traffic light
target
interest
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
CN202410004727.0A
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.)
Chongqing Changan Automobile Co Ltd
Original Assignee
Chongqing Changan Automobile Co Ltd
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 Chongqing Changan Automobile Co Ltd filed Critical Chongqing Changan Automobile Co Ltd
Priority to CN202410004727.0A priority Critical patent/CN117831000A/en
Publication of CN117831000A publication Critical patent/CN117831000A/en
Pending legal-status Critical Current

Links

Landscapes

  • Traffic Control Systems (AREA)

Abstract

The invention relates to a traffic light detection method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring target image information acquired from a road environment; extracting the region of interest from the target image information to obtain an image of interest; extracting features of the interested image to obtain a plurality of image features; and classifying the image features through a target classifier obtained through pre-training, and determining the target category of the target traffic light in the interested image. According to the invention, the interested region is extracted from the target image information to obtain the interested image, so that only the interested region of the original picture is intercepted to perform feature extraction and traffic light detection and identification, the interference of irrelevant pixel values is reduced, a large number of invalid calculations are avoided, and the traffic light detection efficiency is improved; and further, the technical problem that the identification and detection effects on traffic lights are poor when the performance of hardware equipment is low in the related technology can be solved.

Description

Traffic light detection method and device, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of intelligent driving, in particular to a traffic light detection method and device, electronic equipment and a storage medium.
Background
The automatic driving technology is mainly divided into three main modules of visual perception, decision control and path planning. The visual perception can be divided into a static target, a dynamic target, a lane line of a driving area and the like. As a category of static target detection, accurate and rapid traffic light detection and identification play an important role in subsequent vehicle control and path planning modules.
In the prior art, however, the detection and identification of the traffic lights requires the embedded hardware device to meet higher performance requirements and technical support such as GPU, CUDA and the like; otherwise, it is difficult to achieve a good recognition effect.
Therefore, the technical problem that the identification and detection effects on the traffic lights are poor when the performance of the hardware equipment is low exists in the related art.
Disclosure of Invention
The invention aims to provide a traffic light detection method, which aims to solve the problem that in the prior art, when hardware equipment performance is low, the effect of identifying and detecting traffic lights is poor; the second purpose is to provide a traffic light detection device; a third object is to provide an electronic device, and a fourth object is to provide a storage medium.
In order to achieve the above purpose, the technical scheme adopted by the invention is as follows:
a traffic light detection method comprising:
acquiring target image information acquired from a road environment;
extracting the region of interest from the target image information to obtain an image of interest;
extracting features of the interested image to obtain a plurality of image features;
and classifying the image features through a target classifier obtained through pre-training, and determining the target category of the target traffic light in the interested image.
According to the method, the interested region is extracted from the target image information to obtain the interested image, so that only the interested region of the original image is intercepted to perform feature extraction and traffic light detection and identification, interference of irrelevant pixel values is reduced, a large number of invalid calculations are avoided, and the traffic light detection efficiency is improved; and further, the technical problem that the identification and detection effects on traffic lights are poor when the performance of hardware equipment is low in the related technology can be solved.
Optionally, in the traffic light detection method, before the target classifier obtained through pre-training classifies the plurality of image features to determine a target class of a target traffic light in the image of interest, the method further includes:
acquiring a positive sample comprising traffic light image information; acquiring a negative sample which does not contain the traffic light image information;
constructing a traffic light sample library based on the positive sample and the negative sample;
training an original classifier through the traffic light sample library to obtain the target classifier.
The method of the embodiment can train the original classifier in advance to obtain the target classifier capable of providing classification capability.
Optionally, in the foregoing traffic light detection method, the extracting the region of interest from the target image information to obtain an image of interest includes:
determining an installation position of an image acquisition device for acquiring the image information;
determining the interested position information of the interested region corresponding to the installation position;
and extracting the region of interest from the image information according to the position information of interest to obtain the image of interest.
According to the method, the interested images are determined through the installation positions, so that the interested images used for later classification can be accurately determined, the interference of irrelevant pixel values can be reduced, a large number of invalid calculations are avoided, and the traffic light detection efficiency is improved.
Optionally, in the foregoing traffic light detection method, the feature extraction is performed on the image of interest to obtain a plurality of image features, including:
traversing and intercepting the interested image with a fixed step length according to a sliding window with a preset size to obtain a plurality of intercepted images;
extracting Harr characteristics corresponding to each intercepted image;
and determining the characteristic value of each Harr characteristic, and taking all the characteristic values as the plurality of image characteristics.
By the method of the embodiment, a mode of extracting the characteristic value of the Harr characteristic is provided.
Optionally, in the foregoing traffic light detection method, the classifying, by using a target classifier obtained by training in advance, the plurality of image features to determine a target class of a target traffic light in the image of interest includes:
inputting each image feature into a cascade classifier serving as the target classifier respectively to obtain a classification result corresponding to each image feature;
and determining the target category based on all the classification results.
By adopting the method of the embodiment, the cascade classifier is adopted for classification, so that the accuracy and the efficiency of identification can be effectively improved.
Optionally, in the foregoing traffic light detection method, the inputting each image feature into the cascade classifier to obtain a classification result corresponding to each image feature includes:
the following classification operations are circularly performed until a final sub-classification result obtained by the final classifier classification is obtained:
inputting data to be processed into a current classifier to obtain a current sub-classification result obtained by classifying the current classifier, wherein the current classifier is the first classifier positioned at the first position in the cascade classifier under the condition that the data to be processed is the image characteristic, and the data to be processed is the previous sub-classification result obtained by classifying the previous classifier under the condition that the current classifier is not the first classifier;
updating the data to be processed through the current sub-classification result under the condition that the current classifier is not the final classifier positioned at the tail of the cascade classifier, updating the current classifier through a next classifier of the current classifier, and executing a jump operation for jumping to the step of inputting the data to be processed into the current classifier to obtain the current sub-classification result obtained by the classification of the current classifier;
and determining the current sub-classification result as the final sub-classification result in the case that the current classifier is the final classifier located at the end of the cascade classifier.
According to the method, the feature values are classified by adopting the plurality of classifiers in sequence, so that the accuracy of the identification of the cascade classifier can be further improved.
Optionally, in the foregoing traffic light detection method, each classifier includes a plurality of weak classifiers, and the depth of each weak classifier is a preset depth.
By the method, one classifier comprises a plurality of weak classifiers, so that the accuracy of identification of each classifier can be improved, and the overall accuracy of the cascade classifier can be improved conveniently.
According to another aspect of the embodiments of the present application, there is also provided a traffic light detection device, including
The acquisition module is used for acquiring target image information acquired from the road environment;
the first extraction module is used for extracting the region of interest of the target image information to obtain an image of interest;
the second extraction module is used for extracting the characteristics of the interested image to obtain a plurality of image characteristics;
and the classification module is used for classifying the image features through a target classifier obtained through pre-training, and determining the target category of the target traffic light in the interested image.
According to yet another aspect of the embodiments of the present application, there is also provided an electronic device including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein the memory is used for storing a computer program; a processor for performing the method steps of any of the embodiments described above by running the computer program stored on the memory.
According to a further aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having stored therein a computer program, wherein the computer program is arranged to perform the method steps of any of the embodiments described above when run.
The invention has the beneficial effects that:
the interested region is extracted from the target image information to obtain an interested image, so that only the interested region of the original picture is intercepted to perform feature extraction and traffic light detection and identification, interference of irrelevant pixel values is reduced, a large number of invalid calculations are avoided, and the traffic light detection efficiency is improved; and further, the technical problem that the identification and detection effects on traffic lights are poor when the performance of hardware equipment is low in the related technology can be solved.
Drawings
FIG. 1 is a flow chart of an alternative traffic light detection method according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative traffic light detection method according to another embodiment of the present application;
FIG. 3 is a schematic diagram of an alternative traffic light detection method according to another embodiment of the present application;
FIG. 4 is a schematic diagram of a model structure of another alternative cascade classifier according to an embodiment of the application;
FIG. 5 is a block diagram of an alternative traffic light detection device according to an embodiment of the present application;
fig. 6 is a block diagram of an alternative electronic device according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a traffic light detection method is provided. Alternatively, in this embodiment, the traffic light detection method described above may be applied to a hardware environment configured by a terminal and a server. The server is connected with the terminal through a network, can be used for providing services (such as advertisement push service, application service and the like) for the terminal or a client installed on the terminal, and can be used for providing data storage service for the server by setting a database on the server or independent of the server.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal may not be limited to a PC, a mobile phone, a tablet computer, or the like.
The traffic light detection method in the embodiment of the application can be executed by a server, a terminal or both. The traffic light detection method implemented by the terminal according to the embodiment of the present application may also be implemented by a client installed thereon.
Taking a terminal (e.g., a vehicle end) as an example to execute the traffic light detection method in this embodiment, fig. 1 is a traffic light detection method provided in this embodiment of the present application, including the following steps:
step S101, acquiring target image information acquired from a road environment.
The traffic light detection method in this embodiment may be applied to a scenario in which the type of traffic light on a road needs to be identified (for example, which of a red light, a green light, or a yellow light is the current traffic light), for example: a scene of traffic light identification of a running vehicle, a scene of traffic light identification of a road monitoring system, and the like. In the embodiment of the present application, the traffic light detection method is described by taking a scene of traffic light identification performed by a running vehicle as an example, and the traffic light detection method is applicable to other scenes under the condition of no contradiction.
Alternatively, the image of the road environment may be acquired by an imaging device mounted on the vehicle, to obtain the target image information.
Further, the target image information may be a picture or a video.
Step S102, extracting the region of interest from the target image information to obtain an image of interest.
Specifically, after the target image information is acquired, in order to reduce the area to be identified, the target image information may be subjected to region-of-interest extraction to obtain the image of interest. And, the image of interest is a partial image including traffic lights in the target image information.
For example, the interested image can be obtained by performing partial image interception on the interested region and removing the sky and the road surface related region; the position of the traffic light in the general case can be determined according to the experience data of the region of interest, so that the image of interest can be determined.
Step S103, extracting features of the interested image to obtain a plurality of image features.
Specifically, after the image of interest is obtained, feature extraction can be performed on different regions of the image of interest, so as to obtain a plurality of image features.
Step S104, classifying the image features through a target classifier obtained through pre-training, and determining the target category of the target traffic light in the interested image.
Specifically, after a plurality of image features are obtained, each image feature in the plurality of image features may be classified by a target classifier obtained by training in advance, so as to obtain a classification result corresponding to each image feature.
The classification result corresponding to each image feature may be used to indicate whether the image region (the partial image in the image of interest) corresponding to the image feature contains a traffic light, and which of a red light, a green light, or a yellow light is currently on.
And further, based on the classification result corresponding to each image feature, the target category of the target traffic light in the interested image can be obtained, wherein the target category is used for indicating which of the red light, the green light or the yellow light is indicated by the current traffic light.
According to the method, the interested region is extracted from the target image information to obtain the interested image, so that only the interested region of the original image is intercepted to perform feature extraction and traffic light detection and identification, interference of irrelevant pixel values is reduced, a large number of invalid calculations are avoided, and the traffic light detection efficiency is improved; and further, the technical problem that the identification and detection effects on traffic lights are poor when the performance of hardware equipment is low in the related technology can be solved.
As shown in fig. 2, as an alternative embodiment, in the traffic light detection method, before classifying the plurality of image features by the target classifier obtained by pre-training, the method further includes the following steps:
step S201, a positive sample comprising traffic light image information is obtained; acquiring a negative sample which does not contain red-green lamp image information;
step S202, constructing a traffic light sample library based on a positive sample and a negative sample;
and step S203, training the original classifier through a traffic light sample library to obtain a target classifier.
Specifically, a positive sample and a negative sample can be obtained in advance; the positive sample is a picture comprising traffic light image information, and the negative sample is a picture not comprising traffic light image information.
After the positive sample and the negative sample are obtained, a traffic light sample library comprising the positive sample and the negative sample is constructed.
After the traffic light sample library is determined, a training sample and a checking sample can be determined from the traffic light sample library, and the training sample is used for training the original classifier to obtain a trained classifier; then, checking the trained classifier through a check sample, and taking the trained classifier as a target classifier when the trained classifier meets the preset accuracy requirement; and when the trained classifier does not meet the preset accuracy requirement, continuing to train the trained classifier through the training sample until the trained classifier meets the preset accuracy requirement.
The method of the embodiment can train the original classifier in advance to obtain the target classifier capable of providing classification capability.
As shown in fig. 3, as an alternative embodiment, the method for detecting traffic light, in step S102, performs region of interest extraction on the target image information to obtain an image of interest, and includes the following steps:
step S301, determining an installation position of an image capturing device for capturing image information.
In particular, the image capturing device may be a camera or video camera mounted on the vehicle.
The mounting locations may include, but are not limited to: information such as the position of the image capturing device on the vehicle, the lens orientation of the image capturing device, and the like.
Step S302, determining the position information of interest of the region of interest corresponding to the installation position.
Specifically, different installation positions may have differences in the viewing angles at which the image capturing device performs image capturing, and therefore, it is necessary to determine the position information of interest in the region of interest corresponding to the installation position.
The interesting position information is used for indicating the position range of the traffic light image information in the image acquired by the image acquisition device.
Example 1, the resolution of the vehicle front camera (i.e., the image capture device is a camera) was 1920x1080, mounted at the front windshield tachograph (i.e., one of the optional mounting locations). And under the picture coordinates, a rectangle surrounded by coordinate points (420,0), (420,240), (1500,0) and (1500,240) is intercepted to be used as the interested position information.
Step S303, extracting the region of interest from the image information according to the position information of interest to obtain the image of interest.
After the interested position information is determined, the interested image can be extracted from the image information according to the interested position information.
According to the method, the interested images are determined through the installation positions, so that the interested images used for later classification can be accurately determined, the interference of irrelevant pixel values can be reduced, a large number of invalid calculations are avoided, and the traffic light detection efficiency is improved.
As an optional embodiment, as the foregoing traffic light detection method, the step S103 performs feature extraction on the image of interest to obtain a plurality of image features, and includes the following steps:
traversing and intercepting the interested images with a fixed step length according to a sliding window with a preset size to obtain a plurality of intercepted images;
extracting Harr characteristics corresponding to each intercepted image;
and determining the characteristic value of each Harr characteristic, and taking all the characteristic values as a plurality of image characteristics.
Specifically, a sliding window with a preset size of 24x24 is adopted, the intercepted region of interest is traversed with a fixed step length, a plurality of intercepted images are obtained, and approximately 160000 rectangular features can be obtained on the basis of example 1 by adopting the sliding window with the size of 24x 24; and extracting Haar features from each intercepted image, wherein an integral graph can be adopted to calculate the feature value of each Haar feature, and the rectangular feature quantity of the Harr features is only related to the size of the intercepted image.
After the feature value of each Harr feature is obtained, the feature value may be taken as an image feature. And further, offline training of the weak classifier and the strong classifier of the AdaBoost cascade classifier (namely, the target classifier) can be conveniently carried out according to the characteristic values in the later stage.
By the method of the embodiment, a mode of extracting the characteristic value of the Harr characteristic is provided.
As an optional embodiment, as in the foregoing traffic light detection method, the step S104 classifies the plurality of image features by a target classifier obtained by training in advance, and determines a target class of a target traffic light in the image of interest, which includes the following steps:
inputting each image feature into a cascade classifier serving as a target classifier respectively to obtain a classification result corresponding to each image feature;
and determining the target category based on all the classification results.
Specifically, for each image feature, each image feature may be input into a cascade classifier, so that the cascade classifier classifies each image feature and obtains a corresponding classification result.
As an optional embodiment, as in the foregoing traffic light detection method, inputting each image feature into a cascade classifier to obtain a classification result corresponding to each image feature, where the classification result includes:
the following classification operations are circularly performed until a final sub-classification result obtained by the final classifier classification is obtained:
and P1, inputting the data to be processed into a current classifier to obtain a current sub-classification result obtained by classifying the current classifier, wherein the current classifier is the first classifier positioned at the first position in the cascade classifier under the condition that the data to be processed is the image characteristic, and the data to be processed is the previous sub-classification result obtained by classifying the previous classifier under the condition that the current classifier is not the first classifier.
Specifically, in the case of executing the step P1 for the first time, the data to be processed is an image feature, and the current classifier is the first classifier in the cascade of classifiers.
When the step P1 is not executed for the first time, the current classifier is not the first classifier, so the data to be processed is the previous sub-classification result obtained by classifying the previous classifier.
After the data to be processed is processed by the current classifier, the current sub-classification result obtained by classifying by the current classifier can be obtained.
And P2, under the condition that the current classifier is not the final classifier positioned at the tail of the cascade classifier, updating the data to be processed through the current sub-classification result, updating the current classifier through the next classifier of the current classifier, and executing a jump operation for jumping to the step to input the data to be processed into the current classifier, so as to obtain the current sub-classification result obtained by the classification of the current classifier.
Specifically, in the case that the current classifier is not the last classifier located at the end of the cascade classifier, that is, the last classifier exists behind the current classifier, the data to be processed can be updated through the current sub-classification result, and the current classifier is updated through the last classifier of the current classifier; and then jumping to the step P1, and inputting the updated data to be processed into the latest current classifier.
And P3, determining the current sub-classification result as a final sub-classification result in the case that the current classifier is the final classifier positioned at the tail end of the cascade classifier.
According to the method, the feature values are classified by adopting the plurality of classifiers in sequence, so that the accuracy of the identification of the cascade classifier can be further improved.
And after determining all the classification results, taking the traffic light category determined by the classification result as a target category when any one of the classification results comprises red light, green light or yellow light related information.
By adopting the method of the embodiment, the cascade classifier is adopted for classification, so that the accuracy and the efficiency of identification can be effectively improved.
As an optional embodiment, in the foregoing traffic light detection method, each classifier includes a plurality of weak classifiers, and the depth of the weak classifier is a preset depth.
Specifically, the maximum number of cascade classifiers in the cascade classifiers is set to be 20, haar features are adopted in an input image, the size of a sliding window is 24x24 pixel points, the depth of weak classifiers is 1, and the maximum number of weak classifiers in each layer is 120.
By the method, one classifier comprises a plurality of weak classifiers, so that the accuracy of identification of each classifier can be improved, and the overall accuracy of the cascade classifier can be improved conveniently.
As described below, an application example to which any of the foregoing embodiments is applied is provided:
and establishing a traffic light data sample library in advance, taking an actually-collected traffic light photo as a positive sample, taking an collected environmental object photo containing a non-traffic light as a negative sample, and establishing the traffic light sample library based on the positive sample and the negative sample.
Step one: cutting out a region of interest;
in most automatic driving visual perception scenes, the whole original image is not required to be used as input, and in the pictures acquired by the front-mounted cameras, the upper part is generally sky; the lower side is vehicle information; the left and right sides may be information of other objects such as green belts, which are not parts to be processed in the recognition process. Extracting an interested region aiming at the original data acquired by the vehicle-mounted front-end camera, wherein the interested region mainly comprises a region where a traffic light is located. In the original photo, the camera is positioned at the upper part of the image, and the region of interest is cut mainly to effectively discharge the part which does not need to be processed, so that the interference of the pixel values of irrelevant objects is reduced, the calculated amount of Haar feature extraction and AdaBoost algorithm can be greatly reduced, and the frame rate of the whole traffic light detection and identification is improved. In the technical scheme of the invention, the resolution of the front camera of the vehicle is 1920x1080, and the front camera is arranged at the front windshield automobile data recorder. In the picture coordinates, a rectangle surrounded by coordinate points (420,0), (420, 240), (1500,0), (1500, 240) is taken as the region of interest, that is, the position information of interest is coordinate information ((420,0), (420, 240), (1500,0), (1500, 240)).
Step two: harr feature extraction;
traversing the intercepted region of interest with a fixed step size by adopting a sliding window with a preset size of 24x24 to obtain a plurality of intercepted images, and obtaining about 160000 rectangular features by adopting the sliding window with the size of 24x24 on the basis of the example 1; and extracting Haar features from each intercepted image, wherein an integral graph can be adopted to calculate the feature value of each Haar feature, and the rectangular feature quantity of the Harr features is only related to the size of the intercepted image.
After the feature value of each Harr feature is obtained, the feature value may be taken as an image feature. And further, offline training of the weak classifier and the strong classifier of the original AdaBoost cascade classifier (namely, the original classifier) can be conveniently carried out according to the characteristic values at the later stage.
Step three: training to obtain a target Adaboost cascade classifier (i.e. a target classifier);
fig. 4 shows a model structure of an alternative cascade classifier. In the technical scheme of the invention, the following setting parameters are adopted for the AdaBoost cascade classifier, and the maximum cascade number of the classifier is set to be 20; the input image adopts Haar characteristics; the size of the sliding window is 24x24 pixel points; the depth of the weak classifier is 1; the maximum number of weak classifiers in each layer is 120; the Harr features are Basic features, and are stored after offline training.
Step four: detecting the category of traffic lights;
and (3) reasoning the image information of the single target by adopting the target Adaboost cascade classifier after offline training in the step (III), so as to obtain the pixel coordinates of the single traffic light in the input image and the category of the traffic light, and calculating the coordinates under the 1920x1080 image of the original input resolution according to the rectangular coordinates when the region of interest is intercepted. And sending the information to a subsequent module, and performing data fusion and verification according to the red and green lamp information acquired by the high-precision map.
According to the method, the device and the system, the interested region of the original picture is intercepted to perform feature extraction and traffic light detection and identification, the interference of irrelevant pixels is reduced, a large number of invalid calculations are avoided, and the efficiency of traffic light detection is improved. Meanwhile, the AdaBoost cascade classifier based on Harr features is used for traffic light detection, and the constructed data set can be used for offline training, so that the online detection efficiency is not affected.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of action combinations, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required in the present application.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM (Read-Only Memory)/RAM (Random Access Memory ), magnetic disk, optical disc), including instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method described in the embodiments of the present application.
According to another aspect of the embodiments of the present application, a traffic light detection device for implementing the traffic light detection method is also provided. Fig. 5 is a block diagram of an alternative traffic light detection device according to an embodiment of the present application, and as shown in fig. 5, the device may include:
the acquisition module 1 is used for acquiring target image information acquired from a road environment;
the first extraction module 2 is used for extracting the region of interest of the target image information to obtain an image of interest;
the second extraction module 3 is used for extracting features of the interested image to obtain a plurality of image features;
and the classification module 4 is used for classifying the image features through a target classifier obtained through pre-training to determine the target category of the target traffic light in the interested image.
It should be noted that, the acquiring module 1 in this embodiment may be used to perform the above-mentioned step S101, the first extracting module 2 in this embodiment may be used to perform the above-mentioned step S102, the second extracting module 3 in this embodiment may be used to perform the above-mentioned step S103, and the classifying module 4 in this embodiment may be used to perform the above-mentioned step S104.
The apparatus in this embodiment may further include, in addition to the above modules, a module for performing any of the methods in the foregoing embodiments of any of the traffic light detection methods.
It should be noted that the above modules are the same as examples and application scenarios implemented by the corresponding steps, but are not limited to what is disclosed in the above embodiments. It should be noted that the above modules may be implemented as part of an apparatus in a hardware environment implementing the method shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device for implementing the traffic light detection method described above, where the electronic device may be a server, a terminal, or a combination thereof.
According to another embodiment of the present application, there is also provided an electronic apparatus including: as shown in fig. 6, the electronic device may include: the device comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 are in communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501, when executing the program stored in the memory 1503, performs the following steps:
step S101, acquiring target image information acquired from a road environment.
Step S102, extracting the region of interest from the target image information to obtain an image of interest.
Step S103, extracting features of the interested image to obtain a plurality of image features.
Step S104, classifying the image features through a target classifier obtained through pre-training, and determining the target category of the target traffic light in the interested image.
Alternatively, in the present embodiment, the above-described communication bus may be a PCI (Peripheral Component Interconnect, peripheral component interconnect standard) bus, or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus. The communication interface is used for communication between the electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general purpose processor and may include, but is not limited to: CPU (Central Processing Unit ), NP (Network Processor, network processor), etc.; but also DSP (Digital Signal Processor ), ASIC (Application Specific Integrated Circuit, application specific integrated circuit), FPGA (Field-Programmable Gate Array, field programmable gate array) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components.
The embodiment of the application also provides a computer readable storage medium, wherein the storage medium comprises a stored program, and the program executes the method steps of the method embodiment.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, ROM, RAM, a mobile hard disk, a magnetic disk or an optical disk.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
The integrated units in the above embodiments may be stored in the above-described computer-readable storage medium if implemented in the form of software functional units and sold or used as separate products. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions to cause one or more computer devices (which may be personal computers, servers or network devices, etc.) to perform all or part of the steps of the methods described in the various embodiments of the present application.
In the foregoing embodiments of the present application, the descriptions of the embodiments are emphasized, and for a portion of this disclosure that is not described in detail in this embodiment, reference is made to the related descriptions of other embodiments.
In several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely exemplary, and the division of the units, such as the division of the units, is merely a logical function division, and may be implemented in another manner, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interfaces, units or modules, or may be in electrical or other forms.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the present embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. The traffic light detection method is characterized by comprising the following steps of:
acquiring target image information acquired from a road environment;
extracting the region of interest from the target image information to obtain an image of interest;
extracting features of the interested image to obtain a plurality of image features;
and classifying the image features through a target classifier obtained through pre-training, and determining the target category of the target traffic light in the interested image.
2. The traffic light detection method according to claim 1, wherein before the classifying the plurality of image features by the pre-trained target classifier, determining a target class of a target traffic light in the image of interest, the method further comprises:
acquiring a positive sample comprising traffic light image information; acquiring a negative sample which does not contain the traffic light image information;
constructing a traffic light sample library based on the positive sample and the negative sample;
training an original classifier through the traffic light sample library to obtain the target classifier.
3. The traffic light detection method according to claim 1, wherein the extracting the region of interest from the target image information to obtain the image of interest comprises:
determining an installation position of an image acquisition device for acquiring the image information;
determining the interested position information of the interested region corresponding to the installation position;
and extracting the region of interest from the image information according to the position information of interest to obtain the image of interest.
4. The traffic light detection method according to claim 1, wherein the feature extraction of the image of interest to obtain a plurality of image features includes:
traversing and intercepting the interested image with a fixed step length according to a sliding window with a preset size to obtain a plurality of intercepted images;
extracting Harr characteristics corresponding to each intercepted image;
and determining the characteristic value of each Harr characteristic, and taking all the characteristic values as the plurality of image characteristics.
5. The traffic light detection method according to claim 4, wherein the classifying the plurality of image features by the target classifier obtained through pre-training, determining a target class of the target traffic light in the image of interest, includes: inputting each image feature into a cascade classifier serving as the target classifier respectively to obtain a classification result corresponding to each image feature;
and determining the target category based on all the classification results.
6. The traffic light detection method according to claim 5, wherein the inputting each image feature into the cascade classifier to obtain a classification result corresponding to each image feature includes:
the following classification operations are circularly performed until a final sub-classification result obtained by the final classifier classification is obtained:
inputting data to be processed into a current classifier to obtain a current sub-classification result obtained by classifying the current classifier, wherein the current classifier is the first classifier positioned at the first position in the cascade classifier under the condition that the data to be processed is the image characteristic, and the data to be processed is the previous sub-classification result obtained by classifying the previous classifier under the condition that the current classifier is not the first classifier;
updating the data to be processed through the current sub-classification result under the condition that the current classifier is not the final classifier positioned at the tail of the cascade classifier, updating the current classifier through a next classifier of the current classifier, and executing a jump operation for jumping to the step of inputting the data to be processed into the current classifier to obtain the current sub-classification result obtained by the classification of the current classifier;
and determining the current sub-classification result as the final sub-classification result in the case that the current classifier is the final classifier located at the end of the cascade classifier.
7. The traffic light detection method according to claim 6, wherein each classifier comprises a plurality of weak classifiers, and the depth of each weak classifier is a preset depth.
8. The utility model provides a traffic lights detection device which characterized in that includes
The acquisition module is used for acquiring target image information acquired from the road environment;
the first extraction module is used for extracting the region of interest of the target image information to obtain an image of interest;
the second extraction module is used for extracting the characteristics of the interested image to obtain a plurality of image characteristics;
and the classification module is used for classifying the image features through a target classifier obtained through pre-training, and determining the target category of the target traffic light in the interested image.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus, characterized in that,
the memory is used for storing a computer program;
the processor is configured to perform the method of any one of claims 1 to 7 by running the computer program stored on the memory.
10. A computer-readable storage medium, characterized in that the storage medium has stored therein a computer program, wherein the computer program is arranged to perform the method of any of claims 1 to 7 when run.
CN202410004727.0A 2024-01-02 2024-01-02 Traffic light detection method and device, electronic equipment and storage medium Pending CN117831000A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410004727.0A CN117831000A (en) 2024-01-02 2024-01-02 Traffic light detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410004727.0A CN117831000A (en) 2024-01-02 2024-01-02 Traffic light detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117831000A true CN117831000A (en) 2024-04-05

Family

ID=90513074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410004727.0A Pending CN117831000A (en) 2024-01-02 2024-01-02 Traffic light detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117831000A (en)

Similar Documents

Publication Publication Date Title
CN112417953B (en) Road condition detection and map data updating method, device, system and equipment
CN110705405B (en) Target labeling method and device
CN108986465B (en) Method, system and terminal equipment for detecting traffic flow
CN110298300B (en) Method for detecting vehicle illegal line pressing
CN112163543A (en) Method and system for detecting illegal lane occupation of vehicle
CN105631418A (en) People counting method and device
CN111898581A (en) Animal detection method, device, electronic equipment and readable storage medium
KR102297217B1 (en) Method and apparatus for identifying object and object location equality between images
CN112434566A (en) Passenger flow statistical method and device, electronic equipment and storage medium
CN112906471A (en) Traffic signal lamp identification method and device
CN111127358B (en) Image processing method, device and storage medium
CN112163544A (en) Method and system for judging random placement of non-motor vehicles
CN114926791A (en) Method and device for detecting abnormal lane change of vehicles at intersection, storage medium and electronic equipment
CN113160272B (en) Target tracking method and device, electronic equipment and storage medium
CN111339834B (en) Method for identifying vehicle driving direction, computer device and storage medium
CN112949584A (en) Image screening method and device, electronic equipment and storage medium
CN112509321A (en) Unmanned aerial vehicle-based driving control method and system for urban complex traffic situation and readable storage medium
CN112182289A (en) Data deduplication method and device based on Flink framework
CN117831000A (en) Traffic light detection method and device, electronic equipment and storage medium
CN115761668A (en) Camera stain recognition method and device, vehicle and storage medium
CN112950961B (en) Traffic flow statistical method, device, equipment and storage medium
CN114913470A (en) Event detection method and device
CN115829890A (en) Image fusion method, device, equipment, storage medium and product
CN112597924A (en) Electric bicycle track tracking method, camera device and server
CN117392634B (en) Lane line acquisition method and device, storage medium and electronic device

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