Compression and device of boundary point set for mask area

Through edge detection algorithm and semantic detection of common edge boundary lines, point set compression of boundary points in mask area is solved, and the labeling efficiency problem is ineffective caused by large data volume in mask area is achieved, and the double reduction of data volume and range accuracy is achieved. Effect.

CN118967723BActive Publication Date: 2025-02-11ZHEJIANG GEELY HLDG GRP CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411425188.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-12
Publication Date
2025-02-11
Estimated Expiration
2044-10-12

AI Technical Summary

Technical Problem

In the prior art, the amount of data output from the image segmentation model is large, which leads to low efficiency when manually labeling on terminals with different performances, and it is difficult to ensure the accurate range of the mask area.

Method used

By obtaining the mask area in the image to be segmented, the edge detection algorithm is used to determine the set of boundary points of the polygon boundary, and the boundary line of the common edge is detected based on semantics, point set compression is performed to reduce the number of boundary points, while maintaining within the boundary before and after compression. The area remains unchanged.

Benefits of technology

It realizes the conversion of the mask area from a face to a line, ensuring the accurate range of the mask area, and at the same time greatly reduces the amount of data, improves the labeling efficiency, and prevents the loss of common edge characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967723B_ABST
    Figure CN118967723B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide a compression device for a boundary point set of a mask region. The method includes: obtaining at least two mask regions with different semantics identified from the image to be segmented; using an edge detection algorithm to determine the boundary point set constituting the polygonal boundary of each mask region; based on the semantics of the mask region, detecting whether there are common edge boundary lines in the boundary point set; performing point set compression on the boundary point set to reduce the number of boundary points in the boundary point set to the number of compression ratios of the point set compression; wherein, when performing point set compression on two target boundary point sets with common edge boundary lines, only one point set compression is performed on the two groups of identical common edge boundary points in the two target boundary point sets corresponding to the common edge boundary lines.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and in particular to a compression device for a boundary point set of a mask area. Background Art

[0002] In the related art, the mask area output by the image segmentation model usually needs to be transmitted to the downstream annotation platform, so that the downstream annotation platform manually annotates the mask area.

[0003] For downstream annotation platforms, they usually connect to many terminals with different performances, and manual annotation is often completed on these terminals with different performances. Since the amount of data in the mask area is large, the annotation platform requires the upstream image segmentation model to be able to convert the mask area into a data type that can ensure the accurate range of the mask area and has a small amount of data. Summary of the invention

[0004] In view of this, one or more embodiments of this specification provide a compression device, electronic device, and storage medium for a set of boundary points of a mask region, which are used to solve the problems existing in the related art.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of an embodiment of this specification, there is provided a method for compressing a set of boundary points of a mask area, the method comprising:

[0007] Obtain at least two mask regions with different semantics identified from the image to be segmented;

[0008] Using an edge detection algorithm, determine the set of boundary points that constitute the polygonal boundary of each mask region;

[0009] Based on the semantics of the mask area, detecting whether there is a common boundary line in the boundary point set;

[0010] Point set compression is performed on the boundary point set to reduce the number of boundary points in the boundary point set to the number of compression ratios of the point set compression; wherein, when point set compression is performed on two target boundary point sets having common edge boundary lines, point set compression is performed only once for two groups of identical common edge boundary points in the two target boundary point sets corresponding to the common edge boundary lines.

[0011] Optionally, the detecting whether there is a common boundary line in the boundary point set based on the semantics of the mask area includes:

[0012] Traverse the boundary point sets of any two adjacent mask regions and calculate whether there are common boundary points with the same coordinates but different semantics between the two boundary point sets;

[0013] The first traversed common edge boundary point is determined as the starting point of the common edge boundary line, and the last traversed common edge boundary point is determined as the end point of the common edge boundary line;

[0014] A line segment formed by the starting point and the end point and the common edge boundary points between the starting point and the end point is determined as a common edge boundary line.

[0015] Optionally, performing point set compression on the boundary point set to reduce the number of boundary points in the boundary point set to the number of the compression ratio of the point set compression; wherein, when performing point set compression on two target boundary point sets having boundary lines sharing a common edge, performing point set compression only once on two groups of identical boundary points sharing a common edge in the two target boundary point sets corresponding to the boundary lines sharing a common edge, comprises:

[0016] Segmenting target boundary points constituting the boundary line having a common edge from two target boundary point sets of the boundary line, and merging the segmented target boundary points into a boundary point subset associated with the two target boundary point sets;

[0017] Performing point set compression on all boundary point sets and the segmented boundary point subsets to reduce the number of boundary points in the all boundary point sets and the segmented boundary point subsets to the number of the compression ratio of the point set compression; wherein the all boundary point sets include boundary point sets of polygonal boundaries without common edges, and target boundary point sets after segmenting the boundary point subsets;

[0018] According to the association relationship between the boundary point subset and the target boundary point set, the boundary points in the compressed boundary point subset are added to the target boundary point set.

[0019] Optionally, the compression ratio is calculated by a binary algorithm, and a calculation condition of the binary algorithm is to keep the difference in area within the boundary formed by the boundary points before and after compression smaller than a preset threshold.

[0020] Optionally, the performing point set compression on the boundary point set includes:

[0021] The Douglas-Peucker algorithm is used to perform point set compression on the boundary point set.

[0022] Optionally, after obtaining at least two mask regions with different semantics identified from the image to be segmented, the method further includes:

[0023] The area of ​​the mask region is calculated, and the mask region with an area smaller than a threshold is merged into an adjacent mask region with the largest area.

[0024] Optionally, also include:

[0025] After converting the compressed boundary point set into a format that conforms to the annotation platform, the set is sent to the annotation platform, so that the annotation platform can label the mask area using the polygonal boundary formed by the compressed boundary point set.

[0026] According to a second aspect of an embodiment of this specification, a compression device for a set of boundary points of a mask area is provided, the device comprising:

[0027] An acquisition unit, which acquires at least two mask regions with different semantics identified from the image to be segmented;

[0028] A determination unit, using an edge detection algorithm, determines a set of boundary points constituting a polygonal boundary of each mask region;

[0029] A detection unit, based on the semantics of the mask area, detects whether there is a common boundary line in the boundary point set;

[0030] A compression unit performs point set compression on the boundary point set to reduce the number of boundary points in the boundary point set to the number of compression ratios of the point set compression; wherein, when performing point set compression on two target boundary point sets with common edge boundary lines, point set compression is performed only once on two groups of identical common edge boundary points in the two target boundary point sets corresponding to the common edge boundary lines.

[0031] Optionally, the detection unit further comprises:

[0032] Traverse the sub-units, traverse the boundary point sets of any two adjacent mask regions, and calculate whether there are common boundary points with the same coordinates but different semantics between the two boundary point sets;

[0033] A first determining subunit determines the first traversed common edge boundary point as the starting point of the common edge boundary line, and determines the last traversed common edge boundary point as the end point of the common edge boundary line;

[0034] The second determining subunit determines a line segment formed by the starting point and the end point and the common edge boundary points between the starting point and the end point as a common edge boundary line.

[0035] Optionally, the compression unit further comprises:

[0036] A segmentation subunit, which segments target boundary points constituting the boundary line having a common edge from two target boundary point sets having a boundary line having a common edge, and merges the segmented target boundary points into a boundary point subset associated with the two target boundary point sets;

[0037] A compression subunit performs point set compression on all boundary point sets and the segmented boundary point subsets to reduce the number of boundary points in the all boundary point sets and the segmented boundary point subsets to the number of compression ratios of the point set compression; wherein the all boundary point sets include boundary point sets of polygonal boundaries without common edges, and target boundary point sets after segmenting the boundary point subsets;

[0038] The sub-unit is added, and the boundary points in the compressed boundary point subset are added to the target boundary point set according to the association relationship between the boundary point subset and the target boundary point set.

[0039] Optionally, the compression ratio is calculated by a binary algorithm, and a calculation condition of the binary algorithm is to keep the difference in area within the boundary formed by the boundary points before and after compression smaller than a preset threshold.

[0040] Optionally, the compression unit is further used to use the Douglas-Peucker algorithm to perform point set compression on the boundary point set.

[0041] Optionally, after the acquisition unit, the method further includes:

[0042] The merging unit calculates the area of ​​the mask region and merges the mask region with an area smaller than a threshold into an adjacent mask region with the largest area.

[0043] Optionally, the device further comprises:

[0044] The conversion unit converts the compressed boundary point set into a format that conforms to the annotation platform and sends it to the annotation platform, so that the annotation platform can use the polygonal boundary formed by the compressed boundary point set to label the mask area.

