A water ecological environment pollution monitoring system

By adaptively selecting gradient threshold and structural element size, the image segmentation problem of overlapping aquatic products in the fishery environment is handled, and the accurate segmentation and dynamic tracking of aquatic products are achieved, which improves the accuracy of water ecological environment monitoring.

CN119648732BActive Publication Date: 2025-04-15SHENZHEN RUICHIAN ELECTRONIC TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510174859.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-18
Publication Date
2025-04-15
Estimated Expiration
2045-02-18

AI Technical Summary

Technical Problem

Existing image segmentation methods cannot effectively process overlapping aquatic products in the fishery environment, resulting in inaccurate segmentation and the inability to utilize dynamic tracking of individual aquatic products.

Method used

By obtaining the number of edge pixel points under the gradient threshold in the water ecological image, drawing the change curve, obtaining the mutation, adaptively selecting the optimal gradient threshold, obtaining the optimal edge image, and adaptively setting the structural element size for morphological corrosion to obtain the segmented image.

Benefits of technology

Accurate segmentation of overlapping aquatic products is achieved, ensuring that individual aquatic products do not break or disappear due to corrosion, and improving the dynamic tracking ability of aquatic products and the accuracy of water ecological environment monitoring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648732B_ABST
    Figure CN119648732B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image processing, and in particular to a water ecological environment pollution monitoring system, comprising: a water ecological image acquisition module, an edge image acquisition module, an adhesion rate acquisition module, a segmentation module, and a water ecological environment monitoring module, which acquires water ecological images, obtains the number of edge pixels under different gradient thresholds according to the gradient amplitude of all pixels in the water ecological image, and then obtains the mutation degree of each gradient threshold, obtains the optimal edge image according to the mutation degree, and then obtains a binary image of aquatic products, obtains the adhesion rate of each pixel in the connected domain of the binary image of aquatic products, obtains the size of the structural element of the pixel according to the adhesion rate, performs morphological corrosion on each pixel in the connected domain, obtains a segmented image, and then performs water ecological environment monitoring. The present invention has a good segmentation effect on overlapping aquatic products, is conducive to the dynamic tracking of aquatic products, and ensures the accuracy of water ecological environment monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image processing, and in particular to a water ecological environment pollution monitoring system. Background Art

[0002] Aquatic ecosystems play a key role in maintaining ecological balance, supporting biodiversity, regulating climate, providing drinking water, farmland irrigation, and supporting economic activities (such as fisheries, tourism, etc.). Water pollution will cause harm to the ecosystem, such as water quality deterioration, species extinction, destruction of aquatic plants and animal habitats, etc. The fishery environment is one of the aquatic ecological environments. Specifically, when aquatic products in the fishery environment die, it will cause a certain degree of pollution to the fishery environment and affect the growth of other aquatic products. Therefore, it is necessary to test the fishery environment, deal with dead aquatic products in a timely manner, and prevent pollution of the fishery environment.

[0003] Since multiple aquatic products may overlap visually during their movement in a fishery environment, existing image segmentation methods such as threshold segmentation and superpixel segmentation cannot separate overlapping aquatic products and do not utilize the dynamic tracking of individual aquatic products. Summary of the invention

[0004] In order to solve the above problems, the present invention provides a water ecological environment pollution monitoring system, the system comprising:

[0005] A water ecological image acquisition module, which collects water ecological images;

[0006] The edge image acquisition module obtains the gradient amplitude of all pixels in the water ecological image, sets multiple gradient thresholds, and obtains the number of all edge pixels under each gradient threshold according to the gradient amplitude of the pixels; draws a change curve with the gradient threshold as the horizontal axis and the number of edge pixels as the vertical axis; obtains the mutation degree of each gradient threshold according to the change curve; takes the gradient amplitude with the largest mutation rate as the optimal gradient threshold, and obtains the optimal edge image according to the optimal gradient threshold;

[0007] The adhesion rate acquisition module acquires the binary image of the aquatic product according to the optimal edge image, acquires all connected domains in the binary image of the aquatic product, performs skeleton extraction on each connected domain, uses the pixel points on the skeleton as the skeleton pixel points, and uses other pixel points in the connected domain as non-skeleton pixel points; acquires the feature points of each skeleton pixel point in the connected domain and the skeleton distance and spatial distance between the feature points; acquires the adhesion rate of the skeleton pixel point according to the skeleton distance and spatial distance of the feature points of the skeleton pixel point in the connected domain; acquires the reference skeleton point of each non-skeleton pixel point in the connected domain, and acquires the adhesion rate of each non-skeleton pixel point according to the adhesion rate of the reference skeleton point;

