Image processing method, alumen ustum imaging method and camera system

By segmenting the foreground and background and connecting domain segmentation of the alum flower image, the characteristic information of alum flower is accurately extracted, and the problem of inaccurate characteristic information of alum flower in the prior art is solved, and the control accuracy of flocculant addition is improved.

CN119784788AActive Publication Date: 2025-04-08HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202510247930.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-04
Publication Date
2025-04-08
Estimated Expiration
2045-03-04

AI Technical Summary

Technical Problem

The prior art is difficult to accurately determine the characteristic information of alum flower, resulting in inaccurate control of the dosage of flocculant.

Method used

By segmenting the foreground and background of the alum flower image, a binary image is obtained, and the foreground area in the binary image is segmented in the connected domain, and each alum flower is extracted to determine its characteristic information.

Benefits of technology

Accurate extraction of the characteristic information of alum flower is achieved, and the control accuracy of flocculant is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784788A_ABST
    Figure CN119784788A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an image processing method, an alumen ustum imaging method and a camera system. According to the method, foreground and background segmentation processing is performed on the alumen ustum image to obtain the binary image, and connected domain segmentation is performed on the alumen ustum area in the binary image, so that each alumen ustum can be extracted from the alumen ustum image, and feature information of the alumen ustum can be determined more accurately. When the connected domain segmentation is carried out, the connected domain of each pixel point can be determined based on the connected domain to which the adjacent pixel point of each pixel point in the traversed pixel points belongs, and when each pixel point belonging to the foreground region is traversed, whether the number of the currently segmented connected domains is greater than a preset number threshold value can be firstly judged, and if the number of the currently segmented connected domains is greater than the preset number threshold value, the pixel point is segmented. If not, the segmented connected domains are integrated, and then the connected domains to which the currently traversed pixel points belong are determined based on the connected domains to which the adjacent pixel points belong after integration processing, so that the connected domain segmentation efficiency can be improved, and the memory overhead in the connected domain segmentation process is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, a flower imaging method and a camera system. Background Art

[0002] In the water treatment process of a water plant, an alum flocculant is usually used to coagulate impurities in the water, so that the colloid particles and tiny suspended solids that are not easy to precipitate in the water form larger flocs, so as to be separated and precipitated from the water. These flocs are generally called alum flowers. Usually, the flocculation effect after adding alum flocculants can be evaluated based on the characteristic information such as the size and morphological structure of the alum flowers, so as to control the dosage of the flocculant based on the flocculation effect. In the related art, the characteristic information of the alum flowers determined is not accurate enough, and the flocculation effect obtained based on the characteristic information is also inaccurate, resulting in the inability to accurately control the dosage of the flocculant based on the characteristic information of the alum flowers. Therefore, it is necessary to provide a solution that can accurately determine the characteristic information of the alum flowers. Summary of the invention

[0003] In view of this, the present application provides an image processing method, a bloom imaging method and a camera system.

[0004] According to the first aspect of the present application, a method for processing an alum flower image is provided, the method comprising: Acquire the alum flower image to be processed; Determine the foreground area and the background area in the alum flower image to obtain a binary image; Performing connected domain segmentation on the foreground area in the binary image, and taking each connected domain obtained by the segmentation as an alum flower, so as to determine the characteristic information of the alum flower in the alum flower image; The process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

[0005] According to a second aspect of the present application, a method for imaging alum flowers is provided, the method comprising: A camera system is configured, the camera system comprising a camera, a black back plate and a fill light, wherein the camera and the black back plate are arranged in sequence, a first gap is formed between the camera window and the black back plate, an area defined by the first gap is illuminated by the fill light, and a flocculation pool with alum flowers is arranged in the area defined by the first gap; The camera is used to capture the image of the alum flowers in the first gap to obtain an alum flower image, determine the foreground area and the background area in the alum flower image to obtain a binary image, perform connected domain segmentation on the foreground area in the binary image, and use each connected domain obtained by segmentation as an alum flower to determine the characteristic information of the alum flowers in the alum flower image; wherein the process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

[0006] According to a third aspect of the present application, a camera system is provided, the camera system comprising a camera, a black back plate and a fill light, wherein the camera and the black back plate are arranged in sequence, a first gap is formed between the camera window and the black back plate, an area defined by the first gap is illuminated by the fill light, and a flocculation pool with alum flowers is arranged in the area defined by the first gap; The camera is used to collect images of the alum flowers in the first gap to obtain an alum flower image, determine the foreground area and the background area in the alum flower image to obtain a binary image, perform connected domain segmentation on the foreground area in the binary image, and use each connected domain obtained by segmentation as an alum flower to determine the characteristic information of the alum flowers in the alum flower image; The process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

[0007] According to a fourth aspect of the present application, an electronic device is provided, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method mentioned in the first aspect when executing the computer program.

[0008] According to a fifth aspect of the present application, a computer program product is provided, wherein the computer program product comprises a computer program, and when the computer program is executed, the method mentioned in the first aspect is implemented.

[0009] According to a sixth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed, the method mentioned in the first aspect is implemented.

[0010] By applying the solution provided in the present application, a binary image is obtained by performing foreground and background segmentation processing on the alum flower image, and then a connected domain segmentation processing is performed on the alum flower area in the binary image, so that each alum flower can be extracted from the alum flower image, so as to more accurately determine the characteristic information of the alum flower. At the same time, when performing connected domain segmentation, the connected domain of each pixel point in the traversed pixel points can be determined based on the connected domain to which the adjacent pixel points of the pixel point belong, which can improve the processing efficiency, and each time a pixel point belonging to the foreground area is traversed, it can be determined whether the number of connected domains currently segmented is greater than a preset number threshold. If greater than, the segmented connected domains are first integrated, and then the connected domain to which the currently traversed pixel point belongs is determined based on the connected domain to which the adjacent pixel points after the integration processing belong, thereby improving the efficiency of connected domain segmentation and avoiding excessive memory overhead in the process of connected domain segmentation.

