Pyramid-based connected domain marking method, medium and equipment

Through the pyramid-based connected domain labeling method, by binarizing the image and performing pyramid hierarchical processing, multi-layer pyramid data is labeled level by level, which solves the problem of high computational complexity of multi-dimensional data labeling, improves processing efficiency, and meets real-time requirements.

CN120635134APending Publication Date: 2025-09-12SHANGHAI WEIJING SEMICONDUCTOR CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510743621.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-05
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing technologies have high computational complexity when processing connected domain labeling of multi-dimensional data, making it difficult to meet real-time requirements, especially in image segmentation, target detection and multi-dimensional data analysis.

Method used

A pyramid-based connected domain labeling method is adopted. By binarizing the image to be labeled, multi-layer pyramid dimensional data is generated and labeled step by step. The characteristic that the number of data points in the connected area is much larger than the boundary points is utilized to reduce the computational complexity.

Benefits of technology

It significantly reduces the number of pixels that need to be processed directly, improves the processing efficiency of multi-dimensional data connected domain labeling, and meets the needs of real-time processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635134A_ABST
    Figure CN120635134A_ABST
Patent Text Reader

Abstract

The invention provides a pyramid-based connected domain marking method, a medium and equipment. The method comprises the following steps: carrying out binarization processing on a to-be-marked image to obtain a binarized image; processing the binarized image according to a pyramid grading mode to obtain multi-layer pyramid dimension data; and marking the multi-layer pyramid dimension data step by step according to a preset direction, and outputting a connected domain marking result corresponding to the to-be-marked image. According to the method and the device, the processing efficiency of multi-dimensional data connected domain marking can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a pyramid-based connected domain marking method, medium, and device. Background Art

[0002] Connected component labeling technology is an important tool in image processing and computer vision. It provides basic support for image segmentation, target detection, feature extraction, image compression, real-time video processing and multi-dimensional data analysis.

[0003] However, how to complete the labeling of connected domains of data with lower complexity is a technical problem that those skilled in the art urgently need to solve. Summary of the Invention

[0004] The present application provides a pyramid-based connected domain labeling method, medium, and device to improve the processing efficiency of connected domain labeling of multi-dimensional data.

[0005] In a first aspect, the present application provides a pyramid-based connected domain labeling method, comprising the steps of:

[0006] Performing binarization processing on the image to be marked to obtain a binarized image;

[0007] Processing the binary image according to a pyramid grading method to obtain multi-layer pyramid dimension data;

[0008] The multi-layer pyramid dimensional data is marked level by level according to a preset direction, and the connected component marking result corresponding to the image to be marked is output.

[0009] In some embodiments, binarizing the image to be marked to obtain a binarized image comprises the steps of:

[0010] Determine whether the image to be marked is a grayscale image, and if not, convert it into a grayscale image;

[0011] The pixel values ​​of the pixels in the grayscale image whose grayscale values ​​are greater than a preset binarization threshold are set to 1, and the pixel values ​​of the pixels in the grayscale image whose grayscale values ​​are not greater than the preset binarization threshold are set to 0 to obtain the binarized image.

[0012] In some embodiments, processing the binarized image according to a pyramid hierarchical method to obtain multi-layer pyramid dimension data includes the following steps:

[0013] Obtaining a preset pyramid data calculation method, a preset number of pyramid levels, and corresponding preset pyramid scaling ratios for layers N to N+1 under a preset dimension, where N is a natural number.

[0014] Substituting the preset pyramid scaling ratio, the preset pyramid level, and the pixel values ​​of pixels within a preset range in the binarized image into the preset pyramid data calculation method, the pyramid dimension data corresponding to the current coordinates on the N+1th layer is calculated; the number of pixels in the width direction of the binarized image is U, the number of pixels in the height direction of the image to be marked is V, the number of the pyramid dimension data of non-top layers along the width direction is U / W, and the number of the pyramid dimension data of non-top layers along the height direction is V / H; U, V, W, and H are all positive integers, and U is at least twice W, and V is at least twice H; the preset range is the range in which the coordinates corresponding to the N+1th layer in the preset dimension are greater than the product of the coordinates corresponding to the Nth layer in the preset dimension and the preset pyramid scaling ratios corresponding to the layers N to N+1 in the preset dimension, and less than the product of the coordinates corresponding to the N+1th layer in the preset dimension and the preset pyramid scaling ratios corresponding to the layers N to N+1 in the preset dimension;

