A method and device for target extraction of gelatinous plankton in in-situ images
By combining the bilateral-Sobel filtering algorithm and the global thresholding method of maximum inter-class variance with morphological closing operations, the problem of target loss and fragmentation of gel-like plankton in in-situ images was solved, achieving efficient target extraction.
Patent Information
- Application Number
- CN202210887816.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-26
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-07-26
AI Technical Summary
Gel-like planktonic organisms are prone to target loss and breakage in in situ images, and existing technologies struggle to effectively extract their edge information.
The original grayscale image is denoised and edge-enhanced using a bilateral-Sobel filtering algorithm. Adaptive binarization segmentation is performed by combining the maximum inter-class variance global thresholding method, and the target is extracted by morphological closing operation.
It improved the detection rate and integrity rate of gel-like planktonic organisms, enhanced the recall rate, and ensured the integrity and accuracy of the targets.
Smart Images

Figure CN115345834B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of plankton identification, and particularly to a target extraction method and device for gelatinous plankton in in-situ images. BACKGROUND
[0002] In-situ measurement refers to detecting a target in the original system without changing the original environment of the target, rather than detecting the target by separating it from the original environment. This approach can maximize the accuracy of the data obtained by approximating the real situation as much as possible. Therefore, in-situ measurement is also advocated in the field of plankton monitoring. An underwater in-situ optical imaging instrument based on optical imaging technology is the most effective means for in-situ observation of plankton. Representative products include ZOOVIS (see “TREVOR ROW M V, MACKAS D L, BENFIELD MC. Comparison of Multifrequency Acoustic and in Situ Measurements of Zooplankton Abundances in Knight Inlet, British Columbia [J]. The Journal of the Acoustical Society of America, 2005, 117(6): 3574-3588.”) and PlanktonScope (a towed plankton imaging instrument) (see “SONG J, BI H, CAI Z, et al. Early Warning of Noctiluca Scintillans Blooms Using in-Situ Plankton Imaging System: An Example from Dapeng Bay, P.R. China [J]. Ecological Indicators, 2020, 112: 106123. DOI: 10.1016 / j.ecolind.2020.106123.”).
[0003] The PlanktonScope combines back-illumination and dual-CCD imaging technology, and the highest resolution of the in-situ image captured thereby is 2448*2050, and the PlanktonScope has the characteristics of large depth of field, high precision and low contrast, and the farthest imaging distance reaches the meter level, and the imaging scale spans the micrometer and centimeter levels, and the PlanktonScope can truly reflect the condition of a liter of water, and both the jellyfish-like plankton of several centimeters and the copepod-like plankton of several micrometers can be presented in the in-situ image. However, since the seawater also contains a large amount of particulate, rod-shaped and flocculent suspended matters and bubbles and the like impurities, the impurities will be captured into the in-situ image together with the plankton to form noise points, and under the influence of the natural light intensity and the diving depth of the imaging instrument, the in-situ image captured is often dark, and these conditions will bring challenges to the later target extraction. In addition, the imaging characteristics of different types of plankton are different, and therefore the target extraction method is different to a great extent according to the type.
[0004] As shown in Figure 1a 、 1b , the gelatinous plankton such as jellyfish and brown cyst algae has a water content of more than 98%, and the body is translucent, and the characteristics reflected in the in-situ image are that the gray value is close to the background gray value, and the outline is relatively blurred, and the edge connection is relatively weak, and the gelatinous plankton is easy to stick to the background noise, so that the edge information of the target is easy to be lost in the target detection stage, and the problems of target loss and target breakage are caused.
[0005] It should be noted that the information disclosed in the above background section is only for understanding the background of the present application, and therefore can include information that does not constitute the prior art known to those of ordinary skill in the art. SUMMARY
[0006] The purpose of the present application is to solve the problems of target loss and target breakage of the gelatinous plankton in the target detection stage, and to provide a target extraction method and device for gelatinous plankton in an in-situ image.
[0007] The technical problem of the present application is solved by the following technical scheme:
[0008] In a first aspect, the present application discloses a target extraction method for gelatinous plankton in an in-situ image, comprising the following steps: S1, reading an original gray image; S2, processing the original gray image using a bilateral-Sobel filter algorithm to obtain a gradient image after noise reduction and edge enhancement; S3, performing adaptive binaryzation segmentation on the gradient image using a maximum inter-class variance global threshold method to obtain a first binaryzation image; S4, performing a morphological closing operation on the binaryzation image to obtain a second binaryzation image; and S5, extracting a target from the second binaryzation image.
[0009] In a second aspect, the present application further discloses a target extraction device for gelatinous plankton in in-situ images, comprising: a reading module configured to read an original grayscale image; a filtering processing module configured to process the original grayscale image using a bilateral-Sobel filtering algorithm to obtain a gradient image with noise removed and edge enhanced; a binaryzation segmentation module configured to perform adaptive binaryzation segmentation on the gradient image using a maximum inter-class variance global threshold method to obtain a first binaryzation image; a morphological closing operation module configured to perform morphological closing operation on the binaryzation image to obtain a second binaryzation image; and an extraction module configured to extract a target from the second binaryzation image.
[0010] In a third aspect, the present application further discloses a computer readable storage medium storing a computer program, which, when executed by a processor, implements the target extraction method for gelatinous plankton in in-situ images according to the first aspect.
[0011] The beneficial effects of the present application compared with the prior art include:
[0012] The target extraction method for gelatinous plankton in in-situ images according to the present application adopts the bilateral-Sobel filtering algorithm according to the characteristics of gelatinous plankton in in-situ images, which can suppress noise points and background in the in-situ image of plankton while enhancing the edge information of the target, thereby reducing the problem that the target cannot be segmented from the background noise due to the adhesion of the target and noise and background in the target detection stage, and reducing the problem that the target is fragmented and segmented due to the loss of edge information of the object, thereby maximizing the target detection rate and the target integrity rate, and further improving the complete target recall rate. The target detection rate, the target integrity rate and the complete target recall rate of the target extraction method according to the present application are higher than those of the existing similar methods, and it is a very potential method that can be used to extract the target of gelatinous plankton in in-situ images. BRIEF DESCRIPTION OF DRAWINGS
[0013] Figure 1a is an in-situ image of jellyfish class collected by a towed underwater in-situ imager of the prior art;
[0014] Figure 1b is an in-situ image of jellyfish class collected by a towed underwater in-situ imager of the prior art;
[0015] Figure 1c is an in-situ image of brown cyst algae class collected by a towed underwater in-situ imager of the prior art;
[0016] Figure 2 is a flowchart of the target extraction method for gelatinous plankton in in-situ images according to Embodiment 1 of the present application;
[0017] Figure 3ais a binary segmentation result diagram corresponding to the Gaussian filtering in Comparative Example 1;
[0018] Figure 3b is a target detection result diagram corresponding to the Gaussian filtering in Comparative Example 1;
[0019] Figure 4a is a binary segmentation result diagram corresponding to the bilateral filtering in Comparative Example 2;
[0020] Figure 4b is a target detection result diagram corresponding to the bilateral filtering in Comparative Example 2;
[0021] Figure 5a is a gradient gray scale diagram corresponding to the Sobel filtering in Comparative Example 3;
[0022] Figure 5b is a binary segmentation result diagram corresponding to the Sobel filtering in Comparative Example 3;
[0023] Figure 6a is an in-situ diagram of plankton in the experimental example of the present application;
[0024] Figure 6b is a gradient numerical heat map corresponding to the Sobel filtering in the experimental example of the present application;
[0025] Figure 6c is a binary segmentation result diagram corresponding to the Sobel filtering in the experimental example of the present application;
[0026] Figure 6d is a binary segmentation result diagram corresponding to the bilateral filtering in the experimental example of the present application;
[0027] Figure 6e is a gradient numerical heat map corresponding to the combination of the bilateral filtering and the Sobel filtering in the experimental example of the present application;
[0028] Figure 6f is a target extraction result diagram after the combination of the bilateral filtering and the Sobel filtering and binary segmentation in the experimental example of the present application;
[0029] Figure 6g is a target extraction result diagram after the combination of the bilateral filtering and the Sobel filtering, binary segmentation and morphological processing in the experimental example of the present application;
[0030] Figure 7 is a comparison diagram of column gradient mean of images obtained by using only the Sobel filtering and by using the combination of the bilateral filtering and the Sobel filtering in the experimental example of the present application;
[0031] Figure 8is a contrast image of image gradients obtained by using only Sobel filtering and using bilateral filtering and Sobel filtering in combination in the experimental example of the present application;
[0032] Figure 9a is a schematic diagram of the binary segmentation result corresponding to the processing of the combination of Gaussian filtering and Sobel filtering in the experimental example of the present application;
[0033] Figure 9b is a schematic diagram of the target detection result corresponding to the processing of the combination of Gaussian filtering and Sobel filtering in the experimental example of the present application;
[0034] Figure 9c is a schematic diagram of the binary segmentation result corresponding to the processing of the combination of bilateral filtering and Sobel filtering in the experimental example of the present application;
[0035] Figure 9d is a schematic diagram of the target detection result corresponding to the processing of the combination of bilateral filtering and Sobel filtering in the experimental example of the present application. DETAILED DESCRIPTION
[0036] The present application will be further described below with reference to the accompanying drawings and in conjunction with preferred embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0037] The in-situ images of gelatinous plankton used in the embodiments, comparative examples and experimental examples of the present application were taken by a towed underwater in-situ imaging instrument PlanktonScope developed by domestic researchers in the waters of Yangjiang, Guangdong Province (see“SONG J, BI H, CAI Z, et al. Early Warning of Noctiluca Scintillans Blooms Using in-Situ Plankton Imaging System: An Example from Dapeng Bay, P.R. China [J]. Ecological Indicators, 2020, 112: 106123. DOI:10.1016 / j.ecolind.2020.106123.”).
[0038] Embodiment 1
[0039] Reference Figure 2 The present embodiment provides a target extraction method for gelatinous plankton in an in-situ image, comprising the following steps:
[0040] S1, reading an original gray-scale image.
[0041] S2, processing the original gray-scale image using a bilateral-Sobel filtering algorithm to obtain a gradient image that has been denoised and edge enhanced.
[0042] Wherein, the bilateral-Sobel filtering algorithm refers to that the original gray image is denoised by using a bilateral filter algorithm, and then an image after denoising is subjected to edge enhancement by using a Sobel filtering algorithm to obtain the gradient image. The bilateral filtering algorithm considers both the positional relationship between pixels (spatial information) and the difference between pixel values (value domain information), can protect the target edge gray characteristics to the maximum extent while smoothing and denoising, can effectively prevent the problem of target fracture, and then the edge enhancement can make the edge features more obvious.
[0043] Specifically, the bilateral filtering algorithm is that a bilateral kernel is a two-dimensional matrix B of KxK, wherein K is an odd number, a center point of the matrix is an origin (0, 0), the coordinates (x, y) of each element on the matrix are described by the relative positional relationship with the origin, x and y are integers in the range of [- (K-1) / 2, (K-1) / 2], and the spatial weight G x,y is calculated by the following formula:
[0044]
[0045] In the above formula, σ G is a normal distribution variance, τ G is a weight coefficient, the weight coefficient τ G adjusts the size of each spatial weight G x,y so that the sum of the spatial weights satisfies ΣG x,y = 1.
[0046] The weight value of each coordinate point in the value domain is related to the pixel values of the covered region, the image pixel value matrix is I, the bilateral kernel slides on the image, when the center point of the bilateral kernel corresponds to the image pixel coordinates (u, v), the value domain weight W x,y,u,v and the weight value B x,y,u,v of the bilateral kernel are calculated by the following formulas respectively:
[0047]
[0048] B x,y,u,v = G x,y W x,y,u,v
[0049] Wherein, I u+x,v+y is an image pixel value corresponding to the coordinates (u+x, v+y), I u,v is an image pixel value corresponding to the coordinates (u, v), σ W is a normal distribution variance, τ W is a weight coefficient, the weight coefficient τ W adjusts the size of each value domain weight W x,y,u,vThe size of such that their sum satisfies ∑W x,y,u,v =1, the weight value B of the two-sided kernel x,y,u,v Spatial weight G x,y Sum range weight W x,y,u,v The product of the two sides. As can be seen from the formula, when the bilateral kernel processes the target edge, the difference between the neighboring pixel values and the center pixel value is large, and the corresponding value range weight W... x,y,u,v The value is reduced accordingly, thereby weakening the influence of neighboring pixels on edge pixel values and achieving the effect of edge preservation.
[0050] At object edges, pixel values typically change significantly. If we differentiate the image, the derivative value at object edges will be larger than in other areas. The Sobel gradient operator can be used to calculate the derivative value at pixel edges. Specifically, the Sobel filtering algorithm is as follows: the Sobel templates in the x and y directions are D... x and D y Use template D x A weighted summation operation is performed on the corresponding image region to obtain the gradient S of the central pixel of the region in the horizontal direction. x Use template D y A weighted summation operation is performed on the corresponding image region to obtain the gradient S of the central pixel in the vertical direction. y The gradient magnitude S of the corresponding pixel can be obtained through vector operations. x,y :
[0051]
[0052]
[0053] S3. Adaptive binarization segmentation of the gradient image is performed using the Otsu global thresholding method to obtain the first binarized image.
[0054] Among them, the Otsu's global thresholding method has a certain degree of noise resistance and high efficiency, and its computational cost is less than that of commonly used clustering methods and local thresholding methods. Specifically, the Otsu's global thresholding method calculates the global threshold T0 from a statistical perspective based on the idea of maximizing the inter-class variance.
[0055]
[0056]
[0057] Where, σ 2 The variance between classes is denoted as ; T is a variable taking all integer values between 0 and 255; M and N are the width and height of the gradient image obtained in step S2, respectively; n (T) g is the number of pixels in the gradient image obtained in step S2 whose grayscale value is less than the current T value;i is the gray value of the pixel whose gray value is less than the current T value; g j is the gray value of the pixel whose gray value is greater than or equal to the current T value. The specific operation process of the Otsu global threshold method is: the variable T takes all integers from 0 to 255 in turn, and the inter-class variance σ 2 is calculated 256 times as the T value changes, and the T value when the inter-class variance is maximum is taken as the final global threshold T0.
[0058] S4, performing a morphological closing operation on the binary image to obtain a second binary image.
[0059] The morphological closing operation can fill the holes of the target object, remove part of the noise, and will not damage the shape of the target region. Specifically, the structural element used in the morphological closing operation is a rectangular structural element with a size of 13*13 and an anchor point located at the center.
[0060] S5, extracting the target from the second binary image.
[0061] Due to the poor underwater imaging conditions, there are often a large amount of noise in the in-situ image, and the imaging characteristics of the gelatinous plankton such as blurred outline and weak edge connection make it easy to lose the target and break the target in the target detection stage. The bilateral-Sobel filtering algorithm proposed in this embodiment can suppress the noise points and background in the plankton in-situ image while strengthening the edge information of the target in the plankton in-situ image, thereby reducing the problem that the target cannot be segmented from the background noise due to the adhesion of the target and the noise and background in the plankton target detection stage, and reducing the problem that the target is fragmented and segmented due to the loss of edge information of the object, improving the target detection rate and the target integrity rate, and further improving the complete target recall rate.
[0062] Comparative Example 1
[0063] The in-situ image contains a large amount of particulate, rod-shaped, flocculent suspended matter and bubbles and other impurities, which need to be denoised to reduce the influence of impurities on the subsequent plankton target detection and recognition process. A Gaussian kernel template is used to perform weighted summation calculation on the corresponding image region, thereby eliminating noise and reducing the adhesion of plankton edges and background impurities as much as possible when performing edge detection operation on the plankton in-situ image. The Gaussian filtering algorithm is used in this comparative example 1 to replace the bilateral-Sobel filtering algorithm to process the original gray image. Specifically, the Gaussian filtering algorithm is:
[0064] A Gaussian kernel is a two-dimensional matrix G of KxK (K is an odd number), and the center point of the matrix is the origin (0, 0). The coordinates of each element in the matrix are described by the relative position relationship with the origin, where x and y are integers in the range of [- (K-1) / 2, (K-1) / 2], and the weight value G corresponding to each coordinate point is x,y The calculation expression of the weight value G is as follows: the closer the coordinate is to the center of the matrix, the larger the corresponding weight value on the template is. The weight value is multiplied by the corresponding pixel in the covered area when the Gaussian kernel is slid on the image, and the sum is calculated, which is the value of the center pixel point after Gaussian smoothing.
[0065]
[0066] In the above formula, σ G is the variance of the normal distribution, τ G is the weight coefficient, the weight coefficient τ G adjusts the size of each weight value G x,y so that the sum ΣG x,y = 1.
[0067] In this comparative example 1, the Gaussian filter can smooth the noise points while making the plankton edge blurred. The gelatinous plankton body is translucent, and the edge presented in the in-situ image is very thin. Therefore, using the Gaussian filter can easily destroy the edge information of this type of plankton, causing the target to break, as shown in Figure 3a , 3b The binarization result after Gaussian filtering is shown in Figure 3a , where the white part is the target and the black part is the background. The contour extraction algorithm is based on the idea of connected domain, and only when the outermost edge of the target is complete and intact can the target be completely extracted. However, as shown in the circle part in Figure 3a , it can be seen that the target edge that should be connected is broken. Therefore, when the contour extraction is performed, it is easy to divide one target into multiple targets, as shown in Figure 3b , where one target is labeled by two contour extraction boxes.
[0068] Comparative Example 2
[0069] In this comparative example 2, the bilateral filter algorithm is used instead of the bilateral-Sobel filter algorithm to process the original gray-scale image. As shown in Figure 4a , 4b , the corresponding binarization result and target detection result after bilateral filtering are shown.
[0070] Compared with comparative example 1, since the difference between the neighborhood pixel value and the center pixel value is large when the bilateral kernel processes the target edge, the corresponding value range weight W x,y,u,vThe weights are reduced accordingly, thereby weakening the influence of neighboring pixels on edge pixel values and achieving the effect of edge preservation. However, since the weight values need to be recalculated and updated every time the bilateral kernel slides on the image, the average processing time for a 2180×1635 plankton in-situ image is 125ms, which is slower than the Gaussian filtering in Comparative Example 1 (average processing time of 56ms).
[0071] Comparative Example 3
[0072] Comparative Example 3 uses the Sobel filter algorithm instead of the bilateral-Sobel filter algorithm to process the original grayscale image to obtain the gradient image, such as... Figure 5a As shown, the gradient map is then adaptively thresholded and binarized using the Otsu global thresholding method as described in step S3 of Example 1 to obtain the target segmentation result, as shown. Figure 5b As shown in the figure, after Sobel filtering, the edge information of planktonic targets is well preserved, but the noise is also enhanced, which leads to a decrease in the target detection rate and target integrity rate during target detection.
[0073] Experimental Example
[0074] Taking jellyfish-like gelatinous planktonic organisms as an example, their in-situ diagram is as follows: Figure 6a As shown, target extraction was performed using the methods of Example 1 and various comparative examples, and the experimental process and results are as follows:
[0075] Regarding the Sobel filter algorithm in Comparative Example 3: Since the edges of the target object usually have a large difference value from the surrounding pixels, that is, a large gradient value, Sobel filtering is often used as a means of edge enhancement to calculate gradient values. However, as... Figure 6a The in-situ image of plankton shown contains a large number of impurities and noise. Although these impurities and noise are not obvious to the naked eye, their differences from the surrounding pixel values are significant, and the corresponding gradient values are also large. Figure 6b This is a gradient numerical visualization heatmap obtained by directly performing Sobel filtering on the in-situ image. It can be seen that the gradient values of noise points are close to the gradient values of the planktonic target edges, causing the target and noise to stick together. This makes it difficult to separate the target when directly performing binary segmentation on the gradient image. Figure 6c As shown.
[0076] Regarding the bilateral filtering algorithm in Comparative Example 2: Although bilateral filtering can smooth noise and has good edge preservation properties, when the gray values of plankton edges are small in difference from the background gray values, directly performing binary segmentation on the bilaterally filtered image will not suppress the background, causing the target and background to stick together, and thus resulting in the target and background being segmented together, such as... Figure 6d As shown.
[0077] For the bilateral-Sobel filtering algorithm in Example 1: the bilateral-Sobel filtering algorithm is adopted, that is, first, the bilateral filtering algorithm is used to smooth the noise points, and the difference between the noise points and the surrounding pixels is eliminated, and then the Sobel filtering is used to calculate the edge gradient to obtain the corresponding gradient image. The numerical visualization heat map of the gradient image is compared with Figure 6e ) and Figure 6b It is found that the gradient values of the noise points and the background are suppressed, and are not adhered to the target, and the edge information of the target is enhanced. Figure 7 The gradient mean values of the image pixels corresponding to the column direction calculated by using the bilateral-Sobel filtering algorithm and the Sobel filtering algorithm alone are respectively counted. The gradient mean value of the image calculated by using the Sobel filtering algorithm alone is 38.39, and the gradient mean value of the image calculated by using the Sobel filtering algorithm after the edge-preserving noise reduction by the bilateral filtering is reduced to 10.07, and the gradient of the background and the noise points is effectively suppressed. Therefore, the gradient image obtained after the bilateral-Sobel filtering of Example 1 is binarized, and the target of plankton can be extracted as completely as possible, but the edge enhancement effect of the Sobel filtering is limited, and edge breakage may occur, and then the target is marked by multiple contour extraction frames during target extraction, as shown in Figure 6f . Considering that the morphological closing operation has the characteristics of filling the holes of the target object, removing part of the noise and not damaging the shape of the target region, the gradient image obtained by the bilateral-Sobel filtering is binarized, and then a morphological closing operation is further performed, so that the broken edges are connected as much as possible without damaging the target shape, and then the target can be completely extracted, as shown in Figure 6g .
[0078] In order to verify the effectiveness of the bilateral-Sobel filtering algorithm used in the application, the maximum inter-class variance (Otsu) global threshold method and morphological closing operation are used as the benchmark reference before target extraction, and the target detection rate and the target integrity rate are 56.50% and 89.21% respectively.
[0079] The following five processing methods are added before the Otsu global threshold method respectively: Sobel filtering (Sobel), Gaussian filtering (Gaussian), bilateral filtering (Bilateral), combination of Gaussian filtering and Sobel filtering (Gaussian-Sobel), and combination of bilateral filtering and Sobel filtering (Bilateral-Sobel). The target detection rate (the number of extracted targets ÷ the total number of actual targets) and the target integrity rate (the number of extracted complete targets ÷ the number of extracted targets) corresponding to the five methods are counted respectively, and the complete target recall rate (the number of extracted complete targets ÷ the total number of actual targets) is calculated. The experimental results are shown in Table 1.
[0080] Table 1 Comparison of the effects of five filtering methods on the detection of plankton targets
[0081]
[0082] From the above table, it can be seen that after using the Bilateral-Sobel filtering algorithm to process the in-situ images of plankton, the target detection rate and the target integrity rate are greatly improved, which are 95.93% and 98.73% respectively, and the complete target recall rate reaches the highest of 94.71%. Figure 8 The average gradient of 209 in-situ images calculated by using Sobel filter alone and using Bilateral-Sobel filter algorithm respectively is counted. The average gradient of each in-situ image calculated by using Sobel filter alone is 32.93, and after using Bilateral-Sobel method for edge-preserving denoising and edge enhancement, the average gradient of each image is reduced to 8.80, and the gradient of background and noise is effectively suppressed.
[0083] From the analysis of the experimental results, if only Sobel filter is used for pretreatment, the target detection will fail due to too much noise, and the target detection rate (21.54%) and the target integrity rate (79.25%) will decrease greatly. The target detection rate (96.34%) using Gaussian-Sobel processing method is slightly higher than that (95.93%) using Bilateral-Sobel processing method, but due to the certain destructive effect of Gaussian filter on the edge, it leads to the fragmentation of target segmentation, as shown in Figure 9a 、 9b Bilateral filter has strong noise smoothing ability while maintaining the gradient of the edge, thus ensuring the integrity of target segmentation, as shown in Figure 9c 、 9d Therefore, the target integrity rate (87.34%) of the former is much lower than that (98.73%) of the latter.
[0084] Through the specific embodiment of the present application, the target edge can be strengthened while denoising, so as to effectively improve the target detection rate and the target integrity rate of the gelatinous plankton, and has important significance for real-time monitoring the distribution of the gelatinous plankton, analyzing the living habit of the gelatinous plankton, and establishing a monitoring and early warning system of the gelatinous plankton. For example, some factories or public facilities (such as nuclear power plants) need to discharge treated hot water into seawater, and some gelatinous plankton (such as jellyfish) like to live in warmer water, and this living habit will make them gather near the discharge port, and once the number is too large, it will cause the water pipe to be blocked, and then cause a series of chain reactions or even safety hazards, so when a perfect gelatinous plankton monitoring and early warning system is established, the present application is very suitable for the target extraction link in the system.
[0085] The specific embodiment of the present application further provides a target extraction device for gelatinous plankton in an in-situ image, comprising: a reading module configured to read an original gray-scale image; a filtering processing module configured to process the original gray-scale image using a bilateral-Sobel filtering algorithm to obtain a gradient image that is denoised and edge-enhanced; a binaryzation and segmentation module configured to perform adaptive binaryzation and segmentation on the gradient image using a maximum inter-class variance global threshold method to obtain a first binaryzation image; a morphological closing operation module configured to perform morphological closing operation on the binaryzation image to obtain a second binaryzation image; and an extraction module configured to extract a target from the second binaryzation image.
[0086] The specific embodiment of the present application further provides a computer readable storage medium storing a computer program, and the computer program is executed by a processor to realize the target extraction method for gelatinous plankton in an in-situ image.
[0087] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt a computer program product in the form of one or more computer usable storage media (including but not limited to disk memory, CD-ROM, optical memory, etc.) containing computer usable program code.
[0088] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks or in conjunction with the flowchart blocks.
[0089] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks or in conjunction with the flowchart blocks.
[0090] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks or in conjunction with the flowchart blocks.
[0091] The above further describes the present application in conjunction with specific / preferred embodiments, and cannot be deemed to limit the specific implementation of the present application to these descriptions. For those skilled in the art to which the present application belongs, without departing from the concept of the present application, they can make several substitutions or variations to the described embodiments, and these substitutions or variations shall be deemed to fall within the protection scope of the present application. In the description of the present application, the description of the terms "an embodiment", "some embodiments", "a preferred embodiment", "an example", "a specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are contained in at least one embodiment or example of the present application. In the present application, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In the case of no mutual contradiction, those skilled in the art can combine and combine the different embodiments or examples described in the present application and the features of the different embodiments or examples. Although the embodiments of the present application and their advantages have been described in detail, it should be understood that various changes, substitutions and modifications can be made herein without departing from the scope of protection of the patent application.
Claims
1. A method of target extraction of gelatinous plankton in an in-situ image, characterized by, The method comprises the following steps: S1, reading an original gray image; S2, processing the original gray image using a bilateral-Sobel filter algorithm to obtain a gradient image with denoising and edge enhancement; S3, performing adaptive binaryzation segmentation on the gradient image using a maximum inter-class variance global threshold method to obtain a first binaryzation image; S4, performing a morphological closing operation on the binaryzation image to obtain a second binaryzation image; S5, extracting a target from the second binaryzation image; In the step S2, first, a bilateral filter algorithm is used to denoise the original gray image, and then a Sobel filter algorithm is used to perform edge enhancement on the denoised image to obtain the gradient image; The bilateral filter algorithm is as follows: Assuming a bilateral core Two-dimensional matrix ,in If the number is odd, the origin is the center of the matrix. The coordinates of each element on the matrix are described by their relative position to the origin. , and In order to be in Integers within the range, spatial weights of each coordinate point Calculated using the following formula: ; In the above formulae: is the variance of the normal distribution, is a weight coefficient, the weight coefficient adjusts the size of each spatial weight so that the sum of the spatial weights satisfies ; The weight value of each coordinate point on the value range is related to the pixel value of the covered area, and the image pixel value matrix is The bilateral kernel slides on the image, and when the image pixel coordinate corresponding to the center point of the bilateral kernel is The value range weight and the weight value of the bilateral kernel are calculated by the following formula, respectively. ; ; wherein is a coordinate is a corresponding image pixel value, is a corresponding image pixel value for a coordinate (u, v), is a normal distribution variance, is a weight coefficient, the weight coefficient adjusts the size of each value range weight so that the sum of the values satisfies ; The Sobel filter algorithm is as follows: In directions and directions Sobel templates are respectively and , using templates on the corresponding image region weighted sum operation, get the region center pixel in the horizontal direction gradient , using templates on the corresponding image region weighted sum operation, get the region center pixel in the vertical direction gradient , according to the vector operation can get the corresponding pixel gradient size : , ; ; In the step S3, the maximum inter-class variance global threshold method is based on the idea of maximum inter-class variance and calculates a global threshold T0 from a statistical point of view: ; ; wherein, is the inter-class variance; T is a variable taking all integer values between 0 and 255; M, N are the width and height of the gradient image, respectively; n (T) is the number of pixels in the gradient image having a gray value less than the current T value; g i is the gray value of a pixel having a gray value less than the current T value; g j is the gray value of a pixel having a gray value greater than or equal to the current T value.
2. The object extraction method of claim 1, wherein, In the step S4, the morphological closing operation uses a 13*13 rectangular structure element with an anchor point at the center.
3. A target extraction device for gelatinous plankton in an in-situ image for realizing the target extraction method according to claim 1, characterized by, The method comprises the following steps: A reading module is configured to read an original gray image; A filter processing module is configured to process the original gray image using a bilateral-Sobel filter algorithm to obtain a gradient image with denoising and edge enhancement; A binaryzation segmentation module is configured to perform adaptive binaryzation segmentation on the gradient image using a maximum inter-class variance global threshold method to obtain a first binaryzation image; A morphological closing operation module is configured to perform a morphological closing operation on the binaryzation image to obtain a second binaryzation image; An extraction module is configured to extract a target from the second binaryzation image.
4. A computer readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, the in-situ image target extraction method of gelatinous plankton is realized.