[0011] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0013] Figure 1 It is a flowchart of an image processing method according to an embodiment of the present application.

[0014] Figure 2 It is a schematic diagram of performing connected domain segmentation on a binary image according to an embodiment of the present application.

[0015] Figure 3 It is a schematic diagram of performing connected domain segmentation on a binary image according to an embodiment of the present application.

[0016] Figure 4 It is a schematic diagram of collecting alum flower images according to an embodiment of the present application.

[0017] Figure 5 It is a schematic diagram of collecting alum flower images according to another embodiment of the present application.

[0018] Figure 6 It is a schematic diagram of each alum flower extracted from an image according to another embodiment of the present application.

[0019] Figure 7 It is a schematic diagram of the logical structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

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

[0021] In the water treatment process of a water plant, alum flocculants are usually used to coagulate impurities in the water, so that the colloid particles and tiny suspended matter that are not easy to precipitate in the water form larger flocs, so as to separate and precipitate from the water. These flocs are generally called alum flowers. The flocculation effect after adding alum flocculants can usually be evaluated based on the characteristic information such as the size and morphological structure of the alum flowers, so as to control the dosage of the flocculants based on the flocculation effect. In the previous technology, the flocculation effect is usually determined by manually judging the size, morphological structure and other characteristics of the alum flowers, but this method is too dependent on manual experience, it is impossible to unify the evaluation criteria, and it is not efficient.

[0022] There are also technologies that can capture alum flower images through underwater cameras, and then use contour detection algorithms to detect the contours of alum flowers from the alum flower images, and determine the characteristics of the alum flowers based on the contours. However, this algorithm cannot accurately separate each alum flower, and the extracted contour may be the contours of a bunch of alum flowers. The characteristics of the alum flowers determined are also inaccurate, and the flocculation effect cannot be accurately determined based on the alum flower characteristics.

[0023] Based on this, the present application has come up with the idea that in order to better count the characteristic information of the alum flowers, each alum flower can be first extracted from the alum flower image, and then the characteristic information of the alum flower can be determined based on the area corresponding to each extracted alum flower in the image, so as to evaluate the flocculation effect based on these characteristic information. Specifically, when extracting alum flowers, the alum flower image can be segmented into a foreground area and a background area to obtain a binary image, and then the foreground area (i.e., the alum flower area) in the binary image can be segmented into connected domains, and each connected domain obtained by segmentation is regarded as an alum flower.

[0024] In addition, considering that the number of alum flowers in alum flower image is often large, the use of existing techniques for connecting domain segmentation of images, such as depth-first search technology (DFS) or breadth-first search technology (BFS), will result in large memory overhead and low processing efficiency. Based on this, the present application proposes a new connected domain segmentation scheme based on the characteristics of alum flower images, which can traverse the pixels in the binary image, and for the currently traversed pixel points belonging to the foreground area, the connected domain of the pixel point can be determined based on the connected domain to which the adjacent pixels of the pixel point in the traversed pixels belong. Since only the adjacent pixels of the current pixel point are considered when determining the connected domain to which each pixel point belongs, compared with the DFS technology that searches for pixels in a recursive manner (the DFS technology starts from one pixel, visits the neighboring pixels connected to the current pixel one by one, until the adjacent pixels can no longer be visited, and then goes back to the previous pixel to continue exploring), the recursive overhead can be avoided. In addition, since each pixel point determines the connected domain to which the pixel point belongs only based on the connected domain to which the traversed adjacent pixels belong, there may be some pixel points belonging to the same connected domain that are divided into two or more connected domains. Therefore, it is necessary to integrate these connected domains by performing a secondary traversal on the binary image. Specifically, considering that the number of alum flowers in the alum flower image is often large, and the connected domain to which each pixel point belongs is determined only based on the connected domain to which the traversed adjacent pixels belong, the pixel points belonging to the same connected domain will be divided into two or more connected domains, resulting in a large number of determined connected domains and a large memory overhead. In order to reduce the memory overhead, when traversing each pixel point belonging to the foreground area, it can be determined whether the number of connected domains currently obtained by segmentation exceeds a preset number threshold. If it exceeds, the connected domains obtained by segmenting the traversed area can be integrated first, and then the connected domain of the current pixel point can be determined based on the connected domain after the integrated processing. In this way, it can be avoided that the large memory overhead is occupied due to the excessive number of determined connected domains.

[0025] Based on the above invention concept, the present application provides an image processing method, such as Figure 1 As shown, the method may include the following steps: S102, obtaining alum flower image to be processed; In step S102, an image of alum flowers to be processed may be obtained, wherein the image of alum flowers may be obtained by collecting images of alum flowers in the flocculation tank by an underwater camera device disposed in the flocculation tank.

[0026] S104, determining the foreground area and the background area in the alum flower image to obtain a binary image; In step S104, after obtaining the alum flower image, the foreground area and the background area in the alum flower image can be segmented to obtain a binary image. For example, a pixel point with a pixel value of 1 in the binary image represents alum flowers, and a pixel point with a pixel value of 0 represents the background.

[0027] Among them, the segmentation process of the foreground area and the background area in the alum flower image can be implemented in a variety of ways. For example, in some embodiments, the foreground area and the background area in the alum flower image can be determined by threshold segmentation. For example, the maximization of inter-class variance algorithm can be used to perform foreground and background segmentation on the alum flower image. The principle of the maximization of inter-class variance algorithm is as follows: since the image pixel value is between 0 and 255, the inter-class variance when each brightness is used as the segmentation threshold can be calculated in turn by traversal, and the threshold of the maximum inter-class variance is used as the optimal threshold, and the foreground area and the background area in the image are determined based on the optimal threshold.

[0028] Of course, in some scenarios, the foreground area and background area of ​​the alum flower image can also be segmented through a pre-trained neural network to determine whether each pixel in the alum flower image belongs to the foreground or the background.

