Cleaning wastewater treatment method based on machine vision electrophoresis line discharge

By using machine vision technology to process wastewater images from electrophoresis lines, the problems of long processing time, high cost, and inaccuracy of traditional detection methods have been solved, enabling rapid and accurate wastewater treatment detection.

CN120976223AActive Publication Date: 2025-11-18NANTONG SHENGLITE ENERGY SAVING & ENVIRONMENTAL PROTECTION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202511500747.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-21
Publication Date
2025-11-18
Estimated Expiration
2045-10-21

AI Technical Summary

Technical Problem

Traditional wastewater treatment and testing methods for electrophoresis lines are time-consuming, costly, and inaccurate, making it difficult to accurately determine whether the wastewater meets the standards.

Method used

A machine vision-based approach is used to acquire images of the wastewater pool in the electrophoresis line, perform preprocessing, superpixel segmentation, and maximum inscribed rectangle processing, calculate the water surface turbidity index and color shift, construct a standard matching template, and determine whether the wastewater treatment meets the standards.

Benefits of technology

It enables rapid and accurate determination of whether wastewater treatment in electrophoresis lines meets standards, improving detection efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120976223A_ABST
    Figure CN120976223A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of machine vision, in particular to an electrophoresis line discharge cleaning wastewater treatment method based on machine vision, which comprises the following steps: acquiring an initial image of wastewater in a to-be-detected electrophoresis line wastewater pool reaching the standard; respectively preprocessing the initial images; performing superpixel segmentation processing and maximum inscribed rectangle processing on the preprocessed image to obtain a plurality of to-be-matched detection areas and a standard matching template; calculating the to-be-matched detection area and the standard matching template to obtain a first wastewater metal deposition degree and a second wastewater metal deposition degree; matching window deformation adjustment parameters are calculated, and the wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree and the matching window deformation adjustment parameters; and judging whether electrophoresis line wastewater treatment reaches the standard or not based on the wastewater treatment similarity. According to the method, detection of electrophoresis line wastewater treatment is achieved based on machine vision, and whether electrophoresis line wastewater treatment reaches the standard or not can be accurately recognized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of machine vision, in particular to a method for treating wastewater discharged from an electrophoresis line based on machine vision. BACKGROUND

[0002] With the continuous development of electrophoresis technology, electrophoretic coating gradually replaces the original electroplating process and becomes one of the main processes for coating metal devices due to its advantages of environmental protection, high efficiency, and good quality. Since a large amount of water is used as a carrier and medium for electrophoresis and metal coating cleaning in the electrophoresis process, a large amount of wastewater is generated on the electrophoresis coating line. In order to improve the environmental protection effect of the coating line, various physical, chemical, and biological means are usually used for wastewater treatment, and finally the treated wastewater that meets the standards is recycled or discharged, improving the environmental friendliness of the coating line.

[0003] Whether the wastewater treatment of the electrophoresis line meets the standards, the traditional detection method needs to manually sample the wastewater, send the sample to a professional detection laboratory, and then detect impurities, precipitates, heavy metal ions, etc. in the water by chemical, spectral, etc. methods, however, this detection method is time-consuming and costly, and the spectrum is easily affected by the external environment, resulting in inaccurate results. SUMMARY

[0004] In view of the above problems, the present application provides a method for treating wastewater discharged from an electrophoresis line based on machine vision, which can accurately identify whether the wastewater treatment of the electrophoresis line meets the standards.

[0005] The present application provides a method for treating wastewater discharged from an electrophoresis line based on machine vision, comprising: obtaining a first initial image and a second initial image, the first initial image being an image of wastewater in a wastewater pool of a standard electrophoresis line, and the second initial image being an image of wastewater in a wastewater pool of a to-be-detected electrophoresis line; preprocessing the first initial image to obtain a first image and a second image, and preprocessing the second initial image to obtain a third image and a fourth image; the first image and the third image are grayscale images, and the second image and the fourth image are images based on an HSV color space; performing superpixel segmentation processing and maximum inscribed rectangle processing on the third image to obtain a plurality of to-be-matched detection regions, and performing superpixel segmentation processing and maximum inscribed rectangle processing on the first image to obtain a standard matching template; For each of the to-be-matched detection regions, water surface turbidity calculation is performed to obtain a water surface turbidity index of the to-be-matched detection region, color and luster offset calculation is performed based on the fourth image to obtain a first color and luster offset degree, and a first wastewater metal deposition degree is calculated based on the water surface turbidity index of the to-be-matched detection region and the first color and luster offset degree; For the standard matching template, color and luster offset calculation is performed based on the second image to obtain a second color and luster offset degree, and a second wastewater metal deposition degree is calculated based on the second color and luster offset degree; For each of the to-be-matched detection regions, a matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the standard matching template, and a wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree, and the matching window deformation adjustment parameter. Based on the wastewater treatment similarity, it is determined whether the electrophoresis line wastewater treatment meets the standard.

[0006] In a possible implementation, the pre-processing of the first initial image to obtain the first image and the second image, and the pre-processing of the second initial image to obtain the third image and the fourth image, include: Converting the first initial image into a gray-scale image and an image based on the HSV color space; Performing denoising processing and image sharpening on the gray-scale image converted from the first initial image to obtain the first image; Performing denoising processing and image sharpening on the image based on the HSV color space converted from the first initial image to obtain the second image; Converting the second initial image into a gray-scale image and an image based on the HSV color space; Performing denoising processing and image sharpening on the gray-scale image converted from the second initial image to obtain the third image; Performing denoising processing and image sharpening on the image based on the HSV color space converted from the second initial image to obtain the fourth image.

