CN111126165B - Black smoke vehicle detection method and device and electronic equipment - Google Patents

Black smoke vehicle detection method and device and electronic equipment Download PDF

Info

Publication number
CN111126165B
CN111126165B CN201911202492.1A CN201911202492A CN111126165B CN 111126165 B CN111126165 B CN 111126165B CN 201911202492 A CN201911202492 A CN 201911202492A CN 111126165 B CN111126165 B CN 111126165B
Authority
CN
China
Prior art keywords
image
frame
black smoke
detected
video
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.)
Active
Application number
CN201911202492.1A
Other languages
Chinese (zh)
Other versions
CN111126165A (en
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.)
Suzhou Keda Technology Co Ltd
Original Assignee
Suzhou Keda Technology 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 Suzhou Keda Technology Co Ltd filed Critical Suzhou Keda Technology Co Ltd
Priority to CN201911202492.1A priority Critical patent/CN111126165B/en
Publication of CN111126165A publication Critical patent/CN111126165A/en
Priority to PCT/CN2020/121517 priority patent/WO2021103837A1/en
Application granted granted Critical
Publication of CN111126165B publication Critical patent/CN111126165B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • G06V20/42Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items of sport video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/56Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
    • G06V20/58Recognition of moving objects or obstacles, e.g. vehicles or pedestrians; Recognition of traffic objects, e.g. traffic signs, traffic lights or roads
    • G06V20/584Recognition of moving objects or obstacles, e.g. vehicles or pedestrians; Recognition of traffic objects, e.g. traffic signs, traffic lights or roads of vehicle lights or traffic lights
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/08Detecting or categorising vehicles

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a black smoke vehicle detection method, a black smoke vehicle detection device and electronic equipment, wherein the method comprises the steps of obtaining a to-be-detected video with label information; the marking information is a moving target in each frame of image of the video to be detected; generating a background image of each frame of image based on the moving target to obtain a target background image corresponding to the video to be detected; extracting a first image of a tail area of the moving target in each frame image and a second image corresponding to the tail area in the target background image; and detecting whether the moving target is a black smoke vehicle or not according to the first image and the second image. Generating a target background image corresponding to the video to be detected by using the background image of each frame of image so as to ensure the integrity of the detected target background image; the detection of the black smoke vehicle is carried out on each frame of image on the basis of the complete target background image, the detection process is continuous dynamic detection, and the accuracy of the detection of the black smoke vehicle can be improved.

Description