[0029] S106, performing connected domain segmentation on the foreground area in the binary image, and treating each connected domain obtained by the segmentation as an alum flower, so as to determine characteristic information of the alum flower in the alum flower image; Among them, the process of performing connected domain segmentation on the foreground area in the binary image is as follows: traverse the pixel points in the binary image, and for the pixel points currently traversed and belonging to the foreground area, perform the following operations: determine whether the number of connected domains currently segmented is greater than a preset number threshold; if not, determine the connected domain to which the pixel point belongs based on the connected domains to which the adjacent pixel points of the pixel point in the traversed pixel points belong; if yes, merge the connected domains with connectivity in the connected domains currently segmented, and determine the connected domain to which the adjacent pixel points belong after performing the merging operation, and determine the connected domain to which the pixel point belongs based on the connected domains to which the adjacent pixel points belong.

[0030] In step S106, after obtaining the binary image, the foreground area (i.e., the alum flower area) in the binary image may be segmented into connected domains, and each connected domain obtained by the segmentation may be regarded as an alum flower.

[0031] Among them, in order to improve the processing efficiency of connected domain segmentation and reduce the memory overhead in the segmentation process, the embodiment of the present application provides a secondary scanning segmentation scheme, that is, the first scan can be used to traverse each pixel in the image, and determine the connected domain of the pixel based on the connected domain of the traversed pixels adjacent to the currently traversed pixel belonging to the foreground area. Since only the adjacent pixels of the current pixel are considered in one scan, the connected domain segmented in this way may have some connected areas but is segmented into two or more connected domains. For example, if Figure 2 As shown in FIG. 1 , assuming that the pixels in the binary image are traversed from left to right and from top to bottom, for the currently traversed pixel belonging to the foreground area, the connected domain to which the pixel belongs on the left or top can be used as the connected domain to which the pixel belongs. Assuming that a connected domain with a larger connected domain label is selected as the connected domain of the current pixel, the labels of the connected domains to which each pixel belongs are as follows: Figure 2 As shown in the serial number on the upper right corner of each pixel in the figure, it can be seen that some pixels in the foreground area were originally connected, but because when determining the connected domain to which each pixel belongs, only the connected domains to the left and above the pixels are considered, these originally connected pixels are divided into two connected domains. For example, in the area selected by the red circle in the figure, the three pixels originally belonged to the same connected domain, but were divided into two connected domains.

[0032] To address the above problems, the connected domains obtained by segmentation can be integrated through a secondary scan. Considering that the number of alum flowers is often large, and since the area originally belonging to one connected domain will be segmented into two connected domains during one scan, the number of connected domains determined is often very large. In the process of connecting domain segmentation, it is necessary to store each connected domain mark (information used to identify the connected domain, such as the label of the connected domain), the connectivity relationship between connected domains (usually a connectivity relationship table can be used to record the connectivity relationship. When the number of connected domains is too large, the relationship table is very complex and occupies a lot of memory), etc. In order to avoid occupying too much memory, the step of integrating the connected domains through a secondary scan can be performed alternately with a primary scan. For example, in the process of a single scan, each time a pixel point belonging to the foreground area is traversed, it can be determined whether the number of connected domains currently segmented is greater than a preset number threshold, wherein the preset number threshold can be determined based on the memory space that can be provided by the image processing device for storing connected domain marks and connectivity relationships between connected domains. If the number of connected domains currently segmented is less than the preset number threshold, it means that the current memory can still store more connected domain tags and connectivity relationships between connected domains. Therefore, the connected domain to which the pixel belongs can be determined based on the connected domains to which the adjacent pixels of the traversed pixels belong. For example, assuming that the binary image is traversed from left to right and from top to bottom, for each current pixel, the traversed pixels adjacent to the pixel are the pixels on the left and top of the pixel. Therefore, the connected domain of the current pixel can be determined based on the connected domains to which the two determined pixels belong. After determining the connected domain to which the pixel belongs, the next pixel of the pixel can be traversed and the above process can be repeated.

[0033] Of course, if the number of connected domains currently segmented is less than the preset number threshold, it means that the current memory can no longer store more connected domain relationships. At this time, in order to reduce memory overhead, the connected domains with connected relationships in the currently segmented connected domains can be merged (i.e., the scanning process is performed), and after performing the merging operation, the connected domain to which the adjacent pixel points of the current pixel point belong is determined, and the connected domain to which the pixel point belongs is determined based on the connected domain to which the adjacent pixel points belong. In this way, the timing of the secondary scan can be dynamically adjusted based on the current memory space of the image processing device, which can ensure that too much memory will not be occupied during the connected domain segmentation process, reduce memory overhead, and improve the efficiency of connected domain segmentation.

[0034] In the process of traversing the binary image, considering that only the foreground area needs to be segmented into connected domains, the traversed pixels belonging to the background area can be directly skipped.

[0035] Of course, when traversing a binary image, the specific traversal order can be set based on actual needs. For example, it can be traversed from left to right and from top to bottom, or it can be traversed from right to left and from bottom to top. The embodiments of the present application do not limit this.

[0036] Through the method provided by the embodiment of the present application, the foreground and background segmentation processing of the alum flower image is performed to obtain a binary image, and then the connected domain segmentation processing is performed on the alum flower area in the binary image, so that each alum flower can be extracted from the alum flower image, so as to more accurately determine the characteristic information of the alum flower. At the same time, when performing connected domain segmentation, the connected domain of each pixel point in the traversed pixel points can be determined based on the connected domain to which the adjacent pixel points of the pixel point belong, which can improve the processing efficiency, and each time a pixel point belonging to the foreground area is traversed, it can be determined whether the number of connected domains currently segmented is greater than a preset number threshold. If it is greater, the segmented connected domains are first integrated, and then the connected domain to which the currently traversed pixel point belongs is determined based on the connected domain to which the adjacent pixel points after the integration processing belong, thereby improving the efficiency of connected domain segmentation and avoiding excessive memory overhead in the process of connected domain segmentation.

