Label Avoidance Method, Device, Electronic Device and Storage Medium

By automatically identifying and cropping the overlapping areas of marks in the image, the problem of image clarity reduction caused by marking glands is solved, efficient mark avoidance and image display effect is improved.

CN114219812BActive Publication Date: 2025-05-27BEIJING GENGTU TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111513009.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-11
Publication Date
2025-05-27
Estimated Expiration
2041-12-11

AI Technical Summary

Technical Problem

In an image, when the marking position is close, it is easy to cause a gland, resulting in a decrease in image clarity, and the prior art is less efficient and manual editing is required to avoid overlap.

Method used

By automatically determining the labels to be marked in the image and their label position information, identifying overlapping label groups and overlapping areas where the label positions are marked, and the overlapping areas are cut to avoid contact with the label.

Benefits of technology

It realizes automatic avoidance of labels in the image, avoiding contact between different labels, improving the clarity of image display, and improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114219812B_ABST
    Figure CN114219812B_ABST
Patent Text Reader

Abstract

The present application relates to a label avoidance method, apparatus, electronic device, and storage medium. Among them, the label avoidance method includes: determining a plurality of labels to be marked on an image and the corresponding annotation position information for each label; according to the annotation position information corresponding to each label, determining, from the plurality of labels, several groups of labels with overlapping annotation positions and the overlapping region corresponding to each group of labels; for each group of labels, determining the label to be cropped in this group; for each group of labels, determining the cropping region of the label to be cropped in this group according to the overlapping region corresponding to this group of labels; cropping off the cropping region of each label to be cropped. In this way, among the original overlapping labels, there is no longer an overlap between the cropped labels and the uncropped labels, the avoidance between labels is completed, contact between different labels is avoided, and the clarity of the final display of the image can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of data processing, and in particular, to a method, apparatus, electronic device, and storage medium for label avoidance. Background Art

[0002] In terms of information display, images have the characteristics of being clearer, more intuitive, and easier to understand compared to text. Therefore, images are widely used in the promotion and introduction activities of certain topics. With the continuous development of automated information technology, many image generation tools have emerged, helping users quickly and efficiently edit and generate images.

[0003] In order to highlight certain key information, it is often necessary to add corresponding labels to the images. However, when the label positions are close, they are likely to overlap with each other, causing different labels to come into contact, resulting in a decrease in image clarity.

[0004] Many users will manually edit these overlapping labels to make them as clear as possible. However, this processing method is inefficient. Summary of the Invention

[0005] This application provides a method, apparatus, electronic device, and storage medium for label avoidance. During the label annotation process, label avoidance between labels is automatically achieved, avoiding contact between different labels and improving the clarity of image display.

[0006] In a first aspect, this application provides a method for label avoidance, including:

[0007] Determine a plurality of labels to be annotated on an image and the corresponding annotation position information for each label;

[0008] According to the annotation position information corresponding to each label, determine several groups of labels with overlapping annotation positions and the overlapping region corresponding to each group of labels from the plurality of labels;

[0009] For each group of labels, determine the label to be cropped in the group;

[0010] For each group of labels, determine the region to be cropped of the label to be cropped in the group according to the overlapping region corresponding to the group of labels;

[0011] Crop off the region to be cropped of each label to be cropped.

[0012] Optionally, the step of determining several groups of labels with overlapping annotation positions and the overlapping region corresponding to each group of labels from the plurality of labels according to the annotation position information corresponding to each label includes:

[0013] Set a corresponding feature identifier for each label;

[0014] For each label number, add the feature identifier corresponding to the label number to each pixel indicated by the annotation position information corresponding to the label number;

[0015] Traverse all pixels, and determine the pixels containing at least two feature identifiers as target pixels;

[0016] Determine the label numbers corresponding to at least two feature identifiers contained in each target pixel as a group of label numbers;

[0017] Determine the corresponding regions of several adjacent target pixels containing the same group of label numbers as the overlapping region corresponding to this group of label numbers.

[0018] Optionally, for each group of label numbers, determining the label numbers to be cropped in this group includes:

[0019] For each group of label numbers, determine the label numbers to be cropped in this group according to the display priority of each label number in this group.

[0020] Optionally, for each group of label numbers, determining the label numbers to be cropped in this group includes:

[0021] For each group of label numbers, determine the label numbers to be cropped in this group according to the area ratio of the overlapping region corresponding to this group of label numbers to each label number.