Black smoke vehicle detection method and device and electronic equipment
Technical Field
The invention relates to the technical field of image processing, in particular to a black smoke vehicle detection method and device and electronic equipment.
Background
A black smoke vehicle is a vehicle that emits a visibly apparent smoke level or smoke level exceeding the lingemann level 1. The pollutants emitted by the black smoke vehicle are carbon monoxide, hydrocarbons, nitrogen oxides and particles, wherein the nitrogen oxides and particles are the most harmful to the quality of the atmosphere. Therefore, timely discovery of black smoke cars and further processing will help to improve city air quality.
The method comprises the steps that a white paint road surface is formed by coating a layer of white paint on the road surface right below a camera, when no diesel vehicle passes through the white paint road surface, the distance measurement of a distance sensor is kept unchanged, a controller controls the camera to obtain an image of the white paint road surface, and the average value of the image of the nearest N frames of the white paint road surface is stored and calculated to serve as a background image pixel value; when the diesel vehicle is on the white paint road surface, the controller controls the camera to continuously shoot M frames of road surface images containing vehicle tail gas images, and the average value of the M frames of road surface images containing the tail gas images is calculated to be used as a target image pixel value; and calculating the exhaust gas concentration value by using the background image pixel value and the target image pixel value.
However, in the above technical solution, the calculation of the exhaust gas concentration value can be performed only when the vehicle is driven to the white paint road surface on the road surface right below the camera; if a certain black smoke vehicle does not pass through the white paint road surface, the detection omission can not be caused, namely the detection accuracy of the black smoke vehicle is low.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for detecting a black smoke vehicle, and an electronic device, so as to solve the problem that the detection accuracy of the black smoke vehicle is relatively low.
According to a first aspect, an embodiment of the present invention provides a black smoke vehicle detection method, including:
acquiring a video to be detected with label information; the marking information is a moving target in each frame of image of the video to be detected;
generating a background image of each frame of image based on the moving target to obtain a target background image corresponding to the video to be detected;
extracting a first image of a tail area of the moving object in each frame of image and a second image corresponding to the tail area in the object background image;
and detecting whether the moving target is a black smoke vehicle according to the first image and the second image.
According to the black smoke vehicle detection method provided by the embodiment of the invention, the target background image corresponding to the video to be detected is generated by utilizing the background image of each frame of image, so that the integrity of the detected target background image is ensured; meanwhile, the black smoke vehicle detection is carried out on each frame of image on the basis of the complete target background image, the detection process is continuous dynamic detection, and the accuracy of the black smoke vehicle detection can be improved.
With reference to the first aspect, in a first implementation manner of the first aspect, the generating a background image of each frame of image based on the moving object to obtain a background image corresponding to the video to be detected includes:
setting the pixel value of the position corresponding to the moving object in each frame of image as a preset value to obtain a background image of each frame of image;
and accumulating the background images of each frame of image on a time axis to generate a background image corresponding to the video to be detected.
With reference to the first implementation manner of the first aspect, in a second implementation manner of the first aspect, the setting the pixel value of the position corresponding to the moving object in each frame of image as a preset value to obtain a background image of each frame of image includes:
acquiring the position of the moving target in the current image frame;
sequentially judging whether each pixel point in the current image frame is positioned in the position range of the moving target;
when the pixel points in the current image frame are located in the position range of the moving target, setting the pixel values of the pixel points in the current image frame as preset values to obtain a mask image of the current image frame;
Generating a background image of the current image frame based on the mask image of the current image frame and the current image frame.
With reference to the second embodiment of the first aspect, in a third embodiment of the first aspect, the background image of the current image frame is calculated by using the following formula:
Figure BDA0002296210960000021
in the formula (I), the compound is shown in the specification,
Figure BDA0002296210960000022
wherein img (i) is the ith image frame in the video to be detected; n is the number of pixel points in the ith image frame; im (c) i (j) The pixel value of the jth pixel point in the ith image frame is obtained; mark i (j) The pixel value of the jth pixel point in the mask image corresponding to the ith image frame is obtained; object (object) i For the moving object in the ith image frameAnd marking the set of pixel points of the region.
With reference to the first aspect or any one of the first to third embodiments of the first aspect, in a fourth embodiment of the first aspect, the detecting whether the moving object is a black smoke vehicle according to the first image and the second image includes:
calculating the black smoke characteristic image of the moving target in each frame of image by using the pixel value of each pixel point in the second image and the pixel value of the corresponding pixel point in the first image;
Extracting the characteristics of the black smoke characteristic images to detect whether the moving target in each frame of image is the black smoke vehicle or not;
and determining whether the moving target in the video to be detected is the black smoke vehicle or not based on the detection result of the moving target in each frame of image.
According to the black smoke vehicle detection method provided by the embodiment of the invention, the static information in the picture is filtered out from each frame of black smoke characteristic image obtained by subtracting the second image from the first image, all dynamic information is reserved, wherein the black smoke is highly dynamic information, and the interference of other noises on the road surface is mostly static information, so that the accuracy of subsequent detection can be improved by the method of obtaining the black smoke characteristic image.
With reference to the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, the performing feature extraction on the black smoke feature image to detect whether the moving object in each frame of image is the black smoke vehicle includes:
inputting the black smoke characteristic image into a classification model to detect whether the moving target corresponding to the black smoke characteristic image is a black smoke vehicle; the classification model is obtained based on convolutional neural network model training.
According to the black smoke vehicle detection method provided by the embodiment of the invention, the black smoke characteristic images are classified through the classification model, the whole processing process does not need to depend on the limitation of a hardware environment and a detection position, and the application range of the black smoke vehicle detection method can be enlarged.
With reference to the third implementation manner of the first aspect, in a sixth implementation manner of the first aspect, the determining whether the moving object in the video to be detected is the black smoke vehicle based on the detection result of the moving object in each frame of image includes:
counting the number of image frames of the black cigarette car detected in the video to be detected;
judging whether the number of the image frames of the black smoke vehicle is larger than a preset value or not;
and when the number of the image frames of the black smoke vehicle is detected to be larger than the preset value, determining that the moving target in the video to be detected is the black smoke vehicle.
According to the black smoke vehicle detection method provided by the embodiment of the invention, the black smoke vehicle is detected in each frame, and then the black smoke vehicle is detected by combining all image frames in the video to be detected, so that the detection accuracy can be improved.
With reference to the sixth implementation manner of the first aspect, in the seventh implementation manner of the first aspect, before the step of determining whether the number of image frames of the black smoke vehicle is greater than a preset value, the method further includes:
Acquiring the motion parameters of the moving target; wherein the motion parameter comprises a vehicle speed of the moving object;
determining the preset value based on the motion parameter.
According to the black smoke vehicle detection method provided by the embodiment of the invention, the preset value is determined based on the motion parameters of the moving target, so that the problem of inaccurate detection result caused by external factors can be avoided.
According to a second aspect, the present invention also provides a black smoke vehicle detection device, including:
the acquisition module is used for acquiring the video to be detected with the labeled information; the marking information is a moving target in each frame of image of the video to be detected;
the background image generation module is used for generating a background image of each frame of image based on the moving target so as to obtain a target background image corresponding to the video to be detected;
the image extraction module is used for extracting a first image of a tail area of the moving target in each frame of image and a second image corresponding to the tail area in the target background image;
and the black smoke vehicle detection module is used for detecting whether the moving target is a black smoke vehicle according to the first image and the second image.
According to a third aspect, an embodiment of the present invention further provides an electronic device, including:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing therein computer instructions, and the processor executing the computer instructions to perform the method for detecting black smoke in the first aspect of the present invention or in any one of the first aspects.
According to a fourth aspect, the embodiment of the present invention further provides a computer-readable storage medium, which stores computer instructions for causing the computer to execute the method for detecting a black smoke vehicle according to the first aspect of the present invention or any one of the first aspects.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a flow chart of a black smoke vehicle detection method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of moving object detection according to an embodiment of the present invention;
FIG. 3 is a flow chart of a black smoke vehicle detection method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of generating a background image according to an embodiment of the invention;
FIG. 5 is a schematic illustration of a target background image according to an embodiment of the invention;
FIG. 6 is a flow chart of a black smoke vehicle detection method according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of black smoke feature image extraction according to an embodiment of the invention;
fig. 8 is a block diagram of the black smoke vehicle detecting device according to the embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the black smoke vehicle detection method in the embodiment of the present invention may be used for real-time detection, and may also be used for detecting black smoke vehicles in a historical video, where the detection time of the black smoke vehicle is not limited at all. The video to be detected acquired by the electronic equipment at the detection time corresponding to the black smoke vehicle can be the video acquired in real time or historical video.
The electronic device may be a camera for capturing video images, or a server or other electronic devices. For example, the camera collects a video image and detects a black smoke car in the collected video image, or the camera sends the detected video image to a server in the background, and the server detects the black smoke car in the received video image, or other electronic devices detect the black smoke car in the obtained video image, and so on. The specific type of the electronic device is not limited at all, and only the black smoke vehicle detection method in the embodiment of the invention can be operated.
In accordance with an embodiment of the present invention, there is provided a black smoke detection method embodiment, it is noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
In this embodiment, a black smoke vehicle detection method is provided, which may be used in electronic devices such as a camera, a server, and the like, fig. 1 is a flowchart of the black smoke vehicle detection method according to an embodiment of the present invention, and as shown in fig. 1, the flowchart includes the following steps:
and S11, acquiring the video to be detected with the mark information.
And the marking information is a moving target in each frame of image of the video to be detected.
The video to be detected may be collected in real time, or may be historical video, etc., as described above. The video to be detected is also provided with labeling information, that is, a moving object in each frame of image is labeled, for example, the moving object on each frame of image can be framed in a labeling frame mode. The number of the moving objects on each frame image can be one, or a plurality of moving objects.
The detection of the moving object in each frame image can be deduced based on a deep learning training model, can also be deduced based on a Gaussian background modeling mode, or can also be deduced based on an optical flow mode. The method for detecting the moving object is not limited in any way.
Optionally, in this embodiment, the electronic device acquires a video to be detected, then detects a moving object in each frame of image by using a trained object detection model, and simultaneously uses gaussian background modeling and an optical flow method to supplement the condition of model omission. The labeling information in a certain image frame is as shown in fig. 2, and the moving object in the image is selected by adopting a form frame of a labeling frame in fig. 2.
And S12, generating a background image of each frame of image based on the moving target to obtain a target background image corresponding to the video to be detected.
The so-called background image is the static object in each frame of image, and after obtaining the moving object in each frame of image in S11, the electronic device can remove the moving object on the basis of the original image frame, and can obtain the static object in each frame of image. After the static target in each frame of image is obtained, the static targets corresponding to all the image frames in the video image to be processed are superposed, and then a complete target background image corresponding to the video to be detected can be obtained. This step will be described in detail hereinafter.
S13, a first image of the tail region of the moving object in each frame image and a second image of the object background image corresponding to the tail region are extracted.
The black smoke emission part is located in the tail region of the moving target, that is, the tail region of the moving target can be regarded as a region of interest (ROI). The determination of the region of interest may be performed based on the width of the moving object, for example, a rectangular frame having the same width as the moving object is set behind the moving object in each frame of image, and the length of the rectangular frame is a preset length, so that the region framed by the rectangular frame is the tail region of the moving object. Alternatively, the rectangular frame may be a square frame having the same length and width. The specific setting of the rectangular frame may be specifically set according to actual situations, and is not limited herein.
Setting different ROIs for different moving objects, namely the ROIs are related to the moving objects; or, still further, the ROI is related to the size of the moving object. Classification by a dynamic ROI region of the vehicle tail portion is preferable to a static ROI because the density of black smoke in the static ROI region exhibits a diffuse property with time and has a high degree of instability, while the black smoke in the dynamic ROI is changing following the vehicle, the density and diffusion state of black smoke are very stable, and the dynamic ROI is more easily converged.
After setting different ROIs corresponding to different moving objects, the electronic equipment respectively extracts a first image in each frame of image by using the set ROIs and extracts a second image at a corresponding position in the object background image. The first image may be understood as a foreground image and the second image may be understood as a background image.
And S14, detecting whether the moving object is a black smoke vehicle or not according to the first image and the second image.
After the electronic device extracts the first image and the second image of the tail area of the moving object in S13, the electronic device may determine whether the images change by comparing the first image with the second image, and when the images change, may determine that the current moving object in the image frame is a black smoke vehicle; alternatively, a black smoke car or the like may also be detected in a feature extraction manner.
After detecting the black smoke cars in each frame of image, the electronic equipment can mark the black smoke cars in each frame of image, different black smoke cars in the same image frame are marked by different identifiers, and finally the number of the same black smoke car in all the image frames of the video to be detected can be counted to further judge whether the black smoke car is a black smoke car. This step will be described in detail below.
According to the black smoke vehicle detection method provided by the embodiment, the target background image corresponding to the video to be detected is generated by using the background image of each frame of image, so that the integrity of the detected target background image is ensured; meanwhile, the black smoke vehicle detection is carried out on each frame of image on the basis of the complete target background image, the detection process is continuous dynamic detection, and the accuracy of the black smoke vehicle detection can be improved.
In this embodiment, a black smoke vehicle detection method is provided, which may be used in electronic devices such as a camera, a server, and the like, fig. 3 is a flowchart of the black smoke vehicle detection method according to the embodiment of the present invention, and as shown in fig. 3, the flowchart includes the following steps:
and S21, acquiring the video to be detected with the mark information.
And the labeling information is a moving target in each frame of image of the video to be detected.
Please refer to S11 in fig. 1, which is not described herein again.
And S22, generating a background image of each frame of image based on the moving target to obtain a target background image corresponding to the video to be detected.
In this embodiment, the electronic device processes the pixel values of the pixel points in the area where the moving object is located in each frame of image, so as to obtain the background image of each frame of image. Specifically, the step S22 includes the following steps:
s221, setting the pixel value of the position corresponding to the moving object in each frame of image as a preset value, and obtaining the background image of each frame of image.
The electronic device marks a moving object in each frame of image of the to-be-processed video acquired in S21, and may determine the position of the moving object in the image frame by using the coordinates of the mark frame, and after determining the position of the moving object in the image frame, may determine a pixel point corresponding to the moving object in the image frame; then, the electronic device may set the determined pixel values of the pixels to preset values to obtain a background image of each frame of image.
As an optional implementation manner of this embodiment, the step S221 may include the following steps:
(1) and acquiring the position of the moving object in the current image frame.
Please refer to the above description for the position of the moving object in the current image frame.
(2) And sequentially judging whether each pixel point in the current image frame is positioned in the position range of the moving target.
When the pixel point in the current image frame is positioned in the position range of the moving target, executing (3); otherwise, judging the next pixel point, and returning to execute the step (2).
(3) Setting the pixel values of the pixel points in the current image frame as preset values to obtain a mask image of the current image frame.
The pixel values of the pixel points of the electronic equipment in the position range of the moving target are set as preset values, and the pixel values of other pixel points are kept unchanged, so that the mask image of the current image frame can be obtained.
(4) And generating a background image of the current image frame based on the mask image of the current image frame and the current image frame.
The electronic device may remove the mask image from the current image to obtain a background image of the current image frame, wherein the preset value may be 0. Specifically, the background image of the current image frame can be calculated by the following formula:
Figure BDA0002296210960000091
In the formula (I), the compound is shown in the specification,
Figure BDA0002296210960000092
wherein img (i) is the ith image frame (i.e. the current image frame described above) in the video to be detected; n is the number of pixel points in the ith image frame; im (c) i (j) The pixel value of the jth pixel point in the ith image frame is obtained; mark i (j) The pixel value of the jth pixel point in the mask image corresponding to the ith image frame is obtained; object (object) i The motion target is a set of pixel points of the area where the motion target is located in the ith image frame.
As shown in fig. 4, fig. 4 shows an image obtained after setting the pixel value of the pixel point of the moving object selected from the frame in fig. 2 to 1, that is, the mask image corresponding to fig. 2.
And S222, accumulating the background images of each frame of image on a time axis to generate a background image corresponding to the video to be detected.
After the background image of each frame of image is obtained, all the background images are accumulated on a time axis, and then a complete background image corresponding to the video to be detected can be generated.
A specific calculation formula is as follows,
Figure BDA0002296210960000093
wherein m is a preset number of image frames required for generating a background image, and BK _ Img is a background image corresponding to a video to be detected.
As shown in fig. 5, fig. 5 shows a complete background image obtained by superimposing on the time axis based on the background image of fig. 4.
S23, a first image of the tail region of the moving object in each frame image and a second image corresponding to the tail region in the object background image are extracted.
Please refer to S13 in fig. 1, which is not repeated herein.
And S24, detecting whether the moving object is a black smoke vehicle or not according to the first image and the second image.
Please refer to S14 in fig. 1, which is not described herein again.
In this embodiment, a black smoke vehicle detection method is provided, which may be used in electronic devices such as a camera, a server, and the like, fig. 6 is a flowchart of the black smoke vehicle detection method according to the embodiment of the present invention, and as shown in fig. 6, the flowchart includes the following steps:
and S31, acquiring the video to be detected with the mark information.
And the marking information is a moving target in each frame of image of the video to be detected.
Please refer to S21 in fig. 3 for details, which are not described herein.
And S32, generating a background image of each frame of image based on the moving target to obtain a target background image corresponding to the video to be detected.
Please refer to S22 in fig. 3 for details, which are not described herein.
S33, a first image of the tail region of the moving object in each frame image and a second image of the object background image corresponding to the tail region are extracted.
Please refer to S23 in fig. 3, which is not repeated herein.
And S34, detecting whether the moving object is a black smoke vehicle or not according to the first image and the second image.
The electronic device obtains image information of the first image excluding the background by using the difference between the first image and the second image extracted in S33. Specifically, the above S34 includes the following steps:
and S341, calculating the black smoke characteristic image of the moving object in each frame of image by using the pixel value of each pixel point in the second image and the pixel value of the corresponding pixel point in the first image.
The electronic device may calculate a difference between a pixel value of each pixel in the second image and a pixel value of a corresponding pixel in the first image, may also calculate a difference between a pixel value of each pixel in the first image and a pixel value of a corresponding pixel in the second image, and so on, as long as it is ensured that the background image (i.e., the second image) can be removed from the first image.
As shown in fig. 7, the foreground image and the background image of the area corresponding to the tail of the vehicle are subtracted to obtain a black smoke feature image of the vehicle. The region selected by the frame in fig. 7 is the region corresponding to the tail of the vehicle, the left side of fig. 7 is the feature image of the black smoke vehicle, and the right side of fig. 7 is the feature image of the non-black smoke vehicle.
The calculation of the black smoke characteristic image of the moving object in each frame of image can be represented by the following formula:
Figure BDA0002296210960000111
in the formula, the ROI is a vehicle tail region, and K is a pixel point in the second image and a corresponding pixel point in the first image.
As can be seen from fig. 7, there is an obvious difference between the black smoke vehicle feature image and the non-black smoke vehicle feature image, and the difference can be distinguished by using a certain feature classifier, so as to obtain two classification models of the black smoke vehicle and the non-black smoke vehicle.
Through the mode of making the difference with second image and first image for each frame black cigarette characteristic image that obtains has all filtered the static information in the picture, has kept whole dynamic information, and wherein, black cigarette is exactly a highly dynamic information, and other noise interference on the road surface are mostly static information, and the mode of obtaining black cigarette characteristic image can improve the accuracy of follow-up detection.
And S342, performing feature extraction on the black smoke feature image to detect whether the moving object in each frame of image is a black smoke vehicle.
The electronic device may perform feature extraction on the black smoke feature image obtained in S341, where the extracted features may be a color of the discharged gas, a volume of the discharged gas, and the like. Since the black smoke features are obviously variable, because the positions, the concentrations and the diffusion speeds of the black smoke appear in close relation to the distance of the vehicle, the shadow of the tail of the vehicle, the vehicle speed and the aging degree of the vehicle, although the characteristic images of the black smoke vehicle and the non-black smoke vehicle have obvious differences, the difference shadow is difficult to distinguish by a simple formula or a model.
Therefore, in this embodiment, the black smoke feature image is classified by using a classification model obtained by training based on a convolutional neural network model, so as to detect whether a moving target corresponding to the black smoke feature image is a black smoke vehicle. Specifically, inputting a black smoke feature image into a classification model, wherein the output of the classification model is the probability that the moving target corresponding to the black smoke feature image is a black smoke vehicle and the probability of a non-black smoke vehicle; or setting confidence in the model and directly outputting whether the model is a black smoke vehicle or a non-black smoke vehicle. Specifically, a 5-layer convolutional neural network model is constructed by adopting a deep learning method to classify and distinguish black smoke vehicles and non-black smoke vehicles, and the input of the classification model during training is a black smoke characteristic image.
Of course, the scope of the present invention is not limited to the classification model, and other methods may be used to monitor whether the moving object in each frame of image is a black smoke vehicle, and the specific detection method and the specific structural details of the classification model are not limited at all, and only needs to be ensured to detect whether the moving object is a black smoke vehicle.
And S343, determining whether the moving target in the video to be detected is a black smoke vehicle or not based on the detection result of the moving target in each frame of image.
After detecting the black smoke car in each frame of image in S342, the electronic device may perform the determination of the black smoke car based on all the image frames in the video to be detected. Specifically, the S343 may include the following steps:
(1) counting the number of image frames of the black smoke car detected in the video to be detected.
As described above, the electronic device may mark the black smoke vehicle detected in each frame of image, and different black smoke vehicles adopt different identifiers, so that by counting the number of times that the same identifier appears, it is possible to obtain how many image frames the black smoke vehicle corresponding to the identifier is detected in total.
(2) And judging whether the number of the detected image frames of the black smoke vehicle is larger than a preset value.
And the electronic equipment compares the occurrence frequency of the same identification with a preset value and judges whether the occurrence frequency is greater than the preset value. When the number of the image frames of the black smoke vehicle is detected to be larger than the preset value, executing (3); otherwise, determining that the moving target in the video to be detected is not the black smoke vehicle.
The preset value may be set according to an empirical value, or may be set according to the number of image frames in the video to be detected, or may be set according to a motion parameter of a moving object, or according to an environmental parameter, or may be set in any combination of the above manners, and the setting of the preset value is not limited at all.
Alternatively, the preset value may be determined using a motion parameter of the moving object. Specifically, the motion parameters of the moving object, such as vehicle speed, acceleration or steering information, may be obtained first; the preset value is then determined based on the motion parameters. For example, the greater the vehicle speed, the greater the preset value; the smaller the vehicle speed, the smaller the preset value.
The preset value is determined based on the motion parameters of the moving target, so that the problem of inaccurate detection results caused by external factors can be avoided.
(3) And determining that the moving target in the video to be detected is a black smoke vehicle.
The black smoke vehicle detection method provided by the embodiment of the invention belongs to dynamic area detection, whether the vehicle has black smoke in each frame from the appearance of the vehicle to the disappearance of the vehicle can be obtained, and the inferred black smoke information has both state information and time information; the method can simultaneously detect a plurality of black smoke vehicles and the current position of each black smoke vehicle, and has higher accuracy.
According to the black smoke vehicle detection method provided by the embodiment, the black smoke vehicle is detected in each frame, and then the black smoke vehicle is detected by combining all image frames in the video to be detected, so that the detection accuracy can be improved.
In this embodiment, a black smoke vehicle detection device is further provided, and the device is used to implement the above embodiments and preferred embodiments, and the description of the device is omitted. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
The present embodiment provides a black smoke vehicle detection device, as shown in fig. 8, including:
the acquiring module 41 is configured to acquire a to-be-detected video with label information; and the marking information is a moving target in each frame of image of the video to be detected.
And a background image generation module 42, configured to generate a background image of each frame of image based on the moving object, so as to obtain a target background image corresponding to the video to be detected.
An image extracting module 43, configured to extract a first image of a tail region of the moving object in each frame of image, and a second image of the object background image corresponding to the tail region.
And a black smoke vehicle detection module 44, configured to detect whether the moving target is a black smoke vehicle according to the first image and the second image.
The soot vehicle detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory executing one or more software or fixed programs, and/or other devices that can provide the above-described functions.
Further functional descriptions of the modules are the same as those of the corresponding embodiments, and are not repeated herein.
The embodiment of the invention also provides electronic equipment which is provided with the black smoke vehicle detection device shown in the figure 8.
Referring to fig. 9, fig. 9 is a schematic structural diagram of an electronic device according to an alternative embodiment of the present invention, and as shown in fig. 9, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, memory 54, at least one communication bus 52. Wherein the communication bus 52 is used to enable connection communication between these components. The communication interface 53 may include a Display (Display) and a Keyboard (Keyboard), and the optional communication interface 53 may also include a standard wired interface and a standard wireless interface. The Memory 54 may be a high-speed RAM Memory (volatile Random Access Memory) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The memory 54 may alternatively be at least one memory device located remotely from the processor 51. Wherein the processor 51 may be in connection with the apparatus described in fig. 8, the memory 54 stores an application program, and the processor 51 calls the program code stored in the memory 54 for performing any of the above-mentioned method steps.
The communication bus 52 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 52 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 9, but this does not indicate only one bus or one type of bus.
The memory 54 may include a volatile memory (RAM), such as a random-access memory (RAM); the memory may also include a non-volatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (english: hard disk drive, abbreviated: HDD) or a solid-state drive (english: SSD); the memory 54 may also comprise a combination of the above types of memories.
The processor 51 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor 51 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
Optionally, the memory 54 is also used to store program instructions. The processor 51 may call program instructions to implement the black smoke vehicle detection method as shown in the embodiments of fig. 1-7 of the present application.
The embodiment of the invention also provides a non-transitory computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the black smoke vehicle detection method in any method embodiment. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations fall within the scope defined by the appended claims.