[0037] In some embodiments, when determining the connected domain to which the pixel belongs based on the connected domains to which the neighboring pixels of the pixel belong among the traversed pixels, if the neighboring pixels of the pixel all belong to the background area, it means that the pixel is not connected to the traversed neighboring pixels, and therefore, a connected domain can be recreated and used as the connected domain to which the pixel belongs. Figure 3 As shown, for the pixel point selected by the circle frame, since the pixel points on its left and upper sides are all background areas, a new connected domain ④ can be recreated, and it is determined that the pixel point belongs to the connected domain ④.

[0038] In some embodiments, if only one of the neighboring pixels of the pixel belongs to the foreground area, the connected domain to which the neighboring pixel belongs to the foreground area is used as the connected domain to which the pixel belongs. For example, taking the case of traversing the pixels in the binary image from left to right and from top to bottom, the traversed pixels adjacent to the pixel are the pixels on the left and above the pixel, and if the pixel on the left is the background, the connected domain to which the pixel on the top belongs is directly used as the connected domain to which the pixel belongs.

[0039] In some embodiments, if there are at least two neighboring pixel points of the pixel point that belong to the foreground area, a target neighboring pixel point is selected from the neighboring pixel points belonging to the foreground area, and the connected domain to which the target neighboring pixel point belongs is used as the connected domain to which the pixel point belongs.

[0040] In some embodiments, the label of the connected domain to which the target adjacent pixel belongs is greater than the labels of the connected domains to which other adjacent pixels in the foreground area belong, that is, the connected domain with the largest label among the connected domains to which the adjacent pixels belong can be selected as the connected domain to which the current pixel belongs.

[0041] In some embodiments, the label of the connected domain to which the target adjacent pixel belongs is smaller than the labels of the connected domains to which other adjacent pixels in the foreground area belong, that is, the connected domain with the smallest label among the connected domains to which the adjacent pixels belong can be selected as the connected domain to which the current pixel belongs.

[0042] In some embodiments, the connectivity relationship between the segmented connected domains is recorded via a connectivity relationship table. After determining the connected domain to which the pixel belongs based on the connected domains to which the adjacent pixels of the pixel belong among the traversed pixels, the method further includes: if the connected domain to which the pixel belongs is a newly created connected domain, then adding a new data record to the connectivity relationship table, the data record being used to indicate that the newly created connected domain is the source connected domain.

[0043] For example, taking the case of traversing the pixels in a binary image from left to right and from top to bottom, the traversed pixels adjacent to the pixel are the pixels on the left and above the pixel. If the pixels on the left and above the pixel are all background areas, a new connected domain can be recreated, and the connected domain to which the pixel belongs is determined to be the recreated connected domain. Since the recreated connected domain is not connected to the previously determined connected domain, a new data record can be added to the connectivity table. The data record is used to indicate that the recreated connected domain is the source connected domain, which is a connected domain that is not connected to the previously determined connected domain. For example, assuming that the recreated connected domain is labeled A, a new data record can be added: hashmap[A]=O, indicating that the connected domain is the source connected domain.

[0044] In some embodiments, the connectivity relationship between the connected domains obtained by segmentation is recorded through a connectivity relationship table. After determining the connected domain to which the pixel point belongs based on the connected domains to which the adjacent pixels of the pixel point among the traversed pixels belong, the method further includes: if the connected domain to which the pixel point belongs is the connected domain to which the above-mentioned target adjacent pixel point belongs, and the connected domain labels of the connected domains to which the at least two adjacent pixels belonging to the foreground area belong are different, then one or more data records are added to the connectivity relationship table, and the data records are used to indicate that the connected domains to which the at least two adjacent pixels belonging to the foreground area belong are connected.

[0045] For example, taking the case of traversing the pixels in a binary image from left to right and from top to bottom, the traversed pixels adjacent to the pixel are the pixels on the left and above the pixel. If the pixel above the pixel belongs to connected domain 3 and the pixel on the left belongs to connected domain 4, then it can be determined that the pixel belongs to connected domain 4. Since connected domain 3 and connected domain 4 are connected, at this time, a new data record can be added to the connectivity relationship table. The data record is used to indicate that connected domain 3 and connected domain 4 are connected. For example, a new data record can be added: hashmap[4]=3, indicating that connected domain 4 is connected to connected domain 3.

[0046] In some embodiments, since the data records in the connected domain relationship table are updated in the manner mentioned above, that is, if a certain connected domain is not connected to any connected domain determined before the connected domain, then the connected domain is a source connected domain. In addition, the connected relationship table only records the connected relationship between a certain connected domain and its adjacent connected domains determined before, therefore, when merging the connected domains with a connected relationship in the currently segmented connected domains, for any currently segmented connected domain, the data records in the connected relationship table can be recursively searched to determine the source connected domain connected to the connected domain, and the connected domain label of the source connected domain is used to update the connected domain label of the connected domain; after completing the update of the connected domain labels of each connected domain, the connected domains with the same connected domain labels are merged into one connected domain.

[0047] In some embodiments, the connectivity relationship between the segmented connected domains is recorded through a connectivity relationship table. For each segmented connected domain, the connectivity relationship table includes at least one data record corresponding to the connected domain, and the data record is used to indicate that the connected domain is a source connected domain, or the data record is used to indicate that the connected domain is connected to an adjacent connected domain of the connected domain in the connected domain determined before the connected domain, wherein if the connected domain is not connected to all connected domains determined before the connected domain, the connected domain is the source connected domain. Since the connection relationship table only records the connectivity relationship between a certain connected domain and its adjacent connected domains, it is necessary to determine the source connected domain connected to the connected domain by recursive search. For example, when merging the connected domains with connectivity relationships in the currently segmented connected domains, for any currently segmented connected domain, a recursive search can be performed on the data records in the connectivity relationship table to determine the source connected domain connected to the connected domain, and the connected domain label of the source connected domain is used to update the connected domain label of the connected domain; after completing the update of the connected domain labels of each connected domain, the connected domains with the same connected domain label are merged into one connected domain. Of course, if a connected domain itself is a source connected domain, the above recursive search process does not need to be performed.

