Method and device for identifying bubbles in image, electronic equipment and storage medium

By pixatizing the glass liquid-like image and identifying the connective domain, the problem of low manual counting efficiency in the prior art is solved, and automated bubble detection is realized, and data accuracy and counting efficiency are improved.

CN119648734APending Publication Date: 2025-03-18CSG HOLDING CO LTD +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411993868.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

The prior art relies on manual counting in melt sample observation, and rarely uses image recognition and image analysis methods, resulting in inefficient bubble recognition and counting.

Method used

After the glass liquid-like image is pixatized, the communication domain and its number in the pixel image are identified. The communication domain represents the bubble map domain in the image, and the number of communication domains represents the number of bubbles. The specific steps include acquiring the glass liquid pattern, pixelating to obtain the pixel image, and identifying the connecting domain and its number in the pixel image.

Benefits of technology

Improve the working efficiency of bubble recognition and counting, realize automated bubble detection, reduce manual errors, and improve data accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119648734A_ABST
    Figure CN119648734A_ABST
Patent Text Reader

Abstract

The invention discloses a method for identifying bubbles in an image. The method comprises the following steps: acquiring a glass liquid sample image; the molten glass sample image is pixelated to obtain a pixel image; the connected domains in the pixel image and the number of the connected domains are recognized, the connected domains represent bubble image domains in the image, and the number of the connected domains represents the number of bubbles; according to the method, the mapping relation between the image bubble area and the image connected domain is constructed, the target of recognizing the position and the number of the bubbles in the image is achieved by recognizing the connected domain in the pixel image and the number of the connected domain, and therefore the working efficiency of bubble recognition and counting is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to image detection technology, and in particular to a method, device, electronic equipment and storage medium for identifying bubbles in an image. Background Art

[0002] Melt sample observation is an important experimental method, which is widely used in the research and optimization of float glass production process. By observing the molten glass sample, we can intuitively understand the melting behavior of the batch, the formation and evolution of bubbles, the homogenization process of the glass liquid, and the efficiency of clarification and degassing.

[0003] In the melt observation experiment, the pores between the batch particles will bring in air and release it into the glass liquid during the melting process. The salt raw materials in the batch will decompose at high temperatures and produce gases such as CO2, SO2, CO, and O2. In addition, the ambient atmosphere during the melting process may dissolve in the glass liquid, thereby precipitating bubbles. In order to optimize the batch ratio and melting process, it is necessary to observe and analyze the bubble distribution in the glass liquid. The current observation method mainly relies on manual bubble counting, and rarely uses image recognition and image analysis. Summary of the invention

[0004] Based on this, the present invention aims to propose a method, device, electronic device and storage medium for identifying bubbles in an image, which can identify and count bubbles in a glass liquid image through a connected domain after pixelating the image, so as to improve the efficiency of bubble identification and counting.

[0005] In a first aspect, the present invention provides a method for identifying bubbles in an image, comprising:

[0006] Obtain glass liquid sample image;

[0007] Pixelating the glass liquid sample image to obtain a pixel image;

[0008] Identify connected domains and their number in a pixel image, where the connected domains represent bubble map domains in the image, and the number of connected domains represents the number of bubbles.

[0009] Further, identifying connected domains and their number in the pixel image includes:

[0010] The pixel image is matrixed to obtain a pixel matrix, and the elements of the pixel matrix represent the pixel values ​​of the pixels;

[0011] Determine the elements constituting the connected domain in the pixel matrix, and record them as connected domain elements;

[0012] Traverse the zero matrix with the same number of rows and columns as the pixel matrix, query the unlabeled elements, assign the same label value to the elements in the zero matrix with the same position as the connected domain elements that constitute the same connected domain, increase the label value and process the next unlabeled element area until all elements of the zero matrix are labeled, identify the largest element value in the zero matrix and record it as the number of connected domains.

[0013] Furthermore, the elements constituting the connected domain are determined in the pixel matrix including:

[0014] Identify the element path in the pixel matrix. The element path is an ordered set of elements consisting of pixel points with the same pixel value and adjacent to each other. An ordered set of elements represents a connected domain.

[0015] Further, identifying the element path in the pixel matrix includes:

[0016] Traverse the pixel matrix, starting from the current pixel that has not been traversed, query the pixel points that have the same pixel value as the current pixel point and are adjacent to it, put the traversed pixel points with the same pixel value and are adjacent to each other into the same path set, until all the pixels are traversed, and store the elements in the same path set as an element path in the traversal order.

[0017] Furthermore, querying for pixels that have the same pixel value as the current pixel and are adjacent to the current pixel includes:

[0018] A depth-first search algorithm is used to expand from the current pixel, and only adjacent pixels with the same pixel value as the current pixel are expanded.

[0019] Furthermore, matrixing the pixel image to obtain a pixel matrix includes:

[0020] The pixel image is binarized according to a preset pixel threshold to obtain a pixel matrix.

[0021] Furthermore, binarizing the pixel image according to a preset pixel threshold to obtain a pixel matrix includes:

[0022] Get the RGB value of each pixel in the pixel image;

[0023] The grayscale value of each pixel is calculated according to the preset grayscale rule to obtain a grayscale image;

[0024] The grayscale image is binarized according to a preset pixel threshold to obtain a pixel matrix.

[0025] In a second aspect, the present invention provides a device for identifying bubbles in an image, comprising:

[0026] A sample image acquisition module, used to acquire a glass liquid sample image;

[0027] A pixelation module, used for pixelating the glass liquid sample image to obtain a pixel image;

[0028] The connected domain recognition module is used to identify the connected domains and their number in the pixel image. The connected domain represents the bubble map domain in the image, and the number of connected domains represents the number of bubbles.

[0029] In a third aspect, the present invention provides an electronic device comprising a memory storing computer executable instructions and a processor, wherein when the computer executable instructions are executed by the processor, the device executes the various steps of the method for identifying bubbles in an image provided in the first aspect.

[0030] In a fourth aspect, the present invention provides a readable storage medium storing a computer executable program, which, when executed, can implement the various steps of the method for identifying bubbles in an image provided in the first aspect.

[0031] Compared with the existing bubble recognition technology, the bubble recognition method in the image proposed in the present invention constructs a mapping relationship between the bubble area of ​​the image and the connected domain of the image, and achieves the goal of identifying the position and number of bubbles in the image by identifying the connected domain and the number of connected domains in the pixel image. A more specific embodiment traverses the elements that constitute the connected domain in the pixel matrix, and calculates the number of connected domains by marking the element values ​​in the zero matrix with the same number of rows and columns as the pixel matrix, thereby improving the work efficiency of bubble recognition and counting. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0033] Figure 1 This is a flow chart of a method for identifying bubbles in an image provided by an embodiment of the present invention;

[0034] Figure 2 is a pixel image sample provided by an embodiment of the present invention;

[0035] Figure 3 An image of a glass liquid sample containing bubbles provided by an embodiment of the present invention;

[0036] Figure 4 Yes Figure 3 Binary image obtained by binarization processing;

[0037] Figure 5 The identification method provided by the present invention is used to Figure 4 Schematic diagram of the bubble area obtained after treatment;

[0038] Figure 6 is a schematic structural diagram of a device for identifying bubbles in an image provided by an embodiment of the present invention;

[0039] Figure 7 This is a diagram of the electronic device architecture provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0040] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0041] See also Figure 1 An embodiment of the present invention provides a method for identifying bubbles in an image, comprising the following steps:

[0042] Step S110: Obtaining a glass liquid sample image.

[0043] The glass liquid sample image obtained in this step is used to identify bubbles precipitated in the glass liquid. After the glass liquid sample is prepared, a microscopic imaging device can be used to observe the microscopic structure of the liquid surface, and a high-resolution camera can be used to capture a macroscopic or microscopic image of the sample. Specifically, in this embodiment, the need for bubble identification can also be met by adjusting the lighting angle to highlight the bubbles.