[0015] Wherein, the pyramid dimension data corresponding to N being equal to 0 is equal to the pixel value of the binary image in the image coordinate system.

[0016] In some implementations, the preset pyramid data calculation method includes any one of cumulative calculation, average calculation, and exponential calculation.

[0017] In some embodiments, the cumulative calculation is:

[0018]

[0019] Wherein, N is the preset pyramid level, is the pyramid dimension data corresponding to the N+1th layer, is the pyramid dimension data corresponding to the Nth layer, x, y, and z are the coordinates of the N+1 layer, i, j, and n are the coordinates of the N layer, and x_step, y_step, and z_step are the preset pyramid scaling ratios corresponding to the three dimensions from the Nth layer to the N+1th layer, respectively.

[0020] In some embodiments, labeling the multi-layer pyramid dimensional data level by level according to a preset direction includes:

[0021] Using the pyramid dimension data corresponding to the current coordinate on the N+1th layer as a dividend and a product of the preset pyramid scaling ratios corresponding to the Nth layer to the N+1th layer under the preset dimension as a divisor to obtain a current quotient corresponding to the current coordinate on the N+1th layer;

[0022] If the current quotient is greater than 1, setting the pyramid dimension data corresponding to the current coordinates on the N+1th layer to integer data;

[0023] According to a preset connectivity range, a preset scanning method is adopted to mark all the pyramid dimension data set as the integer data to obtain identification values ​​and corresponding identification groups;

[0024] The connected component labeling result is output according to the identification value and the corresponding identification group.

[0025] In some implementations, the identification values ​​and corresponding identification groups obtained by marking all the pyramid dimension data set as integer data using a preset scanning method according to a preset connectivity range include:

[0026] If the identification value and the corresponding identification group are the pyramid data of the top layer, the preset scanning mode is adopted according to the preset connected range, each consecutive integer data in the current row is recorded using a unified identification value and an identification group is set, and the identifier of the identification group is the first identification value in the identification group; the preset scanning mode is adopted according to the preset connected range, a new identification value is recorded for the next consecutive integer data in the next row and a new identification group is set, and the identifier of the new identification group is the first identification value in the new identification group;

[0027] Among them, if an integer data can be recorded as two identification values ​​at the same time and the two identification values ​​correspond to two identification groups, all identification values ​​in the latter identification group are moved to the former identification group, and the latter identification group is discarded.

[0028] In some implementations, the identification values ​​and corresponding identification groups obtained by marking all the pyramid dimension data set as integer data using a preset scanning method according to a preset connectivity range include:

[0029] If the identification value and the corresponding identification group are pyramid data other than the top layer, and do not overlap with the identification value of the pyramid data at the top layer, when an integer data can be recorded as a new identification value and is connected to the identification value of the previous layer, the new identification value is added to the identification group corresponding to the identification value of the previous layer; when an integer data is connected to multiple identification values ​​of the previous layer, the multiple identification groups are merged, all identification values ​​in the subsequent identification group are moved to the previous identification group, and the subsequent identification group is discarded; when an integer data can be recorded as a new identification value and is connected to multiple data with identification values ​​of the previous layer, the multiple identification groups are merged, all identification values ​​in the subsequent identification group are moved to the previous identification group, and the subsequent identification group is discarded, and the new identification value is added to the previous identification group.

[0030] In a second aspect, the present application further provides a storage medium, characterized in that it is applied to the pyramid-based connected domain labeling method described in the first aspect.

[0031] In a third aspect, the present application further provides an image acquisition device, characterized in that it is applied to the pyramid-based connected component labeling method described in the first aspect.

[0032] The pyramid-based connected domain labeling method, medium, and device provided in this application binarize an image to be labeled to obtain a binary image; process the binary image according to a pyramid hierarchical method to obtain multi-layer pyramid dimensional data; label the multi-layer pyramid dimensional data level by level according to a preset direction; and output the labeling result of the image to be labeled based on the identification values ​​and corresponding identification groups obtained during the level-by-level labeling process. This application can improve the processing efficiency of connected domain labeling in multi-dimensional data. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] 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 are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0034] Figure 1 This is a flow chart of a pyramid-based connected domain labeling method provided in an embodiment of the present application.