[0022] Optionally, for each group of label numbers, determining the cropping region of the label numbers to be cropped in this group according to the overlapping region corresponding to this group of label numbers includes:

[0023] For each group of label numbers, based on the overlapping region corresponding to this group of label numbers, expand outward by a preset width to obtain the cropping region of the label numbers to be cropped in this group.

[0024] Optionally, determining several label numbers to be marked in the image and the annotation position information corresponding to each label number includes:

[0025] Obtain the graphic parameter information and positioning point information of several label numbers to be marked in the image;

[0026] For each label number, determine the annotation position information corresponding to the label number according to the image parameter information and positioning point information of the label number.

[0027] Optionally, the method further includes:

[0028] Mark the cropped several label numbers in the image according to the annotation position information corresponding to the several label numbers.

[0029] In a second aspect, the present application provides a label avoidance device, including:

[0030] A label determination module, configured to determine a plurality of labels to be marked on an image and the annotation position information corresponding to each label;

[0031] A label grouping module, configured to determine, from the plurality of labels, several groups of labels with overlapping annotation positions and the overlapping regions corresponding to each group of labels according to the annotation position information corresponding to each label;

[0032] A label to be cropped determination module, configured to determine the labels to be cropped in each group for each group of labels;

[0033] A cropping region determination module, configured to determine the cropping regions of the labels to be cropped in each group for each group of labels according to the overlapping regions corresponding to each group of labels;

[0034] A cropping module, configured to crop off the cropping regions of each label to be cropped.

[0035] Optionally, the label grouping module is specifically configured to:

[0036] Set corresponding feature identifiers for each label;

[0037] For each label, add the feature identifier corresponding to the label to each pixel indicated by the annotation position information corresponding to the label;

[0038] Traverse all pixels, and determine the pixels containing at least two feature identifiers as target pixels;

[0039] Determine the labels corresponding to at least two feature identifiers contained in each target pixel as a group of labels;

[0040] Determine the regions corresponding to adjacent several target pixels containing the same group of labels as the overlapping region corresponding to the group of labels.

[0041] Optionally, the label to be cropped determination module is specifically configured to:

[0042] For each group of labels, determine the labels to be cropped in the group according to the display priority of each label in the group.

[0043] Optionally, the label to be cropped determination module is specifically configured to:

[0044] For each group of labels, determine the labels to be cropped in the group according to the area ratio of the overlapping region corresponding to the group of labels to each label.

[0045] Optionally, the cropping region determination module is specifically configured to:

[0046] For each group of labels, expand a preset width outward based on the overlapping region corresponding to the group of labels to obtain the cropping regions of the labels to be cropped in the group.

[0047] Optionally, the label determination module is specifically configured to:

[0048] Obtain the graphic parameter information and positioning point information of several labels to be marked on the image;

[0049] For each label, determine the annotation position information corresponding to the label according to the image parameter information and positioning point information of the label.

[0050] Optionally, the apparatus further includes:

[0051] An annotation module, configured to annotate the cropped several labels on the image according to the annotation position information corresponding to the several labels.

[0052] In a third aspect, the present application provides an electronic device, including: a memory and a processor, and a computer program capable of being loaded and executed by the processor to implement the method described in any one of the above is stored on the memory.

[0053] In a fourth aspect, the present application provides a computer-readable storage medium, storing a computer program capable of being loaded and executed by a processor to implement the method described in any one of the first aspects.

[0054] The present application provides a label avoidance method, apparatus, electronic device and storage medium. Among them, the label avoidance method includes: determining several labels to be marked on the image and the annotation position information corresponding to each label; according to the annotation position information corresponding to each label, determining several groups of labels with overlapping annotation positions and the overlapping area corresponding to each group of labels from the several labels; for each group of labels, determining the label to be cropped in the group; for each group of labels, determining the area to be cropped of the label to be cropped in the group according to the overlapping area corresponding to the group of labels; cropping off the area to be cropped of each label to be cropped. In the solution of the present application, the overlapping labels are determined before annotating the labels, and the label to be cropped is selected from the overlapping labels, and the area to be cropped of the label to be cropped is determined according to the overlapping area for cropping. In this way, among the original overlapping labels, there is no longer an overlap between the cropped label and the uncropped label, completing the avoidance between labels and avoiding the contact between different labels, which can improve the clarity of the final display of the image. Description of the Drawings