[0008] The segmentation module obtains the reference edge point of each pixel in the connected domain, obtains the size of the structural element of each pixel according to the adhesion rate of each pixel in the connected domain and the reference edge point; performs morphological corrosion on each pixel in the connected domain according to the size of the structural element of each pixel in the connected domain, and uses the image obtained after morphological corrosion as the segmentation image;

[0009] The water ecological environment monitoring module monitors the water ecological environment based on segmented images.

[0010] Preferably, the step of obtaining the number of all edge pixels under each gradient threshold according to the gradient amplitude of the pixel points comprises the following steps:

[0011] Taking any gradient threshold as the target gradient threshold, taking the pixel points whose gradient amplitude is greater than the target gradient threshold as the edge pixel points under the target gradient threshold; obtaining the number of all edge pixel points under the target gradient threshold;

[0012] Get the number of all edge pixels under each gradient threshold.

[0013] Preferably, the step of obtaining the mutation degree of each gradient threshold according to the change curve comprises the following steps:

[0014] Obtaining the slope of the point corresponding to each gradient threshold in the change curve as the slope of each gradient threshold, and taking the absolute value of the difference between the slope of each gradient threshold and the slope of the previous gradient threshold as the slope change rate of each gradient threshold;

[0015] Get the mutation degree of each gradient threshold according to the slope change rate of each gradient threshold:

[0016]

[0017] in, For the The mutation degree of the gradient threshold; For the The slope change rate of the gradient threshold; For the The gradient threshold adjacent to The slope change rate of the gradient threshold; is the set of slope change rates of all gradient thresholds; is the maximum value function; is the neighborhood size of the gradient threshold.

[0018] Preferably, the step of obtaining the optimal edge image according to the optimal gradient threshold comprises the following steps:

[0019] Obtain edge pixels under the optimal gradient threshold, mark the edge pixels as 1, and mark the remaining pixels as 0 to obtain a binary image as the optimal edge image.

[0020] Preferably, the step of obtaining a binary image of aquatic products according to the optimal edge image comprises the following steps:

[0021] The gray values ​​of all pixels in the area enclosed by the closed edges in the optimal edge image are set to 1 to obtain a binary image of aquatic products.

[0022] Preferably, the step of obtaining the feature points of each skeleton pixel point in the connected domain and the skeleton distance and spatial distance between the feature points comprises the following steps:

[0023] Two skeleton pixels on the same skeleton are regarded as indirectly adjacent skeleton pixels, the number of skeleton pixels between the two indirectly adjacent skeleton pixels is regarded as the skeleton distance between the two indirectly adjacent skeleton pixels, and the Euclidean distance between the two skeleton pixels is regarded as the spatial distance between the two skeleton pixels;

[0024] Get the skeletons located on both sides of the skeleton pixel point and indirectly adjacent to the skeleton pixel point, and the distance between the skeleton pixel point and the skeleton pixel point is The two skeleton pixels are respectively used as the two feature points of the skeleton pixel, where R is a preset skeleton distance threshold; the skeleton distance and the spatial distance of the two feature points of each skeleton pixel are obtained.

[0025] Preferably, the step of obtaining the adhesion rate of skeleton pixels according to the skeleton distance and the spatial distance of the feature points of the skeleton pixels in the connected domain comprises the following steps:

[0026] Take any connected domain as the target connected domain, and any skeleton pixel point in the target connected domain as the target skeleton point in the target connected domain; obtain the curvature of each skeleton pixel point on the skeleton; obtain the adhesion rate of the target skeleton point in the target connected domain based on the curvature and the skeleton distance and spatial distance between the two feature points of the target skeleton point:

[0027]

[0028] in is the adhesion rate of the target skeleton points in the target connected domain; is the curvature of the target skeleton point in the target connected domain; It is the set of curvatures of all skeleton pixels in the target connected domain; is the maximum value function; is the skeleton distance between two feature points of the target skeleton point in the target connected domain; is the spatial distance between two feature points of the target skeleton point in the target connected domain; is an exponential function with a natural constant as base;

[0029] Get the adhesion rate of each skeleton pixel in each connected domain.

[0030] Preferably, the step of obtaining a reference skeleton point of each non-skeleton pixel in the connected domain and obtaining the adhesion rate of each non-skeleton pixel according to the adhesion rate of the reference skeleton point comprises the following steps:

[0031] Obtain multiple skeleton pixels closest to each non-skeleton pixel in the target connected domain as reference skeleton points for each non-skeleton pixel;

[0032] According to the adhesion rate of the reference skeleton point of each non-skeleton pixel, the adhesion rate of each non-skeleton pixel in the target connected domain is obtained:

[0033]

[0034] in, is the first The adhesion rate of non-skeleton pixels; is the first The first non-skeleton pixel The reference skeleton point to the The distance between non-skeleton pixels; is the first The first non-skeleton pixel Adhesion rate of reference skeleton points; is the number of reference skeleton points for non-skeleton pixels; is an exponential function with a natural constant as base;

[0035] Get the adhesion rate of each non-skeleton pixel in each connected domain.

[0036] Preferably, the step of obtaining the reference edge point of each pixel in the connected domain and obtaining the size of the structural element of each pixel according to the adhesion rate of each pixel in the connected domain and the reference edge point comprises the following steps:

[0037] The pixel points on the edge of each connected domain of the aquatic product binary image are edge pixel points, and the edge pixel point closest to each pixel point in each connected domain is obtained as the reference edge point of each pixel point;

[0038] Get the size of the structural element of each pixel in the target connected domain according to the reference edge point of each pixel in the target connected domain:

[0039]

[0040] in, The target connected domain The size of the structural element of pixels; The target connected domain The distance from a pixel to its reference edge point; The target connected domain The adhesion rate of pixels; is a natural constant; is the maximum value function; The rounding symbol.

[0041] The present invention has the following beneficial effects: the present invention obtains the number of edge pixel points under different gradient thresholds according to the gradient amplitude of all pixel points in the water ecological image, draws a change curve, and then obtains the mutation degree of each gradient threshold, obtains the optimal gradient threshold according to the mutation degree, obtains the optimal edge image according to the optimal gradient threshold, and eliminates the interference of water ripples in the optimal edge image, and only retains the edge of the aquatic product. Compared with obtaining the edge image by artificially setting the gradient threshold, the optimal edge image obtained by the present invention is more accurate; the present invention obtains a binary image of aquatic products according to the optimal edge image, performs skeleton extraction on the connected domain in the binary image of aquatic products, obtains the adhesion rate of each pixel point in the connected domain of the binary image of aquatic products according to the distribution of skeleton pixels, obtains the size of the structural element of the pixel point according to the adhesion rate, performs morphological corrosion on each pixel point in the connected domain to obtain a segmented image, and monitors the ecological environment of the water area according to the segmented image. The present invention segments overlapping aquatic products into independent aquatic products by adaptively adjusting the size of the structural element of each pixel in the connected domain, while ensuring that a single aquatic product will not break or disappear due to corrosion. Compared with artificially setting the size of the structural element of morphological corrosion, the present invention has a better segmentation effect on overlapping aquatic products, is more conducive to the dynamic tracking of aquatic products, and ensures the accuracy of water ecological environment monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0043] Figure 1 A system block diagram of a water ecological environment pollution monitoring system provided by an embodiment of the present invention;

[0044] Figure 2 This is an image of water ecology. DETAILED DESCRIPTION

[0045] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation, structure, features and effects of a water ecological environment pollution monitoring system proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.

[0046] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0047] The specific scheme of the water ecological environment pollution monitoring system provided by the present invention is described in detail below with reference to the accompanying drawings.

[0048] See also Figure 1 , which shows a water ecological environment pollution monitoring system provided by an embodiment of the present invention, the system includes the following modules:

[0049] The water area ecological image acquisition module S101 acquires water area ecological images.

[0050] The camera deployed above the aquaculture waters is used to capture the monitoring video of the aquatic ecological environment of the aquaculture waters. In order to monitor the aquatic ecological environment in real time, it is necessary to identify the aquatic products in each frame of the monitoring video. Each frame of the monitoring video is recorded as an RGB image of the aquatic ecological environment. In order to facilitate subsequent analysis, the RGB image of the aquatic ecological environment is converted into a grayscale image and recorded as an aquatic ecological image. See Figure 2 .

[0051] At this point, the water ecological image has been obtained.

[0052] The edge image acquisition module S102 acquires the optimal edge image of the water ecological image.