[0007] In a possible implementation, the superpixel segmentation processing and the maximum inscribed rectangle processing on the third image to obtain a plurality of to-be-matched detection regions, and the superpixel segmentation processing and the maximum inscribed rectangle processing on the first image to obtain a standard matching template, include: Performing superpixel segmentation processing on the third image to obtain a plurality of first superpixel blocks, and performing maximum inscribed rectangle processing on each of the first superpixel blocks to obtain a plurality of to-be-matched detection regions; The first image is subjected to superpixel segmentation to obtain multiple second superpixel blocks. One second superpixel block to be processed is selected from the multiple second superpixel blocks, and the second superpixel block to be processed is subjected to maximum inscribed rectangle processing to obtain a standard matching template.

[0008] In one possible implementation, calculating the turbidity index of each of the detection areas to be matched includes: For each detection area to be matched, perform pixel grayscale statistics to obtain a first grayscale value and a second grayscale value. Based on the average of the first grayscale value and the second grayscale value, divide the pixels of the detection area to be matched into sediment particles and dust particles. The first grayscale value is the largest pixel grayscale value in the detection area to be matched, and the second grayscale value is the smallest pixel grayscale value in the detection area to be matched. For each of the regions to be matched for detection, the precipitation colloidal index of the region to be matched for detection is calculated. The formula for calculating the precipitation colloidal index is as follows: in, The sedimentation gel index of the region to be matched for detection. For the first in the region to be matched for detection The average Euclidean distance between a precipitate particle and other precipitate particles in its eight-neighborhood. The number of precipitated particles in the detection area to be matched; For each of the areas to be matched for testing, the turbidity index of the water surface in the area to be matched for testing is calculated based on the sedimentation colloidal index. The formula for calculating the turbidity index is as follows: in, For the first The water turbidity index of the area to be matched for testing The average sedimentation gel index of all regions to be matched in the third image. For the first The sedimentation gel index of the detection area to be matched.

[0009] In one possible implementation, the step of calculating the first color shift based on the fourth image includes: For each of the detection regions to be matched, a first color change gradient for each pixel in the detection region to be matched is calculated based on the fourth image. The formula for calculating the first color change gradient is: in, a first color change gradient of a first pixel point in the to-be-matched detection region, a coordinate value of a first pixel point in the fourth image; For each to-be-matched detection region, a first color offset degree is calculated based on the first color change gradient of each pixel point, and a calculation formula of the first color offset degree is: wherein, the first color offset degree, a number of pixel points in the to-be-matched detection region, a first color change gradient of a first pixel point in the to-be-matched detection region, an average value of the first color change gradients of all pixel points in the to-be-matched detection region.

[0010] In a possible implementation, the first wastewater metal deposition degree is calculated based on the water surface turbidity index and the first color offset degree of the to-be-matched detection region, and the calculation formula of the first wastewater metal deposition degree is: wherein, a first wastewater metal deposition degree of a first to-be-matched detection region, the first color offset degree of the to-be-matched detection region, the water surface turbidity index of the to-be-matched detection region.

[0011] In a possible implementation, the second color offset degree is calculated based on the second image for the standard matching template, and the calculation formula of the second color change gradient of each pixel point of the standard matching template is: wherein, a second color change gradient of a first pixel point of the standard matching template, a coordinate value of a first pixel point in the second image; ​​​​​​​​The second color offset degree is calculated based on the second color change gradient of each pixel point of the standard matching template, and a calculation formula of the second color offset degree is as follows: wherein, the second color offset degree is, a pixel point number of the standard matching template, a second color change gradient of an i-th pixel point in the standard matching template, a second color change gradient of an i-th pixel point in the standard matching template, an average value of the second color change gradients of all pixel points of the standard matching template.

[0012] In a possible implementation, the second wastewater metal deposition degree is calculated based on the second color offset degree, and the calculation formula of the second wastewater metal deposition degree is as follows: The second wastewater metal deposition degree is calculated based on the second color offset degree of the standard matching template, and a calculation formula of the second wastewater metal deposition degree is as follows: wherein, the second wastewater metal deposition degree is, the second color offset degree, a water surface turbidity index of the standard matching template, and the water surface turbidity index of the standard matching template is 1.

[0013] In a possible implementation, the matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the rectangular size of the standard matching template, and the wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree, and the matching window deformation adjustment parameter, and the calculation formula of the wastewater treatment similarity is as follows: The matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the rectangular size of the standard matching template, and a calculation formula of the matching window deformation adjustment parameter is as follows: wherein, the matching window deformation adjustment parameter is, an i-th to-be-matched detection region, a rectangular size of an i-th to-be-matched detection region, a rectangular size of the standard matching template; The wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree, and the matching window deformation adjustment parameter, and a calculation formula of the wastewater treatment similarity is as follows: wherein, is the wastewater treatment similarity, is the matching window deformation adjustment parameter, is the first wastewater metal deposition degree of the mth matching detection region, is the first wastewater metal deposition degree of the mth matching detection region, is the second wastewater metal deposition degree.

[0014] In a possible implementation, the determining whether the electrophoresis line wastewater treatment meets the standard based on the wastewater treatment similarity comprises: determining the number of standard meeting regions in the plurality of matching detection regions based on the wastewater treatment similarity, and determining whether the electrophoresis line wastewater treatment meets the standard according to the proportion of the number of standard meeting regions in the total number of matching detection regions.