[0048] For example, assume that the connectivity table determined based on the currently traversed binary image includes the following data records: hashmap[1]=O, hashmap[2]=O, hashmap[3]=1, hashmap[4]=3, hashmap[5]=4, hashmap[6]=O… Among them, hashmap[N]=0 means that the connected domain N is the source connected domain, and hashmap[N1]=N2 means that the connected domain N2 is connected to the connected domain N1.

[0049] When merging the currently segmented connected domains, for each connected domain, if the connected domain is a source connected domain, there is no need to update its connected domain label. If the connected domain is not source connected, the source connected domain connected to the connected domain can be determined by recursive search. For example, for connected domain 5, through recursive search, it can be determined that the source connected domain connected to it is connected domain 1, so its connected domain label can be updated to 1. It is similar for connected domains 4 and 3. It is determined that the connected domain connected to them is connected domain 1, so its connected domain label is updated to 1. Then the connected domains with the same connected domain label can be merged, for example, connected domain 1, connected domain 3, connected domain 4, and connected domain 5 are merged into one connected domain. After the connected merging is completed, the connected domain labels can be updated again to make the connected domain labels continuous.

[0050] Considering that the floccules (i.e., alum flowers) formed after the flocculant adsorbs impurities in water and condenses usually have overlapping and sticking phenomena, in order to more accurately extract each alum flower, the alum flowers that are at least partially overlapping in the alum flower image can be separated first, so as to avoid the extracted alum flowers being obtained by overlapping multiple alum flowers, and thus the characteristic information such as the size of the alum flowers being determined is inaccurate. Therefore, in some embodiments, before determining the foreground area and background area of ​​the alum flower image to obtain a binary image, a morphological operation can be performed on the alum flower image to separate the alum flowers that are at least partially overlapping in the alum flower image, wherein the morphological operation includes an erosion operation and an expansion operation. Then, the foreground area and background area of ​​the alum flower image can be determined based on the image after the morphological operation is performed to obtain a binary image.

[0051] In some embodiments, considering that the alum flower images collected by the underwater camera device usually have more noise, in order to avoid the noise being mistakenly identified as small-sized alum flowers later, before extracting the alum flowers from the image, the alum flower image can be denoised. For example, before determining the foreground area and background area of ​​the alum flower image and obtaining a binary image, the alum flower image can be denoised first, and then the alum flower image after denoising can be segmented into foreground and background to obtain a binary image. Among them, the specific denoising method can include multiple methods, for example, the alum flower image can be denoised by using a median filter.

[0052] In the related art, when collecting the image of the alum flower, an underwater camera is usually placed in the flocculation tank, and the underwater camera is used to collect the image of the alum flower. Since the underwater camera has the problem of distortion that the alum flower is larger when it is near and smaller when it is far away, the alum flower in the alum flower image will be distorted to varying degrees, and thus the alum flower size determined based on the alum flower image is not very accurate. In order to more accurately determine the size of the alum flower, in some embodiments, such as Figure 4 As shown, when using an underwater camera placed in a flocculation tank to collect images of alum flowers, a black backboard can be placed in front of the lens of the underwater camera in the flocculation tank (i.e., facing the shooting direction of the underwater camera), and the black backboard can cover the shooting field of the underwater camera, and in order to avoid the inaccurate size of the alum flowers in the alum flower image due to the distortion problem of the underwater camera, which is larger near and smaller far away, the distance between the underwater camera and the black backboard does not exceed a preset distance. A channel can be formed between the black backboard and the underwater camera, and the underwater camera can be used to collect images of the alum flowers in the channel to obtain an alum flower image. In an embodiment of the present application, by setting a black backing plate in front of the underwater camera device, the contrast of the collected alum flower image can be improved, which is convenient for the subsequent foreground and background segmentation and the extraction of the alum flower. In addition, the distance between the black backing plate and the underwater camera device can be controlled so that the distance between the alum flower in the collected alum flower image and the underwater camera device is controlled within a certain distance range, which can reduce distortion so as to obtain a more accurate alum flower size based on the alum flower image.

[0053] In addition, due to the low light underwater, the image of the alum flower collected is often of poor quality. In some embodiments, a fill light can be set on at least one side of the channel formed between the underwater camera device and the black background, and the fill light can be used to fill light for the alum flower in the channel. By illuminating the channel with the fill light, and then using the underwater camera device to collect images of the alum flower in the channel, the brightness of the shooting area can be increased, and a better alum flower image can be obtained. Figure 5 As shown, a fill light can be set on each side of the channel to fill light for the alum flowers in the channel.

[0054] In the related art, when determining the physical size of the alum flower in the alum flower image, a ruler of known size is usually used to determine the physical size of the alum flower. For example, assuming that the actual size of the ruler is L1, the corresponding number of pixels in the alum flower image is N1, and for any alum flower in the alum flower image, the corresponding number of pixels in the alum flower image is N2, then the physical size of the alum flower L2=L1*N 2 / N 1. Similarly, due to the distortion problem of underwater camera devices where objects appear larger near and smaller far away, the size of the alum flower can be accurately determined using the above calculation formula for alum flowers in the same depth plane as the ruler, but for alum flowers in different depth planes from the above ruler, due to the distortion, the alum flower size determined using the above formula is not accurate.

[0055] Considering that in the embodiment of the present application, since a black back plate is provided at a certain distance from the underwater camera device, that is, the object distance is known, the size of the alum flower can be determined based on the optical parameters of the underwater camera device and the object distance to obtain a more accurate alum flower size. In some embodiments, the characteristic information of the alum flower can include the physical size of each alum flower. When determining the physical size of each alum flower, the physical size corresponding to each pixel in the alum flower image can be determined based on the distance between the black back plate and the underwater camera device and the optical parameters of the underwater camera device. Then, the physical size of each alum flower can be obtained based on the number of pixels occupied by each alum flower in the alum flower image and the physical size corresponding to each pixel.