[0055] Figure 1 is a schematic diagram of the display effect of label overlap provided by the present application;

[0056] Figure 2 is a flowchart of a label avoidance method provided by an embodiment of the present application;

[0057] Figure 3 A schematic diagram of a rendering result of a feature identifier provided by an embodiment of the present application;

[0058] Figure 4 A schematic diagram of determining a region to be cropped according to an overlapping region provided by an embodiment of the present application;

[0059] Figure 5 A schematic structural diagram of a label avoidance device provided by an embodiment of the present application;

[0060] Figure 6 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0061] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without making creative efforts shall fall within the protection scope of the present application.

[0062] In addition, the term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this article generally represents an "or" relationship between the associated objects before and after, unless otherwise specified.

[0063] The embodiments of the present application will be further described in detail below with reference to the accompanying drawings of the specification.

[0064] By adding labels to an image (geographical image, product image), an explanatory effect can be achieved. However, in areas where labels are densely distributed, there will inevitably be some overlap and covering situations. As Figure 1 shown, two labels A and B on an image overlap. It is even impossible to distinguish the specific shape of B. It can be seen that when two labels are in contact, their intuitive display effect is not very good and the display is not clear enough.

[0065] The user can choose to manually edit one of the labels to create a gap and optimize the display effect. However, there may be more than one overlap in an image, and there may also be more than one image that needs to be processed. Therefore, the manual editing method is relatively inefficient.

[0066] Based on this, the present application provides a label avoidance method, apparatus, electronic device, and storage medium, aiming to provide a method for automatically processing the problem of label capping. The specific implementation manner of the present application can refer to the following embodiments.

[0067] Figure 2 FIG. 4 is a flowchart of a label avoidance method provided by an embodiment of the present application. The method of this embodiment can be applied to an electronic device with computing functions, such as a server, a computer, a smart phone, a tablet computer, etc. As Figure 2 shown, the method includes:

[0068] S201. Determine a plurality of labels to be marked in the image and the annotation position information corresponding to each label.

[0069] In one scenario, when annotating a certain image, after determining all the labels that need to be annotated for part or all of the image and the annotation position corresponding to each label, the annotation is performed uniformly. That is, before annotating a batch of labels, there are no other labels in the annotation area corresponding to this batch of labels. In this scenario, the plurality of labels to be marked in the image are all the labels that need to be annotated for part or all of the image.

[0070] In other scenarios, when annotating a certain image, after determining a certain type of labels that need to be annotated for part or all of the image and the annotation position corresponding to each label, the annotation is performed uniformly. That is, before annotating a batch of labels, there may already be other types of labels in the annotation area corresponding to this batch of labels. In this scenario, capping may also occur between the newly marked batch of labels and the existing labels. Therefore, the plurality of labels to be marked in the image are the labels that have been marked and a certain type of labels that need to be marked for part or all of the image. It may be necessary to make adaptive adjustments to the labels that have been marked by judging the capping relationship.

[0071] S202. According to the annotation position information corresponding to each label, determine several groups of labels with overlapping annotation positions and the overlapping area corresponding to each group of labels from the plurality of labels.

[0072] According to the principle of image processing, drawing is actually filling different pixel points. The annotation position information corresponding to a label refers to the position information of all the pixel points corresponding to the label in the image.

[0073] If the annotation position information corresponding to a certain label includes certain pixel points, and the annotation position information corresponding to another label also includes these pixel points, it means that the two labels overlap at the positions of these pixel points. That is, by comparing the annotation position information of any two labels, it can be determined whether there is an overlap between the two labels and the corresponding overlapping area.

[0074] In the present application, at least two labels having the same overlapping area are referred to as a group of labels. Taking Figure 3 as an example, label M overlaps with label N and label O respectively. Then two groups of labels can be determined: M and N, with the overlapping area being n; M and O, with the overlapping area being o.

[0075] S203. For each group of labels, determine the label to be cropped in the group.

[0076] In order to prevent the labels in each group from overlapping any more, the complete shape of one of the labels can be retained for display, while the other labels in the group are cropped. Before cropping, the object to be cropped (the label to be cropped) needs to be determined.

[0077] In some embodiments, one label in the group can be randomly selected for complete display, while the other labels in the group are determined as the labels to be cropped.

[0078] S204. For each group of labels, determine the area to be cropped of the label to be cropped in the group according to the overlapping area corresponding to the group of labels.