Claims (10)

1. A black smoke vehicle detection method is characterized by comprising the following steps:
Acquiring a video to be detected with label information; the marking information is a moving target in each frame of image of the video to be detected;
generating a background image of each frame of image based on the moving target to obtain a target background image corresponding to the video to be detected;
extracting a first image of a tail area of the moving object in each frame of image and a second image corresponding to the tail area in the object background image;
detecting whether the moving target is a black smoke vehicle according to the first image and the second image;
wherein, whether the motion target is a black smoke vehicle according to the first image and the second image comprises:
calculating a black smoke characteristic image of the moving object in each frame of image by using the pixel value of each pixel point in the second image and the pixel value of the corresponding pixel point in the first image, wherein the black smoke characteristic image is obtained by removing the second image from the first image;
extracting the characteristics of the black smoke characteristic image to detect whether the moving target in each frame of image is the black smoke vehicle;
And determining whether the moving target in the video to be detected is the black smoke vehicle or not based on the detection result of the moving target in each frame of image.
2. The method according to claim 1, wherein the generating a background image of each frame of image based on the moving object to obtain a background image corresponding to the video to be detected comprises:
setting the pixel value of the position corresponding to the moving target in each frame of image as a preset value to obtain a background image of each frame of image;
and accumulating the background images of each frame of image on a time axis to generate a background image corresponding to the video to be detected.
3. The method according to claim 2, wherein the setting the pixel value of the position corresponding to the moving object in each frame of image to a preset value to obtain the background image of each frame of image comprises:
acquiring the position of the moving target in the current image frame;
sequentially judging whether each pixel point in the current image frame is positioned in the position range of the moving target;
when the pixel points in the current image frame are located in the position range of the moving target, setting the pixel values of the pixel points in the current image frame as preset values to obtain a mask image of the current image frame;
Generating a background image of the current image frame based on the mask image of the current image frame and the current image frame.
4. The method of claim 3, wherein the background image of the current image frame is calculated using the following formula:
Figure FDA0003676741890000021
in the formula (I), the compound is shown in the specification,
Figure FDA0003676741890000022
wherein Im g (i) is the ith image frame in the video to be detected; n is the number of pixel points in the ith image frame; im is i (j) The pixel value of the jth pixel point in the ith image frame is obtained; mark i (j) In the mask image corresponding to the ith image frameThe pixel value of the jth pixel point; object (object) i The motion target is a set of pixel points of the area where the motion target is located in the ith image frame.
5. The method according to claim 1, wherein the performing feature extraction on the black smoke feature image to detect whether the moving object in each frame image is the black smoke vehicle comprises:
inputting the black smoke characteristic image into a classification model to detect whether the moving target corresponding to the black smoke characteristic image is a black smoke vehicle; the classification model is obtained based on convolutional neural network model training.
6. The method according to claim 4, wherein the determining whether the moving object in the video to be detected is the black smoke vehicle based on the detection result of the moving object in each frame of image comprises:
Counting the number of image frames of the black smoke vehicle detected in the video to be detected;
judging whether the number of the image frames of the black smoke vehicle is larger than a preset value or not;
and when the number of the image frames of the black smoke vehicle is detected to be larger than the preset value, determining that the moving target in the video to be detected is the black smoke vehicle.
7. The method of claim 6, wherein before the step of determining whether the number of image frames of the black smoke vehicle is greater than a predetermined value, the method further comprises:
acquiring the motion parameters of the moving target; wherein the motion parameter comprises a vehicle speed of the moving object;
determining the preset value based on the motion parameter.
8. The utility model provides a black cigarette car detection device which characterized in that includes:
the acquisition module is used for acquiring the video to be detected with the labeled information; the marking information is a moving target in each frame of image of the video to be detected;
the background image generation module is used for generating a background image of each frame of image based on the moving target so as to obtain a target background image corresponding to the video to be detected;
the image extraction module is used for extracting a first image of a tail area of the moving target in each frame of image and a second image corresponding to the tail area in the target background image;
The black smoke vehicle detection module is used for detecting whether the moving target is a black smoke vehicle according to the first image and the second image;
wherein, whether the motion target is a black smoke vehicle according to the first image and the second image comprises:
calculating the black smoke characteristic image of the moving target in each frame of image by using the pixel value of each pixel point in the second image and the pixel value of the corresponding pixel point in the first image;
extracting the characteristics of the black smoke characteristic image to detect whether the moving target in each frame of image is the black smoke vehicle;
and determining whether the moving target in the video to be detected is the black smoke vehicle or not based on the detection result of the moving target in each frame of image.
9. An electronic device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the black smoke detection method of any one of claims 1 to 7.
10. A computer-readable storage medium storing computer instructions for causing a computer to perform the black smoke vehicle detection method of any one of claims 1 to 7.
CN201911202492.1A 2019-11-29 2019-11-29 Black smoke vehicle detection method and device and electronic equipment Active CN111126165B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201911202492.1A CN111126165B (en) 2019-11-29 2019-11-29 Black smoke vehicle detection method and device and electronic equipment
PCT/CN2020/121517 WO2021103837A1 (en) 2019-11-29 2020-10-16 Smoke-emitting vehicle detection method and device, and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911202492.1A CN111126165B (en) 2019-11-29 2019-11-29 Black smoke vehicle detection method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111126165A CN111126165A (en) 2020-05-08
CN111126165B true CN111126165B (en) 2022-07-29