[0056] The following is an introduction to the alum flower image processing method of the present application in combination with a specific scheme, and the specific process is as follows: 1. Collection of alum flower images Alum flower detection is usually carried out in the sedimentation tank of a water plant. How to collect reliable alum flower images in this environment is the premise for subsequent alum flower extraction feature analysis. This scheme proposes a collection method, the specific structure is as follows Figure 5 As shown in the figure, a black background plate is placed 2 cm away from the front glass of the underwater camera, and fill lights are set on both sides of the gap formed, and the alum flowers pass through this gap. By placing a black background plate at a certain distance in front of the underwater camera, this method can solve the problem of misestimation of the alum flower size caused by the characteristics of large near and small far when alum flowers appear at different distances in the camera field of view. In addition, by setting the background to a pure black backboard, the contrast of the alum flowers in the image can be improved, and the accuracy of the foreground and background segmentation of the alum flower image can be improved.

[0057] 2. Extract each alum flower from the alum flower image (1) Separate the overlapping alum flowers in the alum flower image First, the noise in the flower image is filtered, and the overlapping flowers are separated by morphological filtering. Specifically, the point noise in the image is first filtered using a 3×3 median filter to prevent the noise from being misidentified as small-scale flowers; a 5×5 rectangular window is used as a structural element to perform an opening operation to separate overlapping or adjacent flowers from each other. The opening operation can be expressed as:

[0058] Where A is the input image, B is the structure element, Indicates the start operation. represents the corrosion operation, represents the expansion operation, Indicates maximum value filtering (i.e. setting the current pixel value to the maximum pixel value in the neighborhood). Indicates minimum value filtering (i.e. setting the current pixel value to the minimum pixel value in the neighborhood).

[0059] (2) Segment the foreground and background regions of the alum flower image to obtain a binary image The background and the flower are distinguished by threshold segmentation. The threshold determination method is to maximize the inter-class variance. Specifically, if all the pixels of the image are divided into two categories, background and flower, by this threshold, the inter-class variance of the two categories of pixels should be the largest. Since the image pixel value is between 0 and 255, the inter-class variance when each brightness is used as the segmentation threshold can be calculated in turn by traversal, and the threshold with the maximum inter-class variance is taken as the optimal threshold.

[0060] (3) Perform connected domain segmentation on the foreground area in the binary image to obtain each alum flower in the alum flower image.

[0061] First, create a connected domain counter count, a connected relationship table hashmap, and a connected domain label image label. Among them, the connected domain counter count is used to record the label of the latest connected domain; the connected relationship table hashmap is used to record the connectivity relationship between connected domains. For example, if connected domains A and B are connected, then hashmap[B]=A; if connected domains B and C are connected, then hashmap[C]=B. Further, the connected domain C can be found to be connected to A through hashmap; in addition, if connected domain D is the source connected domain, that is, it is not connected to the connected domain determined before this connected domain, then hashmap[D]=O; the connected label image is used to record the label of the connected domain to which each pixel belongs.

[0062] Initialize the connected domain counter to 2, the connected relationship tables to 0, and the connected labeled images to 0.

[0063] A scanning process is as follows: Traverse all the pixels of the binary image from left to right and from top to bottom. If the pixel is a bloom, execute the subsequent steps. If the pixel is the background, skip this traversal.

[0064] Each time a pixel is traversed, it is first determined whether the current number of connected domains exceeds the upper limit. If so, a second scan is performed on the traversed image area to integrate the connected domains. If the number of connected domains still exceeds the upper limit after integration, the method exits abnormally; otherwise, the subsequent traversal content is executed.

[0065] The subsequent traversal content is to determine the connected domain label of the current pixel by judging the connected domain labels of the pixels on the left and above the current pixel, and to update the connected domain relationship table and the connected domain counter. The connected domain labels of the left and upper pixels can be divided into four cases: a) If the left and upper labels are both 0, the connected domain counter is increased (assuming the label is 3), and it is used as the connected domain label of the current pixel, and the connectivity relationship table is updated, such as adding a new data record (hash[3]=1); b) If the label of the left or upper side is 0, or the two are the same, the larger of the two labels is assigned to the current pixel, and the connectivity relationship table is updated; c) If the upper label is smaller than the left label, the current pixel label is set to be the same as the left label, and the connectivity label relationship table is updated to connect the labels of the upper and left sides, such as adding a new data record (hash[left pixel connected domain label]=upper pixel connected domain label); d) If the left label is smaller than the upper label, the current pixel label is set to be the same as the upper side, and the connectivity relationship table is updated to connect the labels of the left and upper sides, such as adding a new data record (hash[left pixel connected domain label]=upper pixel connected domain label).

[0066] The process of the secondary scan is as follows: In the second scan, source label, first-level label and empty label are introduced, which are defined as hashmap[source label]=0, hashmap[first-level label]=source label, hashmap[empty label]=0. Among them, if a label is not connected to any previously determined label, then the label is the source label. If a label is connected to a previously determined label, then the label is a first-level label, and the connected domain labels of background pixels are all empty labels.

[0067] The connectivity relationship table hashmap is updated through self-recursive search to include only source labels and empty labels. For example, for any first-level label, the source label corresponding to the first-level label can be determined through recursive search, and the first-level label is updated to the source label.

[0068] For example, suppose hashmap[1]=O, hashmap[2]=O, hashmap[3]=1, hashmap[4]=3, hashmap[5]=4, hashmap[6]=O… Among them, labels 1, 2, and 6 are source labels, and labels 3, 4, and 5 are first-level labels. Through recursive search, it is determined that the source label corresponding to labels 3, 4, and 5 is 1. Therefore, labels 3, 4, and 5 can be updated to 1.