[0079] In some implementation manners, the overlapping area can be expanded outward by a certain width and used as the area to be cropped.

[0080] S205. Crop off the area to be cropped of each label to be cropped.

[0081] Crop off the area to be cropped of each label to be cropped in each group. After cropping, there is no longer any overlap between the cropped label to be cropped and the uncropped label in the group, and the boundaries do not touch either, so they can be clearly displayed.

[0082] The label avoidance method provided in this embodiment includes: determining a plurality of labels to be marked in the image and the annotation position information corresponding to each label; according to the annotation position information corresponding to each label, determining a plurality of groups of labels with overlapping annotation positions and the overlapping area corresponding to each group of labels from the plurality of labels; for each group of labels, determining the label to be cropped in the group; for each group of labels, determining the area to be cropped of the label to be cropped in the group according to the overlapping area corresponding to the group of labels; and cropping off the area to be cropped of each label to be cropped. The solution of the present application determines the overlapping labels before marking the labels, selects the labels to be cropped from the overlapping labels, and determines the area to be cropped of the labels to be cropped according to the overlapping area for cropping. In this way, among the original overlapping labels, there is no longer any overlap between the cropped labels and the uncropped labels, completing the avoidance between labels, avoiding the contact between different labels, and improving the clarity of the final display of the image.

[0083] In some embodiments, the method of determining, from a plurality of labels, several groups of labels with overlapping annotation positions and the overlapping region corresponding to each group of labels according to the annotation position information corresponding to each label may include: for each label, comparing the annotation position information corresponding to the label with the annotation position information corresponding to each other label; if there is partial identical information between the annotation position information corresponding to the label and the annotation position information corresponding to a certain other label, determining that the two labels are a group of labels, and determining the region corresponding to the partial identical information as the overlapping region corresponding to the group of labels.

[0084] That is, by means of pairwise comparison, all labels and all pixel points in each label are traversed to determine whether there are identical pixel points between any two labels. The labels with identical pixel points are taken as a group, and the region corresponding to the identical pixel points is the overlapping region corresponding to the group of labels.

[0085] In this comparison method, each label has to go through multiple comparisons, and the overall computational amount is very large and time-consuming. Therefore, the inventor proposed another relatively fast and simple method during the implementation of this application, which is described as follows.

[0086] In other embodiments, the method of determining, from a plurality of labels, several groups of labels with overlapping annotation positions and the overlapping region corresponding to each group of labels according to the annotation position information corresponding to each label may include: setting a corresponding feature identifier for each label; for each label, adding the feature identifier corresponding to the label to each pixel indicated by the annotation position information corresponding to the label; traversing all pixels to determine the pixels containing at least two feature identifiers as target pixels; determining the labels corresponding to the at least two feature identifiers contained in each target pixel as a group of labels; and determining the region corresponding to several adjacent target pixels containing the same group of labels as the overlapping region corresponding to the group of labels.

[0087] Specifically, a unique corresponding feature identifier (which may be Tn for example) can be set for each label. A cache with the same size as the image is established, and each label "renders" the corresponding feature identifier Tn into the cache according to the corresponding annotation position information. The feature identifier marked by each pixel point in the cache represents the label corresponding to the pixel point. If the number of feature identifiers in a certain pixel point is greater than 1, it means that at least two labels correspond to this pixel point. That is, at least two labels overlap at this pixel point. Accordingly, by traversing the pixel points, the pixels containing at least two feature identifiers (target pixels) can be determined. If there is an overlap between two labels, there is at least one overlapping region, and each overlapping region corresponds to several adjacent pixel points. On the contrary, during the process of traversing the pixel points, several adjacent target pixels containing the same group of labels are summarized, and the region corresponding to these pixels is the overlapping region corresponding to the group of labels.

[0088] The overlapping area of ​​a group of labels may be one, two, or more than two.

[0089] Figure 3 FIG. 1 is a schematic diagram of a feature identification rendering result provided in an embodiment of the present application. The rendering effect of the feature identification Ta corresponding to label a and the feature identification Tb corresponding to label b in the image is as follows: Figure 3 As shown. It can be seen that each pixel point in the polygonal box marked by the thick solid line corresponds to the two feature identifiers Ta and Tb at the same time. This means that the labels a and b overlap in this polygonal box. The labels a and b form a group of labels, and the overlapping area of ​​the group of labels is the corresponding area of ​​this polygonal box.