[0045] According to a third aspect of the embodiments of this specification, there is provided an electronic device, including a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;

[0046] The memory stores machine-readable instructions, and the processor executes the above method by calling the machine-readable instructions.

[0047] According to a fourth aspect of the embodiments of this specification, a machine-readable storage medium is provided, wherein the machine-readable storage medium stores machine-readable instructions, and the machine-readable instructions implement the above method when called and executed by a processor.

[0048] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:

[0049] On the one hand, the mask area is converted from a surface to a line, which is a polygonal boundary equivalent to the outline of the mask area. Since the area within the polygonal boundary is the mask area, the accuracy of the range of the mask area can be ensured based on the polygonal boundary, and since the polygonal boundary is only a closed solid line, its data volume is greatly reduced relative to the mask area.

[0050] On the other hand, by performing point set compression on the boundary point set of the polygon boundary, the data volume of the boundary point set is further reduced while ensuring that the area within the polygon boundary constituted by the boundary point set before and after compression remains unchanged.

[0051] On the other hand, for two target boundary point sets with common boundary lines, the boundary points of the common boundary lines are compressed once to prevent the loss of the common boundary characteristic. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1 A schematic diagram of the architecture of a labeling platform provided as an exemplary embodiment of this specification;

[0053] Figure 2 A schematic diagram of image segmentation provided as an exemplary embodiment of this specification;

[0054] Figure 3 A flowchart for compressing a set of boundary points of a mask area provided as an exemplary embodiment of this specification;

[0055] Figure 4 A schematic diagram of a common edge boundary line provided in accordance with an embodiment of the present disclosure;

[0056] Figure 5 A schematic diagram of a polygon boundary before and after compression provided by an embodiment of the present invention;

[0057] Figure 6 A schematic diagram of losing the common edge characteristic provided by an embodiment of the present invention;

[0058] Figure 7 A schematic diagram of the structure of an electronic device in which a compression device for a set of boundary points of a mask area is provided in an exemplary embodiment of this specification;

[0059] Figure 8A block diagram of a device for compressing a set of boundary points of a mask area is provided as an exemplary embodiment of the present specification. DETAILED DESCRIPTION

[0060] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0061] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0062] In the real world, we often encounter categories that we have never encountered in the model learning stage. For example, during the model training process, we will learn about several configured categories to learn the relationship between features in the image and each category. In this way, the image segmentation model can only recognize a limited number of categories for the input image, and cannot recognize categories that have never appeared before.

[0063] In this regard, this manual provides Figure 1 The schematic diagram of the architecture of an image segmentation network shown in FIG. The image segmentation network may refer to image segmentation with open set semantics.

[0064] The open set semantics is designed to handle unknown or unseen categories and is applicable to open scenes in the real world. Image segmentation of open set semantics usually requires the model to have better generalization capabilities so that it can recognize and label unknown categories. When the initial image is input, the semantic label (which can be the category used in model training or the category not used in model training) is also input. The text encoding features of the semantic label are projected into the image space area, and the spatial distance between the text encoding features and the image encoding features is calculated to obtain the pre-annotated result that conforms to the semantic label, thereby completing the segmentation of the image.

[0065] Taking autonomous driving based on vision as an example, it is necessary to identify and segment the real-time images collected by the vehicle, such as Figure 2 Schematic diagram of image segmentation in , with the help of the input semantic label (i.e. Figure 2Segmentation targets: cars, place names and buildings) can segment driving images into building areas, vehicle areas and ground areas that the semantic labels expect to be segmented.

[0066] In the training above Figure 1 When using the image segmentation model shown in the figure, it is usually necessary to use a labeling platform, which refers to a platform for the category labels corresponding to the mask areas identified by the image segmentation model downstream.

[0067] The high-quality category labels annotated by the annotation platform can help the image segmentation model better learn the intrinsic relationship between the image features in the mask area and the category labels, so that the subsequent image segmentation model can output more accurate category labels when facing the same or similar image features.

[0068] However, downstream annotation platforms usually connect to many terminals with different performances, and manual annotation is often completed on these terminals with different performances. Since the amount of data in the mask area is large, the annotation platform requires the upstream image segmentation model to convert the mask area into a data type that can ensure the accurate range of the mask area and has a small amount of data.