Family

ID=70497222

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911202492.1A Active CN111126165B (en) 2019-11-29 2019-11-29 Black smoke vehicle detection method and device and electronic equipment

Country Status (2)

Country Link
CN (1) CN111126165B (en)
WO (1) WO2021103837A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111126165B (en) * 2019-11-29 2022-07-29 苏州科达科技股份有限公司 Black smoke vehicle detection method and device and electronic equipment
CN113111737A (en) * 2021-03-26 2021-07-13 杭州鸿泉物联网技术股份有限公司 Black smoke blackness detection method and device based on deep learning
CN113378629A (en) * 2021-04-27 2021-09-10 阿里云计算有限公司 Method and device for detecting abnormal vehicle in smoke discharge
CN113435260A (en) * 2021-06-07 2021-09-24 上海商汤智能科技有限公司 Image detection method, related training method, related device, equipment and medium
CN113487544A (en) * 2021-06-22 2021-10-08 杭州鸿泉物联网技术股份有限公司 Vehicle black smoke detection method and device, electronic equipment and storage medium
CN113435393B (en) * 2021-07-12 2023-05-09 北京林业大学 Forest fire smoke root node detection method, device and equipment
CN113657305B (en) * 2021-08-20 2023-08-04 深圳技术大学 Video-based intelligent detection method for black smoke vehicle and ringeman blackness level
CN115984780B (en) * 2023-02-23 2023-06-02 合肥英特灵达信息技术有限公司 Industrial solid waste warehouse-in and warehouse-out judging method and device, electronic equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329815A (en) * 2008-07-07 2008-12-24 山东省计算中心 Novel system and method for detecting four-phase vehicle flow of a traffic road junction
CN103093192A (en) * 2012-12-28 2013-05-08 昆山市工业技术研究院有限责任公司 High voltage transmission line galloping identification method
CN106951821A (en) * 2016-12-27 2017-07-14 湘潭大学 A kind of black smoke car intelligent monitoring recognition methods based on image processing techniques

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2428472A (en) * 2005-07-18 2007-01-31 Sony Uk Ltd Smoke detection by processing video images
CN101751558B (en) * 2009-12-16 2011-12-14 北京智安邦科技有限公司 Tunnel smog detection method based on video and device thereof
TWI595450B (en) * 2014-04-01 2017-08-11 能晶科技股份有限公司 Object detection system
CN108416316B (en) * 2018-03-19 2022-04-05 中南大学 Detection method and system for black smoke vehicle
CN109993778A (en) * 2019-04-11 2019-07-09 浙江立元通信技术股份有限公司 A kind of method and device of determining target position
CN111126165B (en) * 2019-11-29 2022-07-29 苏州科达科技股份有限公司 Black smoke vehicle detection method and device and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101329815A (en) * 2008-07-07 2008-12-24 山东省计算中心 Novel system and method for detecting four-phase vehicle flow of a traffic road junction
CN103093192A (en) * 2012-12-28 2013-05-08 昆山市工业技术研究院有限责任公司 High voltage transmission line galloping identification method
CN106951821A (en) * 2016-12-27 2017-07-14 湘潭大学 A kind of black smoke car intelligent monitoring recognition methods based on image processing techniques