[0015] The application has the beneficial effect that by detecting the image of the electrophoresis line wastewater tank, the optimal region of the wastewater image meeting the standard is obtained as a standard matching template using prior knowledge, the wastewater metal deposition degree is constructed according to the metal deposition amount in the electrophoresis line wastewater, and finally the similarity judgment criterion in the template matching algorithm is modified to achieve the wastewater treatment detection of the electrophoresis line based on machine vision. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 is a step flow chart of a method for treating and cleaning wastewater discharged by an electrophoresis line based on machine vision provided by an embodiment of the application. DETAILED DESCRIPTION

[0017] In order to make the above objectives, features and advantages of the application more apparent and understandable, the application will be further described in detail below with reference to the drawings and specific embodiments. Obviously, the described embodiments are only some of the embodiments of the application, but not all the embodiments. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art belong to the scope of protection of the application.

[0018] The terms used in the embodiment part of the application are only used to explain the specific embodiments of the application, and are not intended to limit the application.

[0019] It should be noted that the modification of "one" and "multiple" mentioned in the application is illustrative and not limiting, and those skilled in the art should understand that unless otherwise explicitly indicated in the context, it should be understood as "one or more".

[0020] The embodiments of the present application are described below with reference to the accompanying drawings. Those skilled in the art can know that, with the development of technology and the emergence of new scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0021] The wastewater generated by the electrophoresis line is relatively complex, usually containing heavy metal ions, suspended solids and industrial impurities, etc. Usually, the wastewater is treated by flocculation precipitation, biological treatment, etc. The RO reverse osmosis membrane treatment wastewater method has relatively strong treatment capacity for the wastewater generated by the electrophoresis line, and the treated wastewater is better in water quality than other methods. However, since the RO membrane itself has certain loss in treating wastewater, after a certain period of use, if the RO membrane is damaged, the wastewater treated by the RO membrane may not meet the water recycling or discharge standards, so it is necessary to detect the water quality of the treated electrophoresis line wastewater to determine whether it meets the standards.

[0022] When the RO membrane is damaged, the wastewater penetrates through the RO membrane, and the heavy metal ions, suspended solids or precipitates generated in the wastewater treatment process before reverse osmosis in the original wastewater pass through the RO membrane and finally enter the treated wastewater tank. Among them, since the electrophoresis process mainly uses various materials for metal coating, and the surface of various materials needs to be cleaned and treated before coating, the content of heavy metal ions in the wastewater generated by the electrophoresis process is large, and the influence on water quality is also serious. The precipitate of metal ions is mainly colloidal precipitate, which floats in water and produces a phenomenon similar to the Tyndall effect when exposed to strong light, eventually causing the wastewater to appear locally turbid.

[0023] Referring to Figure 1 The embodiment of the present application discloses a machine vision-based electrophoresis line discharge cleaning wastewater treatment method, which comprises: Step S11, acquiring a first initial image and a second initial image, the first initial image being an image of wastewater in a wastewater tank of a qualified electrophoresis line, and the second initial image being an image of wastewater in a wastewater tank of an electrophoresis line to be detected; Step S12, preprocessing the first initial image to obtain a first image and a second image; preprocessing the second initial image to obtain a third image and a fourth image; the first image and the third image being grayscale images, and the second image and the fourth image being images based on an HSV color space; Step S13, performing superpixel segmentation processing and maximum inscribed rectangle processing on the third image to obtain a plurality of to-be-matched detection regions, and performing superpixel segmentation processing and maximum inscribed rectangle processing on the first image to obtain a standard matching template; Step S14, for each of the to-be-matched detection region, water surface turbidity calculation is performed to obtain the water surface turbidity index of the to-be-matched detection region, color and luster offset calculation is performed based on the fourth image to obtain a first color and luster offset degree, and a first wastewater metal deposition degree is calculated based on the water surface turbidity index of the to-be-matched detection region and the first color and luster offset degree; Step S15, for the standard matching template, color and luster offset calculation is performed based on the second image to obtain a second color and luster offset degree, and a second wastewater metal deposition degree is calculated based on the second color and luster offset degree; Step S16, for each of the to-be-matched detection region, a matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the standard matching template, and a wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree and the matching window deformation adjustment parameter; Step S17, based on the wastewater treatment similarity, it is judged whether the electrophoresis line wastewater treatment meets the standard.

[0024] In the above embodiment steps, a first initial image and a second initial image are obtained, the first initial image is an image of wastewater in a wastewater pool of a standard electrophoresis line, and the second initial image is an image of wastewater in a wastewater pool of a to-be-detected electrophoresis line. Since the whole inside of the wastewater pool of the electrophoresis line is relatively dark, it is difficult to observe the inside of the wastewater of the electrophoresis line, so before shooting the image, an industrial light source is arranged inside the edge of the wastewater pool of the electrophoresis line, is turned on 1 second before shooting the image, irradiates the wastewater pool of the electrophoresis line, and is turned off after shooting the image; then a wastewater region that belongs to treatment meeting the standard is artificially selected after a large amount of prior experience is judged, a CMOS camera is arranged above the wastewater region that meets the standard, a panoramic image of the wastewater region that meets the standard is shot under the condition that the light is sufficient and the water surface is stable, and an RGB image of the wastewater region of the standard electrophoresis line is obtained; under the same light and water surface conditions, a wastewater region image is shot above the wastewater pool after treatment using the CMOS camera, and an RGB image of the to-be-detected wastewater region of the electrophoresis line is obtained; in addition to the CMOS camera, other devices capable of realizing image acquisition can also be used as the image acquisition device, which is not limited here.