[0044] Step S120: pixelate the glass liquid sample image to obtain a pixel image.

[0045] The pixel image required in this step is relative to the high-dimensional image. Since the original image is not convenient for intuitively understanding the mapping relationship between the image and the matrix, the image can be converted into a block pixel image with lower resolution to highlight the distribution of bubbles, impurities or other structural features in the glass liquid, while reducing the complexity of data processing.

[0046] Specifically, the original image can be a color image or a grayscale image that has been processed by grayscale. The core of image pixelation is to divide the image into several small blocks (called "pixel blocks"). After pixelation, the bubble distribution can be observed through the change of pixel intensity, and the areas with sudden intensity changes in the pixel blocks can be counted to detect the bubble edges.

[0047] In a more preferred embodiment, the grayscale processing can be implemented by using methods such as the average method, the weighted average method, the minimum method, the brightness method, etc.

[0048] Step S130: Identify connected domains and their number in the pixel image, where the connected domains represent bubble map domains in the image, and the number of connected domains represents the number of bubbles.

[0049] In this step, the bubbles in the image are regarded as a connected domain. Since the contrast between the bubble domain and other areas of the image in the pixel image is large, the bubbles can be identified through the connected domain. The connected domain is an area composed of a group of pixel points with the same pixel value and satisfying a certain adjacency relationship.

[0050] Specifically, in order to more clearly distinguish the connected domain from other areas of the image, the binary image can be used as the input for recognition, and each connected domain in the binary image can be numbered using the connected domain labeling technology, and the number of connected domains is the number of bubbles.

[0051] In a further embodiment, step S130 includes the following steps:

[0052] Step S131. Matrix the pixel image to obtain a pixel matrix, where the elements of the pixel matrix represent the pixel values ​​of the pixels.

[0053] Specifically, each pixel is composed of three primary colors RGB, so the image can be converted into a The number of matrix elements That is, the number of pixels in the pixel image. Each element corresponds to a pixel represented by an RGB value. Each element in the pixel matrix can be regarded as a one-dimensional row vector consisting of three elements.

[0054] In a more preferred implementation, in order to segment out the bubble area and help highlight the ROI area of ​​the image, the color or grayscale pixel image is binarized according to a set threshold to obtain a pixel matrix, and the pixel matrix at this time is a binary matrix.

[0055] Specifically, the acquisition of the above binary matrix may include the following steps:

[0056] Get the RGB value of each pixel in the pixel image;

[0057] The grayscale value of each pixel is calculated according to the preset grayscale rule to obtain a grayscale image;

[0058] The grayscale image is binarized according to a preset pixel threshold to obtain a pixel matrix.

[0059] In a more preferred embodiment, the elements in the initial binarization matrix after the grayscale image is binarized can still be represented by a row vector representing the three primary colors, for example, (1,1,1) represents white, (0,0,0) represents black, and then the row vector is binary mapped, for example, 1 represents (1,1,1), and 0 represents (0,0,0), and the elements in the final binary pixel matrix are a single value. In a further embodiment, a conventional binarization process can also be used to obtain a binary pixel matrix of a pixel image.

[0060] Step S132: Determine the elements constituting the connected domain in the pixel matrix and record them as connected domain elements.

[0061] Specifically, this step identifies the elements of the connected domain through the element path. In a matrix, for an arbitrary starting element, its adjacent elements are identified, and the process is repeated for new elements until the determined end element is reached. It is considered that there is an element path between the starting element and the end element, and the element path is equivalent to an ordered sequence of elements in the traversal order. According to the properties of the connected domain, if the starting element, the end element, and the elements constituting the element path have the same element value, they are considered to constitute a connected domain together, so that the connected domain is determined by the element path.

[0062] In a further embodiment, a binary matrix of the pixel image may be first obtained, and other connected domain detection algorithms, such as Flood Fill, depth optimization search, OpenCV, etc., may be used to mark the connected domain.