[0069] In view of this, this specification proposes a compression scheme for the boundary point set of the mask area, which can correspond to Figure 1 The common edge processing submodule in the post-processing module shown in FIG.

[0070] Please refer to the following Figure 3 The flowchart shown is a method for compressing a set of boundary points in a mask area, the method may include the following steps:

[0071] Step 210: Obtain at least two mask regions with different semantics identified from the image to be segmented.

[0072] A mask region refers to a mark or label used to indicate a specific region in the image to be segmented. The mask region is usually a binary array or matrix of the same size as the image pixel, and each element in the binary array or matrix is ​​used to indicate whether the corresponding pixel in the image belongs to a specific region or object. For example, in medical images, the mask region may be used to mark the location of a tumor; in autonomous driving, the mask can mark the location of pedestrians or vehicles.

[0073] In an exemplary embodiment, after obtaining at least two mask regions with different semantics identified from the image to be segmented, the method further includes:

[0074] The area of ​​the mask region is calculated, and the mask region with an area smaller than a threshold is merged into an adjacent mask region with the largest area.

[0075] In practical applications, since the mask areas output by the image segmentation model vary in size, in order to reduce the amount of subsequent calculations, the mask areas with an area smaller than a certain threshold can be merged into the adjacent mask area with the largest area.

[0076] The threshold value may be an empirical value, for example, threshold value = image resolution * error ratio required by the business. The image resolution may refer to the image resolution of the image to be segmented, and the error ratio may be, for example, 1% or other values. By adjusting the error ratio, the size of the mask area to be merged may be controlled.

[0077] Step 220: using an edge detection algorithm, determine a set of boundary points constituting the polygonal boundary of each mask region.

[0078] The edge detection algorithm may include but is not limited to a Canny edge detector, a Sobel operator, a Laplacian operator, and the like.

[0079] The polygonal boundary corresponding to the mask area can be calculated by an edge detection algorithm, wherein the polygonal boundary can be understood as the outer contour line of the mask area.

[0080] The polygonal boundary appears as a closed solid line in the image to be segmented, and the solid line is essentially composed of many dense points, which are referred to as boundary points in this specification. After the polygonal boundary is calculated, the boundary point set constituting the polygonal boundary can be determined.

[0081] Step 230: Based on the semantics of the mask area, detect whether there are co-edge boundary lines in the boundary point set.

[0082] For two adjacent mask regions, there may be common boundary lines. Figure 4 As shown, the boundary line AB between the mask area 1 and the mask area 2 is the common edge boundary line.

[0083] The boundary points that form the common edge boundary line will exist in the boundary point sets of the two mask regions at the same time. Figure 4 For example, several boundary points constituting the boundary line AB are simultaneously recorded in the boundary point set of the mask area 1 and the boundary point set of the mask area 2.

[0084] In an exemplary embodiment, the above step 230 may include:

[0085] Traverse the boundary point sets of any two adjacent mask regions and calculate whether there are common boundary points with the same coordinates but different semantics between the two boundary point sets;

[0086] The first traversed common edge boundary point is determined as the starting point of the common edge boundary line, and the last traversed common edge boundary point is determined as the end point of the common edge boundary line;

[0087] A line segment formed by the starting point and the end point and the common edge boundary points between the starting point and the end point is determined as a common edge boundary line.

[0088] Please continue to refer to Figure 4 As shown, assuming that the semantics of mask region 1 is X, the semantics of all boundary points in the boundary point set of mask region 1 are X. Similarly, assuming that the semantics of mask region 2 is Y, the semantics of all boundary points in the boundary point set of mask region 2 are Y.

[0089] Traverse the boundary point sets of mask area 1 and mask area 2. Assuming that the traversal direction is as shown by the arrow, the first common edge boundary point traversed with the same coordinates is A. Since the semantics of the common edge boundary point A in the boundary point sets of mask area 1 and mask area 2 are X and Y respectively, it can be determined that the common edge boundary point A is the starting point of the common edge boundary line; then all boundary points between the boundary lines AB are traversed, which are common edge boundary points with the same coordinates but different semantics; finally, the common edge boundary point traversed with the same coordinates but different semantics is B; so far, it can be determined that the boundary line AB is the common edge boundary line between the mask area 1 and the mask area 2.