[0025] The RGB image of the wastewater region of the standard electrophoresis line and the RGB image of the to-be-detected wastewater region of the electrophoresis line are respectively preprocessed, specifically: the first initial image is preprocessed to obtain a first image and a second image; the second initial image is preprocessed to obtain a third image and a fourth image; the first image and the third image are gray images, and the second image and the fourth image are images based on the HSV color space.

[0026] In order to perform template matching, a standard matching template is obtained by superpixel segmentation processing and maximum inscribed rectangle processing in the qualified electrophoresis line wastewater image, and a to-be-matched detection region is determined by superpixel segmentation processing and maximum inscribed rectangle processing in the to-be-detected electrophoresis line wastewater image. Specifically, the third image is subjected to superpixel segmentation processing and maximum inscribed rectangle processing to obtain a plurality of to-be-matched detection regions, and the first image is subjected to superpixel segmentation processing and maximum inscribed rectangle processing to obtain a standard matching template.

[0027] According to the characteristics of the electrophoresis process wastewater, the water surface turbidity index of the to-be-matched detection region is calculated first, then the first color shade offset degree is calculated, and finally the water surface turbidity index and the first color shade offset degree are used to realize the calculation of the first wastewater metal deposition degree for characterizing the metal deposition amount in the to-be-matched detection region. Specifically, for each to-be-matched detection region, the water surface turbidity is calculated to obtain the water surface turbidity index of the to-be-matched detection region, the fourth image is used to calculate the first color shade offset degree, and the water surface turbidity index and the first color shade offset degree of the to-be-matched detection region are used to calculate the first wastewater metal deposition degree.

[0028] Similarly, according to the characteristics of the electrophoresis process wastewater, the second color shade offset degree is calculated, and the second color shade offset degree is used to realize the calculation of the second wastewater metal deposition degree for characterizing the metal deposition amount in the standard matching template. Specifically, for the standard matching template, the second color shade offset degree is calculated based on the second image, and the second wastewater metal deposition degree is calculated based on the second color shade offset degree.

[0029] Considering that the area sizes of the standard matching template and the to-be-matched detection region are inconsistent, a matching window deformation adjustment parameter is constructed, and then an electrophoresis line wastewater treatment similarity of template matching is constructed according to the first metal deposition degree of the to-be-matched detection region and the second wastewater metal deposition degree of the standard matching template. Specifically, for each to-be-matched detection region, the matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the standard matching template, and the wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree, and the matching window deformation adjustment parameter.

[0030] The wastewater treatment similarity can be used as a template matching similarity judgment index for electrophoresis line wastewater detection, so the wastewater treatment similarity is used to judge whether the electrophoresis line wastewater treatment is qualified.

[0031] In an optional embodiment of the present application, the pre-processing of the first initial image to obtain the first image and the second image, and the pre-processing of the second initial image to obtain the third image and the fourth image, include: convert the first initial image into a gray image and an image based on HSV color space; perform denoising processing and image sharpening on the gray image converted from the first initial image to obtain a first image; perform denoising processing and image sharpening on the image based on HSV color space converted from the first initial image to obtain a second image; convert the second initial image into a gray image and an image based on HSV color space; perform denoising processing and image sharpening on the gray image converted from the second initial image to obtain a third image; perform denoising processing and image sharpening on the image based on HSV color space converted from the second initial image to obtain a fourth image.

[0032] In the above embodiment steps, the initial image in RGB (including the image of wastewater in the qualified electrophoresis line wastewater pool and the image of wastewater to be detected in the electrophoresis line wastewater pool) is converted into a gray image and an image based on HSV color space, and then denoising processing and image sharpening are performed to obtain a first image , a second image , a third image , and a fourth image . The denoising processing can adopt bilateral filtering or other conventional denoising processing methods, which are not specifically limited herein; the image sharpening can adopt image sharpening based on Laplace operator or other conventional image sharpening methods, which are not specifically limited herein.

[0033] In an optional embodiment of the present application, the third image is subjected to superpixel segmentation processing and maximum inscribed rectangle processing to obtain a plurality of detection areas to be matched, and the first image is subjected to superpixel segmentation processing and maximum inscribed rectangle processing to obtain a standard matching template, including: The third image is subjected to superpixel segmentation processing to obtain a plurality of first superpixel blocks, and each first superpixel block is subjected to maximum inscribed rectangle processing to obtain a plurality of detection areas to be matched; The first image is subjected to superpixel segmentation processing to obtain a plurality of second superpixel blocks, a second superpixel block to be processed is selected from the plurality of second superpixel blocks, and the second superpixel block to be processed is subjected to maximum inscribed rectangle processing to obtain a standard matching template.

[0034] In the above embodiment steps, the third image of wastewater to be detected is subjected to superpixel segmentation processing to obtain a plurality of first superpixel blocks in the third image of wastewater to be detected, and each first superpixel block is subjected to maximum inscribed rectangle processing to obtain a rectangle as a detection area to be matched, and the size of the rectangle is recorded as Then, the first image of the compliant wastewater. Superpixel segmentation was performed to obtain the first image of the compliant wastewater. Multiple second superpixel blocks are processed. Then, the best-quality, clearest, and most uniformly distributed wastewater texture second superpixel block is manually selected from these (if multiple matching blocks exist, one is randomly selected for subsequent processing). This second superpixel block is then subjected to maximum inscribed rectangle processing. The resulting rectangular region is set as the standard matching template, and its size is recorded as follows: .

