A method, device and equipment for extracting adherent bubbles from dynamic ice images based on watershed segmentation
By applying distance transformation and histogram equalization to adjust the brightness of bubble centers in dynamic ice images, and combining this with watershed transformation, the problem of poor segmentation of adhering bubbles in dynamic ice images was solved, achieving better segmentation results for adhering bubbles.
Patent Information
- Application Number
- CN202311101039.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-06-08
AI Technical Summary
Existing technologies have poor segmentation results when extracting adhering bubbles from dynamic ice images, especially when there are large differences in bubble size or large bubbles, making it difficult to effectively segment small bubbles.
By performing a distance transformation on the minimum distance from bubble pixels to the background in the preprocessed binary image, a distance image is obtained. Histogram equalization is then performed to adjust the values in the center of the bubbles. Values that meet preset conditions are marked, and combined with watershed transformation, the segmentation of adhering bubbles is achieved.
It effectively improves the segmentation of adhering bubbles in dynamic ice images, accurately segmenting adhering bubbles of different sizes and nearby larger bubbles, avoiding the omission of small bubbles.
Smart Images

Figure CN117011531B_ABST
Abstract
Description
[0001] The application is a divisional application of the prior application of the applicant, the application number of the prior application is CN202210638584.X, and the application name is a method, device and equipment for extracting adherent bubbles from dynamic ice images. TECHNICAL FIELD
[0002] The application relates to the technical field of image processing, and more particularly to a method, device and equipment for extracting adherent bubbles from dynamic ice images based on watershed segmentation. BACKGROUND
[0003] When an aircraft passes through a cloud layer, supercooled water droplets may change phase and cause icing phenomenon after impacting the aircraft body. Icing changes the shape and flow field around the aircraft, damages the aerodynamic performance, reduces the maneuverability and stability, threatens flight safety, and even causes air crash accidents in severe cases. Aircraft icing is essentially a dynamic icing process of supercooled water droplets. The ice formed by the impact of supercooled water on a low-temperature substrate, which has non-uniformly distributed bubbles, is dynamic ice. The bubbles in the dynamic ice are the fundamental factors that determine the physical properties of the dynamic ice. By analyzing the bubble content, distribution, pore size and other characteristics in the microstructure of the dynamic ice, the physical properties of the dynamic ice can be studied, and scientific and effective icing protection measures can be established to ensure the safety of aircraft flight.
[0004] To study the bubble content, distribution, pore size and other characteristics in the microstructure of the dynamic ice, the bubble image in the dynamic ice needs to be obtained. However, there are adherent bubbles in the dynamic ice, and it is difficult to extract the adherent bubbles from the dynamic ice image. At present, a watershed algorithm based on marker control can be used to segment adherent bubbles or particles. This method has good segmentation effect when the size of the bubbles or particles is the same. However, when the size of the adherent bubbles in the dynamic ice differs greatly, it is difficult to mark the small bubbles, and therefore it is difficult to segment multiple small adherent bubbles. Furthermore, when there are larger bubbles with an area greater than the adherent bubbles near the adherent bubbles in the dynamic ice, it is difficult to mark the adherent bubbles, and therefore it is difficult to segment the adherent bubbles.
[0005] Therefore, the prior art has the problem of poor segmentation effect of adherent bubbles when extracting adherent bubbles from dynamic ice images. SUMMARY
[0006] The present inventors have found through long-term practice that a watershed algorithm based on label control obtains a distance image according to the minimum distance of a bubble pixel point in a preprocessed binary image to a background, and then labels the distance image. Taking labeling a point at which a local minimum value in the distance image is located as an example, the value in the distance matrix of the distance image is related to the size of a bubble. The larger the bubble, the farther the minimum distance of the bubble center part from the background, and the smaller the value of the bubble center part in the distance matrix after inversion, and the lower the brightness of the center of the large bubble in the distance image. When labeling the local minimum value in the distance image, the value of the large bubble center part in the local region is smaller than that of the small bubble center part, so the center part of the small bubble cannot be labeled, and it is difficult to segment the adhered small bubbles. Based on this, the present application proposes a method for extracting adhered bubbles from a dynamic ice image. The distance image is obtained according to the minimum distance of the bubble pixel point in the preprocessed binary image to the background. The distance matrix of the distance image is histogram equalized to adjust the value of each bubble center part, and an adjusted image is obtained. The values meeting the preset condition are obtained from the image matrix of the adjusted image, and the points at which the values meeting the preset condition are located in the adjusted image are labeled to obtain a labeled image. The labeled image includes the labeled points of the center parts of all bubbles. The preprocessed binary image is subjected to watershed transformation according to the labeled points in the labeled image, and a segmented image of the adhered bubbles is obtained. In this way, the problem of poor segmentation of adhered bubbles in the prior art when extracting adhered bubbles from a dynamic ice image can be effectively solved.
[0007] In a first aspect, the embodiments of the present application provide a method for extracting adhered bubbles from a dynamic ice image. The method comprises: S110. obtaining a distance image according to the minimum distance of a bubble pixel point in a preprocessed binary image to a background; S120. histogram equalizing the distance image to obtain an adjusted image; S130. obtaining values meeting a preset condition from an image matrix of the adjusted image, and labeling points at which the values meeting the preset condition are located in the adjusted image to obtain a labeled image; and S140. performing watershed transformation on the preprocessed binary image according to the labeled points in the labeled image to obtain a segmented image of the adhered bubbles.
[0008] In a second aspect, the embodiments of the present application further provide a system for extracting adherent bubbles from a dynamic ice image, the system comprising a distance obtaining unit configured to obtain a distance image according to the minimum distance from a bubble pixel in a preprocessed binary image to a background; an adjusting unit configured to perform histogram equalization on the distance image to obtain an adjusted image; a marking unit configured to obtain a value satisfying a preset condition from an image matrix of the adjusted image, and mark a point in the adjusted image where the value satisfying the preset condition is located to obtain a marked image; and a watershed transformation unit configured to perform watershed transformation on the marked image according to a marked point in the marked image to obtain a segmented image of the adherent bubbles.
[0009] In a third aspect, the embodiments of the present application further provide an electronic device, comprising one or more processors; a memory; a screen configured to display an image in the foregoing method; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the foregoing method.
[0010] In summary, the present application has at least the following technical effects:
[0011] 1. Taking the distance image obtained by performing distance transformation on the preprocessed binary image and taking the inverse as an example, the present application performs histogram equalization on the distance image to be marked, so that the center brightness of the large bubble in the distance image is high, and the center brightness of the small bubble is low, that is, the value of the center part of the large bubble in the distance matrix is large, and the value of the center part of the small bubble is small. When marking the point where the local minimum value is located, the value of the center part of the bubble in the local region is different due to the different sizes of the bubbles, and the value of the center part of the small bubble is not identified as a local minimum value, so that the point where the center part of the small bubble is located cannot be marked. Using the method for extracting adherent bubbles from a dynamic ice image provided by the present application, when the sizes of the adherent bubbles in the dynamic ice are greatly different, and when there is a larger bubble with an area greater than the adherent bubble near the adherent bubble in the dynamic ice, the point where the center part of the small adherent bubble is located can be marked, so that the effect of segmenting the adherent bubble is better.
[0012] 2. The application extracts bubbles directly from the original image by a preset neural network model, extracts a first intermediate image containing complete large bubbles, then segments the original image, extracts bubbles from the second segmented image block by a preset neural network model, obtains a second intermediate image containing complete small bubbles, and performs OR operation on the first intermediate image and the second intermediate image to obtain a preprocessed binary image containing both complete large bubbles and complete small bubbles, thereby avoiding problems such as identifying textures in the dynamic ice image as bubbles, unclear bubble boundary identification, missing a large number of small bubbles, and large bubbles with holes, and making the extracted bubbles in the preprocessed binary image better, thereby laying a foundation for improving the effect of segmenting and connecting bubbles.
[0013] Therefore, the scheme provided by the application can effectively solve the problem of poor effect of segmenting and connecting bubbles in the prior art when extracting connected bubbles from a dynamic ice image. BRIEF DESCRIPTION OF DRAWINGS
[0014] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor.
[0015] Figure 1 A flowchart of a method for extracting connected bubbles from a dynamic ice image provided by Embodiment 1 of the application is shown;
[0016] Figure 2 A microscopic image of connected bubbles in dynamic ice provided by Embodiment 1 of the application is shown;
[0017] Figure 3 An original image of the microstructure of dynamic ice provided by Embodiment 1 of the application is shown;
[0018] Figure 4 A distance image obtained by performing distance transformation on the preprocessed binary image and taking the inverse provided by Embodiment 1 of the application is shown;
[0019] Figure 5 An adjusted image obtained by performing histogram equalization on the distance image provided by Embodiment 1 of the application is shown;
[0020] Figure 6 A marked image obtained by marking the points where the local minimum values are located in the adjusted image provided by Embodiment 1 of the application is shown;
[0021] Figure 7 A marked image obtained by not performing histogram equalization provided by Embodiment 1 of the application is shown;
[0022] Figure 8 A segmentation image of the adhered bubbles obtained by using the histogram equalization is shown according to the embodiment 1 of the present application;
[0023] Figure 9 A segmentation image of the adhered bubbles obtained without histogram equalization is shown according to the embodiment 1 of the present application;
[0024] Figure 10 A block diagram of a system for extracting adhered bubbles from a dynamic ice image is shown according to the embodiment 2 of the present application;
[0025] Figure 11 A block diagram of an electronic device for performing the method of extracting adhered bubbles from a dynamic ice image according to the embodiment of the present application is shown according to the embodiment 3 of the present application. DETAILED DESCRIPTION
[0026] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work fall within the scope of protection of the present application.
[0027] At present, the watershed algorithm based on marker control can be used to segment the adhered bubbles or particles, and this method has good segmentation effect when the bubbles or particles have the same size. However, when the sizes of the adhered bubbles in the dynamic ice are quite different, it is difficult to mark the small bubbles, and thus it is difficult to segment the multiple small adhered bubbles. Moreover, when there are large bubbles with an area larger than the adhered bubbles near the adhered bubbles in the dynamic ice, it is difficult to mark the adhered bubbles, and thus it is difficult to segment the adhered bubbles.
[0028] Therefore, in order to solve the above-mentioned defects, the present application provides a method for extracting adhered bubbles from a dynamic ice image, which comprises: obtaining a distance image according to the minimum distance from a bubble pixel point in a preprocessed binary image to a background; performing histogram equalization on the distance image to adjust the value of each center part of the bubble in the distance matrix of the distance image, and obtaining an adjusted image; obtaining a value meeting a preset condition from the image matrix of the adjusted image, marking the point where the value meeting the preset condition is located in the adjusted image, and obtaining a marked image, wherein the marked image comprises the marking points of the center parts of all bubbles; and performing watershed transformation on the preprocessed binary image according to the marking points in the marked image, and obtaining a segmentation image of the adhered bubbles. In this way, the problem that the segmentation effect of the adhered bubbles is poor when the adhered bubbles are extracted from the dynamic ice image in the prior art can be effectively solved.
[0029] The method for extracting adherent air bubbles from dynamic ice images is described below.
[0030] Embodiment 1
[0031] Please refer to Figure 1 and Figure 2 , Figure 1 The flowchart of the method for extracting adherent air bubbles from dynamic ice images provided in Embodiment 1 of the present application is shown in Figure 2 The microscopic image of adherent air bubbles in dynamic ice. The method for extracting adherent air bubbles from dynamic ice images in this embodiment can include the following steps:
[0032] Step S110: Obtain a distance image according to the minimum distance from the air bubble pixel points in the preprocessed binary image to the background.
[0033] As shown in Figure 3 , the original image of the microstructure of dynamic ice. The preprocessed binary image can be obtained by preprocessing the original image. Figure 3 In
[0034] , the case where the sizes of the adherent air bubbles in dynamic ice greatly differ is shown in the upper box, specifically, three air bubbles of different sizes are adhered together, among the three adherent air bubbles, the uppermost air bubble is the largest, the middle air bubble is the second largest, and the lowermost air bubble is the smallest. Figure 3 In
[0035] , the case where a larger air bubble exists near the adherent air bubbles in dynamic ice is shown in the lower box, specifically, three air bubbles are adhered together, and a larger air bubble existing near has a diameter larger than any of the three adherent air bubbles. In this case, the sizes of the three adherent air bubbles can be the same or different. For convenience of description, Figure 3 the case where the sizes of the three adherent air bubbles are the same is shown. Figure 3
[0036] As an optional implementation manner, the step S110 further includes a sub-step S111.
[0037] Sub-step S111: Perform distance transformation on the preprocessed binary image to obtain the distance image according to the minimum distance from the air bubble pixel points in the preprocessed binary image to the background.
[0038] In an exemplary embodiment, the distance transformation can be Euclidean distance transformation, Manhattan distance transformation, or other distance transformation manners.
[0039] The greater the bubble in the pre-processed binary image, the greater the minimum distance from the center part of the bubble to the background, and the greater the value of the center part of the bubble in the distance matrix of the distance image, and the higher the center brightness of the bubble in the distance image.
[0040] As another optional implementation, the step S110 further includes a sub-step S112.
[0041] The sub-step S112: performing distance transformation on the pre-processed binary image and taking the inverse, to obtain the distance image according to the inverse of the minimum distance from the bubble pixel in the pre-processed binary image to the background.
[0042] The greater the bubble in the pre-processed binary image, the greater the minimum distance from the center part of the bubble to the background, and the greater the value of the center part of the bubble in the distance matrix of the distance image, and the higher the center brightness of the bubble in the distance image. Figure 4 As shown in Figure 4 The distance image obtained by performing distance transformation on the pre-processed binary image and taking the inverse.
[0043] As shown in Figure 4 It can be seen that, among the three adhesion bubbles in the upper box, the center part of the uppermost bubble has the lowest brightness, the center part of the middle bubble has the second lowest brightness, and the center part of the lowermost bubble has the highest brightness, that is, in the distance matrix of the distance image, the value of the center part of the uppermost bubble is the smallest, the value of the center part of the middle bubble is the second smallest, and the value of the center part of the lowermost bubble is the largest.
[0044] As shown in Figure 4 It can be seen that, among the three adhesion bubbles in the lower box and the larger bubble existing nearby, the center parts of the three adhesion bubbles have the same high brightness, and are higher than the center part of the larger bubble existing nearby, that is, in the distance matrix of the distance image, the values of the center parts of the three adhesion bubbles are the same and are higher than the value of the center part of the larger bubble existing nearby.
[0045] In the embodiments of the present application, the taking the inverse can also be after the step S120.
[0046] Step S120: performing histogram equalization on the distance image to obtain an adjusted image.
[0047] Taking the distance image obtained by performing distance transformation on the pre-processed binary image and taking the inverse as an example, the distance image in this case is histogram equalized, so that the center brightness of the large bubble in the distance image is higher, and the center brightness of the small bubble is lower, that is, the value of the center part of the large bubble in the distance matrix is larger, and the value of the center part of the small bubble is smaller, so as to obtain the adjusted image. Figure 5As shown, Figure 5 This is the adjusted image obtained by histogram equalization of the distance image.
[0048] from Figure 5 As can be seen, the brightness of the central parts of the three sticky bubbles in the box above is the same, which means that the values of the central parts of the three sticky bubbles are the same in the image matrix of the adjusted image.
[0049] from Figure 5 As can be seen, among the three sticky bubbles in the lower box and the larger bubbles nearby, the brightness of the central part of the three sticky bubbles is the same as the brightness of the central part of the larger bubbles nearby. That is, in the image matrix of the adjusted image, the value of the central part of the three sticky bubbles is the same as the value of the central part of the larger bubbles nearby.
[0050] Step S130: Obtain the values that meet the preset conditions from the image matrix of the adjusted image, and mark the points where the values that meet the preset conditions are located in the adjusted image to obtain a marked image.
[0051] As an optional implementation, if step S110 includes sub-step S111 and the preset condition is a local maximum, then step S130 includes sub-step S131.
[0052] Sub-step S131: Obtain the local maxima from the image matrix of the adjusted image, and mark the points where the local maxima are located in the adjusted image to obtain the marked image.
[0053] A local maximum can be the maximum value within a local region in the image matrix of the adjusted image. This local region can be the area that exactly covers the largest bubble in the adjusted image, such as... Figure 5 The box shown can also be a slightly larger area than just covering the largest bubble in the adjusted image; this application does not limit this.
[0054] The local region is iteratively calculated using the image matrix of the adjusted image, and the local maxima are obtained in each iteration.
[0055] After histogram equalization of the distance image to obtain the adjusted image, the brightness of the central part of the bubbles in the local region of the adjusted image is consistent, and the value of the central part of the bubbles in the local region of the image matrix of the adjusted image is consistent. Therefore, the value of the central part of each bubble is the maximum value in the local region, and the point where the central part of each bubble is located can be marked.
[0056] If histogram equalization is not performed, local maxima are directly obtained from the distance matrix of the distance image obtained by performing distance transformation on the preprocessed binary image, and the points where the local maxima are located are marked in the distance image. Since the brightness of the central part of the bubbles in the local region of the distance image is inconsistent, the values of the central part of the bubbles in the local region of the distance matrix of the distance image are also inconsistent. Therefore, only the bubble with the largest value in the central part can be marked, and the bubble with the smaller value in the central part will be missed.
[0057] As another optional implementation, if step S110 includes sub-step S112 and the preset condition is a local minimum, then step S130 includes sub-step S132.
[0058] Sub-step S132: Obtain the local minimum from the image matrix of the adjusted image, and mark the point where the local minimum is located in the adjusted image to obtain the marked image.
[0059] A local minimum can be the minimum value within a local region of the image matrix of the adjusted image. The details of the local region and the method for obtaining the local minimum can be found in sub-step S131, and will not be repeated here.
[0060] After performing histogram equalization on the distance image to obtain the adjusted image, the brightness of the central part of the bubbles in the local region of the adjusted image is consistent, and the value of the central part of the bubbles in the local region of the image matrix of the adjusted image is consistent. Therefore, the value of the central part of each bubble is the minimum value in the local region, and the point where the central part of each bubble is located can be marked.
[0061] like Figure 6 As shown, Figure 6 A labeled image obtained using the method of this application.
[0062] from Figure 6 As can be seen, the center points of the three sticky bubbles in the box above are all marked.
[0063] from Figure 6 As can be seen, the center points of the three sticky bubbles and the center points of the larger nearby bubbles are all marked in the three sticky bubbles in the box below.
[0064] If histogram equalization is not performed, directly from... Figure 4Local minima are obtained from the distance matrix of the distance image shown, and the points containing these local minima are marked in the distance image. Because the brightness of the central portions of bubbles within the local regions of the distance image is inconsistent, the values of the central portions of bubbles within the local regions of the distance matrix are also inconsistent. Therefore, only the bubble with the smallest value in its central portion can be marked; bubbles with values other than the smallest in their central portion are missed. Without histogram equalization, the resulting marked image would look like... Figure 7 As shown.
[0065] From Figure 7 As can be seen, among the three sticky bubbles in the box above, only the center of the largest bubble at the top is marked, while the center of the second largest bubble in the middle and the smallest bubble at the bottom are omitted.
[0066] from Figure 7 As can be seen, among the three sticky bubbles in the box below and the larger nearby bubble, only the center point of the larger nearby bubble is marked, while the center points of the three sticky bubbles are omitted.
[0067] Step S140: Based on the marker points in the marked image, perform watershed transformation on the preprocessed binary image to obtain a segmented image of the sticky bubbles.
[0068] As an optional implementation, if step S110 includes sub-step S111, then step S140 includes sub-step S141.
[0069] Sub-step S141: Based on the marker points in the marked image, perform a watershed transformation on the preprocessed binary image to obtain a watershed segmentation line based on the marker points. Perform an OR operation between the watershed segmentation line and the preprocessed binary image to obtain a segmented image of the sticky bubbles.
[0070] In this embodiment of the application, since the center point of each bubble is marked, a watershed transformation is performed on the preprocessed binary image based on the marked point of each bubble to obtain the watershed dividing line of each bubble. The watershed dividing line of each bubble is then ORed with the preprocessed binary image to separate the adhered bubbles.
[0071] As another optional implementation, if step S110 includes sub-step S112, then step S140 includes sub-step S142.
[0072] Sub-step S142: according to the marker points in the marker image, performing a watershed transform on the pre-processed binary image to obtain a watershed segmentation line based on the marker points, taking the inverse of the watershed segmentation line, and performing an OR operation with the pre-processed binary image to obtain a segmentation image of the adhered bubbles.
[0073] In the embodiments of the present application, since the points where the center portions of each bubble are located are marked, according to the marker points of each bubble, a watershed transform is performed on the pre-processed binary image to obtain a watershed segmentation line of each bubble, the inverse of the watershed segmentation line of each bubble is taken, and an OR operation is performed with the pre-processed binary image, so as to segment the adhered bubbles.
[0074] As shown in FIG. 6, the segmentation image of the adhered bubbles obtained by using the method of the present application is shown. Figure 8 Figure 8 As shown in FIG. 6, the segmentation image of the adhered bubbles obtained by using the method of the present application is shown.
[0075] As shown in FIG. 6, the segmentation image of the adhered bubbles obtained by using the method of the present application is shown. Figure 8 As can be seen from FIG. 6, among the three adhered bubbles in the upper box, the three adhered bubbles are all segmented.
[0076] As can be seen from FIG. 6, among the three adhered bubbles in the lower box, the three adhered bubbles are all segmented. Figure 8 As can be seen from FIG. 6, among the three adhered bubbles in the lower box, the three adhered bubbles are all segmented.
[0077] As shown in FIG. 7, the segmentation image of the adhered bubbles obtained without performing histogram equalization is shown. Figure 9 As shown in FIG. 7, the segmentation image of the adhered bubbles obtained without performing histogram equalization is shown.
[0078] As shown in FIG. 7, the segmentation image of the adhered bubbles obtained without performing histogram equalization is shown. Figure 9 As can be seen from FIG. 7, among the three adhered bubbles in the upper box, since only the point where the center portion of the uppermost bubble is located is marked, the points where the center portions of the middle bubble and the lowermost bubble are located are not marked, so only the uppermost bubble is segmented, and the middle bubble and the lowermost bubble are not segmented and still adhere together.
[0079] As can be seen from FIG. 7, among the three adhered bubbles in the lower box, since the points where the center portions of the three adhered bubbles are located are not marked, the three adhered bubbles are not segmented and still adhere together. Figure 9 As can be seen from FIG. 7, among the three adhered bubbles in the lower box, since the points where the center portions of the three adhered bubbles are located are not marked, the three adhered bubbles are not segmented and still adhere together.
[0080] The application avoids the situation that the value of the center part of the bubble in the local region is different due to the different sizes of the bubbles, and the value of the center part of the small bubble is not identified as the value meeting the preset condition, so that the point where the center part of the small bubble is located cannot be marked. When the sizes of the adhered bubbles in the dynamic ice are greatly different, and when there is a larger bubble with an area greater than the adhered bubble near the adhered bubble in the dynamic ice, the point where the center part of the adhered small bubble is located can be marked by using the method for extracting adhered bubbles from a dynamic ice image provided by the application, so that the effect of segmenting the adhered bubbles is better.
[0081] In the example embodiment, before the step S110, steps S101 to S104 are further included.
[0082] Step S101: extracting bubbles from the original image by a preset neural network model to obtain a first intermediate image.
[0083] In the embodiment of the application, the original image of the dynamic ice can be a microscopic image or an image obtained by a mobile phone camera shooting the dynamic ice, and the original image can be a color image or a grayscale image.
[0084] As an optional implementation, if the size of the original image is equal to the preset size, the bubbles are extracted from the original image by the preset neural network model to obtain the first intermediate image.
[0085] As another optional implementation, if the size of the original image is not equal to the preset size, the size of the original image is adjusted to the preset size, the bubbles are extracted from the original image adjusted to the preset size by the preset neural network model to obtain a first extraction image, and the first extraction image is restored to the size of the original image to obtain the first intermediate image.
[0086] If the size of the original image is smaller than the preset size, the size of the original image is enlarged to the preset size, the bubbles are extracted from the original image enlarged to the preset size by the preset neural network model to obtain a first extraction image, and the first extraction image is reduced to the size of the original image to obtain the first intermediate image.
[0087] If the size of the original image is greater than the preset size, the size of the original image is reduced to the preset size, the bubbles are extracted from the original image reduced to the preset size by the preset neural network model to obtain a first extraction image, and the first extraction image is enlarged to the size of the original image to obtain the first intermediate image.
[0088] As a further optional implementation, if the size of the original image is smaller than the preset size, the bubbles are extracted from the original image by a preset neural network model to obtain a first intermediate image.
[0089] The preset size can be a size set according to a computer resource limit, such as 256*256 or 512*512.
[0090] The manner of enlarging or reducing the original image can be an interpolation manner, a manner of reducing the first extraction image to the size of the original image or enlarging the first extraction image to the size of the original image, or can also be an interpolation manner.
[0091] By adjusting the original image to the preset size when the size of the original image is not equal to the preset size, it is avoided that the original image cannot be subjected to image recognition due to the limitation of computer resources, and the first extraction image is restored to the size of the original image, so that the accuracy of the first intermediate image is avoided to be lost due to the size adjustment.
[0092] In the embodiments of the present application, the preset neural network model can be a U-net network model with an attention mechanism, can also be an R2U-net model, and can also be other neural network models, which are not limited in the present application.
[0093] The present application extracts bubbles from the dynamic ice image by the preset neural network model, avoids identifying the texture in the dynamic ice image as bubbles, and the unclear boundary of the bubbles, and provides a basis for extracting better bubbles.
[0094] As an optional implementation, if the shape of the original image does not satisfy the input shape of the preset neural network model, the original image is padded to the input shape of the preset neural network model, and then step S101 is performed.
[0095] Step S102: The original image is divided into n second segmentation image blocks, and n≥2, and bubbles are extracted from the n second segmentation image blocks by the preset neural network model respectively to obtain n second extraction image blocks.
[0096] The present application divides the dynamic ice image into second segmentation image blocks with smaller sizes, and extracts bubbles from each second segmentation image block by the preset neural network model, so as to avoid missing small bubbles when the size of the original image is too large and the bubbles are too small, and make the extracted bubbles better.
[0097] Step S103: The n second extraction image blocks are spliced into a second intermediate image according to a segmentation position arrangement order, the segmentation position arrangement order being an arrangement order of the position of each second segmentation image block in the original image when the original image is divided into the n second segmentation image blocks.
[0098] In the embodiments of the present application, the step of obtaining the first intermediate image can be performed first, and then the step of obtaining the second intermediate image is performed, or the step of obtaining the second intermediate image can be performed first, and then the step of obtaining the first intermediate image is performed, or the step of obtaining the first intermediate image and the step of obtaining the second intermediate image can be performed simultaneously.
[0099] Step S104: performing an OR operation on the first intermediate image and the second intermediate image to obtain a preprocessed binary image.
[0100] Specifically, small bubbles in the first intermediate image are missed, and large bubbles in the second intermediate image have holes, and the preprocessed binary image is obtained by performing an OR operation on the first intermediate image and the second intermediate image to fill in the missed small bubbles and the holes in the large bubbles, and the preprocessed binary image contains complete small bubbles and complete large bubbles.
[0101] As an optional implementation, the preprocessed binary image obtained in step S104 is subjected to an opening operation to obtain a preprocessed binary image after noise elimination.
[0102] The present application extracts bubbles from the original image directly through a preset neural network model, extracts the first intermediate image containing complete large bubbles, and then segments the original image, extracts bubbles from the second segmented image block through a preset neural network model, and obtains the second intermediate image containing complete small bubbles. The first intermediate image and the second intermediate image are subjected to an OR operation to obtain a preprocessed binary image containing complete large bubbles and complete small bubbles, so that the bubbles extracted by the preprocessed binary image are better, and a foundation is established for improving the effect of segmenting the connected bubbles.
[0103] Embodiment 2
[0104] Please refer to Figure 10 , Figure 10 A structural block diagram of a system 1000 for extracting connected bubbles from a dynamic ice image according to Embodiment 2 of the present application. The system can include: a distance acquisition unit 1010, an adjustment unit 1020, a marking unit 1030, and a watershed transformation unit 1040.
[0105] The distance acquisition unit 1010 is configured to obtain a distance image according to the minimum distance from the bubble pixel points in the preprocessed binary image to the background.
[0106] The adjustment unit 1020 is configured to perform histogram equalization on the distance image to obtain an adjusted image.
[0107] The marking unit 1030 is configured to acquire a value meeting a preset condition from the image matrix of the adjusted image, mark a point where the value meeting the preset condition is located in the adjusted image, and obtain a marked image.
[0108] The watershed transformation unit 1040 is configured to perform watershed transformation on the marked image according to the marked points in the marked image, and obtain a segmentation image of the adhered bubbles.
[0109] As an optional implementation, the distance acquisition unit 1010 includes a first distance acquisition subunit configured to perform distance transformation on the preprocessed binary image, and acquire the distance image according to the minimum distance from the bubble pixel points in the preprocessed binary image to the background.
[0110] The marking unit 1030 includes a first marking subunit configured to acquire a local maximum value from the image matrix of the adjusted image, and mark a point where the local maximum value is located in the adjusted image, and obtain the marked image.
[0111] The watershed transformation unit 1040 includes a first watershed transformation subunit configured to perform watershed transformation on the preprocessed binary image according to the marked points in the marked image, obtain a watershed segmentation line based on the marked points, and perform or operation on the watershed segmentation line and the preprocessed binary image, and obtain the segmentation image of the adhered bubbles.
[0112] As another optional implementation, the distance acquisition unit 1010 further includes a second distance acquisition subunit configured to perform distance transformation on the preprocessed binary image and take the inverse, and acquire the distance image according to the inverse of the minimum distance from the bubble pixel points in the preprocessed binary image to the background.
[0113] The marking unit 1030 further includes a second marking subunit configured to acquire a local minimum value from the image matrix of the adjusted image, and mark a point where the local minimum value is located in the adjusted image, and obtain the marked image.
[0114] The watershed transformation unit 1040 includes a second watershed transformation subunit configured to perform watershed transformation on the preprocessed binary image according to the marked points in the marked image, obtain a watershed segmentation line based on the marked points, take the inverse of the watershed segmentation line, and perform or operation on the inverse and the preprocessed binary image, and obtain the segmentation image of the adhered bubbles.
[0115] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the described system and units can refer to the corresponding processes in the foregoing method embodiments, which will not be described herein.
[0116] In addition, each of the functional modules in the embodiments of the present application can be integrated in one processing module, or each of the modules can exist physically, or two or more modules can be integrated in one module. The integrated module can be implemented in the form of hardware or in the form of a software functional module.
[0117] Embodiment 3
[0118] Please refer to Figure 11 , Figure 11 A structural block diagram of an electronic device 1100 is provided in Embodiment 3 of the present application. The electronic device 1100 in the present application can include one or more of the following components: a memory 1110, a processor 1120, a screen 1130, and one or more application programs, wherein the one or more application programs can be stored in the memory 1110 and configured to be executed by the one or more processors 1120, and the one or more programs are configured to perform the methods as described in the foregoing method embodiments.
[0119] The memory 1110 can include a random access memory (RAM) and can also include a read-only memory (ROM). The memory 1110 can be used to store instructions, programs, codes, code sets, or instruction sets. The memory 1110 can include a program storage area and a data storage area, wherein the program storage area can store instructions for implementing an operating system, instructions for implementing at least one function (such as a histogram equalization function, etc.), instructions for implementing each of the method embodiments described below, etc. The data storage area can also store data created by the electronic device 1100 in use (such as image matrix data, etc.).
[0120] The processor 1120 can include one or more processing cores. The processor 1120 connects various parts within the electronic device 1100 with various interfaces and lines, performs various functions of the electronic device 1100 and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1110, and calls data stored in the memory 1110. Alternatively, the processor 1120 can be implemented in at least one of a Digital Signal Processing (DSP), a Field-Programmable Gate Array (FPGA), and a Programmable Logic Array (PLA). The processor 1120 can be integrated with one or several combinations of a Central Processing Unit (CPU) and a modem. Among them, the CPU mainly processes operating systems and application programs, etc., and the modem is used to process wireless communication. It can be understood that the above-mentioned modem can also not be integrated into the processor 1120, but can be implemented by a separate communication chip.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of extracting adhered air bubbles from dynamic ice images based on watershed segmentation, characterized by, The method comprises: S110. Obtain a distance image according to the minimum distance from the center part of the bubble in the preprocessed binary image to the background, comprising: Perform distance transformation on the preprocessed binary image, and obtain the distance image according to the inverse of the minimum distance from the center part of the bubble in the preprocessed binary image to the background; S120. Perform histogram equalization on the distance image, adjust the value of each center part of the bubble in the distance matrix of the distance image, so that the brightness of the center part of the larger bubble existing near the coalesced bubble is as high as that of the coalesced bubble, and obtain an adjusted image; S130. Obtain a local minimum value from the image matrix of the adjusted image, and mark the point where the local minimum value is located in the adjusted image to obtain a marked image; S140. According to the marked points in the marked image, perform watershed transformation on the preprocessed binary image to obtain a watershed segmentation line based on the marked points, take the inverse of the watershed segmentation line, and perform OR operation with the preprocessed binary image to obtain a segmented image of the coalesced bubble.
2. The method of extracting adhered air bubbles from dynamic ice images based on watershed segmentation according to claim 1, characterized in that, The distance transformation is Euclidean distance transformation or Manhattan distance transformation.
3. The method of extracting adhered air bubbles from dynamic ice images based on watershed segmentation according to claim 1, wherein, Before the step S110, further comprising: Extract the bubble from the original image through a preset neural network model to obtain a first intermediate image; Segment the original image into n second segmented image blocks, and n≥2, and extract the bubble from the n second segmented image blocks through the preset neural network model respectively to obtain n second extracted image blocks; Arrange the n second extracted image blocks according to the segmentation position arrangement order to splice into a second intermediate image, wherein the segmentation position arrangement order is the arrangement order of the position of each second segmented image block in the original image when the original image is segmented into the n second segmented image blocks; Perform OR operation on the first intermediate image and the second intermediate image to obtain a preprocessed binary image.
4. A system for extracting adhered air bubbles from dynamic ice images based on watershed segmentation, characterized in that, Comprise: A distance acquisition unit is configured to obtain a distance image according to the minimum distance from the center part of the bubble in the preprocessed binary image to the background, comprising: Perform distance transformation on the preprocessed binary image, and obtain the distance image according to the inverse of the minimum distance from the center part of the bubble in the preprocessed binary image to the background; An adjustment unit is configured to perform histogram equalization on the distance image, adjust the value of each center part of the bubble in the distance matrix of the distance image, so that the brightness of the center part of the larger bubble existing near the coalesced bubble is as high as that of the coalesced bubble, and obtain an adjusted image; A marking unit is configured to obtain a local minimum value from the image matrix of the adjusted image, and mark the point where the local minimum value is located in the adjusted image to obtain a marked image; A watershed transformation unit is configured to perform watershed transformation on the preprocessed binary image according to the marked points in the marked image to obtain a watershed segmentation line based on the marked points, take the inverse of the watershed segmentation line, and perform OR operation with the preprocessed binary image to obtain a segmented image of the coalesced bubble.
5. An electronic device, comprising: Comprise: One or more processors; Memory; A screen is configured to display an image in the method according to any one of claims 1-3. one or more applications, wherein the one or more applications are stored in the memory and are configured to be executed by the one or more processors, the one or more programs configured to perform the method of any of claims 1-3.
Citation Information
Patent Citations
Extraction method for sea ice motion features in SAR (synthetic aperture radar) images
CN102867184A
Automatic small insect trapping detection method and system thereof
CN106570534A