[0090] It should be noted that the positive and negative directions of the boundary line AB are regarded as the same line segment. Figure 4 The line segment AB when traversed in the direction of the arrow shown and the line segment BA traversed in the opposite direction are regarded as the same common edge boundary line.

[0091] Step 240, performing point set compression on the boundary point set, reducing the number of boundary points in the boundary point set to the number of compression ratios of the point set compression; wherein, when performing point set compression on two target boundary point sets having common edge boundary lines, point set compression is performed only once on two groups of identical common edge boundary points in the two target boundary point sets corresponding to the common edge boundary lines.

[0092] In this specification, the point set compression of the boundary point set may use, but is not limited to, the Douglas-Peucker algorithm and the like.

[0093] Taking the Douglas-Peucker algorithm as an example, it can delete redundant boundary points in the boundary point set and retain key boundary points, thereby reducing the amount of data in the boundary point set.

[0094] In an exemplary embodiment, the compression ratio is calculated by a binary algorithm, and the calculation condition of the binary algorithm is to keep the difference in area within the boundary formed by the boundary points before and after compression smaller than a preset threshold.

[0095] In practical applications, although point set compression can reduce the amount of data in the boundary point set, it may also significantly change the shape of the polygon boundary, thereby affecting the accuracy of the mask area. Therefore, for point set compression, it is necessary to achieve the maximum compression ratio as much as possible while keeping the shape of the polygon boundary basically unchanged.

[0096] To this end, this embodiment proposes a method of calculating the compression ratio by a binary algorithm. Since the range of the compression ratio is (0, 1), the point set compression can be initially performed on the binary result of 0-1, that is, the compression ratio of 0.5, and it is determined whether the difference in the area within the boundary formed by the boundary points before and after compression is less than a preset threshold; if the area difference is less than the preset threshold, it means that the optimal compression ratio is between 0.5-1, and the binary result of 0.5-1, that is, the compression ratio of 0.75, can be further re-compressed; on the contrary, if the area difference is greater than the preset threshold, it means that the optimal compression ratio is between 0-0.5, and the point set compression can be further re-performed on the binary result of 0-0.5, that is, the compression ratio of 0.25. In this way, the optimal compression ratio can be calculated through several binary calculations.

[0097] By calculating the most recent compression ratio, such as Figure 5 As shown, the amount of data of the boundary point set can be further reduced while ensuring that the area within the polygon boundary formed by the boundary point set before and after compression remains unchanged.

[0098] As mentioned above, the boundary points of the common boundary lines are recorded in the boundary point sets corresponding to the two target mask regions at the same time; then when the boundary point sets corresponding to the two target mask regions are compressed, the consistency of the compression results of the common boundary points cannot be guaranteed. Once the compression results of the common boundary points are inconsistent, such as Figure 6 As shown in the abnormal results in , the boundary lines that originally shared edges will no longer share edges, thus losing the shared edge property.

[0099] This specification prevents the loss of common edge features by performing point set compression only once on two groups of identical common edge boundary points in two target boundary point sets corresponding to the common edge boundary lines.

[0100] In an exemplary embodiment, the above step 240 may further include:

[0101] Segmenting target boundary points constituting the boundary line having a common edge from two target boundary point sets of the boundary line, and merging the segmented target boundary points into a boundary point subset associated with the two target boundary point sets;

[0102] Performing point set compression on all boundary point sets and the segmented boundary point subsets to reduce the number of boundary points in the all boundary point sets and the segmented boundary point subsets to the number of the compression ratio of the point set compression; wherein the all boundary point sets include boundary point sets of polygonal boundaries without common edges, and target boundary point sets after segmenting the boundary point subsets;

[0103] According to the association relationship between the boundary point subset and the target boundary point set, the boundary points in the compressed boundary point subset are added to the target boundary point set.

[0104] By segmenting the target boundary points constituting the common edge boundary line from the two target boundary point sets, the two target boundary point sets are converted into boundary point sets of polygonal boundaries without common edges, so that point set compression can be performed directly;

[0105] The segmented target boundary points are merged into the boundary point subset, and the merging may refer to merging the boundary points with the same coordinates into one boundary point. Since the segmented target boundary point set needs to be restored later, an association relationship between the boundary point subset and the two target boundary point sets can be constructed here.

[0106] Since there is only one set of target boundary points constituting the common edge boundary lines in the boundary point subset, the common edge boundary lines are compressed only once when the boundary subset is click-compressed.