Also Published As

Publication number Publication date
WO2021103837A1 (en) 2021-06-03
CN111126165A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN111126165B (en) Black smoke vehicle detection method and device and electronic equipment
CN109636771B (en) Flight target detection method and system based on image processing
CN112800860B (en) High-speed object scattering detection method and system with coordination of event camera and visual camera
CN110555347B (en) Vehicle target identification method and device with dangerous cargo-carrying behavior and electronic equipment
CN105915840B (en) A method of the factory smoke discharge based on vision signal monitors automatically
CN110458126B (en) Pantograph state monitoring method and device
CN112528861B (en) Foreign matter detection method and device applied to ballast bed in railway tunnel
CN111223129A (en) Detection method, detection device, monitoring equipment and computer readable storage medium
CN113792586A (en) Vehicle accident detection method and device and electronic equipment
CN111783524A (en) Scene change detection method and device, storage medium and terminal equipment
CN115171218A (en) Material sample feeding abnormal behavior recognition system based on image recognition technology
CN111461076A (en) Smoke detection method and smoke detection system combining frame difference method and neural network
CN113065454B (en) High-altitude parabolic target identification and comparison method and device
CN112766046B (en) Target detection method and related device
CN112784642B (en) Vehicle detection method and device
CN117173647A (en) Insulator abnormality detection method and device, electronic equipment and storage medium
CN112001336A (en) Pedestrian boundary crossing alarm method, device, equipment and system
WO2023071874A1 (en) Roadside assistance working node determining method and apparatus, electronic device, and storage medium
CN115272284A (en) Power transmission line defect identification method based on image quality evaluation
CN114943954A (en) Parking space detection method, device and system
CN111027560B (en) Text detection method and related device
CN113963233A (en) Target detection method and system based on double-stage convolutional neural network
CN114677343A (en) Highway object throwing detection method based on double backgrounds
Ye et al. A blurry image recognition method for straw burning detection
JP2001283374A (en) Traffic flow measuring system

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
GR01 Patent grant
GR01 Patent grant