[0090] Compared with the one-to-one comparison method between labels provided in the previous embodiment, the method provided in this embodiment is simpler and more convenient, requires less calculation, has a faster processing speed, and has higher processing efficiency.

[0091] In some implementations, the above-mentioned determining the labels to be cropped in each group of labels may include: for each group of labels, determining the labels to be cropped in the group according to the display priority of each label in the group.

[0092] The display priority of the labels can be set in advance according to certain rules, and the labels with higher display priority are fully displayed first, while the labels with lower display priority are clipped and avoided. That is, in a group of labels, the priority order of each label is determined, and the label with the highest priority is fully retained, while the other labels are determined as labels to be clipped and clipped.

[0093] Labels can generally include point labels and line and surface labels. Correspondingly, the display priority determination rule can be that the priority of point labels is higher than that of line and surface labels. That is, when a set of labels contains both a point label and a line and surface label, the point label is completely retained, and the line and surface label is determined as a label to be cut and cut.

[0094] In other implementations, the above-mentioned determining the labels to be cut in each group of labels may include: for each group of labels, determining the labels to be cut in the group according to the area ratio of the overlapping area corresponding to the group of labels and each label.

[0095] When there is an overlap between several labels, the size of the overlapping area is not fixed, and the proportion of the overlapping area in each label is also not fixed. The larger the proportion of the overlapping area in a label, the smaller the remaining area of the label after the corresponding cropping area of the overlapping area is cropped, the less information can be displayed, and the greater the impact on the normal display of this label. Therefore, the label to be cropped can be determined according to the area ratio of the overlapping area corresponding to the group of labels to each label. The area ratios of the overlapping area to each label can be sorted, and one label with the largest area ratio is completely retained, while other labels are determined as the labels to be cropped and cropped.

[0096] In some other implementation manners, the above two determination methods can also be combined and used. For example, first calculate the area ratio of the overlapping area to each label; if each area ratio is less than a preset threshold, it means that the cropping of the area to be cropped will not cause a great impact on the normal display of each label, then the label to be cropped can be determined according to the priority order.

[0097] In some embodiments, for each group of labels, determining the area to be cropped of the label to be cropped in the group according to the overlapping area corresponding to the group of labels may include: for each group of labels, based on the overlapping area corresponding to the group of labels, expanding a preset width outward to obtain the area to be cropped of the label to be cropped in the group.

[0098] In one implementation manner, based on the above method of determining the overlapping area according to the feature identifier, the method for determining the area to be cropped may specifically be to expand the overlapping area by a preset width in the direction where the feature identifier of the label to be cropped is located. The preset width may be several pixels, such as 2 pixels, 3 pixels, 4 pixels, 5 pixels, etc.

[0099] Figure 4 This is a schematic diagram of determining the area to be cropped according to the overlapping area provided in an embodiment of the present application. Still continuing Figure 3 The corresponding example. According to the priority judgment, it is determined that label a is the label to be cropped in this group. After expanding the overlapping area (polygonal frame) of label a and label b by 2 pixels in the direction of the pixel marked with Ta, the area to be cropped of label a is determined, as Figure 4 shown by the dashed box in.

[0100] In some embodiments, the above determination of several labels to be marked in the image and the annotation position information corresponding to each label may include: obtaining the graphic parameter information and positioning point information of several labels to be marked in the image; for each label, determining the annotation position information corresponding to the label according to the image parameter information and positioning point information of the label.

[0101] In some scenarios, a label may include at least one positioning point information. The user determines the specific position of the label in the image by matching the positioning point of a label with a position in the image. At the same time, the shape of a label is certain, and it is represented and stored with graphic parameter information. When the user determines to mark certain labels in the image, he generally only needs to determine the position of the positioning point in the label. Then, the labeling position information of a label in the image (that is, all the pixels corresponding to the entire label) can be determined by combining the positioning point and graphic parameter information.

[0102] In some embodiments, after cropping, the method further includes: marking the cropped labels into the image according to the label position information corresponding to the labels. The cropped labels include the labels to be cropped and the labels that are fully displayed without cropping. Specifically, it is only necessary to fill the corresponding area after cropping to achieve labeling.

[0103] Compared with the method in the prior art in which the user cuts the filled labels, the filling amount is reduced and the marking efficiency is improved.