[0035] In an optional embodiment of this application, the step of calculating the water surface turbidity index of each of the detection areas to be matched includes: For each detection area to be matched, perform pixel grayscale statistics to obtain a first grayscale value and a second grayscale value. Based on the average of the first grayscale value and the second grayscale value, divide the pixels of the detection area to be matched into sediment particles and dust particles. The first grayscale value is the largest pixel grayscale value in the detection area to be matched, and the second grayscale value is the smallest pixel grayscale value in the detection area to be matched. For each of the regions to be matched for detection, the precipitation colloidal index of the region to be matched for detection is calculated. The formula for calculating the precipitation colloidal index is as follows: in, The sedimentation gel index of the region to be matched for detection. For the first in the region to be matched for detection The average Euclidean distance between a precipitate particle and other precipitate particles in its eight-neighborhood. The number of precipitated particles in the detection area to be matched; For each of the areas to be matched for testing, the turbidity index of the water surface in the area to be matched for testing is calculated based on the sedimentation colloidal index. The formula for calculating the turbidity index is as follows: in, For the first The water turbidity index of the area to be matched for testing The average sedimentation gel index of all regions to be matched in the third image. For the first The sedimentation gel index of the detection area to be matched.

[0036] In the above embodiment steps, based on the turbidity phenomenon of the electrophoresis line wastewater, the precipitation caused by metal ions is the main reason. First, the particles in each to-be-matched detection region are divided. Since the inside of the wastewater pool is illuminated, the particles in the electrophoresis line wastewater in the to-be-matched detection region are mainly divided into two types: one is fine impurities such as dust particles generated in the process of wastewater treatment and transportation; and the other is precipitation particles of heavy metal ions obtained after chemical treatment. When the precipitation particles are at a certain concentration, they will coagulate and form local colloidal precipitation, resulting in turbidity of the water surface in this region. Since the metal precipitation particles are relatively large, they have more reflection surfaces for light and are more obvious in the to-be-matched detection region under light source illumination, while other impurity particles are relatively small and have lower light sensitivity under light source illumination. According to this feature, the pixel point gray scale of each to-be-detected region is counted, the maximum pixel point gray scale is recorded as , the minimum pixel point gray scale is recorded as , the average value of the maximum gray scale and the minimum gray scale is set as the division threshold T of the dust particles and the precipitation particles; the pixels with a gray scale greater than the threshold T are divided into precipitation particles, and the pixels with a gray scale less than T are divided into dust particles.

[0037] For each precipitation particle, the Euclidean distance between it and other precipitation particles in its eight-neighbor domain is calculated , and then the average value of the Euclidean distance between each precipitation particle and other precipitation particles in its eight-neighbor domain is calculated . For each to-be-matched detection region, the colloidal index of the to-be-matched detection region is calculated . It should be noted that the greater the colloidal index , the smaller the sum of the average distances between the precipitation particles in the to-be-matched detection region, the more concentrated the distribution, and the greater the possibility of forming local colloidal precipitation; the smaller the colloidal index , the greater the sum of the average distances between the precipitation particles in the to-be-matched detection region, the more dispersed the distribution, and the smaller the possibility of forming local colloidal precipitation.

[0038] Then, for each to-be-matched detection region, the average colloidal index of all to-be-matched detection regions is calculated as based on the colloidal index in the to-be-matched detection region, which is used as a judgment index of the influence of the precipitation in the to-be-matched detection region on the clarity of the water surface. Finally, the water turbidity index of the to-be-matched detection region is calculated . It should be noted that the greater the water turbidity index, the greater the colloidal index of the to-be-matched detection region than the average value of the entire image, and the more turbid the water surface of the to-be-matched detection region; the smaller the water turbidity index, the smaller the colloidal index of the to-be-matched detection region than the average value of the entire image, and the less turbid the water surface of the to-be-matched detection region. ​The gelatinous sedimentation index in this area is lower than the average of the entire image, indicating that the water surface in this area to be matched and detected is relatively clear.

[0039] In an optional embodiment of this application, the step of calculating the first color shift based on the fourth image includes: For each of the detection regions to be matched, a first color change gradient for each pixel in the detection region to be matched is calculated based on the fourth image. The formula for calculating the first color change gradient is: in, The first detection region to be matched The first color change gradient of each pixel The fourth image is the first The coordinates of each pixel; For each of the detection regions to be matched, a first color shift is calculated based on the first color change gradient of each pixel. The formula for calculating the first color shift is as follows: in, This represents the first color offset. The number of pixels in the detection area to be matched. For the first detection region to be matched The first color change gradient of each pixel It is the average value of the first color change gradient of all pixels in the detection area to be matched.

[0040] When metal precipitates aggregate to form a colloidal substance, they can also cause changes in the color of the local water surface. Color change analysis is performed based on the HSV image (fourth image) of the wastewater area to be tested. Specifically, in the steps of the above embodiment, for each of the areas to be matched for detection, a first color change gradient is calculated based on the HSV value of each pixel, centered on each pixel. It should be noted that when the first color changes gradient... The larger the value, the greater the HSV value variation at that pixel location, potentially indicating the formation of metallic gel-like deposits in a localized area; when the first color change gradient... The smaller the value, the smaller the HSV value change at the location of the pixel, and the less or no gelatinous deposits are produced in the local area.