[0035] Figure 2 This is a schematic diagram of generating three-dimensional data of a three-level pyramid provided in an embodiment of the present application.

[0036] Figure 3 This is a schematic diagram of two-dimensional data marking provided in an embodiment of the present application.

[0037] Figure 4 This is a schematic diagram of two-dimensional data mapping provided in an embodiment of the present application. DETAILED DESCRIPTION

[0038] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.

[0039] In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0040] In order to enable any person skilled in the art to implement and use the present application, the following description is provided. In the following description, details are listed for the purpose of explanation. It should be understood that one of ordinary skill in the art will recognize that the present application can be implemented without using these specific details. In other examples, well-known processes will not be elaborated in detail to avoid obscuring the description of the embodiments of the present application with unnecessary details. Therefore, the present application is not intended to be limited to the embodiments shown, but is consistent with the widest range of principles and features disclosed in accordance with the embodiments of the present application.

[0041] Connected component labeling is an important tool in image processing and computer vision, used to identify and label connected regions within an image. Traditional connected component labeling techniques include the Two-Pass algorithm and the Seed-Filling algorithm. However, these techniques often require the determination and labeling of connected regions for each pixel in the image. This pixel-by-pixel approach fails to effectively utilize the overall characteristics of connected regions, resulting in high computational complexity. This is particularly true when processing large-scale images or multidimensional data, where computational complexity increases significantly with increasing dimensionality, leading to low efficiency. In applications requiring real-time processing, such as video surveillance and industrial automation, the high computational complexity of traditional connected component labeling algorithms may prevent them from meeting real-time requirements. Furthermore, traditional connected component labeling techniques primarily focus on processing low-dimensional image data (e.g., two-dimensional images) and lack the processing power for multidimensional data (e.g., three-dimensional medical images or multispectral images). When these point-by-point processing-based techniques are applied to multidimensional data, their computational complexity increases exponentially with increasing dimensionality, resulting in low efficiency.

[0042] The following describes the pyramid-based connected domain marking method, medium, and device of the present application in conjunction with the accompanying drawings to solve the above-mentioned problems.

[0043] Reference Figure 1 As shown, Figure 1 This is a flow chart of a pyramid-based connected domain labeling method provided in an embodiment of the present application. Figure 1The flowcharts shown in the figures or other figures show a logical order, but in some cases, the steps shown or described may be performed in a different order than that shown in the figures. The pyramid-based connected domain labeling method provided in the embodiment of the present application is applied to an image acquisition device, which includes multiple image acquisition related devices, and the multiple image acquisition related devices include an image signal processor, such as Figure 1 As shown in FIG, the pyramid-based connected component labeling method includes the following steps:

[0044] S100, performing binarization processing on the image to be marked to obtain a binarized image;

[0045] S200, processing the binarized image according to a pyramid grading method to obtain multi-layer pyramid dimension data;

[0046] S300 , marking the multi-layer pyramid dimensional data level by level according to a preset direction, and outputting the connected component marking result corresponding to the image to be marked.

[0047] Specifically, given that the number of data points within connected regions significantly exceeds that of their boundaries, this property also applies to two-dimensional and even higher-dimensional data. To effectively reduce the complexity of connected region labeling, a systematic process is proposed. First, the input dimensional data is binarized to convert it into clear binary dimensional data. Next, a pyramid hierarchy technique is applied to the binarized dimensional data to generate multi-level pyramid dimensional data. Pyramid hierarchy gradually reduces the data resolution, enabling it to exploit data correlations and effectively reducing computational complexity. Subsequently, a top-down, step-by-step labeling strategy is employed to process the multi-level pyramid dimensional data. Starting from the top level (lowest resolution) of the pyramid, each connected region is gradually labeled, and as the level descends (resolution increases), the boundaries of these connected regions are gradually refined. This strategy exploits the fact that the number of data points within connected regions is significantly greater than that of their boundaries, thereby reducing the number of pixels that require direct processing. Finally, based on the identification values ​​and corresponding identification groups obtained during the step-by-step labeling process, the labeling results of the region data and key information such as the region area are output. This application deeply explores the statistical properties of connected domains, particularly the pattern that the amount of data within a connected region far exceeds the amount of data on its boundaries. By constructing a pyramid data structure, the resolution of the data can be gradually reduced, allowing for rapid and accurate identification and processing of connected regions at a higher level. This approach not only significantly reduces the number of pixels that require direct processing but also further improves the efficiency of labeling connected domains in multidimensional data.