[0063] Step S133. Traverse the zero matrix with the same number of rows and columns as the pixel matrix, query the unlabeled elements, assign the same label value to the elements in the zero matrix at the same position as the connected domain elements constituting the same connected domain, increment the label value to process the next unlabeled element area, until all elements of the zero matrix are labeled, identify the largest element value in the zero matrix and record it as the number of connected domains.

[0064] This step introduces a zero matrix with the same number of rows and columns as the pixel matrix, and all elements are initialized to 0, indicating that it has not been labeled. For a binary pixel matrix, its element values ​​are only two. After determining the connected domain elements in the pixel matrix, the elements at the same element position in the zero matrix are assigned values. Each label completes a connected domain and increases the label value until all elements of the zero matrix are traversed. The maximum element value of the zero matrix is ​​the number of connected domains, which is also the number of bubbles in the sample image.

[0065] A more preferred implementation is that since the matrix dimension is too high and there is a repeated iterative process, a logical auxiliary matrix F can be introduced under the condition of introducing a zero matrix for marking. The matrix F has the same number of rows and columns as the pixel matrix, and the initial values ​​of the elements are all false. If an element is an element of the connected domain of the current element, it is marked in the matrix F and no longer participates in subsequent iterative operations.

[0066] In a further embodiment, the process of identifying an element path with the same pixel value in step S132 includes the following steps:

[0067] Traverse the pixel matrix, starting from the current pixel that has not been traversed, query the pixel points that have the same pixel value as the current pixel point and are adjacent to it, put the traversed pixel points with the same pixel value and are adjacent to each other into the same path set, until all the pixels are traversed, and store the elements in the same path set as an element path in the traversal order.

[0068] In a more preferred embodiment, the adjacent pixels may be expanded from the current pixel using a depth-first search algorithm, and only the adjacent pixels having the same pixel value as the current pixel are expanded.

[0069] The bubble recognition method proposed in the present invention is further introduced below by taking a specific image sample marking process.

[0070] like Figure 2 As shown, it illustrates a 9×9 binary pixel image, in which the white pixel area represents the bubble and the black area represents the background area.

[0071] The pixel value of each pixel is represented by the RGB channel value, (1,1,1) represents white, and (0,0,0) represents black. Figure 2 The corresponding pixel matrix can be expressed as:

[0072]

[0073] Let 1 represent (1,1,1) and 0 represent (0,0,0). Converted to a 9×9 pixel matrix as follows :

[0074]

[0075] matrix The elements of , .

[0076] For matrices whose element values ​​are only 0 and 1, assume that the element , , if exists and If the element value between them is 1, then it is considered and Connected, it and the elements on the element path together form a connected region.

[0077] Create a matrix with The zero matrix D of the same size, all elements of the matrix D are 0. According to the definition of the connected domain above, the depth-first search algorithm can be used to find these element paths, that is, to determine several connected domains and observe Figure 2 It can be seen that the elements To form a connected region, traverse the matrix D, mark the elements in the same position as 1, and traverse the next unmarked region by increasing the label value. Similarly, the matrix Elements in Construct a connected region, mark the elements in the same position of matrix D as 2, and the matrix Elements in To form a connected region, mark the elements in the same position of matrix D as 3, which is specifically expressed as follows:

[0078]

[0079] Since the maximum value of the elements in matrix D is 3, Figure 2 The number of white areas is exactly 3, because at this time the matrix All connected regions in have been marked by matrix D. According to Figure 2 Pixels and matrices From the mapping relationship, we can see that the maximum value of the element in the matrix D is Figure 1 The number of white areas in the middle is the number of bubbles.

[0080] See also Figure 3~Figure 5 An embodiment of the present invention further illustrates the effectiveness of the identification method proposed by the present invention with a specific glass liquid sample image.