[0053] It should be noted that in order to identify aquatic products in the water ecological environment, it is necessary to first extract aquatic products from the water ecological image. It is known that the edge gradient of the aquatic product area in the image is large, and the gradient of the water ripple is small. Therefore, as the gradient threshold increases, the edge pixel points that disappear first are the pixel points on the edge of the water ripple. Since the edge gradient of aquatic products is large, the speed at which the edge pixel points disappear is slow as the threshold gradually increases. Therefore, the optimal gradient threshold can be obtained by obtaining the change in the number of edge pixels under different gradient thresholds.

[0054] In an embodiment of the present invention, the Sobel operator is used to obtain the gradient amplitude of all pixels in the aquatic ecological image. Each integer in the range of [0,255] is used as a gradient threshold, any gradient threshold is used as a target gradient threshold, and the pixel points with a gradient amplitude greater than the target gradient threshold are used as edge pixels under the target gradient threshold. The number of all edge pixels under the target gradient threshold is obtained.

[0055] Similarly, the number of all edge pixels under each gradient threshold is obtained.

[0056] With the gradient threshold as the horizontal axis and the number of edge pixels as the vertical axis, a change curve of the number of edge pixels under different gradient thresholds is drawn, which is referred to as a change curve for short.

[0057] It should be noted that as the gradient threshold increases, the edge pixels belonging to water ripples disappear first, and the remaining edge pixels belong to aquatic products. Water ripples account for the majority of the water ecological image, and aquatic products account for a small part relative to water ripples. As the gradient threshold increases, the number of edge pixels decreases. When it decreases to a certain extent, the edge pixels of water ripples disappear, and only the edge pixels of aquatic products remain. At this time, the number of edge pixels tends to be stable. As the gradient threshold continues to increase, the edge pixels of aquatic products also gradually disappear, and the number of edge pixels gradually tends to 0. In order to eliminate the interference of water ripples and obtain aquatic products, it is necessary to obtain the mutation degree of each gradient threshold according to the change of the number of edge pixels under different gradient thresholds in the change curve, so as to screen out the optimal gradient threshold and extract aquatic products in the water ecological image according to the optimal gradient threshold.

[0058] In an embodiment of the present invention, the slope of a point corresponding to each gradient threshold in the change curve is obtained as the slope of each gradient threshold, and the absolute value of the difference between the slope of each gradient threshold and the slope of the previous gradient threshold is taken as the slope change rate of each gradient threshold.

[0059] Get the mutation degree of each gradient threshold according to the slope change rate of each gradient threshold:

[0060]

[0061] in, For the The mutation degree of the gradient threshold; For the The slope change rate of the gradient threshold; For the The gradient threshold adjacent to The slope change rate of the gradient threshold; is the set of slope change rates of all gradient thresholds; is the maximum value function, Indicates in the collection Get the maximum slope change rate; is the neighborhood size of the gradient threshold. In the embodiment of the present invention, In other embodiments, the implementer can set The size of When the slope change rate of the first gradient threshold is the local maximum and is significantly different from the slope change rates of the adjacent multiple gradient thresholds, The first gradient threshold may be the dividing line between the gradient amplitude of the water ripple and the edge pixel of the aquatic product. The greater the mutation degree of the gradient threshold.

[0062] It should be noted that the gradient threshold 0 does not have a previous gradient threshold, so the gradient threshold 0 does not have a slope change rate, and there is no need to calculate the mutation degree.

[0063] The gradient amplitude with the largest mutation rate is taken as the optimal gradient threshold, and the edge pixels under the optimal gradient threshold are obtained. The edge pixels are marked as 1, and the remaining pixels are marked as 0 to obtain a binary image as the optimal edge image.

[0064] At this point, the optimal edge image is obtained.

[0065] The adhesion rate acquisition module S103 acquires the adhesion rate of each pixel point in each connected domain of the binary image of the aquatic product.

[0066] It should be noted that when detecting the death of aquatic products, some aquatic products may overlap, which may cause errors in the subsequent identification of aquatic products. Therefore, it is necessary to separate the aquatic products based on the overlapping characteristics of the aquatic products. The edge in the optimal edge image is the outline of the aquatic product. It is difficult to identify whether the aquatic products overlap based on the outline alone. Therefore, it is necessary to obtain the binary image of the aquatic product based on the outline of the aquatic product.

[0067] In the embodiment of the present invention, the area enclosed by the closed edges in the optimal edge image is filled, and the grayscale values ​​of all pixels in the area enclosed by the closed edges are set to 1, so as to obtain a binary image of aquatic products.