[0048] In some embodiments, binarizing the image to be marked to obtain a binarized image comprises the steps of:

[0049] Determine whether the image to be marked is a grayscale image, and if not, convert it into a grayscale image;

[0050] The pixel values ​​of the pixels in the grayscale image whose grayscale values ​​are greater than a preset binarization threshold are set to 1, and the pixel values ​​of the pixels in the grayscale image whose grayscale values ​​are not greater than the preset binarization threshold are set to 0 to obtain the binarized image.

[0051] Specifically, the input dimensional data is binarized to obtain the binary dimensional data. That is, all the input dimensional data are comprehensively traversed to ensure that each data point is processed correctly. Then, during the traversal process, a clear binarization threshold is set. For each input dimensional data, it is compared with this threshold: if the input dimensional data is greater than the binarization threshold, then the corresponding binarized dimensional data position is set to 1; if the input dimensional data is not greater than the binarization threshold, then the corresponding binarized dimensional data position is set to 0; finally, all the binarized dimensional data, namely the binarized image, are obtained.

[0052] In some embodiments, processing the binarized image according to a pyramid hierarchical method to obtain multi-layer pyramid dimension data includes the following steps:

[0053] Obtaining a preset pyramid data calculation method, a preset number of pyramid levels, and corresponding preset pyramid scaling ratios for layers N to N+1 under a preset dimension, where N is a natural number.

[0054] Substituting the preset pyramid scaling ratio, the preset pyramid level, and the pixel values ​​of pixels within a preset range in the binarized image into the preset pyramid data calculation method, the pyramid dimension data corresponding to the current coordinates on the N+1th layer is calculated; the number of pixels in the width direction of the binarized image is U, the number of pixels in the height direction of the image to be marked is V, the number of the pyramid dimension data of non-top layers along the width direction is U / W, and the number of the pyramid dimension data of non-top layers along the height direction is V / H; U, V, W, and H are all positive integers, and U is at least twice W, and V is at least twice H; the preset range is the range in which the coordinates corresponding to the N+1th layer in the preset dimension are greater than the product of the coordinates corresponding to the Nth layer in the preset dimension and the preset pyramid scaling ratios corresponding to the layers N to N+1 in the preset dimension, and less than the product of the coordinates corresponding to the N+1th layer in the preset dimension and the preset pyramid scaling ratios corresponding to the layers N to N+1 in the preset dimension;

[0055] Wherein, the pyramid dimension data corresponding to N being equal to 0 is equal to the pixel value of the binary image in the image coordinate system.

[0056] In some implementations, the preset pyramid data calculation method includes any one of cumulative calculation, average calculation, and exponential calculation.

[0057] In some embodiments, the cumulative calculation is:

[0058]

[0059] Wherein, N is the preset pyramid level, is the pyramid dimension data corresponding to the N+1th layer, is the pyramid dimension data corresponding to the Nth layer, x, y, and z are the coordinates of the N+1 layer, i, j, and n are the coordinates of the N layer, and x_step, y_step, and z_step are the preset pyramid scaling ratios corresponding to the three dimensions from the Nth layer to the N+1th layer, respectively.

[0060] Specifically, the binary dimension data is pyramid-graded to obtain multi-level pyramid dimension data;

[0061] Specifically, the pyramid reduction step size of different dimensions is set, the pyramid data calculation method is set, the pyramid level is set, and multi-level pyramid dimension data is obtained according to the method; an example of three-dimensional data is as follows:

[0062] Processing of binary 3D data;

[0063] The scaling ratios of the pyramid three-dimensional data are set to be consistent, for example, 2. For specific applications, the scaling ratios of different dimensions may also be inconsistent.

[0064] Set the pyramid data calculation method to data accumulation, the specific accumulation formula is:

[0065]

[0066] Where N is the pyramid level, P is the pyramid data, x, y, and z are the data coordinates of the N+1 layer, i, j, and n are the data coordinates of the N layer, and x_step, y_step, and z_step are the scaling ratios in three dimensions from the N layer to the N+1 layer.

[0067] The pyramid data calculation method can also be mean calculation, exponential calculation, etc. Set the pyramid level to 3; according to the above settings, the final three-level pyramid 3D data is as follows Figure 2 shown.