[0107] Finally, the boundary points in the compressed boundary point subset are added to the two compressed target boundary point sets, so that the two target boundary point sets still maintain a common edge boundary line formed by the boundary points in the compressed boundary point subset.

[0108] Through the above embodiment, for two target boundary point sets with common boundary lines, the boundary points of the common boundary lines are compressed once, thereby preventing the common boundary characteristic from being lost.

[0109] In an exemplary embodiment, the compressed boundary point set is converted into a format that conforms to the annotation platform and then sent to the aforementioned annotation platform, so that the annotation platform can label the mask area using the polygonal boundary formed by the compressed boundary point set.

[0110] Through the above embodiment, the mask area is converted into a boundary point set with a smaller data volume while maintaining the common edge features and the polygonal boundary shape unchanged. On this basis, the boundary point set is further converted into the format specified by the downstream annotation platform and sent to the annotation platform. This can achieve less annotation modification and improve the annotation efficiency of the annotators in labeling.

[0111] In an exemplary embodiment of the present specification, a device capable of implementing the above method is also provided.

[0112] Figure 7 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 7 At the hardware level, the device includes a processor 402, an internal bus 404, a network interface 406, a memory 408, and a non-volatile memory 410, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 402 reading the corresponding computer program from the non-volatile memory 410 into the memory 408 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0113] Please refer to Figure 8 In a software implementation, a compression device for a set of boundary points of a mask region is provided, the device comprising:

[0114] An acquisition unit 510 acquires at least two mask regions with different semantics identified from the image to be segmented;

[0115] A determination unit 520 determines a set of boundary points constituting a polygonal boundary of each mask region using an edge detection algorithm;

[0116] A detection unit 530 detects whether there is a common boundary line in the boundary point set based on the semantics of the mask area;

[0117] The compression unit 540 performs point set compression on the boundary point set to reduce the number of boundary points in the boundary point set to the number of compression ratios of the point set compression; wherein, when performing point set compression on two target boundary point sets having common edge boundary lines, point set compression is performed only once on two groups of identical common edge boundary points in the two target boundary point sets corresponding to the common edge boundary lines.

[0118] In an exemplary embodiment, the detection unit 530 further includes:

[0119] Traverse the sub-units, traverse the boundary point sets of any two adjacent mask regions, and calculate whether there are common boundary points with the same coordinates but different semantics between the two boundary point sets;

[0120] A first determining subunit determines the first traversed common edge boundary point as the starting point of the common edge boundary line, and determines the last traversed common edge boundary point as the end point of the common edge boundary line;

[0121] The second determining subunit determines a line segment formed by the starting point and the end point and the common edge boundary points between the starting point and the end point as a common edge boundary line.

[0122] In an exemplary embodiment, the compression unit 540 further comprises:

[0123] A segmentation subunit, which segments target boundary points constituting the boundary line having a common edge from two target boundary point sets having a boundary line having a common edge, and merges the segmented target boundary points into a boundary point subset associated with the two target boundary point sets;

[0124] A compression subunit performs point set compression on all boundary point sets and the segmented boundary point subsets to reduce the number of boundary points in the all boundary point sets and the segmented boundary point subsets to the number of compression ratios of the point set compression; wherein the all boundary point sets include boundary point sets of polygonal boundaries without common edges, and target boundary point sets after segmenting the boundary point subsets;

[0125] The sub-unit is added, and the boundary points in the compressed boundary point subset are added to the target boundary point set according to the association relationship between the boundary point subset and the target boundary point set.

[0126] In an exemplary embodiment, the compression ratio is calculated by a binary algorithm, and the calculation condition of the binary algorithm is to keep the difference in area within the boundary formed by the boundary points before and after compression smaller than a preset threshold.

[0127] In an exemplary embodiment, the compression unit may use the Douglas-Peucker algorithm to perform point set compression on the boundary point set.

[0128] In an exemplary embodiment, after the acquisition unit 510, the following is further included:

[0129] The merging unit calculates the area of ​​the mask region and merges the mask region with an area smaller than a threshold into an adjacent mask region with the largest area.

[0130] In an exemplary embodiment, the apparatus further comprises:

[0131] The conversion unit converts the compressed boundary point set into a format that conforms to the annotation platform and sends it to the annotation platform, so that the annotation platform can use the polygonal boundary formed by the compressed boundary point set to label the mask area.