[0068] Connected domain analysis is performed on white pixels in the binary image of aquatic products to obtain all connected domains in the binary image of aquatic products, and skeleton extraction is performed on each connected domain to obtain the skeleton of each connected domain. The pixels on the skeleton are used as skeleton pixels.

[0069] It should be noted that each connected domain in the binary image of aquatic products may be a single aquatic product or multiple overlapping aquatic products. When the connected domain is a plurality of overlapping aquatic products, the aquatic products are partially overlapped, and the swimming directions of each aquatic product are different, so there are intersections in the skeleton of the connected domain. When the connected domain is a single aquatic product, the skeleton of the connected domain approaches a straight line. The embodiment of the present invention introduces the concept of adhesion rate, which is used to represent the probability that a pixel point is located in an area where multiple aquatic products overlap. When the adhesion rate of a skeleton pixel point is large, it means that the skeleton pixel point is located in the overlapping part of multiple aquatic products, and when the adhesion rate of a skeleton pixel point is small, it means that the pixel point is located in the non-overlapping part. For a pixel point with a large adhesion rate, it is necessary to perform an erosion operation on its adaptively larger structural element so that the overlapping area can be separated. For a pixel point with a small adhesion rate, it is necessary to perform an erosion operation on its adaptively smaller structural element so that the current area will not be broken due to corrosion.

[0070] In the embodiment of the present invention, if two skeleton pixel points are on the same skeleton, the two skeleton pixel points are called indirectly adjacent, the number of skeleton pixel points between the two skeleton pixel points is used as the skeleton distance of the two skeleton pixel points, and the Euclidean distance of the two skeleton pixel points is used as the spatial distance of the two skeleton pixel points. Any connected domain is used as the target connected domain, and any skeleton pixel point in the target connected domain is used as the target skeleton point in the target connected domain. The skeleton pixels located on both sides of the target skeleton point and indirectly adjacent to the target skeleton point and having a skeleton distance to the target skeleton point are obtained. The two skeleton pixel points are used as the two feature points of the target skeleton point. is a preset skeleton distance threshold. In the embodiment of the present invention, In other embodiments, the implementer can set It should be noted that when the target skeleton point is close to the end point of the skeleton, there may be no skeleton on the side of the target skeleton point that is indirectly adjacent to the target skeleton point and has a distance of At this time, the skeleton pixel point that is indirectly adjacent to the target skeleton point on this side and has the largest skeleton distance with the target skeleton point is obtained as a feature point of the target skeleton point.

[0071] Get the curvature of each skeleton pixel on the skeleton, and get the adhesion rate of the target skeleton point in the target connected domain based on the curvature:

[0072]

[0073] in is the adhesion rate of the target skeleton points in the target connected domain; is the curvature of the target skeleton point in the target connected domain; It is the set of curvatures of all skeleton pixels in the target connected domain; is the maximum value function, Indicates obtaining the maximum curvature in the set K, the purpose is to Perform normalization; is the skeleton distance between two feature points of the target skeleton point in the target connected domain; is the spatial distance between two feature points of the target skeleton point in the target connected domain; is an exponential function with a natural constant as base; It is the ratio of the spatial distance of the two feature points of the target skeleton point to the skeleton distance. When the ratio is larger, that is, the closer it is to 1, the spatial distance is approximately equal to the skeleton distance. At this time, the skeleton between the two feature points is approximately a straight line. At this time, the skeleton segment is likely to belong to one aquatic product, and the adhesion rate of the target skeleton point is smaller. Conversely, when the ratio is smaller, that is, the closer it is to 0, the spatial distance is different from the skeleton distance. At this time, there is a large bend in the skeleton between the two feature points. At this time, the skeleton segment is likely to belong to two aquatic products, and the adhesion rate of the target skeleton point is larger. There may be two partially overlapping aquatic products with roughly the same skeleton direction. At this time, it is difficult to distinguish them only based on the ratio of the spatial distance of the two feature points of the target skeleton point to the skeleton distance. Therefore, the curvature of the target skeleton point is combined to distinguish them. When the curvature of the target skeleton point is larger, the target skeleton point is at the intersection of the skeletons of the two aquatic products. At this time, the adhesion rate of the target skeleton point is larger, otherwise the adhesion rate is smaller.

[0074] Similarly, the adhesion rate of each skeleton pixel in the target connected domain is obtained.