[0069] (3) Based on the updated hashmap, search and update the connected label graph label so that the connected label graph only contains the source label and the empty label.

[0070] Count the total number of source labels, that is, the number of current connected domains. For example, in the above example, there are 3 source labels, which means there are 3 connected domains.

[0071] Compared with the contour detection method, the above-mentioned optimized secondary scanning method can extract the complete area of ​​​​the alum flower. Even if multiple alum flowers overlap with each other, the adhering alum flowers can be separated from each other through morphological filtering, thereby improving the accuracy of alum flower extraction. In addition, compared with other scanning methods such as depth-first search (DFS), the optimized secondary scanning method only requires two traversals, and each traversal only requires one visit to each pixel, and the time complexity is only O(N), avoiding recursive overhead, and introducing a connectivity relationship table integration mechanism between two scans, solving the problem of excessive memory usage of the connectivity relationship record table. Through the above method, the results of alum flower extraction are as follows: Figure 6 As shown, the area of ​​different brightness is an alum flower.

[0072] 3. Determination of alum flower size Through the above-mentioned alum flower segmentation and recognition algorithm, the number of pixels occupied by each alum flower in the image is extracted, but the number of pixels does not belong to the standard unit, which is not conducive to the normalization analysis of alum flower features. This method proposes a method for calculating the physical size of alum flowers based on camera optical parameters. The specific process is as follows:

[0073] Where u represents the object distance, v represents the distance, f represents the focal length, N represents the number of pixels occupied, and d represents the pixel size. Using the above formula, the number of pixels occupied by the flower N and the camera optical parameters can be input to calculate the physical diameter of the flower (i.e. the object height).

[0074] Among them, the solutions of the above-mentioned embodiments can be freely combined to obtain new solutions when there is no conflict. Due to space constraints, they will not be listed one by one here.

[0075] In addition, the present application also provides a method for imaging alum flowers, the method comprising: A camera system is configured, the camera system comprising a camera, a black back plate and a fill light, wherein the camera and the black back plate are arranged in sequence, a first gap is formed between the camera window and the black back plate, an area defined by the first gap is illuminated by the fill light, and a flocculation pool with alum flowers is arranged in the area defined by the first gap; The camera is used to capture the image of the alum flowers in the first gap to obtain an alum flower image, determine the foreground area and the background area in the alum flower image to obtain a binary image, perform connected domain segmentation on the foreground area in the binary image, and use each connected domain obtained by segmentation as an alum flower to determine the characteristic information of the alum flowers in the alum flower image; wherein the process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

[0076] The camera is used to extract alum flowers from the alum flower image. The specific process of obtaining each alum flower can be referred to the description in the above embodiment and will not be repeated here.

[0077] In addition, the embodiment of the present application further provides a camera system, the camera system comprising a camera, a black back plate and a fill light, wherein the camera and the black back plate are arranged in sequence, a first gap is formed between the camera window and the black back plate, an area defined by the first gap is illuminated by the fill light, and a flocculation pool with alum flowers is arranged in the area defined by the first gap; The camera is used to collect images of the alum flowers in the first gap to obtain an alum flower image, determine the foreground area and the background area in the alum flower image to obtain a binary image, perform connected domain segmentation on the foreground area in the binary image, and use each connected domain obtained by segmentation as an alum flower to determine the characteristic information of the alum flowers in the alum flower image; The process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

[0078] The camera is used to extract alum flowers from the alum flower image. The specific process of obtaining each alum flower can be referred to the description in the above embodiment and will not be repeated here.

[0079] In addition, an embodiment of the present disclosure further provides a computer program product, which includes a computer program. When the computer program is executed, the method mentioned in any of the above embodiments is implemented.

[0080] The present disclosure also provides an electronic device, such as Figure 7 As shown, the electronic device 70 includes a processor 71, a memory 72, and computer instructions stored in the memory 72. When the processor 71 executes the computer instructions, the method mentioned in any of the above embodiments is implemented.

[0081] Accordingly, an embodiment of the present specification further provides a computer storage medium, in which a program is stored. When the program is executed by a processor, the method in any of the above embodiments is implemented.

[0082] The embodiments of this specification may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.

[0083] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.

[0084] The user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0085] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. The terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprises a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0086] The method and device provided in the embodiments of the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for processing alum flower image, characterized in that: The method comprises: Acquire the alum flower image to be processed; Determine the foreground area and the background area in the alum flower image to obtain a binary image; Performing connected domain segmentation on the foreground area in the binary image, and taking each connected domain obtained by the segmentation as an alum flower, so as to determine the characteristic information of the alum flower in the alum flower image; The process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

2. The method according to claim 1, characterized in that The step of determining the connected domain to which the pixel point belongs based on the connected domain to which the adjacent pixels of the pixel point in the traversed pixels belong includes: If the adjacent pixels all belong to the background area, re-create a connected domain, and use the re-created connected domain as the connected domain to which the pixel belongs; and / or If only one of the adjacent pixel points belongs to the foreground area, the connected domain to which the adjacent pixel point belonging to the foreground area belongs is used as the connected domain to which the pixel point belongs; and / or If there are at least two adjacent pixel points belonging to the foreground area among the adjacent pixel points, a target adjacent pixel point is selected from the adjacent pixel points belonging to the foreground area, and the connected domain to which the target adjacent pixel point belongs is used as the connected domain to which the pixel point belongs; wherein the target adjacent pixel point is the pixel point with the largest connected domain label among the adjacent pixel points belonging to the foreground area, or the target adjacent pixel point is the pixel point with the smallest connected domain label among the adjacent pixel points belonging to the foreground area.