[0132] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the compression of the boundary point set of the mask area. For relevant parts, please refer to the partial description of the method implementation method, which will not be repeated here.

[0133] The device implementation described above is merely illustrative, 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 modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the units or modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Ordinary technicians in this field can understand and implement it without paying creative work.

[0134] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.

[0135] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0136] Memory may include non-permanent storage in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.

[0137] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules 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, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media 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. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0138] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0139] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0140] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0141] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0142] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A compression method for a set of boundary points in a mask region, characterized in that: The method comprises: Obtain at least two mask regions with different semantics identified from the image to be segmented; Using an edge detection algorithm, determine the set of boundary points that constitute the polygonal boundary of each mask region; Based on the semantics of the mask area, detecting whether there is a common boundary line in the boundary point set; Segmenting target boundary points constituting the boundary line having a common edge from two target boundary point sets of the boundary line, and merging the segmented target boundary points into a boundary point subset associated with the two target boundary point sets; Performing point set compression on all boundary point sets and the segmented boundary point subsets to reduce the number of boundary points in the all boundary point sets and the segmented boundary point subsets to the number of the compression ratio of the point set compression; wherein the all boundary point sets include boundary point sets of polygonal boundaries without common edges, and target boundary point sets after segmenting the boundary point subsets; According to the association relationship between the boundary point subset and the target boundary point set, the boundary points in the compressed boundary point subset are added to the target boundary point set.

2. The method according to claim 1, characterized in that The detecting whether there is a common boundary line in the boundary point set based on the semantics of the mask area includes: Traverse the boundary point sets of any two adjacent mask regions and calculate whether there are common boundary points with the same coordinates but different semantics between the two boundary point sets; The first traversed common edge boundary point is determined as the starting point of the common edge boundary line, and the last traversed common edge boundary point is determined as the end point of the common edge boundary line; A line segment formed by the starting point and the end point and the common edge boundary points between the starting point and the end point is determined as a common edge boundary line.

3. The method according to claim 1, characterized in that The compression ratio is calculated by a binary algorithm, and a calculation condition of the binary algorithm is to keep the difference in area within the boundary formed by the boundary points before and after compression smaller than a preset threshold.

4. The method according to claim 1, characterized in that: The step of compressing the boundary point set includes: The Douglas-Peucker algorithm is used to perform point set compression on the boundary point set.

5. The method according to claim 1, characterized in that After obtaining at least two mask regions with different semantics identified from the image to be segmented, the method further includes: The area of ​​the mask region is calculated, and the mask region with an area smaller than a threshold is merged into an adjacent mask region with the largest area.

6. The method according to claim 1, characterized in that Also includes: After converting the compressed boundary point set into a format that conforms to the annotation platform, the format is sent to the annotation platform; The annotation platform uses the polygonal boundary formed by the compressed boundary point set to label the mask area.

7. A compression device for a set of boundary points of a mask area, characterized in that: The device comprises: An acquisition unit, which acquires at least two mask regions with different semantics identified from the image to be segmented; A determination unit, using an edge detection algorithm, determines a set of boundary points constituting a polygonal boundary of each mask region; A detection unit, based on the semantics of the mask area, detects whether there is a common boundary line in the boundary point set; A segmentation subunit, which segments target boundary points constituting the boundary line having a common edge from two target boundary point sets having a boundary line having a common edge, and merges the segmented target boundary points into a boundary point subset associated with the two target boundary point sets; A compression subunit performs point set compression on all boundary point sets and the segmented boundary point subsets to reduce the number of boundary points in the all boundary point sets and the segmented boundary point subsets to the number of compression ratios of the point set compression; wherein the all boundary point sets include boundary point sets of polygonal boundaries without common edges, and target boundary point sets after segmenting the boundary point subsets; The sub-unit is added, and the boundary points in the compressed boundary point subset are added to the target boundary point set according to the association relationship between the boundary point subset and the target boundary point set.

8. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 6 by running the executable instructions.

9. A machine-readable storage medium, characterized in that: Machine-readable instructions are stored thereon, and when the instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Polygon compression method based on topological relation of line segments

    CN102522043A

  • Extensible farmland boundary normalizing and simplifying method, system, equipment and terminal

    CN115719355A