[0104] In other embodiments, the user can also adjust the marked labels. For example, when the user checks the marked labels, if he feels that the display effect of a group of labels is not good and wants to adjust the fully displayed labels, he can select the labels to be restored to full display. Correspondingly, after detecting the user's selection operation (the operation of restoring full display), the electronic device executing this method can readjust the labels to be cropped in this group (using the previously fully displayed labels as the labels to be cropped and determining the labels to be restored to full display as the fully displayed labels), redetermine the cropping area of ​​the labels to be cropped, and re-mark the labels in this group.

[0105] In this way, the marking status of the label can be quickly adjusted again according to the user's wishes to make it more in line with the user's expectations and improve the user experience.

[0106] Figure 5 A structural diagram of a label avoidance device provided in one embodiment of the present application is shown in FIG. Figure 5 As shown, the label avoiding device 500 of this embodiment includes: a label determining module 501 , a label grouping module 502 , a to-be-cropped label determining module 503 , a to-be-cropped region determining module 504 , and a cropping module 505 .

[0107] The label determination module 501 is used to determine a number of labels to be marked in the image and the label position information corresponding to each label;

[0108] The label grouping module 502 is configured to determine, from a plurality of labels, several groups of labels with overlapping annotation positions and the overlapping regions corresponding to each group of labels according to the annotation position information corresponding to each label;

[0109] The label to be cropped determination module 503 is configured to determine the labels to be cropped in each group for each group of labels;

[0110] The cropping region determination module 504 is configured to determine the cropping regions of the labels to be cropped in each group for each group of labels according to the overlapping regions corresponding to the group of labels;

[0111] The cropping module 505 is configured to crop the cropping regions of each label to be cropped.

[0112] Optionally, the label grouping module 502 is specifically configured to:

[0113] Set a corresponding feature identifier for each label;

[0114] For each label, add the feature identifier corresponding to the label to each pixel indicated by the annotation position information corresponding to the label;

[0115] Traverse all pixels, and determine the pixels containing at least two feature identifiers as target pixels;

[0116] Determine the labels corresponding to at least two feature identifiers contained in each target pixel as a group of labels;

[0117] Determine the regions corresponding to adjacent several target pixels containing the same group of labels as the overlapping regions corresponding to the group of labels.

[0118] Optionally, the label to be cropped determination module 503 is specifically configured to:

[0119] For each group of labels, determine the labels to be cropped in the group according to the display priorities of each label in the group.

[0120] Optionally, the label to be cropped determination module 503 is specifically configured to:

[0121] For each group of labels, determine the labels to be cropped in the group according to the area ratios of the overlapping regions corresponding to the group of labels to each label.

[0122] Optionally, the cropping region determination module 504 is specifically configured to:

[0123] For each group of labels, expand a preset width outward based on the overlapping regions corresponding to the group of labels to obtain the cropping regions of the labels to be cropped in the group.

[0124] Optionally, the label determination module 501 is specifically configured to:

[0125] Obtain the graphic parameter information and positioning point information of several labels to be marked on the image;

[0126] For each label, determine the annotation position information corresponding to the label according to the graphic parameter information and positioning point information of the label.

[0127] Optionally, the apparatus 500 further includes:

[0128] An annotation module 506, configured to annotate the cropped several labels on the image according to the annotation position information corresponding to the several labels.

[0129] The apparatus of this embodiment can be used to execute the method of any of the above embodiments, and its implementation principle and technical effects are similar, which will not be elaborated here.

[0130] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 6 shown, the electronic device 600 of this embodiment may include: a memory 601 and a processor 602.

[0131] A computer program capable of being loaded and executed by the processor 602 is stored on the memory 601 and executes the method in the above embodiment.

[0132] Wherein, the processor 602 and the memory 601 are connected, such as through a bus.

[0133] Optionally, the electronic device 600 may further include a transceiver. It should be noted that in practical applications, the transceiver is not limited to one, and the structure of the electronic device 600 does not constitute a limitation to the embodiments of the present application.

[0134] The processor 602 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in conjunction with the disclosure of the present application. The processor 602 may also be a combination for implementing computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0135] The bus may include a path for transmitting information between the above components. The bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0136] The memory 601 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or it can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to this.

[0137] The memory 601 is used to store the application program code for executing the solution of this application, and is controlled by the processor 602 to execute. The processor 602 is used to execute the application program code stored in the memory 601 to implement the content shown in the foregoing method embodiments.