3. The method according to claim 2, characterized in that The connectivity relationship between the segmented connected domains is recorded in a connectivity relationship table. After determining the connected domain to which the pixel point belongs based on the connected domain to which the adjacent pixel points of the pixel point belong among the traversed pixel points, the method further includes: If the connected domain to which the pixel point belongs is a newly created connected domain, then a new data record is added to the connectivity relationship table, and the data record is used to indicate that the newly created connected domain is the source connected domain; and / or If the connected domain to which the pixel point belongs is the connected domain to which the target adjacent pixel point belongs, and the connected domain labels of the connected domains to which the at least two adjacent pixel points belonging to the foreground area belong are different, then one or more data records are added to the connectivity relationship table, and the data records are used to indicate that the connected domains to which the at least two adjacent pixel points belonging to the foreground area belong are connected.

4. The method according to claim 3, characterized in that The merging of the connected domains having a connected relationship in the currently segmented connected domains includes: For any connected domain currently segmented, recursively search the data records in the connectivity relationship table to determine the source connected domain connected to the connected domain, and use the connected domain label of the source connected domain to update the connected domain label of the connected domain; After the connected domain labels of the connected domains are updated, the connected domains with the same connected domain labels are merged into one connected domain.

5. The method according to claim 1, characterized in that The connectivity relationship between the segmented connected domains is recorded in a connectivity relationship table. For each segmented connected domain, the connectivity relationship table includes at least one data record corresponding to the connected domain, the data record is used to indicate that the connected domain is a source connected domain, or the data record is used to indicate that the connected domain is connected to an adjacent connected domain of the connected domain in the connected domains determined before the connected domain, wherein if the connected domain is not connected to all the connected domains determined before the connected domain, the connected domain is the source connected domain; The merging of the connected domains having a connected relationship in the currently segmented connected domains includes: For any connected domain currently segmented, recursively search the data records in the connectivity relationship table to determine the source connected domain connected to the connected domain, and use the connected domain label of the source connected domain to update the connected domain label of the connected domain; After the connected domain labels of the connected domains are updated, the connected domains with the same connected domain labels are merged into one connected domain.

6. The method according to claim 1, characterized in that Before determining the foreground area and background area of ​​the alum flower image to obtain a binary image, the method further includes: performing a morphological operation on the alum flower image to separate the alum flowers that are at least partially overlapped in the alum flower image; wherein the morphological operation includes an erosion operation and a dilation operation; the determining the foreground area and background area of ​​the alum flower image to obtain a binary image includes: determining the foreground area and background area of ​​the alum flower image based on the image after the morphological operation to obtain a binary image; and / or Before determining the foreground area and background area of ​​the alum flower image to obtain a binary image, the method also includes: denoising the alum flower image; determining the foreground area and background area of ​​the alum flower image to obtain a binary image includes: determining the foreground area and the background area based on the alum flower image obtained by denoising to obtain a binary image.

7. The method according to claim 1, characterized in that The alum flower image is acquired by an underwater camera device disposed in a flocculation tank, wherein a black back plate is disposed in front of the lens of the underwater camera device in the flocculation tank, and the alum flower image is acquired by the underwater camera device by acquiring an image of the alum flower in a channel formed between the underwater camera device and the black back plate, wherein the distance between the black back plate and the underwater camera device does not exceed a preset distance.

8. The method according to claim 7, characterized in that A fill light is provided on at least one side of the channel formed between the underwater camera device and the black back plate, and the fill light is used to fill light on the alum flowers in the channel; and / or The characteristic information of the alum flower includes the physical size of each alum flower, and the physical size of each alum flower is determined based on the following method: the physical size corresponding to each pixel in the alum flower image is determined based on the distance between the underwater camera device and the black backplate and the optical parameters of the underwater camera device; the physical size of each alum flower is obtained based on the number of pixels occupied by each alum flower in the alum flower image and the physical size corresponding to each pixel.

9. A method for imaging alum flowers, characterized in that: The method comprises: A camera system is configured, the camera system comprising a camera, a black back plate and a fill light, wherein the camera and the black back plate are arranged in sequence, a first gap is formed between the camera window and the black back plate, an area defined by the first gap is illuminated by the fill light, and a flocculation pool with alum flowers is arranged in the area defined by the first gap; The camera is used to capture the image of the alum flowers in the first gap to obtain an alum flower image, determine the foreground area and the background area in the alum flower image to obtain a binary image, perform connected domain segmentation on the foreground area in the binary image, and use each connected domain obtained by segmentation as an alum flower to determine the characteristic information of the alum flowers in the alum flower image; wherein the process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

10. A camera system, characterized in that: The camera system comprises a camera, a black back plate and a fill light, wherein the camera and the black back plate are arranged in sequence, a first gap is formed between the camera window and the black back plate, an area defined by the first gap is illuminated by the fill light, and a flocculation pool with alum flowers is arranged in the area defined by the first gap; The camera is used to collect images of the alum flowers in the first gap to obtain an alum flower image, determine the foreground area and the background area in the alum flower image to obtain a binary image, perform connected domain segmentation on the foreground area in the binary image, and use each connected domain obtained by segmentation as an alum flower to determine the characteristic information of the alum flowers in the alum flower image; The process of performing connected domain segmentation on the foreground area in the binary image is as follows: The pixels in the binary image are traversed, and the following operations are performed for the currently traversed pixels belonging to the foreground area: Determine whether the number of connected domains currently segmented is greater than a preset number threshold; If not, then determining the connected domain to which the pixel point belongs based on the connected domains to which the neighboring pixels of the pixel point among the traversed pixels point belong; If so, the connected domains with connectivity in the currently segmented connected domains are merged, and after performing the merging operation, the connected domain to which the adjacent pixel points belong is determined, and the connected domain to which the pixel points belong is determined based on the connected domains to which the adjacent pixel points belong.

Citation Information

Patent Citations

  • Extracting method and device of marker central point and image processing system

    CN103164702A

  • Method and device for marking pixel points in image

    CN111833398A

  • Post-processing method and system for AI tooth segmentation result based on CBCT data

    CN114549559A

  • Water treatment dosing control method and device based on alumen ustum detection

    CN116012701A

  • Data processing method, device and equipment after skeleton segmentation and readable storage medium

    CN116523938A