[0081] Figure 3 A glass liquid sample is shown. It can be seen that bubbles are randomly distributed in the liquid. Figure 2 The value is obtained as Figure 4 The binarized image shown in the figure can be binarized by analyzing the RGB value of the sample image to select a suitable binarization threshold. In this embodiment, the threshold is set to 0.41, that is, the RGB value of the pixel is less than 0.41, then it is converted into a black pixel, and the element value at the same position in the binary pixel matrix is ​​marked as 0, otherwise it is marked as 1. Figure 4 The connected domain boundary in the traversal, the bubble area boundary identified after traversal is as follows Figure 5 shown.

[0082] The above-mentioned embodiments provide a method for identifying bubbles in an image, construct a mapping relationship between the bubble area of ​​the image and the connected domain of the image, and achieve the goal of identifying the position and number of bubbles in the image by identifying the connected domain and its number in the pixel image. A more specific embodiment traverses the elements that constitute the connected domain in the pixel matrix, and calculates the number of connected domains by marking the element values ​​in the zero matrix with the same number of rows and columns as the pixel matrix, thereby improving the work efficiency of bubble identification and counting.

[0083] The above method disclosed can be implemented by using various forms of equipment, so the present invention also discloses a device for identifying bubbles in an image corresponding to the above method, and a specific embodiment is given below for detailed description.

[0084] like Figure 6 As shown, an embodiment of the present invention provides a device for identifying bubbles in an image, comprising:

[0085] The sample image acquisition module 602 is used to acquire a sample image of the glass liquid;

[0086] A pixelation module 604 is used to pixelate the glass liquid sample image to obtain a pixel image;

[0087] The connected domain identification module 606 is used to identify the connected domains and their number in the pixel image. The connected domains represent the bubble map domains in the image, and the number of connected domains represents the number of bubbles.

[0088] The implementation principle and technical effects of the device provided in the embodiments of the present application are the same as those of the aforementioned method embodiments. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiments.

[0089] The methods and related devices mentioned in the above embodiments are described with reference to the method flow charts and / or structural diagrams provided in the embodiments of the present application. Specifically, each process and / or block in the method flow charts and / or structural diagrams, as well as the combination of processes and / or blocks in the flow charts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide for implementing the process in the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0090] The following embodiments are described by taking the method applied to a computer device as an example. It can be understood that the computer device can be any device with computing and processing functions, and can be but not limited to a server or a personal laptop computer, etc. In one embodiment, the computer device can be an application server, and the application server can be a server for running an application to be tested.

[0091] See also Figure 7 , which shows a hardware block diagram of an electronic device, the electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0092] like Figure 7 As shown, the electronic device includes: at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4;

[0093] In the embodiment of the present application, the number of the processor 1, the communication interface 2, the memory 3, and the communication bus 4 is at least one, and the processor 1, the communication interface 2, and the memory 3 communicate with each other through the communication bus 4;

[0094] The processor 1 may be a central processing unit CPU, or an application-specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present invention, etc.;

[0095] The memory 3 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory;

[0096] The memory stores a program, and the processor can call the program stored in the memory, wherein the program is used to implement various processing flows of the aforementioned bubble recognition solution in the image.

[0097] An embodiment of the present invention further provides a readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the various processing flows of the bubble recognition solution in the image provided by the above embodiment and / or any possible implementation method in combination with the embodiment.

[0098] The above-mentioned embodiments have described the present invention in particular detail with respect to possible scenarios, and those skilled in the art will recognize that the present invention can be practiced through other embodiments. The specific naming of components, the capitalization of terms, attributes, data structures, or any other programming or structural aspects are not mandatory or important, and the mechanisms or features of the present invention may have different names, forms, or procedures. The system may be implemented by a combination of hardware and software (as described), entirely by hardware elements, or entirely by software elements. The specific division of functions between the various system components described herein is exemplary only and not mandatory; on the contrary, the functions performed by a single system component may be performed by multiple components, or the functions performed by multiple components may be performed by a single component.

[0099] Those skilled in the art should understand that the various steps of the above disclosed method can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented with program codes executable by the computing device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the embodiments of the present invention are not limited to any specific combination of hardware and software.

