Freezing rain particle image segmentation method
Through the frozen rain particles image segmentation method, combined with holographic imaging and automated algorithms, the problem of difficulty in image segmentation and recognition of frozen rain particles is solved, and the rapid, accurate identification and real-time monitoring of frozen rain particles is achieved, providing timely and accurate data support for weather forecasts.
Patent Information
- Application Number
- CN202411375588.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-30
- Publication Date
- 2025-01-14
AI Technical Summary
It is difficult to segment and identify frozen rain particles images, especially because tiny particles are easily disturbed by light and background, resulting in low segmentation accuracy, diverse and complex shapes, making it difficult to distinguish.
The freezing rain particles image segmentation method includes steps: obtaining the original image, subtracting the background image to obtain a grayscale image, performing binarization and noise removal, using the watershed algorithm to segment the adhered particles, calculate geometric feature parameters, and combining holographic imaging and automated algorithms , adapt to different ambient light conditions.
It realizes the rapid and accurate distinction between frozen rain particles and background, improves image processing efficiency and accuracy, supports real-time monitoring and analysis, and provides timely and accurate data for weather forecasts and disaster warnings.
Smart Images

Figure CN119313698A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of electric power technology, in particular to a freezing rain particle image segmentation method. Background Art
[0002] Freezing rain is a meteorological phenomenon that refers to the situation where raindrops freeze into ice when they come into contact with the ground or other objects. This phenomenon usually occurs when the temperature is low, causing the ground or objects to be covered with a layer of ice, causing inconvenience to transportation and life. Transmission lines covered with ice are prone to power failures. Therefore, timely and accurate detection of the occurrence of freezing rain is of great significance to social production and life.
[0003] The segmentation of freezing rain particles and background in freezing rain images is relatively complex. Tiny freezing rain particles are easily disturbed by light and background, resulting in low segmentation accuracy.
[0004] The frost particles have various forms, sizes and complex shapes, and are sometimes difficult to distinguish from other objects, which increases the difficulty of identification. The existing technology has problems such as difficulty in image segmentation and identification of frost particles. Summary of the invention
[0005] In order to overcome the deficiencies of the prior art, the present invention provides a freezing rain particle image segmentation method to solve the problems of the prior art such as the difficulty in segmenting and identifying freezing rain particle images.
[0006] The technical solution adopted by the present invention to solve the above problems is:
[0007] A freezing rain particle image segmentation method comprises the following steps:
[0008] S1, obtain the original image of freezing rain particles;
[0009] S2, subtract the original image from the background image to obtain a grayscale image;
[0010] S3, performing a binarization operation on the grayscale image to obtain a binary image;
[0011] S4, remove noise points in the binary image;
[0012] S5, segmenting two freezing rain particles that are adhered to each other in the image after the noise points are removed;
[0013] S6, obtaining geometric characteristic parameters of a single freezing rain particle.
[0014] As a preferred technical solution, in step S2, median filtering and Gaussian filtering are used to perform denoising and contrast enhancement operations on the grayscale image to obtain a preprocessed grayscale image.
[0015] As a preferred technical solution, in step S3, an adaptive threshold method is used to dynamically adjust the grayscale value of the neighborhood around each pixel.
[0016] As a preferred technical solution, in step S4, the grayscale image is first subjected to two morphological opening operations, then to two morphological closing operations, and then to a hole filling operation.
[0017] As a preferred technical solution, in step S5, a watershed algorithm is used to segment the mutually adhered parts of the freezing rain particles.
[0018] As a preferred technical solution, in step S5, the gradient of the freezing rain particle target binary image is calculated using the Sobel operator to obtain the gradient amplitude and direction information of the freezing rain particle image. Based on the gradient information, the seed points in the freezing rain particle image are determined, and these seed points will be used as the starting points of the watershed algorithm.
[0019] As a preferred technical solution, in step S5, distance transformation is performed on the seed points to convert the distance information between the seed points into the distance value from each pixel in the image to the nearest seed point.
[0020] As a preferred technical solution, in step S5, the distance transformation result and gradient information are used to perform label propagation, starting from the seed point and spreading the label outward until the labels between different seed points meet; then, based on the result of the label propagation, a watershed transformation is performed, the freezing rain particle image is regarded as terrain, the seed point is regarded as a peak, and the gradient is regarded as water flow, and the freezing rain particle image is divided into different areas by filling the valley.
[0021] As a preferred technical solution, in step S6, the Canny algorithm is first used to perform edge detection on the segmented freezing rain particle target binary image to obtain edge information of the freezing rain particles in the image, the detected edges of the freezing rain particles are connected, and the contour extraction algorithm findContours function is used to extract the contour of the target from the connected edges.
[0022] As a preferred technical solution, in step S6, the geometric characteristic parameters of the target contour are calculated to obtain the geometric characteristic parameters of the freezing rain particles, and the geometric characteristic parameters include one or more of the following: area, perimeter, center of mass, aspect ratio, rectangularity, and roundness.
[0023] Compared with the prior art, the present invention has the following beneficial effects:
[0024] The present invention can quickly and accurately distinguish freezing rain particles from the background, improve the efficiency and accuracy of image processing, and combine holographic imaging and automatic segmentation algorithms to achieve quantitative analysis of freezing rain particles, including extraction and statistics of shape parameters, size distribution, density and other information, so as to achieve real-time monitoring and analysis of freezing rain particles and provide more timely and accurate data support for weather forecasts, disaster warnings and the like; the present invention can adapt to the recognition of freezing rain particles under different ambient light conditions, has better generalization ability, and makes the segmentation of freezing rain particles fast and accurate. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 It is the original image of holographic imaging of freezing rain particles;
[0026] Figure 2 It is the grayscale image of freezing rain particle target;
[0027] Figure 3 It is a binary image of freezing rain particles;
[0028] Figure 4 It is a binary image of freezing rain particles after shape filtering;
[0029] Figure 5 It is the image of freezing rain particles after the target area is segmented;
[0030] Figure 6 This is an image of the geometric feature parameter extraction results of freezing rain particles.
[0031] Figure 7 It is a flow chart of the present invention. DETAILED DESCRIPTION
[0032] The present invention will be further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0033] Example 1
[0034] like Figures 1 to 7 As shown, a freezing rain particle image segmentation method based on holographic imaging includes the following steps:
[0035] S1, obtain the original image of freezing rain particles;
[0036] S2, subtract the original image from the background image to obtain a grayscale image;
[0037] S3, performing a binarization operation on the grayscale image to obtain a binary image;
[0038] S4, remove noise points in the binary image;
[0039] S5, segmenting two freezing rain particles that are adhered to each other in the image after the noise points are removed;
[0040] S6, obtaining geometric characteristic parameters of a single freezing rain particle.
[0041] A further technical solution is to use a holographic imaging device of freezing rain particles to collect the original holographic imaging images of the freezing rain particles in real time, and to collect the images under the condition that the laser light source of the holographic imaging device is turned on. After the collection is completed, the laser light source is turned off to avoid the laser light source from irradiating the lens of the holographic imaging device for a long time and damaging the lens.
[0042] A further technical solution is that the background image is an image stored under the condition that no freezing rain occurs, and the background image is re-collected and updated once every one hour.
[0043] A further technical solution is to obtain a target grayscale image containing freezing rain particles by subtracting the original holographic imaging image of freezing rain particles from the background image. The target grayscale image is remapped to the interval [0, 255], where the freezing rain particle target is in the low grayscale value area in the image, and the target grayscale image is denoised and contrast increased using median filtering and Gaussian filtering to obtain a preprocessed target grayscale image.
[0044] A further technical solution is that in step S3, a suitable threshold is selected to divide the target grayscale image into two parts: one part is pixels greater than the threshold, i.e., the background image, and the other part is pixels less than or equal to the threshold, i.e., the freezing rain particle image. An adaptive threshold method is used to dynamically adjust the threshold according to the grayscale value of the neighborhood around each pixel to adapt to the image's uneven illumination and noise, etc., and to improve the accuracy of binarization.
[0045] A further technical solution is to first perform two morphological opening operations, then perform two morphological closing operations, and then perform a hole filling operation to obtain a binary image after morphological filtering.
[0046] A further technical solution is that in step S5, if there are two or more freezing rain particles adhering to or overlapping each other in the target binary image, a watershed algorithm is used to segment the parts where the freezing rain particles are adhering to each other.
[0047] A further technical solution is to use the Sobel operator to calculate the gradient of the freezing rain particle target binary image to obtain the gradient amplitude and direction information of the freezing rain particle image. According to the gradient information, the seed points in the freezing rain particle image are determined, and these seed points will be used as the starting points of the watershed algorithm.
[0048] A further technical solution is to perform distance transformation on the seed points, and convert the distance information between the seed points into the distance value from each pixel in the image to the nearest seed point.
[0049] A further technical solution is to use the distance transformation results and gradient information to perform label propagation, starting from the seed point and spreading the label outward until the labels between different seed points meet. According to the result of label propagation, a watershed transformation is performed, the frozen rain particle image is regarded as terrain, the seed point is the peak, and the gradient is the water flow, and the frozen rain particle image is divided into different areas by filling the valley. The segmentation results are post-processed, including removing small areas, connecting broken areas, etc., to obtain more accurate segmentation results.
[0050] A further technical solution is: firstly, the Canny algorithm is used to perform edge detection on the segmented freezing rain particle target binary image to obtain the edge information of the freezing rain particles in the image. The detected freezing rain particle edges are connected to obtain the complete freezing rain particle target contour. The contour extraction algorithm findContours function is used to extract the target contour from the connected edges.
[0051] A further technical solution is to calculate the geometric characteristic parameters of the target contour to obtain the geometric characteristic parameters of the freezing rain particles, including: Area: the size of the area enclosed by the freezing rain particle target contour; Perimeter: the perimeter of the freezing rain particle target contour; Centroid: the centroid position of the freezing rain particle target contour, used to describe the position of the target; Aspect Ratio: the ratio of the long side to the short side of the freezing rain particle target; Moments: used to describe the shape of the freezing rain particle target, including central moments, normalized central moments, etc.; Rectangularity: the rectangularity of the freezing rain particle target contour, describing the similarity between the freezing rain particle target and the rectangle; Circularity: the circularity of the freezing rain particle target contour, describing the similarity between the target and the circle.
[0052] Example 2
[0053] like Figures 1 to 7 As shown, as a further optimization of Example 1, based on Example 1, this embodiment also includes the following technical features:
[0054] like Figure 7 As shown, the present invention discloses a freezing rain particle image segmentation method based on holographic imaging, which includes the following steps:
[0055] Step S1: obtaining the original holographic imaging image of the freezing rain particles.
[0056] A holographic imaging device of freezing rain particles is used to collect the original holographic imaging images of the freezing rain particles in real time. The collection is performed under the condition that the laser light source of the holographic imaging device is turned on. After the collection is completed, the laser light source is turned off to avoid the laser light source irradiating the lens of the holographic imaging device for a long time and damaging the lens.
[0057] like Figure 1 Shown is the original holographic imaging image of freezing rain particles.
[0058] Step S2: Obtain a target grayscale image.
[0059] According to Formula 1, the original image is subtracted from the background image to obtain a grayscale image.
[0060] f_dst(x,y)=f_org(x,y)-background(x,y) Formula 1
[0061] In Formula 1, f_dst(x,y) is the grayscale value of the pixel at the coordinate point (x,y) of the target grayscale image, f_org(x,y) is the grayscale value of the pixel at the coordinate point (x,y) of the original image acquired in real time, and background(x,y) is the grayscale value of the pixel at the coordinate point (x,y) of the background image.
[0062] The background image background(x,y) is an image stored when there is no freezing rain. The background image is collected and updated once every hour.
[0063] According to Formula 2, the target grayscale image f_dst(x,y) is remapped to the [0 255] interval.
[0064] f_dst(x,y)=255*(f_dst(x,y)-min(f_dst(x,y))) /
[0065] (max(f_dst(x,y))-min(f_dst(x,y))) Formula 2
[0066] In Formula 2, the min(f_dst(x,y)) function represents the minimum value of the target grayscale image, and the max(f_dst(x,y)) function represents the maximum value of the target grayscale image.
[0067] In the target grayscale image f_dst(x,y), the freezing rain particle target is in the low grayscale value area in the image. The median filter and Gaussian filter are used to perform denoising and contrast enhancement operations on the target grayscale image to obtain the preprocessed target grayscale image.
[0068] Figure 2 A grayscale image of a freezing rain particle target is shown.
[0069] Step S3: Obtain a target binary image.
[0070] Select an appropriate threshold to convert the target grayscale image into a target binary image B_dst(x,y).
[0071] According to Formula 3, the target class image is binarized.
[0072]
[0073] In Formula 3, B_dst(x,y) is the pixel value of the target binary image at the coordinate point (x,y), and adp_thrsh is the threshold value obtained using the adaptive threshold algorithm.
[0074] In the target binary image B_dst(x,y), pixels greater than the threshold are the background image, and pixels less than or equal to the threshold are the freezing rain particle image.
[0075] The adaptive threshold method is used to dynamically adjust the threshold according to the grayscale value of the neighborhood around each pixel to adapt to the image uneven illumination and noise, and improve the accuracy of the freezing rain particle target binary image B_dst(x,y).
[0076] Step S4: Perform shape filtering to remove noise points in the binary image of the freezing rain particle target.
[0077] The freezing rain particle target binary image B_dst(x,y) is first subjected to two morphological opening operations, then two morphological closing operations, and then a hole filling operation to obtain a binary image after morphological filtering.
[0078] When using shape learning opening and closing operations, a disk-shaped operator is used, and the size of the operator is selected to be 3 pixels.
[0079] like Figure 4 As shown, it is a binary image of freezing rain particles after shape filtering.
[0080] Step S5: segmenting mutually adhering freezing rain particles in the rain particle target binary image;
[0081] In the target binary image B_dst(x,y), there are two or more freezing rain particles that are adhered or overlapped with each other. The watershed algorithm is used to segment the parts where the freezing rain particles are adhered with each other.
[0082] The Sobel operator is used to calculate the gradient of the freezing rain particle target binary image, and the gradient amplitude and direction information of the freezing rain particle image are obtained.
[0083] According to Formula 4, the convolution kernel of the Sobel operator in the horizontal direction is obtained.
[0084]
[0085] According to Formula 5, the convolution kernel of the Sobel operator in the vertical direction is taken.
[0086]
[0087] Based on the gradient information, the seed points in the freezing rain particle image are determined, and these seed points will be used as the starting points of the watershed algorithm. The distance transformation is performed on the seed points, and the distance information between the seed points is converted into the distance value from each pixel in the image to the nearest seed point. Using the distance transformation result and the gradient information, the mark propagation is performed, starting from the seed point and spreading the mark outward until the marks between different seed points meet.
[0088] According to the result of label propagation, watershed transformation is performed, the freezing rain particle image is regarded as terrain, the seed point is the peak, the gradient is the water flow, and the freezing rain particle image is segmented into different areas by filling the valley. The segmentation results are post-processed, including removing small areas, connecting broken areas, etc., to obtain more accurate segmentation results.
[0089] Figure 5 As shown, it is the freezing rain particle image after the target area is segmented.
[0090] Step S6: obtaining geometric characteristic parameters of a single freezing rain particle;
[0091] Firstly, the Canny algorithm is used to perform edge detection on the segmented binary image of freezing rain particles to obtain the edge information of freezing rain particles in the image.
[0092] The Canny algorithm first uses a Gaussian filter for smoothing, then calculates the image gradient, then performs non-maximum suppression, and finally performs double threshold edge detection.
[0093] Connect the detected freezing rain particle edges to obtain the complete freezing rain particle target contour. Use the contour extraction algorithm findContours function to extract the target contour from the connected edges.
[0094] Calculate the geometric feature parameters of the target contour.
[0095] The target binary image area (Area) calculation formula is:
[0096]
[0097] In Equation 6, Area is the area enclosed by the outline of the freezing rain particle target, and M and N represent the height and width of the image (in pixels), respectively.
[0098] Target binary image perimeter (Perimeter) calculation formula;
[0099]
[0100] In Equation 6, Perimeter is the perimeter of the freezing rain particle target contour, M and N represent the height and width of the image (in pixels), respectively. k ,y k ) represents the 8 neighboring pixel values of the coordinate point (x, y), and K ranges from 1 to 8 corresponding to the 8 neighboring pixel values respectively.
[0101] The aspect ratio calculation formula of the target binary image is:
[0102] Aspect Ratio= W / H Formula 8
[0103] In Formula 8, Aspect Ratio is the ratio of the long side to the short side of the freezing rain particle target, W is the width of the minimum circumscribed rectangle in the freezing rain particle target image, that is, the short axis, and H is the length of the minimum circumscribed rectangle in the freezing rain particle target image, that is, the long axis.
[0104] The rectangular degree (Rectangularity) calculation formula of the target binary image is:
[0105]
[0106] In Formula 9, Rectangularity is the rectangularity of the freezing rain particle target outline, Area is the area enclosed by the freezing rain particle target outline, and Rect_Area is the area of the minimum circumscribed rectangle of the freezing rain particle target area.
[0107] The circularity calculation formula of the target binary image is:
[0108]
[0109] In Equation 10, Circularity is the roundness of the outline of the freezing rain particle target, which describes the similarity between the target and the circle.
[0110] As described above, the present invention can be preferably implemented.
[0111] All features disclosed in all embodiments in this specification, or steps in all methods or processes implicitly disclosed, except for mutually exclusive features and / or steps, can be combined and / or expanded or replaced in any manner.
[0112] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. According to the technical essence of the present invention, within the spirit and principles of the present invention, any simple modification, equivalent replacement and improvement made to the above embodiment still falls within the protection scope of the technical solution of the present invention.
Claims
1. A freezing rain particle image segmentation method, characterized in that: The following steps are involved: S1, obtain the original image of freezing rain particles; S2, subtract the original image from the background image to obtain a grayscale image; S3, performing a binarization operation on the grayscale image to obtain a binary image; S4, remove noise points in the binary image; S5, segmenting two freezing rain particles that are adhered to each other in the image after the noise points are removed; S6, obtaining geometric characteristic parameters of a single freezing rain particle.
2. A freezing rain particle image segmentation method according to claim 1, characterized in that: In step S2, median filtering and Gaussian filtering are used to perform denoising and contrast enhancement operations on the grayscale image to obtain a preprocessed grayscale image.
3. The freezing rain particle image segmentation method according to claim 1, characterized in that: In step S3, the adaptive threshold method is used to dynamically adjust the grayscale value of the neighborhood around each pixel.
4. The freezing rain particle image segmentation method according to claim 1, characterized in that: In step S4, the grayscale image is first subjected to two morphological opening operations, then to two morphological closing operations, and then to a hole filling operation.
5. The freezing rain particle image segmentation method according to claim 1, characterized in that: In step S5, the watershed algorithm is used to segment the mutually adhered parts of the freezing rain particles.
6. A freezing rain particle image segmentation method according to claim 5, characterized in that: In step S5, the gradient of the freezing rain particle target binary image is calculated using the Sobel operator to obtain the gradient amplitude and direction information of the freezing rain particle image. Based on the gradient information, the seed points in the freezing rain particle image are determined, and these seed points will be used as the starting points of the watershed algorithm.
7. A freezing rain particle image segmentation method according to claim 6, characterized in that: In step S5, distance transformation is performed on the seed points to convert the distance information between the seed points into the distance value from each pixel in the image to the nearest seed point.
8. A freezing rain particle image segmentation method according to claim 7, characterized in that: In step S5, the distance transformation result and gradient information are used to perform label propagation, starting from the seed point and spreading the label outward until the labels between different seed points meet. Then, according to the result of label propagation, a watershed transformation is performed, the freezing rain particle image is regarded as terrain, the seed point is regarded as a peak, and the gradient is regarded as water flow, and the freezing rain particle image is divided into different areas by filling the valley.
9. A freezing rain particle image segmentation method according to any one of claims 1 to 8, characterized in that: In step S6, firstly, the Canny algorithm is used to perform edge detection on the segmented freezing rain particle target binary image to obtain edge information of the freezing rain particles in the image, the detected edges of the freezing rain particles are connected, and the contour extraction algorithm findContours function is used to extract the contour of the target from the connected edges.
10. The freezing rain particle image segmentation method according to claim 7, characterized in that: In step S6, geometric characteristic parameters of the target contour are calculated to obtain geometric characteristic parameters of the freezing rain particles, and the geometric characteristic parameters include one or more of the following: area, perimeter, centroid, aspect ratio, rectangularity, and roundness.