[0041] For the area to be matched for detection, when there is no metallic colloidal precipitate, the gradient of the first color change is relatively uniform; however, when metallic colloidal precipitate appears on the water surface within the area, the gradient of the first color change fluctuates significantly. Based on the gradient of the first color change... The average value of the first color change gradient of all pixels in the detection region is obtained by averaging all pixels within the detection region window. Based on the first color change gradient of pixels within the detection region window to be matched The average value of the first color change gradient of all pixels in the detection region to be matched The first color shift of the detection region to be matched is calculated. It should be noted that the greater the first color shift in the detection area to be matched, the more pixels there are with a large gradient of the first color change within the window, and the greater the possibility of metallic gel-like deposits within the window; conversely, the smaller the first color shift in the detection area to be matched, the fewer pixels there are with a large gradient of the first color change within the window, and the less likely there are metallic gel-like deposits within the window.

[0042] In an optional embodiment of this application, the calculation of the first wastewater metal deposition degree based on the water surface turbidity index of the detection area to be matched and the first color shift includes: For each of the detection areas to be matched, the degree of metal deposition in the first wastewater is calculated based on the turbidity index of the water surface and the first color shift of the detection area to be matched. The formula for calculating the degree of metal deposition in the first wastewater is as follows: in, For the first The degree of metal deposition in the first wastewater of the area to be matched for detection. The first color offset of the detection area to be matched. The turbidity index of the water surface in the area to be matched for detection.

[0043] In the above embodiment steps, for each of the detection areas to be matched, the water surface turbidity index of the detection area to be matched is used as a basis. and the first color offset The degree of metal deposition in the first wastewater was calculated. It should be noted that when the degree of metal deposition in the first wastewater... The larger the value, the greater the likelihood of metallic colloidal precipitates in the wastewater from the electrophoresis line, and the lower the completeness of wastewater treatment; when the degree of metal deposition in the first wastewater... The smaller the value, the less likely there is a metallic colloidal precipitate in the electrophoresis line area, and the greater the completeness of wastewater treatment.

[0044] In an optional embodiment of this application, the step of calculating the second color shift degree based on the second image using the standard matching template includes: For the standard matching template, the second color change gradient of each pixel of the standard matching template is calculated based on the second image. The formula for calculating the second color change gradient is: in, For the standard matching template of the first The second color gradient of each pixel For the second image, the first The coordinates of each pixel; For the standard matching template, the second color shift is calculated based on the second color change gradient of each pixel. The formula for calculating the second color shift is: in, This is the second color offset. The number of pixels in the standard matching template. For the first standard matching template The second color gradient of each pixel It is the average value of the second color change gradient of all pixels in the standard matching template.

[0045] In the above embodiment steps, considering that the aggregation of metal precipitates to form a gel can also cause changes in the color of the local water surface, color change analysis is performed based on the HSV image (second image) of the compliant wastewater area. For the standard matching template, the second color change gradient is calculated based on the HSV value of each pixel, centered on each pixel. For the standard matching template, the gradient is adjusted according to the second color. The average value of the second color change gradient of all pixels in the standard matching template is obtained by averaging all pixels within the standard matching template window. Based on the gradient of the second color change of pixels within the standard matching template window The average value of the second hue gradient of all pixels matching the standard template The second color offset of the standard matching template is calculated. .

[0046] In an optional embodiment of this application, the calculation of the second wastewater metal deposition degree based on the second color shift includes: For the standard matching template, the degree of metal deposition in the second wastewater is calculated based on the second color offset. The formula for calculating the degree of metal deposition in the second wastewater is as follows: wherein, is the second wastewater metal deposition degree, is the second color shade offset degree, is the water surface turbidity index of the standard matching template, and the water surface turbidity index of the standard matching template is 1.

[0047] In the above embodiment step, for the standard matching template, based on the water surface turbidity index of the standard matching template and the second color shade offset degree a first wastewater metal deposition degree is calculated.In the standard matching template, since there may be a small amount of precipitated particles in the standard wastewater, the water surface is relatively clear, the precipitated gel index of the standard matching template is 0, and therefore the water surface turbidity index of the standard matching template is 1.

[0048] In an optional embodiment of the present application, for each of the to-be-matched detection regions, a matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the rectangular size of the standard matching template, and a wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree, and the matching window deformation adjustment parameter, including: For each of the to-be-matched detection regions, the matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the rectangular size of the standard matching template, and the calculation formula of the matching window deformation adjustment parameter is as follows: wherein, is the matching window deformation adjustment parameter, is the rectangular size of the i-th to-be-matched detection region, is the rectangular size of the i-th to-be-matched detection region, is the rectangular size of the standard matching template; For each of the to-be-matched detection regions, a wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree, and the matching window deformation adjustment parameter, and the calculation formula of the wastewater treatment similarity is as follows: wherein, is the wastewater treatment similarity, is the matching window deformation adjustment parameter, is the first wastewater metal deposition degree of the i-th to-be-matched detection region, is the second wastewater metal deposition degree.

[0049] The first wastewater metal deposition degree of the to-be-matched detection region and the second wastewater metal deposition degree of the standard matching template are required to be used to construct a similarity criterion of template matching, but since the sizes of the to-be-matched detection region and the standard matching template segmented by superpixels may not be consistent, the size of the matching region also needs to be adjusted. If the sizes of the two compared regions (the to-be-matched detection region and the standard matching template) are different, the amount of feature information contained in the region will be too much or too little, which cannot fully represent the characteristics of the region. In view of the above situation, in the matching process, when the size of the to-be-matched detection region is larger than that of the standard matching template, the standard matching template is expanded to be consistent with the size of the to-be-matched detection region; when the size of the to-be-matched detection region is smaller than that of the standard template, the to-be-matched detection region is expanded to be consistent with the size of the standard matching template, so as to not miss the feature information in the image when the matching is completed. Therefore, in the above embodiment steps, for each to-be-matched detection region, the matching window deformation adjustment parameter is calculated based on the rectangular size of the to-be-matched detection region and the rectangular size of the standard matching template. It should be noted that when is larger, it means that the size difference between the two windows (the to-be-matched detection region and the standard matching template) is larger, and the adjustment range required is larger; when is smaller, it means that the size difference between the two windows is smaller, and the adjustment space required is smaller.