[0068] In some embodiments, labeling the multi-layer pyramid dimensional data level by level according to a preset direction includes:

[0069] Using the pyramid dimension data corresponding to the current coordinate on the N+1th layer as a dividend and a product of the preset pyramid scaling ratios corresponding to the Nth layer to the N+1th layer under the preset dimension as a divisor to obtain a current quotient corresponding to the current coordinate on the N+1th layer;

[0070] If the current quotient is greater than 1, setting the pyramid dimension data corresponding to the current coordinates on the N+1th layer to integer data;

[0071] According to a preset connectivity range, a preset scanning method is adopted to mark all the pyramid dimension data set as the integer data to obtain identification values ​​and corresponding identification groups;

[0072] The connected component labeling result is output according to the identification value and the corresponding identification group.

[0073] Specifically, the connectivity range is preset. For example, two-dimensional data can be 4-connected or 8-connected, and three-dimensional data can be 6-connected or 26-connected. For any layer of the pyramid dimension data, normalize it to get integer data and decimal data, where integer data is 1 and decimal data is less than 1; the specific formula is as follows

[0074]

[0075] Where N is the pyramid level, P is the data, x, y, and z are the data coordinates of the N+1 layer, i, j, and n are the data coordinates of the N layer, and x_step, y_step, and z_step are the scaling ratios in the three dimensions from the N layer to the N+1 layer.

[0076] After the integer data and decimal data are obtained according to the above formula, the integer data are marked according to the preset connectivity range using a preset scanning method, such as raster scanning, to obtain identification values ​​and corresponding identification groups.

[0077] In some implementations, the identification values ​​and corresponding identification groups obtained by marking all the pyramid dimension data set as integer data using a preset scanning method according to a preset connectivity range include:

[0078] If the identification value and the corresponding identification group are the pyramid data of the top layer, the preset scanning mode is adopted according to the preset connected range, each consecutive integer data in the current row is recorded using a unified identification value and an identification group is set, and the identifier of the identification group is the first identification value in the identification group; the preset scanning mode is adopted according to the preset connected range, a new identification value is recorded for the next consecutive integer data in the next row and a new identification group is set, and the identifier of the new identification group is the first identification value in the new identification group;

[0079] Among them, if an integer data can be recorded as two identification values ​​at the same time and the two identification values ​​correspond to two identification groups, all identification values ​​in the latter identification group are moved to the former identification group, and the latter identification group is discarded.

[0080] S331. If it is the top layer of the pyramid data, according to the connectivity range, for example Figure 3 As shown,

[0081] S3311. Use a unified identification value to record continuous integer data, and set an identification group, and the identification value is the first identification value in the identification group;

[0082] S3312. When the integer data is interrupted, a new identification value is enabled to record the next consecutive integer data, and a new identification group is set, and the identification value is the first identification value in the identification group;

[0083] S3313. If an integer data can be recorded as two identification values ​​at the same time and the two identification values ​​correspond to two identification groups, it means that the two identification groups overlap at the position of the integer data. Then merge the two identification groups, that is, move all the identifications in identification group B to identification group A, and discard identification group B.

[0084] S3314. After the integer data of this layer is marked, the identification number is amplified and mapped to the next layer of the pyramid according to the scaling ratio of the dimension, and the corresponding identification value data of the upper layer is obtained. For example, for two-dimensional data, the scaling ratio is 3, and the data before and after mapping are as follows: Figure 4 shown.

[0085] Each identification group has an identification group serial number, that is, a region serial number, and the data corresponding to all identifications in the identification group belong to the same region.

[0086] In some implementations, the identification values ​​and corresponding identification groups obtained by marking all the pyramid dimension data set as integer data using a preset scanning method according to a preset connectivity range include:

[0087] If the identification value and the corresponding identification group are pyramid data other than the top layer, and do not overlap with the identification value of the pyramid data at the top layer, when an integer data can be recorded as a new identification value and is connected to the identification value of the previous layer, the new identification value is added to the identification group corresponding to the identification value of the previous layer; when an integer data is connected to multiple identification values ​​of the previous layer, the multiple identification groups are merged, all identification values ​​in the subsequent identification group are moved to the previous identification group, and the subsequent identification group is discarded; when an integer data can be recorded as a new identification value and is connected to multiple data with identification values ​​of the previous layer, the multiple identification groups are merged, all identification values ​​in the subsequent identification group are moved to the previous identification group, and the subsequent identification group is discarded, and the new identification value is added to the previous identification group.