[0075] Each pixel other than all skeleton pixels in the target connected domain is called a non-skeleton pixel. Get the nearest pixel in the target connected domain to each non-skeleton pixel. skeleton pixel points as reference skeleton points for each non-skeleton pixel point. In this embodiment of the present invention, In other embodiments, the implementer can set The value of .

[0076] According to the adhesion rate of the reference skeleton point of each non-skeleton pixel, the adhesion rate of each non-skeleton pixel in the target connected domain is obtained:

[0077]

[0078] in, is the first The adhesion rate of non-skeleton pixels; is the first The first non-skeleton pixel The reference skeleton point to the The distance between non-skeleton pixels; is the first The first non-skeleton pixel The adhesion rate of the reference skeleton points; is the number of reference skeleton points for non-skeleton pixels; is an exponential function with a natural constant as the base; As the The first non-skeleton pixel The weight of the reference skeleton point The first non-skeleton pixel The reference skeleton point to the The smaller the distance between the first and second non-skeleton pixels, the greater the weight, and vice versa. The weighted sum of the adhesion rates of all reference skeleton points of non-skeleton pixels is obtained The adhesion rate of non-skeleton pixels; When the adhesion rate of the reference skeleton point of the non-skeleton pixel is large, the The closer the first skeleton pixel is to its reference skeleton point, the The greater the adhesion rate of the skeleton points, the greater the When the adhesion rates of the reference skeleton points of the non-skeleton pixels are all small, The adhesion rate of non-skeleton pixels is also small.

[0079] At this point, the adhesion rate of each skeleton pixel point and the adhesion rate of each non-skeleton pixel point in the target connected domain are obtained, that is, the adhesion rate of each pixel point in the target connected domain is obtained.

[0080] Similarly, the adhesion rate of each pixel in each connected domain of the aquatic product binary image was obtained.

[0081] The segmentation module S104 segments the adhesion area in the binary image of the aquatic product.

[0082] It should be noted that pixels with a larger adhesion rate are more likely to be located in the area where multiple aquatic products overlap. Therefore, when performing morphological corrosion on them, a larger structural element needs to be used to separate the adhesion areas. For pixels with a smaller adhesion rate, a smaller structural element is used when corroding them so that the area will not break or disappear due to corrosion.

[0083] In the embodiment of the present invention, the pixel points on the edge of each connected domain of the aquatic product binary image are edge pixels. The edge pixel point closest to each pixel point in each connected domain is obtained as the reference edge point of each pixel point.

[0084] Get the size of the structural element of each pixel in the target connected domain according to the reference edge point of each pixel in the target connected domain:

[0085]

[0086] in, The target connected domain The size of the structural element of pixels; The target connected domain The distance from a pixel to its reference edge point; The target connected domain The adhesion rate of pixels; is a natural constant; is the maximum value function, Indicated in and Take the maximum value to prevent the size of the structure element from being 0; is the rounding symbol; As the The initial structure element size of pixels is When the adhesion rate of pixels is large, A pixel may be located in multiple aquatic product areas. In order to separate the adhering areas, the The structural element of the pixel should be larger than its initial structural element size. When the adhesion rate of pixels is small, The pixel point may be located in the area of ​​a single aquatic product. In order to prevent the area from breaking or disappearing due to corrosion, the The size of the structural element of each pixel should be smaller than its initial structural element size. Therefore, the embodiment of the present invention will As the The adjustment coefficient of the initial structure element size of each pixel is used to adjust the size of the structure element.

[0087] use The structural element of size is used to focus on the target connected domain in the binary image of aquatic products. Morphological corrosion is performed on pixels.

[0088] Similarly, the size of the structural element of each pixel point of each connected domain in the binary image of aquatic products is obtained, and morphological corrosion is performed on each pixel point of each connected domain according to the size of the structural element of each pixel point of each connected domain in the binary image of aquatic products, and the image obtained after morphological corrosion is used as the segmented image.

[0089] At this point, the segmented image is obtained.

[0090] The water area ecological environment monitoring module S105 performs water area ecological environment monitoring based on the segmented images.

[0091] Each connected domain in the segmented image is an aquatic product. By comparing the position changes of the same aquatic product in the segmented images of multiple consecutive frames in the surveillance video, each aquatic product is dynamically monitored. If an aquatic product has not moved for a long time or has moved very little, it is likely that the aquatic product has died. At this time, it is necessary to manually salvage the dead aquatic product to prevent pollution of the water ecological environment.

