Black smoke pollution ship automatic identification method and system
Through the SLIC algorithm and the calculation of differential image feature values, the problem of dark clouds being misjudged as black smoke is solved, and high accuracy recognition of black smoke areas is achieved.
Patent Information
- Application Number
- CN202510721044.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-07-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, in the detection of the black smoke concentration of ships, the dark cloud area is easily misjudged as a black smoke area, resulting in low accuracy of the detection results.
The color image is segmented using the SLIC algorithm, and the characteristic values of the homogeneity and differential images of the superpixel region are calculated. The black smoke region is obtained through clustering, and the multi-dimensional characteristic values are used to distinguish dark clouds and black smoke.
It improves the accuracy of identification of black smoke areas, avoids misjudgment of dark cloud areas, and enhances the accuracy of black smoke concentration detection.
Smart Images

Figure CN120339973A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of black smoke recognition, and particularly to an automatic recognition method and system for ships polluted by black smoke. Background Art
[0002] Ship engines are mainly diesel engines, and the fuels used are light diesel oil, heavy diesel oil, shale oil, and fuel oil. Compared with the exhaust gases of other motor vehicles, the concentrations of sulfur dioxide, nitrogen oxides, and particulate matter in the exhaust gases discharged by ships are relatively high, which pose great harm to the human body and the environment. With the development of the concepts of traffic environmental protection and ecological energy conservation, higher requirements have been put forward for the exhaust gas emission standards of inland river port and shipping vessels in the traffic field. Therefore, it is necessary to monitor the black smoke concentration of ships to determine whether the black smoke concentration discharged by ships exceeds the standard.
[0003] The Chinese patent application document with the publication number CN116363117A discloses a distributed monitoring system for black smoke of inland river channel ships based on deep learning, including: a laser judgment module, an image acquisition module, and a ship black smoke detection module; the laser judgment module is used to judge whether a ship passes through by a distributed laser array; the image acquisition module is used to capture the ship in real time when the ship passes through; the ship black smoke detection module is used to judge whether the black smoke of the ship exceeds the standard through the ship photos captured in real time; the laser judgment module, the image acquisition module, and the ship black smoke detection module are connected in sequence.
[0004] In the existing ship black smoke monitoring process, it is necessary to identify the black smoke area in the collected image and then detect the concentration of the black smoke area. However, in the process of identifying the black smoke area, based on the fact that the ship's driving area is a port or a sea area, the background area of the ship image obtained contains a large amount of sky area, and the dark clouds in the sky area have similar characteristics to black smoke, so the dark cloud area is misidentified as the black smoke area, thus reducing the accuracy of the black smoke concentration detection result. Summary of the Invention
[0005] In order to solve the problem of low accuracy of the black smoke concentration detection result caused by misjudging the dark cloud area as the black smoke area, the present invention provides an automatic recognition method and system for ships polluted by black smoke.
[0006] In a first aspect, the present invention provides an automatic recognition method for ships polluted by black smoke, adopting the following technical solution: Obtain multiple frames of color images and corresponding grayscale images of the ship; Use the SLIC algorithm to segment each frame of color image to obtain multiple first superpixel regions, take the region corresponding to the first superpixel region in the grayscale image as the second superpixel region, and calculate the homogeneity of the second superpixel region; The grayscale images of adjacent frames are differenced to obtain a difference image, and then the third superpixel region of the difference image is obtained; the eigenvalue of the third superpixel region is calculated, and the eigenvalue is positively correlated with the grayscale values of the pixel points in the third superpixel region. Calculate the black smoke eigenvalue and the comprehensive eigenvalue of each second superpixel region in the grayscale image of the current frame. The comprehensive eigenvalue is positively correlated with the black smoke eigenvalue; cluster the comprehensive eigenvalues of the second superpixels to obtain multiple clustering clusters, and use the clustering cluster region with the largest average value of the comprehensive eigenvalue as the black smoke region.
[0007] By calculating the black smoke eigenvalue and the comprehensive eigenvalue and clustering the comprehensive eigenvalue to obtain the black smoke region, it is possible to distinguish the dark clouds from the black smoke in the background region, avoid misjudging the dark cloud region as the black smoke region, and improve the accuracy of identifying the black smoke region.
[0008] Preferably, the expression of the eigenvalue of the third superpixel region is:
[0009]
[0010] In the formula, represents the grayscale value of the x-th pixel point in the q-th third superpixel region of the p-th difference image, represents the normalized value of the grayscale value of the x-th pixel point in the q-th third superpixel region of the p-th difference image, represents the total number of pixel points in the q-th third superpixel region of the p-th difference image, represents the eigenvalue of the q-th third superpixel region of the p-th difference image.
[0011] The eigenvalue can comprehensively reflect the dynamic change situation of the pixel points in the second superpixel region of the adjacent frame grayscale images, providing a theoretical basis for identifying the black smoke region.
[0012] Preferably, the expression of the comprehensive eigenvalue is:
[0013] In the formula, represents the comprehensive eigenvalue of the m-th second superpixel region in the grayscale image, represents the black smoke eigenvalue of the m-th second superpixel region in the grayscale image, represents the grayscale average value of the m-th second superpixel region in the grayscale image, and exp represents the exponential function with e as the base.
[0014] Preferably, the expression of the comprehensive eigenvalue is:
[0015] In the formula, represents the comprehensive eigenvalue of the m-th second superpixel region in the grayscale image, represents the black smoke eigenvalue of the m-th second superpixel region in the grayscale image, represents the grayscale mean value of the m-th second superpixel region in the grayscale image, and norm represents the normalization function.
[0016] By calculating the comprehensive eigenvalue through multiple dimensions, the accuracy of the calculation result of the comprehensive eigenvalue is improved, enabling the comprehensive eigenvalue to overall reflect whether the corresponding second superpixel region is a black smoke region.
[0017] Preferably, the method for obtaining the third superpixel region of the difference image is as follows: Denote the two grayscale images for differencing as the first grayscale image and the second grayscale image. Take any second superpixel region in the first grayscale image as the target region, calculate the Euclidean distance between the center points of each second superpixel region in the second grayscale image and the center point of the target region, take the second superpixel region in the second grayscale image closest to the target region as the matching region, and merge the target region and the matching region and map them to the difference image to obtain the third superpixel region.
[0018] The difference image can reflect the dynamic change situation of the same superpixel region in the time series, facilitating the judgment of whether the corresponding region is a black smoke region.
[0019] Preferably, before using the SLIC algorithm to segment each frame of the color image, it also includes the step of performing Gaussian filtering on the color image.
[0020] By performing Gaussian filtering on the color image, the noise interference in the color image is reduced, and the accuracy of segmenting the color image is improved.
[0021] Preferably, the k-means algorithm is used to cluster the comprehensive eigenvalues of the second superpixels to obtain multiple clustering clusters.
[0022] Preferably, the method for obtaining multiple frames of color images of the ship is as follows: Obtain the video during the ship's navigation, extract the ship images at equal time intervals, and perform color space conversion on the ship images to obtain color images.
[0023] Preferably, the color image is a CIELAB color space image.
[0024] Preferably, the expression of the black smoke eigenvalue is:
[0025] In the formula, is the black smoke eigenvalue of the i-th second superpixel region in the n-th grayscale image, is the eigenvalue of the i-th third superpixel region in the n-th difference image, , They are the eigenvalues of the i-th third superpixel region of the j-th and (j - 1)-th differential images respectively. is the homogeneity of the i-th second superpixel region in the n-th grayscale image. exp represents the exponential function with base e, and μ represents the mean of the eigenvalue differences of the i-th superpixel region in multiple differential images.
[0026] In a second aspect, the present invention provides an automatic identification system for ships with black smoke pollution, adopting the following technical solution: An automatic identification system for ships with black smoke pollution includes: a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, an automatic identification method for ships with black smoke pollution as described above is implemented.
[0027] The beneficial effect is: generating a computer program of the above-mentioned automatic identification method for ships with black smoke pollution and storing it in the memory to be loaded and executed by the processor. Thus, making a system according to the memory and the processor is convenient for use.
[0028] The present invention has the following technical effects: By calculating the comprehensive eigenvalue in multiple dimensions, the accuracy of the calculation result of the comprehensive eigenvalue is improved. Clustering the comprehensive eigenvalue to obtain the black smoke area can distinguish the dark clouds from the black smoke in the background area, avoiding misjudging the dark cloud area as the black smoke area and improving the accuracy of identifying the black smoke area. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 is a flowchart of an automatic identification method for ships with black smoke pollution according to the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0030] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0031] An embodiment of the present invention discloses an automatic identification method for ships with black smoke pollution. Referring to Figure 1 , the method includes the following steps: S1: Obtain multiple frames of color images and corresponding grayscale images of the ship.
[0032] Use a camera device to collect videos of ships in a specified water area, obtain the driving videos of ships in the current time period, extract ship images from the videos at equal time intervals. The ship images are YUV format images. Convert the color space of the ship images to obtain color images, which are images in the CIELAB color space, and convert the color images to grayscale images. Thus, it can be seen that the color images and the grayscale Figure 1 correspond one by one. Exemplarily, obtain the driving video of the ship in the current one-minute time period, and extract one frame of color image every 1 second.
[0033] S2: Use the SLIC algorithm to segment each frame of color image to obtain multiple first superpixel regions. Take the regions in the grayscale image corresponding to the first superpixel regions as the second superpixel regions, and calculate the homogeneity of the second superpixel regions.
[0034] Perform Gaussian filtering on the obtained color images to remove the noise in the images. Then, use the SLIC algorithm to segment each frame of color image to obtain multiple first superpixel regions. In the corresponding grayscale image, take the regions corresponding to the first superpixel regions as the second pixel regions. Thus, it can be seen that in the color image and the corresponding grayscale image, the first superpixel regions and the second superpixel regions correspond one by one.
[0035] Obtain the gray-level co-occurrence matrix of the second pixel region, and use the homogeneity calculation formula of the gray-level co-occurrence matrix to calculate the homogeneity of the second superpixel region. Homogeneity reflects the similarity of gray values between pixel pairs in the superpixel region. The calculation method of homogeneity is a prior art, and the specific steps are not elaborated here.
[0036] The dark cloud region usually has relatively smooth texture features. Although the pixel gray values in the dark cloud region will have certain fluctuations but are relatively gentle, and the texture of the dark cloud region is relatively uniform, and the difference between gray values is relatively small; while the texture of the black smoke region is relatively complex, and there are strong local gray changes. The fine particles and uneven density in the black smoke result in a large difference in gray values in the black smoke region, and its texture structure is relatively complex and irregular. Therefore, it can be preliminarily judged whether it is a black smoke region through homogeneity.
[0037] In summary, the texture of the black smoke region is more complex and has a greater difference than that of the dark cloud region, and the homogeneity of the black smoke region is lower than that of the dark cloud region.
[0038] S3: Take the difference between adjacent frames of grayscale images to obtain a difference image, and then obtain the third superpixel region of the difference image.
[0039] Calculate the difference in grayscale values of corresponding pixel points in adjacent frames of grayscale images to further obtain a difference image. It should be noted that during the differentiation process, if the difference in grayscale values is negative, the absolute value of the difference in grayscale values is taken. Exemplarily, for the first frame of grayscale image and the second frame of grayscale image, the pixel points in the first frame of grayscale image and the second frame of grayscale image correspond one by one. Subtract the grayscale value of the pixel point in the first frame of grayscale image from the grayscale value of the pixel point in the second frame of grayscale image to obtain the difference, thereby obtaining the difference image , obtain a difference image for the nth frame of grayscale image and the (n - 1)th frame of grayscale image , it should be noted that the first frame of grayscale image is used as the first difference image in the difference images, that is .
[0040] The difference image can reflect the dynamic changes of the same superpixel region in the time series.
[0041] Ship black smoke has the characteristics of rapid diffusion and constantly changing morphology, while dark clouds have the characteristics of relative stillness or slow movement. Therefore, by introducing dynamic change features, black smoke and dark clouds can be effectively distinguished.
[0042] The method for obtaining the third superpixel region of the difference image is as follows: Denote the two frames of grayscale images for differentiation as the first grayscale image and the second grayscale image. Take any second superpixel region in the first grayscale image as the target region. Calculate the Euclidean distance between the center points of each second superpixel region in the second grayscale image and the center point of the target region. Take the second superpixel region in the second grayscale image that is closest to the target region as the matching region. Merge the target region and the matching region and map them to the difference image to obtain the third superpixel region. It can also be understood that the third superpixel region is the union of the target region and the matching region. From this, it can be seen that the first superpixel region in the mth frame of color image, the second superpixel region in the mth frame of grayscale image, and the third superpixel region in the mth frame of difference image correspond to each other.
[0043] S4: Calculate the eigenvalue of the third superpixel region. The eigenvalue is positively correlated with the grayscale values of the pixel points in the third superpixel region.
[0044] The expression for the eigenvalue of the third superpixel region is:
[0045]
[0046] In the formula, represents the grayscale value of the xth pixel point in the qth third superpixel region of the pth difference image, represents the normalized value of the grayscale value of the xth pixel point in the qth third superpixel region of the pth difference image, represents the total number of pixel points in the q-th third superpixel region in the p-th difference image. represents the eigenvalue of the q-th third superpixel region in the p-th difference image.
[0047] Among them, reflects the degree of change of pixel points in adjacent frame grayscale images. The larger its value, the greater the change of the corresponding pixel points; comprehensively reflects the dynamic change of pixel points in the q-th second superpixel region from the p-th grayscale image to the p - 1-th grayscale image. The larger its value, the greater the degree of change of the corresponding second superpixel region between adjacent two grayscale images, and the greater the possibility that the corresponding superpixel region is a black smoke region.
[0048] S5: Calculate the black smoke eigenvalue and the comprehensive eigenvalue of each second superpixel region in the current frame grayscale image. The comprehensive eigenvalue is positively correlated with the black smoke eigenvalue.
[0049] Among them, the expression of the black smoke eigenvalue is:
[0050] In the formula, is the black smoke eigenvalue of the i-th second superpixel region in the n-th grayscale image, is the eigenvalue of the i-th third superpixel region in the n-th difference image, , are the eigenvalues of the i-th third superpixel region in the j-th and j - 1-th difference images respectively, is the homogeneity of the i-th second superpixel region in the n-th grayscale image. exp represents the exponential function with base e, and µ represents the mean value of the differences of the eigenvalues of the i-th superpixel region in multiple difference images.
[0051] is the variance of the differences of the eigenvalues of the i-th superpixel region in the obtained multiple difference images. The larger the variance value, the greater the degree of fluctuation of the i-th superpixel region in the current time period, and the more likely it is caused by the spread of the black smoke region to the i-th superpixel region.
[0052] The larger the value of, the more it indicates the spread of black smoke in the i-th superpixel region, and the greater the possibility that the i-th superpixel region belongs to the black smoke region.
[0053] The larger the value of, the greater the similarity of the grayscale values between pixel pairs in the i-th superpixel region, that is, the greater the uniformity of the grayscale values of pixel points in the i-th second superpixel region, and the smaller the possibility of belonging to the black smoke region; conversely, The smaller the value is, the smaller the degree of gray value uniformity of the pixel points in the $i$-th second superpixel region is, which conforms to the characteristics of non-uniform diffusion of black smoke, and the greater the possibility of belonging to the black smoke region is.
[0054] In summary, the larger the black smoke feature value is, the greater the possibility that the corresponding second superpixel region is a black smoke region. On the contrary, the smaller the black smoke feature value is, the smaller the possibility that the corresponding second superpixel region is a black smoke region.
[0055] In one embodiment, the expression of the comprehensive feature value is:
[0056] In the formula, represents the comprehensive feature value of the $m$-th second superpixel region in the grayscale image, represents the black smoke feature value of the $m$-th second superpixel region in the grayscale image, represents the average gray value of the $m$-th second superpixel region in the grayscale image.
[0057] In one embodiment, the expression of the comprehensive feature value is:
[0058] In the formula, represents the comprehensive feature value of the $m$-th second superpixel region in the grayscale image, represents the black smoke feature value of the $m$-th second superpixel region in the grayscale image, represents the average gray value of the $m$-th second superpixel region in the grayscale image, and norm represents the min-max normalization function.
[0059] The black smoke feature value reflects whether the second superpixel region conforms to the characteristics of non-uniform diffusion of the black smoke region. And the gray value of the black smoke is relatively smaller than that of the dark cloud. Therefore, the comprehensive feature value can overall reflect whether the corresponding second superpixel region is a black smoke region. Specifically, the larger the comprehensive feature value is, the greater the possibility that the corresponding second superpixel region is a black smoke region. On the contrary, the smaller the comprehensive feature value is, the smaller the possibility that the corresponding second superpixel region is a black smoke region.
[0060] S6: Cluster the comprehensive feature values of the second superpixels to obtain multiple clustering clusters, and take the clustering cluster region with the largest average value of the comprehensive feature values as the black smoke region.
[0061] Use the mean shift algorithm to cluster the comprehensive feature values of the second superpixels to obtain multiple clustering clusters. Each clustering cluster includes one or more second superpixel regions. Calculate the average value of the comprehensive feature values of the second superpixel regions within each clustering cluster, and take the second superpixel regions within the clustering cluster with the largest average value as the black smoke region to complete the identification of the black smoke region.
[0062] An embodiment of the present invention also discloses an automatic identification system for ships with black smoke pollution, which includes a processor and a memory. The memory stores computer program instructions, and when the computer program instructions are executed by the processor, an automatic identification method for ships with black smoke pollution according to the present invention is implemented.
[0063] The above system also includes other components well-known to those skilled in the art, such as a communication bus and a communication interface. Their settings and functions are known in the art, so they will not be elaborated here.
Claims
1. An automatic identification method for ships polluted by black smoke, characterized in that, Including the steps of: Obtaining multiple frames of color images and corresponding grayscale images of a ship; using the SLIC algorithm to segment each frame of color image to obtain multiple first superpixel regions, taking the region corresponding to the first superpixel region in the grayscale image as the second superpixel region, and calculating the homogeneity of the second superpixel region; Performing difference on adjacent frames of grayscale images to obtain a difference image, and further obtaining the third superpixel region of the difference image; calculating the eigenvalue of the third superpixel region, where the eigenvalue is positively correlated with the grayscale value of the pixel points in the third superpixel region; calculating the black smoke eigenvalue and the comprehensive eigenvalue of each second superpixel region in the current frame grayscale image, where the comprehensive eigenvalue is positively correlated with the black smoke eigenvalue; Clustering the comprehensive eigenvalues of the second superpixels to obtain multiple clustering clusters, and taking the clustering cluster region with the largest average value of the comprehensive eigenvalues as the black smoke region.
2. The automatic identification method for a black smoke polluting ship according to claim 1, characterized in that The expression of the eigenvalue of the third superpixel region is: Wherein, represents the gray value of the x-th pixel point in the q-th third superpixel region of the p-th difference image, represents the normalized value of the gray value of the x-th pixel point in the q-th third superpixel region of the p-th difference image, represents the total number of pixel points in the q-th third superpixel region of the p-th difference image, represents the eigenvalue of the q-th third superpixel region of the p-th difference image.
3. The automatic identification method for a black smoke polluting ship according to claim 1, characterized in that, The expression of the comprehensive eigenvalue is: Wherein, represents the comprehensive feature value of the m-th second superpixel region in the grayscale image, represents the black smoke feature value of the m-th second superpixel region in the grayscale image, represents the gray mean value of the m-th second superpixel region in the grayscale image, and exp represents the exponential function with e as the base.
4. The automatic identification method for a black smoke polluting ship according to claim 1, characterized in that, The expression of the comprehensive eigenvalue is: Wherein, represents the comprehensive eigenvalue of the m-th second superpixel region in the grayscale image, represents the black smoke eigenvalue of the m-th second superpixel region in the grayscale image, represents the grayscale mean of the m-th second superpixel region in the grayscale image, and norm represents the normalization function.
5. The automatic identification method for a black smoke polluting ship according to claim 1, characterized in that The method for obtaining the third superpixel region of the difference image is: Denoting the two frames of grayscale images for difference as the first grayscale image and the second grayscale image, taking any second superpixel region in the first grayscale image as the target region, calculating the Euclidean distance between the center points of each second superpixel region in the second grayscale image and the center point of the target region, taking the second superpixel region in the second grayscale image closest to the target region as the matching region, and merging the target region and the matching region and mapping them into the difference image to obtain the third superpixel region.
6. The automatic recognition method for black smoke pollution ships according to claim 1, characterized in that, Before using the SLIC algorithm to segment each frame of color image, it also includes the step of performing Gaussian filtering on the color image.
7. The automatic identification method for a black smoke polluting ship according to claim 1, characterized in that, Using the mean shift algorithm to cluster the comprehensive eigenvalues of the second superpixels to obtain multiple clustering clusters.
8. The automatic recognition method for ships with black smoke pollution according to claim 1, characterized in that, The method for obtaining multiple frames of color images of a ship is: obtaining a video during the ship's driving, extracting ship images at equal time intervals, and performing color space conversion on the ship images to obtain color images.
9. The automatic recognition method for a black smoke polluting ship according to claim 1, characterized in that, The expression of the black smoke eigenvalue is: ; In the formula, is the black smoke feature value of the i-th second superpixel region in the n-th grayscale image, is the feature value of the i-th third superpixel region in the n-th difference image, , are the feature values of the i-th third superpixel region in the j-th and (j - 1)-th difference images respectively, is the homogeneity of the i-th second superpixel region in the n-th grayscale image, exp represents the exponential function with base e, and µ represents the mean of the differences in the feature values of the i-th superpixel region in multiple difference images.
10. An automatic identification system for ships with black smoke pollution, characterized in that, Including: A processor and a memory, where the memory stores computer program instructions, and when the computer program instructions are executed by the processor, it realizes an automatic recognition method for a ship polluted by black smoke according to any one of claims 1-9.
Citation Information
Patent Citations
Deep learning-based inland waterway ship black smoke distributed monitoring system
CN116363117A