[0088] S332. If the data is not the top layer of the pyramid and has no upper layer identification value, based on the connectivity range, on the basis of using steps S3311-S3313,

[0089] S3321. If an integer data can be recorded as a new identification value and is connected to data with an upper-level identification value, it means that the new identification value also belongs to the identification group corresponding to the upper-level identification value, then the new identification value is added to the identification group corresponding to the upper-level identification value.

[0090] S3322. If an integer data is connected to multiple data with upper-level identification values ​​at the same time, it means that the identification groups corresponding to multiple upper-level identification values ​​overlap at the position of the integer data, then merge the multiple identification groups, that is, move all the identifications in the identification group BCD..G to the identification group A, and discard the identification group BCD..G at the same time.

[0091] S3323. If an integer data can be recorded as a new identification value at the same time and connects multiple data with upper-level identification values, it means that the new identification value also belongs to the identification group corresponding to the upper-level identification value, and the identification groups corresponding to multiple upper-level identification values ​​overlap at the position of the integer data, then merge multiple identification groups, that is, move all identifications in identification group BCD..G to identification group A, discard identification group BCD..G, and add the new identification value to identification group A.

[0092] S34. Mark interrupt processing

[0093] S341. When the total number of identifications reaches the upper threshold, the interruption process is terminated;

[0094] S342. When the number of identification groups reaches the upper threshold, the interruption process is terminated;

[0095] S343. When entering the interrupt end processing, the area identification processing stops and the output is all 0.

[0096] S4. Based on the obtained identification value and the corresponding identification group, the input dimension data is processed to obtain information such as the regional data label and the regional area.

[0097] The present application also provides a storage medium, characterized in that it is applied to the pyramid-based connected domain labeling method described in the first aspect.

[0098] The present application also provides an image acquisition device, characterized in that it is applied to the pyramid-based connected component labeling method described in the first aspect.

[0099] In specific implementation, the above units or modules can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The above units or modules can refer to the pyramid-based connected domain labeling method in the previous method embodiment, which will not be repeated here.

[0100] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be accomplished by instructions, or by controlling related hardware through instructions. The instructions can be stored in a computer-readable storage medium and loaded and executed by a processor to implement the above method embodiments. The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0101] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in one embodiment, reference can be made to the relevant description of other embodiments. Those skilled in the art will clearly understand that for the convenience and brevity of description, the specific working process and beneficial effects of the data acquisition system and its corresponding units described above can be referred to the description of the pyramid-based connected domain labeling method in the above embodiment, and the details will not be repeated here.

[0102] The above is a detailed introduction to a pyramid-based connected domain labeling method and system provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of ​​the present application. At the same time, for those skilled in the art, based on the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present application.

Claims

1. A connected domain labeling method based on pyramid, characterized in that: Including steps: Performing binarization processing on the image to be marked to obtain a binarized image; Processing the binary image according to a pyramid grading method to obtain multi-layer pyramid dimension data; The multi-layer pyramid dimensional data is marked level by level according to a preset direction, and the connected component marking result corresponding to the image to be marked is output.

2. The pyramid-based connected domain labeling method according to claim 1, characterized in that: The binarization process of the image to be marked to obtain the binarized image comprises the following steps: Determine whether the image to be marked is a grayscale image, and if not, convert it into a grayscale image; The pixel values ​​of the pixels in the grayscale image whose grayscale values ​​are greater than a preset binarization threshold are set to 1, and the pixel values ​​of the pixels in the grayscale image whose grayscale values ​​are not greater than the preset binarization threshold are set to 0 to obtain the binarized image.