[0100] These computing device executable programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors, and these computing programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or device (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0101] Certain aspects of the present invention include process steps and instructions described herein in the form of algorithms. It should be noted that the process steps and instructions of the present invention can be implemented in software, firmware and / or hardware, and when implemented by software, it can be downloaded, stored on different platforms used by various operating systems and operated from the platforms.

[0102] Those skilled in the art will understand that the structures shown in the accompanying drawings are merely block diagrams of partial structures related to the scheme of the present application, and do not constitute a limitation on the terminal device to which the scheme of the present application is applied. The specific terminal device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.

[0103] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "possible design" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0104] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for identifying bubbles in an image, characterized in that: include: Obtain glass liquid sample image; Pixelating the glass liquid sample image to obtain a pixel image; Connected domains and their number in the pixel image are identified, wherein the connected domains represent bubble map domains in the image, and the number of connected domains represents the number of bubbles.

2. The method according to claim 1, characterized in that The identifying of connected domains and their number in the pixel image comprises: Matrixing the pixel image to obtain a pixel matrix, wherein the elements of the pixel matrix represent the pixel values ​​of the pixel points; Determine the elements constituting a connected domain in the pixel matrix, recorded as connected domain elements; Traverse the zero matrix of the same size as the pixel matrix, query the unlabeled elements, assign the same label value to the elements in the zero matrix at the same position as the connected domain elements constituting the same connected domain, increment the label value and process the next unlabeled element area until all elements of the zero matrix are labeled, identify the largest element value in the zero matrix and record it as the number of the connected domain.

3. The method according to claim 2, characterized in that The determining of elements constituting a connected domain in the pixel matrix comprises: An element path in the pixel matrix is ​​identified, where the element path is an ordered element set consisting of pixel points with the same pixel value and adjacent to each other.

4. The method according to claim 3, characterized in that The identifying an element path in the pixel matrix comprises: The pixel matrix is ​​traversed, and the pixel points that are the same as and adjacent to the current pixel point are traversed, starting from the current pixel point that has not been traversed, and the traversed pixel points that have the same pixel value and are adjacent to the current pixel point are traversed, and the elements in the same path set are stored as an element path in the traversal order.

5. The method according to claim 4, characterized in that The query pixel point having the same pixel value as the current pixel point and adjacent to the current pixel point includes: A depth-first search algorithm is used to expand from the current pixel, and only adjacent pixels with the same pixel value as the current pixel are expanded.

6. The method according to claim 2, characterized in that The matrixing the pixel image to obtain a pixel matrix comprises: The pixel image is binarized according to a preset pixel threshold to obtain a pixel matrix.

7. The method according to claim 6, characterized in that Binarizing the pixel image according to a preset pixel threshold to obtain a pixel matrix includes: Obtaining the RGB value of each pixel in the pixel image; The grayscale value of each pixel is calculated according to the preset grayscale rule to obtain a grayscale image; The grayscale image is binarized according to a preset pixel threshold to obtain a pixel matrix.

8. A device for identifying bubbles in an image, characterized in that: include: A sample image acquisition module, used to acquire a glass liquid sample image; A pixelation module, used for pixelating the glass liquid sample image to obtain a pixel image; The connected domain recognition module is used to identify the connected domains and their number in the pixel image. The connected domain represents the bubble map domain in the image, and the number of connected domains represents the number of bubbles.

9. An electronic device, characterized in that: The device comprises a memory storing computer executable instructions and a processor, and when the computer executable instructions are executed by the processor, the device executes the method for recognizing bubbles in an image as described in any one of claims 1 to 7.

10. A readable storage medium, characterized in that: A computer executable program is stored, and when the program is executed, the method for recognizing bubbles in an image as described in any one of claims 1 to 7 can be implemented.

Citation Information

Cited By

  • Method for improving clarification effect in melting process of float glass batch and float glass batch

    CN121573908A