[0092] In summary, the system of the present invention includes an aquatic ecological image acquisition module, an edge image acquisition module, an adhesion rate acquisition module, a segmentation module, and an aquatic ecological environment monitoring module. The present invention obtains the number of edge pixels under different gradient thresholds according to the gradient amplitude of all pixel points in the aquatic ecological image, draws a change curve, and then obtains the mutation degree of each gradient threshold, obtains the optimal gradient threshold according to the mutation degree, and obtains the optimal edge image according to the optimal gradient threshold. The interference of water ripples is eliminated in the optimal edge image, and only the edge of the aquatic product is retained. Compared with the edge image obtained by artificially setting the gradient threshold, the optimal edge image obtained by the present invention is more accurate; the present invention obtains a binary image of aquatic products according to the optimal edge image, performs skeleton extraction on the connected domain in the binary image of aquatic products, obtains the adhesion rate of each pixel point in the connected domain of the binary image of aquatic products according to the distribution of skeleton pixels, obtains the structural element size of the pixel point according to the adhesion rate, performs morphological corrosion on each pixel point in the connected domain, obtains a segmented image, and monitors the ecological environment of the aquatic product according to the segmented image. The present invention segments overlapping aquatic products into independent aquatic products by adaptively adjusting the size of the structural element of each pixel in the connected domain, while ensuring that a single aquatic product will not break or disappear due to corrosion. Compared with artificially setting the size of the structural element of morphological corrosion, the present invention has a better segmentation effect on overlapping aquatic products, is more conducive to the dynamic tracking of aquatic products, and ensures the accuracy of water ecological environment monitoring.