3. The pyramid-based connected domain labeling method according to claim 1, characterized in that: The step of processing the binarized image according to the pyramid grading method to obtain multi-layer pyramid dimension data comprises the following steps: Obtaining a preset pyramid data calculation method, a preset number of pyramid levels, and corresponding preset pyramid scaling ratios for layers N to N+1 under a preset dimension, where N is a natural number. Substituting the preset pyramid scaling ratio, the preset pyramid level, and the pixel values ​​of pixels within a preset range in the binarized image into the preset pyramid data calculation method, the pyramid dimension data corresponding to the current coordinates on the N+1th layer is calculated; the number of pixels in the width direction of the binarized image is U, the number of pixels in the height direction of the image to be marked is V, the number of the pyramid dimension data of non-top layers along the width direction is U / W, and the number of the pyramid dimension data of non-top layers along the height direction is V / H; U, V, W, and H are all positive integers, and U is at least twice W, and V is at least twice H; the preset range is the range in which the coordinates corresponding to the N+1th layer in the preset dimension are greater than the product of the coordinates corresponding to the Nth layer in the preset dimension and the preset pyramid scaling ratios corresponding to the layers N to N+1 in the preset dimension, and less than the product of the coordinates corresponding to the N+1th layer in the preset dimension and the preset pyramid scaling ratios corresponding to the layers N to N+1 in the preset dimension; Wherein, the pyramid dimension data corresponding to N being equal to 0 is equal to the pixel value of the binary image in the image coordinate system.

4. The pyramid-based connected domain labeling method according to claim 3, characterized in that: in, The preset pyramid data calculation method includes any one of cumulative calculation, average calculation and exponential calculation.

5. The pyramid-based connected domain labeling method according to claim 3, characterized in that: The cumulative calculation is: Wherein, N is the preset pyramid level, is the pyramid dimension data corresponding to the N+1th layer, is the pyramid dimension data corresponding to the Nth layer, x, y, and z are the coordinates of the N+1 layer, i, j, and n are the coordinates of the N layer, and x_step, y_step, and z_step are the preset pyramid scaling ratios corresponding to the three dimensions from the Nth layer to the N+1th layer, respectively.

6. The pyramid-based connected domain labeling method according to claim 3, characterized in that: The step of marking the multi-layer pyramid dimension data level by level according to a preset direction includes: Using the pyramid dimension data corresponding to the current coordinate on the N+1th layer as a dividend and a product of the preset pyramid scaling ratios corresponding to the Nth layer to the N+1th layer under the preset dimension as a divisor to obtain a current quotient corresponding to the current coordinate on the N+1th layer; If the current quotient is greater than 1, setting the pyramid dimension data corresponding to the current coordinates on the N+1th layer to integer data; According to a preset connectivity range, a preset scanning method is adopted to mark all the pyramid dimension data set as the integer data to obtain identification values ​​and corresponding identification groups; The connected component labeling result is output according to the identification value and the corresponding identification group.

7. The pyramid-based connected domain labeling method according to claim 6, characterized in that: The identification values ​​and corresponding identification groups obtained by marking all the pyramid dimension data set as integer data using a preset scanning method according to the preset connectivity range include: If the identification value and the corresponding identification group are the pyramid data of the top layer, the preset scanning mode is adopted according to the preset connected range, each consecutive integer data in the current row is recorded using a unified identification value and an identification group is set, and the identifier of the identification group is the first identification value in the identification group; the preset scanning mode is adopted according to the preset connected range, a new identification value is recorded for the next consecutive integer data in the next row and a new identification group is set, and the identifier of the new identification group is the first identification value in the new identification group; Among them, if an integer data can be recorded as two identification values ​​at the same time and the two identification values ​​correspond to two identification groups, all identification values ​​in the latter identification group are moved to the former identification group, and the latter identification group is discarded.

8. The pyramid-based connected domain labeling method according to claim 6, characterized in that: The identification values ​​and corresponding identification groups obtained by marking all the pyramid dimension data set as integer data using a preset scanning method according to the preset connectivity range include: If the identification value and the corresponding identification group are pyramid data other than the top layer, and do not overlap with the identification value of the pyramid data at the top layer, when an integer data can be recorded as a new identification value and is connected to the identification value of the previous layer, the new identification value is added to the identification group corresponding to the identification value of the previous layer; when an integer data is connected to multiple identification values ​​of the previous layer, the multiple identification groups are merged, all identification values ​​in the subsequent identification group are moved to the previous identification group, and the subsequent identification group is discarded; when an integer data can be recorded as a new identification value and is connected to multiple data with identification values ​​of the previous layer, the multiple identification groups are merged, all identification values ​​in the subsequent identification group are moved to the previous identification group, and the subsequent identification group is discarded, and the new identification value is added to the previous identification group.

9. A storage medium, characterized in that: The method is applied to the pyramid-based connected domain labeling method described in any one of claims 1 to 4.

10. An image acquisition device, characterized in that: The method is applied to the pyramid-based connected domain labeling method described in any one of claims 1 to 4.