[0050] Then, for each to-be-matched detection region, the wastewater treatment similarity is calculated based on the first wastewater metal deposition degree, the second wastewater metal deposition degree, and the matching window deformation adjustment parameter. It should be noted that when is larger, it means that the similarity of the two regions (the to-be-matched detection region and the standard matching template) is higher, and the water surface condition of the to-be-matched detection region is closer to the standard water surface condition; when is smaller, it means that the similarity of the two regions (the to-be-matched detection region and the standard matching template) is lower, and the water surface condition of the to-be-matched detection region is worse compared to the standard water surface condition, which may appear RO membrane damage leading to incomplete wastewater treatment.

[0051] In an optional embodiment of the present application, the judgment of whether the electrophoresis line wastewater treatment meets the standard based on the wastewater treatment similarity includes: determining the number of standard regions meeting the standard in the plurality of to-be-matched detection regions based on the wastewater treatment similarity, and judging whether the electrophoresis line wastewater treatment meets the standard according to the proportion of the number of standard regions meeting the standard in the total number of to-be-matched detection regions.

[0052] In the above embodiment steps, based on the wastewater treatment similarity The number of qualified regions in the plurality of to-be-matched detection regions is determined, and then whether the electrophoresis line wastewater treatment is qualified is judged according to the proportion of the qualified regions in the total number of to-be-matched detection regions.

[0053] The various embodiments are described in the specification by way of progression, each building on the previous embodiment, but it should be understood that those skilled in the art will be able to practice the application with the embodiments in any order noted in the specification without departing from the spirit and the scope of the application. In addition, if a particular feature is described in connection with one embodiment and not in connection with another embodiment, it should not be construed that the associated feature is only present or has particular, desired properties in that one embodiment, but is not present or has different properties in another embodiment.

[0054] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0055] The above provides a kind of based on machine vision electrophoresis line discharge cleaning wastewater treatment method provided in the application, specific examples are applied in this paper, the principle and implementation mode of the application are described, the above embodiment is only used to help understand the method of the application and its core idea;For those skilled in the art, according to the idea of the application, there will be changes in specific implementation mode and application range, in conclusion, the content of the specification should not be understood as the limitation of the application.

Claims

1. A method for treating cleaning wastewater discharged from an electrophoresis line based on machine vision, characterized in that, include: Acquire a first initial image and a second initial image. The first initial image is an image of wastewater in the wastewater tank of the qualified electrophoresis line, and the second initial image is an image of wastewater in the wastewater tank of the electrophoresis line to be tested. The first initial image is preprocessed to obtain a first image and a second image; The second initial image is preprocessed to obtain a third image and a fourth image; the first image and the third image are grayscale images, and the second image and the fourth image are images based on the HSV color space; The third image is subjected to superpixel segmentation and maximum inscribed rectangle processing to obtain multiple detection regions to be matched. The first image is subjected to superpixel segmentation and maximum inscribed rectangle processing to obtain a standard matching template. For each of the detection areas to be matched, the water surface turbidity is calculated to obtain the water surface turbidity index of the detection area to be matched, the color shift is calculated based on the fourth image to obtain the first color shift degree, and the first wastewater metal deposition degree is calculated based on the water surface turbidity index and the first color shift degree of the detection area to be matched. For the standard matching template, a second color shift degree is obtained by calculating the color shift based on the second image, and a second degree of metal deposition in the wastewater is obtained by calculating the second color shift degree. For each of the detection regions to be matched, the deformation adjustment parameters of the matching window are calculated based on the rectangle size of the detection region to be matched and the standard matching template, and the wastewater treatment similarity is calculated based on the degree of metal deposition in the first wastewater, the degree of metal deposition in the second wastewater, and the deformation adjustment parameters of the matching window. The similarity of the wastewater treatment is used to determine whether the wastewater treatment of the electrophoresis line meets the standards.

2. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The first initial image is preprocessed to obtain a first image and a second image; The second initial image is preprocessed to obtain the third and fourth images, including: The first initial image is converted into a grayscale image and an image based on the HSV color space; The grayscale image obtained by converting the first initial image is subjected to denoising and image sharpening to obtain the first image; The image based on the HSV color space obtained by converting the first initial image is subjected to denoising and image sharpening to obtain the second image; The second initial image is converted into a grayscale image and an image based on the HSV color space; The grayscale image obtained by converting the second initial image is subjected to denoising and image sharpening to obtain the third image; The image based on the HSV color space obtained by converting the second initial image is subjected to denoising and image sharpening to obtain the fourth image.

3. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The process of performing superpixel segmentation and maximum inscribed rectangle processing on the third image to obtain multiple regions to be matched and detected, and performing superpixel segmentation and maximum inscribed rectangle processing on the first image to obtain a standard matching template, includes: The third image is subjected to superpixel segmentation to obtain multiple first superpixel blocks. The maximum inscribed rectangle of each first superpixel block is processed to obtain multiple regions to be matched and detected. The first image is subjected to superpixel segmentation to obtain multiple second superpixel blocks. One second superpixel block to be processed is selected from the multiple second superpixel blocks, and the second superpixel block to be processed is subjected to maximum inscribed rectangle processing to obtain a standard matching template.

4. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The step of calculating the turbidity index of each of the detection areas to be matched includes: For each detection area to be matched, perform pixel grayscale statistics to obtain a first grayscale value and a second grayscale value. Based on the average of the first grayscale value and the second grayscale value, divide the pixels of the detection area to be matched into sediment particles and dust particles. The first grayscale value is the largest pixel grayscale value in the detection area to be matched, and the second grayscale value is the smallest pixel grayscale value in the detection area to be matched. For each of the regions to be matched for detection, the precipitation colloidal index of the region to be matched for detection is calculated. The formula for calculating the precipitation colloidal index is as follows: in, The sedimentation gel index of the region to be matched for detection. For the first in the region to be matched for detection The average Euclidean distance between a precipitate particle and other precipitate particles in its eight-neighborhood. The number of precipitated particles in the detection area to be matched; For each of the areas to be matched for testing, the turbidity index of the water surface in the area to be matched for testing is calculated based on the sedimentation colloidal index. The formula for calculating the turbidity index is as follows: in, For the first The water turbidity index of the area to be matched for testing The average sedimentation gel index of all regions to be matched in the third image. For the first The sedimentation gel index of the detection area to be matched.

5. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The calculation of the first color shift degree based on the fourth image includes: For each of the detection regions to be matched, a first color change gradient for each pixel in the detection region to be matched is calculated based on the fourth image. The formula for calculating the first color change gradient is: in, The first detection region to be matched The first color change gradient of each pixel The fourth image is the first The coordinates of each pixel; For each of the detection regions to be matched, a first color shift is calculated based on the first color change gradient of each pixel. The formula for calculating the first color shift is as follows: in, This represents the first color offset. The number of pixels in the detection area to be matched. For the first detection region to be matched The first color change gradient of each pixel It is the average value of the first color change gradient of all pixels in the detection area to be matched.

6. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The calculation of the first wastewater metal deposition degree based on the water surface turbidity index and the first color shift of the detection area to be matched includes: For each of the detection areas to be matched, the degree of metal deposition in the first wastewater is calculated based on the turbidity index of the water surface and the first color shift of the detection area to be matched. The formula for calculating the degree of metal deposition in the first wastewater is as follows: in, For the first The degree of metal deposition in the first wastewater of the area to be matched for detection. The first color offset of the detection area to be matched. The turbidity index of the water surface in the area to be matched for detection.

7. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The step of calculating the second color shift degree based on the second image using the standard matching template includes: For the standard matching template, the second color change gradient of each pixel of the standard matching template is calculated based on the second image. The formula for calculating the second color change gradient is: in, For the standard matching template of the first The second color change gradient of each pixel For the second image, the first The coordinates of each pixel; For the standard matching template, the second color shift is calculated based on the second color change gradient of each pixel. The formula for calculating the second color shift is: in, This is the second color offset. The number of pixels in the standard matching template. For the first standard matching template The second color change gradient of each pixel It is the average value of the second color change gradient of all pixels in the standard matching template.

8. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The calculation of the second wastewater metal deposition degree based on the second color shift includes: For the standard matching template, the degree of metal deposition in the second wastewater is calculated based on the second color offset. The formula for calculating the degree of metal deposition in the second wastewater is as follows: in, The degree of metal deposition in the second wastewater. This is the second color offset. The turbidity index of the standard matching template is 1.

9. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, For each of the detection regions to be matched, a matching window deformation adjustment parameter is calculated based on the rectangle size of the detection region to be matched and the standard matching template. The wastewater treatment similarity is calculated based on the degree of metal deposition in the first wastewater, the degree of metal deposition in the second wastewater, and the matching window deformation adjustment parameter, including: For each of the regions to be matched and detected, the deformation adjustment parameters of the matching window are calculated based on the rectangular size of the region to be matched and the rectangular size of the standard matching template. The calculation formula for the deformation adjustment parameters of the matching window is as follows: in, Adjust the deformation parameters for the matching window. For the first The size of the rectangle of the detection region to be matched. The rectangle size of the standard matching template; For each of the regions to be matched, the wastewater treatment similarity is calculated based on the degree of metal deposition in the first wastewater, the degree of metal deposition in the second wastewater, and the deformation adjustment parameter of the matching window. The formula for calculating the wastewater treatment similarity is as follows: in, The similarity of the wastewater treatment process is... Adjust the deformation parameters for the matching window. For the first The degree of metal deposition in the first wastewater in the area to be matched for detection. This represents the degree of metal deposition in the second wastewater.

10. The method for treating cleaning wastewater from an electrophoresis line based on machine vision according to claim 1, characterized in that, The method of determining whether the wastewater treatment of the electrophoresis line meets the standards based on the wastewater treatment similarity includes: Based on the wastewater treatment similarity, the number of compliant areas that meet the standards among the multiple areas to be matched for detection is determined, and the wastewater treatment of the electrophoresis line is judged to meet the standards based on the ratio of the compliant areas to the total number of areas to be matched for detection.

Citation Information

Patent Citations

  • Image processing apparatus and image processing method

    CN102842126A

  • Sewage treatment detection method based on template matching

    CN114882040A

  • Wastewater treatment grade detection method based on machine vision electrophoresis line discharge

    CN116823834A

  • Short-process wastewater zero-discharge treatment process

    CN118811945A

  • Method and apparatus for measurement of gloss of metal plate

    JP1997089770A