[0138] Among them, the electronic device includes but is not limited to: mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. It can also be a server, etc. Figure 6 The electronic device shown is only an example and should not bring any limitations to the functions and usage scopes of the embodiments of this application.

[0139] This application also provides a computer-readable storage medium storing a computer program that can be loaded and executed by a processor to perform the method in the above embodiments.

[0140] It should be understood that although the steps in the flowchart of the accompanying drawings are shown sequentially according to the indication of the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise clearly stated in this document, there is no strict order restriction for the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or sub-steps or stages of other steps.

[0141] The above are only some embodiments of the present application. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present application, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present application.

Claims

1. A method for label avoidance, characterized in that, it includes: Determine a plurality of labels to be marked in the image and the annotation position information corresponding to each label; According to the annotation position information corresponding to each label, determine several groups of labels with overlapping annotation positions and the overlapping area corresponding to each group of labels from the plurality of labels; For each group of labels, determine the labels to be cropped in this group; For each group of labels, determine the cropping area of the labels to be cropped in this group according to the overlapping area corresponding to this group of labels; Crop off the cropping area of each label to be cropped; The step of determining several groups of labels with overlapping annotation positions and the overlapping area corresponding to each group of labels from the plurality of labels according to the annotation position information corresponding to each label includes: Set a corresponding feature identifier for each label; For each label, add the feature identifier corresponding to the label to each pixel indicated by the annotation position information corresponding to the label; Traverse all pixels and determine the pixels containing at least two feature identifiers as target pixels; Determine the labels corresponding to at least two feature identifiers contained in each target pixel as a group of labels; Determine the corresponding area of adjacent several target pixels containing the same group of labels as the overlapping area corresponding to this group of labels.

2. The method according to claim 1, characterized in that, The step of determining the labels to be cropped in each group of labels includes: For each group of labels, determine the labels to be cropped in this group according to the display priority of each label in this group.

3. The method according to claim 1, characterized in that, The step of determining the labels to be cropped in each group of labels includes: For each group of labels, determine the labels to be cropped in this group according to the area ratio of the overlapping area corresponding to this group of labels to each label.

4. The method according to claim 1, characterized in that, The step of determining the cropping area of the labels to be cropped in each group of labels according to the overlapping area corresponding to this group of labels includes: For each group of labels, expand a preset width outward based on the overlapping area corresponding to this group of labels to obtain the cropping area of the labels to be cropped in this group.

5. The method according to claim 1, characterized in that, The step of determining a plurality of labels to be marked in the image and the annotation position information corresponding to each label includes: Obtain the graphic parameter information and positioning point information of a plurality of labels to be marked in the image; For each label, determine the annotation position information corresponding to the label according to the image parameter information and positioning point information of the label.

6. The method according to claim 1, characterized in that, It further includes: Mark the cropped plurality of labels in the image according to the annotation position information corresponding to the plurality of labels.

7. A label avoidance device, characterized in that, it includes: A label determination module for determining a plurality of labels to be marked in the image and the annotation position information corresponding to each label; The label grouping module is used to determine several groups of labels with overlapping annotation positions and the overlapping regions corresponding to each group of labels from the several labels according to the annotation position information corresponding to each label; The label to be cropped determination module is used to determine the label to be cropped in each group of labels for each group of labels; The cropping region determination module is used to determine the cropping region of the label to be cropped in each group of labels according to the overlapping region corresponding to each group of labels for each group of labels; The cropping module is used to crop off the cropping region of each label to be cropped; Specifically, the label grouping module is used to set a corresponding feature identifier for each label; for each label, add the feature identifier corresponding to the label to each pixel indicated by the annotation position information corresponding to the label; traverse all pixels, determine the pixels containing at least two feature identifiers as target pixels; determine the labels corresponding to at least two feature identifiers contained in each target pixel as a group of labels; determine the corresponding region of several adjacent target pixels containing the same group of labels as the overlapping region corresponding to this group of labels.

8. An electronic device Characterized in that It includes: A memory and a processor, and a computer program capable of being loaded and executed by the processor to implement the method according to any one of claims 1 to 6 is stored on the memory.

9. A computer-readable storage medium Characterized in that A computer program capable of being loaded and executed by the processor to implement the method according to any one of claims 1 to 6 is stored.

Citation Information

Patent Citations

  • Label box correction method, electronic equipment and storage medium

    CN110796201A