[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A water ecological environment pollution monitoring system, characterized in that: The system comprises: A water ecological image acquisition module, which collects water ecological images; The edge image acquisition module obtains the gradient amplitude of all pixels in the water ecological image, sets multiple gradient thresholds, and obtains the number of all edge pixels under each gradient threshold according to the gradient amplitude of the pixels; draws a change curve with the gradient threshold as the horizontal axis and the number of edge pixels as the vertical axis; obtains the mutation degree of each gradient threshold according to the change curve; takes the gradient amplitude with the largest mutation rate as the optimal gradient threshold, and obtains the optimal edge image according to the optimal gradient threshold; The adhesion rate acquisition module acquires the binary image of the aquatic product according to the optimal edge image, acquires all connected domains in the binary image of the aquatic product, performs skeleton extraction on each connected domain, uses the pixel points on the skeleton as the skeleton pixel points, and uses other pixel points in the connected domain as non-skeleton pixel points; acquires the feature points of each skeleton pixel point in the connected domain and the skeleton distance and spatial distance between the feature points; acquires the adhesion rate of the skeleton pixel point according to the skeleton distance and spatial distance of the feature points of the skeleton pixel point in the connected domain; acquires the reference skeleton point of each non-skeleton pixel point in the connected domain, and acquires the adhesion rate of each non-skeleton pixel point according to the adhesion rate of the reference skeleton point; The segmentation module obtains the reference edge point of each pixel in the connected domain, obtains the size of the structural element of each pixel according to the adhesion rate of each pixel in the connected domain and the reference edge point; performs morphological corrosion on each pixel in the connected domain according to the size of the structural element of each pixel in the connected domain, and uses the image obtained after morphological corrosion as the segmentation image; The water ecological environment monitoring module monitors the water ecological environment based on the segmented images; The step of obtaining the mutation degree of each gradient threshold according to the change curve includes: Obtaining the slope of the point corresponding to each gradient threshold in the change curve as the slope of each gradient threshold, and taking the absolute value of the difference between the slope of each gradient threshold and the slope of the previous gradient threshold as the slope change rate of each gradient threshold; Get the mutation degree of each gradient threshold according to the slope change rate of each gradient threshold: in, For the The mutation degree of the gradient threshold; For the The slope change rate of the gradient threshold; For the The gradient threshold adjacent to The slope change rate of the gradient threshold; is the set of slope change rates of all gradient thresholds; is the maximum value function; is the neighborhood size of the gradient threshold.

2. A water ecological environment pollution monitoring system according to claim 1, characterized in that: The step of obtaining the number of all edge pixels under each gradient threshold according to the gradient amplitude of the pixel points comprises: Taking any gradient threshold as the target gradient threshold, taking the pixel points whose gradient amplitude is greater than the target gradient threshold as the edge pixel points under the target gradient threshold; obtaining the number of all edge pixel points under the target gradient threshold; Get the number of all edge pixels under each gradient threshold.

3. A water ecological environment pollution monitoring system according to claim 1, characterized in that: The step of obtaining the optimal edge image according to the optimal gradient threshold comprises: Obtain edge pixels under the optimal gradient threshold, mark the edge pixels as 1, and mark the remaining pixels as 0 to obtain a binary image as the optimal edge image.

4. A water ecological environment pollution monitoring system according to claim 1, characterized in that: The step of obtaining a binary image of aquatic products according to the optimal edge image comprises: The gray values ​​of all pixels in the area enclosed by the closed edges in the optimal edge image are set to 1 to obtain a binary image of aquatic products.

5. The water ecological environment pollution monitoring system according to claim 1 is characterized in that: The step of obtaining the feature points of each skeleton pixel point in the connected domain and the skeleton distance and spatial distance between the feature points comprises: Two skeleton pixels on the same skeleton are regarded as indirectly adjacent skeleton pixels, the number of skeleton pixels between the two indirectly adjacent skeleton pixels is regarded as the skeleton distance between the two indirectly adjacent skeleton pixels, and the Euclidean distance between the two skeleton pixels is regarded as the spatial distance between the two skeleton pixels; Get the skeletons located on both sides of the skeleton pixel point and indirectly adjacent to the skeleton pixel point, and the distance between the skeleton pixel point and the skeleton pixel point is The two skeleton pixels are taken as two feature points of the skeleton pixel, respectively, where R is a preset skeleton distance threshold; Get the skeleton distance and spatial distance between the two feature points of each skeleton pixel.

6. The water ecological environment pollution monitoring system according to claim 1 is characterized in that: The method of obtaining the adhesion rate of skeleton pixels according to the skeleton distance and the spatial distance of the feature points of the skeleton pixels in the connected domain comprises the following steps: Take any connected domain as the target connected domain, and any skeleton pixel point in the target connected domain as the target skeleton point in the target connected domain; obtain the curvature of each skeleton pixel point on the skeleton; obtain the adhesion rate of the target skeleton point in the target connected domain based on the curvature and the skeleton distance and spatial distance between the two feature points of the target skeleton point: in is the adhesion rate of the target skeleton points in the target connected domain; is the curvature of the target skeleton point in the target connected domain; It is the set of curvatures of all skeleton pixels in the target connected domain; is the maximum value function; is the skeleton distance between two feature points of the target skeleton point in the target connected domain; is the spatial distance between two feature points of the target skeleton point in the target connected domain; is an exponential function with a natural constant as base; Get the adhesion rate of each skeleton pixel in each connected domain.

7. A water ecological environment pollution monitoring system according to claim 6, characterized in that: The step of obtaining a reference skeleton point of each non-skeleton pixel in the connected domain and obtaining the adhesion rate of each non-skeleton pixel according to the adhesion rate of the reference skeleton point comprises the following steps: Obtain multiple skeleton pixels closest to each non-skeleton pixel in the target connected domain as reference skeleton points for each non-skeleton pixel; According to the adhesion rate of the reference skeleton point of each non-skeleton pixel, the adhesion rate of each non-skeleton pixel in the target connected domain is obtained: in, is the first The adhesion rate of non-skeleton pixels; is the first The first non-skeleton pixel The reference skeleton point to the The distance between non-skeleton pixels; is the first The first non-skeleton pixel The adhesion rate of the reference skeleton points; is the number of reference skeleton points for non-skeleton pixels; is an exponential function with a natural constant as base; Get the adhesion rate of each non-skeleton pixel in each connected domain.

8. The water ecological environment pollution monitoring system according to claim 1 is characterized in that: The step of obtaining the reference edge point of each pixel in the connected domain and obtaining the size of the structural element of each pixel according to the adhesion rate of each pixel in the connected domain and the reference edge point comprises the following steps: The pixel points on the edge of each connected domain of the aquatic product binary image are edge pixel points, and the edge pixel point closest to each pixel point in each connected domain is obtained as the reference edge point of each pixel point; Get the size of the structural element of each pixel in the target connected domain according to the reference edge point of each pixel in the target connected domain: in, The target connected domain The size of the structural element of pixels; The target connected domain The distance from a pixel to its reference edge point; The target connected domain The adhesion rate of pixels; is a natural constant; is the maximum value function; The rounding symbol.

Citation Information

Patent Citations

  • Background frame feature-based adhesion rice grain image segmentation method

    CN108460780A

  • Image-based assay using intelligent monitoring structures

    CN113227754A