Method and device for marking coordinate points in image

By connecting the line segments formed by the points to be marked and the marked points in the image annotation, and judging whether they intersect, the problem of low image annotation efficiency is solved and a more efficient polygon annotation process is achieved.

CN114299143BActive Publication Date: 2024-10-15ZHEJIANG DAHUA TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111614692.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2024-10-15
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The efficiency of image annotation in the existing technology is low. Errors in drawing polygonal annotation boxes lead to intersecting edges, which require repeated undoing and re-annotation, resulting in a lot of duplication of work.

Method used

Obtain the coordinate point to be marked on the target image and connect it to the last coordinate point among the N marked coordinate points. Determine whether the connecting line segment intersects with the existing line segment. If not, determine that the point to be marked is the next already marked point. Mark points to avoid duplication of work.

Benefits of technology

It improves the efficiency of image annotation, reduces repeated work caused by coordinate point annotation errors, and ensures that the connections do not intersect to improve annotation accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114299143B_ABST
    Figure CN114299143B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method and device for marking coordinate points in an image, wherein the method comprises: obtaining the coordinate point to be marked on the target image; connecting the coordinate point to be marked with the Nth marked coordinate point among the N marked coordinate points to obtain the Nth line segment; when the Nth line segment does not have an intersection with the line segments in the first line segment set, determining the coordinate point to be marked as the N+1th marked coordinate point. Through the present invention, the problem of low efficiency in image marking is solved, thereby achieving the effect of improving the efficiency of image marking.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the computer field, and in particular, to a method and device for marking coordinate points in an image. Background Art

[0002] In the field of image recognition, the training of artificial intelligence models relies on a large number of labeled images. In order to obtain high-precision labeled images, the images required for training need to be graphically labeled. The polygonal labeling method can more accurately capture irregularly shaped targets in the image. The labeled images obtained by polygonal labeling can improve the accuracy of the model.

[0003] In the prior art, when annotating an image using a polygon annotation box, incorrect coordinate points may be drawn, resulting in intersecting edges of the drawn polygon. When the coordinate points are drawn incorrectly, the annotator needs to re-annotate the image, that is, the annotator needs to cancel the incorrectly marked coordinate points and then reselect the annotation coordinate points so that the drawn polygon does not have intersecting edges. This generates a lot of repetitive work, resulting in low efficiency in image annotation.

[0004] With regard to the problem of low efficiency of image annotation in related technologies, no effective solution has been proposed so far. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for marking coordinate points in an image, so as to at least solve the problem of low efficiency of image marking in the related art.

[0006] According to one embodiment of the present invention, a method for marking coordinate points in an image is provided, comprising: obtaining a coordinate point to be marked on a target image; connecting the coordinate point to be marked with an Nth marked coordinate point among N marked coordinate points to obtain an Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3; when there is no intersection between the Nth line segment and a line segment in a first line segment set, determining the coordinate point to be marked as the N+1th marked coordinate point, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and the N-2 line segments do not intersect.

[0007] Optionally, the method further includes: when the Nth line segment has an intersection with a line segment in the first line segment set, displaying a prompt message, wherein the prompt message is used to indicate that the coordinate point to be marked is an invalid coordinate point; and / or when the Nth line segment has an intersection with a line segment in the first line segment set, canceling the display of the coordinate point to be marked on the target image.

[0008] Optionally, after determining the coordinate point to be marked as the N+1th marked coordinate point, the method further includes: displaying the Nth line segment between the N+1th marked coordinate point and the Nth marked coordinate point.

[0009] Optionally, the method further includes: displaying the Nth line segment and the N-1th line segment, wherein the N-1th line segment includes the N-2 line segment and the N-1th line segment, the N-1th line segment is a line segment obtained by connecting the Nth labeled coordinate point and the N-1th labeled coordinate point, and the N-1th labeled coordinate point is the previous labeled coordinate point of the Nth labeled coordinate point.

[0010] Optionally, the method further includes: when it is determined that the N+1th marked coordinate point is the last marked coordinate point, connecting the N+1th marked coordinate point with the first marked coordinate point among the N marked coordinate points to form the N+1th line segment.

[0011] Optionally, the method further includes: storing the N marked coordinate points and the N+1th marked coordinate point in a target array according to a marking order.

[0012] According to another embodiment of the present invention, a device for marking coordinate points in an image is provided, comprising: an acquisition module, used to acquire the coordinate point to be marked on the target image; a connection module, used to connect the coordinate point to be marked with the Nth marked coordinate point among N marked coordinate points to obtain the Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3; a determination module, used to determine the coordinate point to be marked as the N+1th marked coordinate point when there is no intersection between the Nth line segment and a line segment in a first line segment set, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and the N-2 line segments do not intersect.

[0013] Optionally, the above-mentioned device also includes: a first display module, used to display a prompt message when the Nth line segment has an intersection with the line segments in the first line segment set, wherein the prompt message is used to indicate that the coordinate point to be marked is an invalid coordinate point; a second display module, used to cancel the display of the coordinate point to be marked on the target image when the Nth line segment has an intersection with the line segments in the first line segment set.

[0014] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of any of the above methods when executed by a processor.

[0015] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0016] According to the present invention, when marking the coordinate point to be marked, the coordinate point to be marked is first connected with the last marked coordinate point among the N marked coordinate points to obtain the Nth line segment. When the Nth line segment does not intersect with the N-2 line segments formed by the N-1 marked coordinate points among the N marked coordinate points in the marking order, the coordinate point to be marked is determined to be the N+1th marked coordinate point. In this way, the coordinate point is only allowed to be marked when the lines between the coordinate points do not intersect. The repeated work generated when the coordinate point is marked incorrectly is avoided. In addition, the problem of low efficiency in image marking can be solved, and the effect of improving the efficiency of image marking can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a hardware structure block diagram of a mobile terminal of a method for marking coordinate points in an image according to an embodiment of the present invention;

[0018] Figure 2 is a flow chart of a method for marking coordinate points in an image according to an embodiment of the present invention;

[0019] Figure 3 is a schematic diagram of optionally marking coordinate points in an image according to an embodiment of the present invention Figure 1 ;

[0020] Figure 4 is a schematic diagram of optionally marking coordinate points in an image according to an embodiment of the present invention Figure 2 ;

[0021] Figure 5 is a schematic diagram of a set of coordinate point annotation positions in an image according to an embodiment of the present invention;

[0022] Figure 6 is a flow chart of an overall method for marking coordinate points in an image that can be selected according to an embodiment of the present invention;

[0023] Figure 7 It is a structural block diagram of an optional device for marking coordinate points in an image according to an optional embodiment of the present invention. DETAILED DESCRIPTION

[0024] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0026] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal for a method for marking coordinate points in an image according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0027] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for marking coordinate points in an image in an embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0028] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0029] In this embodiment, a method for marking coordinate points in an image running on the mobile terminal is provided. Figure 2 is a flow chart of a method for marking coordinate points in an image according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0030] Step S202, obtaining coordinate points to be marked on the target image;

[0031] The target image can be the original image obtained before model training, for example, it can be taken by an image acquisition device, and the target image can be annotated using a polygonal annotation box. The coordinate points to be annotated can be obtained by obtaining the position where the mouse is clicked on the target image, such as Figure 3 FIG. 1 is a schematic diagram of optionally marking coordinate points in an image according to an embodiment of the present invention. Figure 1 , the objects to be labeled in the target image can be labeled, where Figure 3 The coordinate point E in is the coordinate point to be marked, and the coordinate point E to be marked can be obtained by obtaining the position where the mouse is clicked on the target image.

[0032] Step S204, connecting the coordinate point to be marked with the Nth marked coordinate point among the N marked coordinate points to obtain the Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3;

[0033] The coordinate point to be marked is the coordinate point currently clicked by the mouse in the target image, and the marked coordinate points are the coordinate points that will not produce intersecting line segments after being connected in sequence. The coordinate point to be marked is connected with the Nth marked coordinate point among the N marked coordinate points to obtain the Nth line segment. N is an integer greater than or equal to 3. If N is 4, it means that the total number of marked coordinate points is 4. Figure 3As shown, the object to be labeled in the target image can be labeled, wherein the four labeled coordinate points can be coordinate points A, B, C, and D, the coordinate point to be labeled can be coordinate point E, and the coordinate point to be labeled E can be connected with the fourth labeled coordinate point D among the labeled coordinate points to obtain the latest fourth line segment DE.

[0034] Step S206, when the Nth line segment does not have an intersection with a line segment in the first line segment set, the coordinate point to be marked is determined as the N+1th marked coordinate point, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and the N-2 line segments do not intersect.

[0035] The first line segment set may be N-2 line segments formed by the marked N-1 coordinate points in the order of marking, and the N-1 marked coordinate points are the coordinate points of the N marked coordinate points except the Nth marked coordinate point, that is, the N-1 marked coordinate points are the first N-1 coordinate points marked in order among the N marked coordinate points, and when there is no intersection between the Nth line segment and the line segments in the first line segment set, the coordinate point to be marked is determined to be the N+1th marked coordinate point. Assuming that the value of N is 4, it means that 4 coordinate points have been marked, such as Figure 3 As shown, the coordinate points A, B, C, and D in the figure are 4 marked coordinate points. The 4th marked coordinate point D is removed from the 4 marked coordinate points A, B, C, and D, and 3 marked coordinate points A, B, and C remain. It should be noted that the reason for removing the 4th marked coordinate point D is that the 4th marked coordinate point D is the intersection of the 4th line segment DE and the 3rd line segment CD, and there is no need to determine whether the line segments with common coordinate points intersect. The first line segment set can be 3 line segments formed by the 4 coordinate points A, B, C, and D in the order of marking, that is, the first marked coordinate point is coordinate point A, the second marked coordinate point is coordinate point B, the third marked coordinate point is coordinate point C, and the fourth marked coordinate point is coordinate point D. The line segments formed in the order of marking A, B, C, and D are line segments AB, BC, and CD, respectively. Then the first line segment set includes AB, BC, and CD, a total of 3 line segments. When the fourth line segment DE has no intersection with line segment AB, line segment BC, and line segment CD, the coordinate point E to be marked is determined as the fifth marked coordinate point, and the marking of the coordinate point to be marked is completed.

[0036] like Figure 4 FIG. 1 is a schematic diagram of optionally marking coordinate points in an image according to an embodiment of the present invention. Figure 2, assuming that the coordinate point to be marked is E', the first line segment set includes 3 line segments, AB, BC and CD, and when the fourth line segment DE' has an intersection with at least one of the line segments AB, BC and CD, for example Figure 4 When DE' in the first line segment set intersects with line segment BC in the first line segment set, the coordinate point E' to be marked will be cancelled, that is, the coordinate point E' will not be marked.

[0037] Through the above steps, when the coordinate point to be marked is marked, the coordinate point to be marked is first connected with the last marked coordinate point among the N marked coordinate points to obtain the Nth line segment. When the Nth line segment does not intersect with the N-2 line segments formed by the N-1 marked coordinate points among the N marked coordinate points in the marking order, the coordinate point to be marked is determined to be the N+1th marked coordinate point. In this way, the coordinate point is only allowed to be marked when the lines between the coordinate points do not intersect. The repeated work caused by the coordinate point marking errors is avoided. In addition, the problem of low efficiency of image marking can be solved, and the effect of improving the efficiency of image marking can be achieved.

[0038] As an optional implementation, assuming that (xF, yF) is the coordinate point to be marked, and (xL, yL) is the last coordinate point among the marked coordinate points, then (xL, yL) and (xF, yF) are the two latest coordinate points. Temp stores the coordinate point array of the connected line segments. When the number of marked coordinate points reaches 3 or more, we need to determine the positional relationship between the latest line segment, that is, the two coordinate points in the line segment between (xL, yL) and (xF, yF), and the coordinate points of all drawn line segments (excluding line segments with the same coordinate nodes). Traverse the temp array and use the pointer movement method, where the pointer step size is 1, to calculate the relationship between each line segment coordinate node and the two latest coordinate nodes. Assuming that (x0, y0) and (x1, y1) are the first and second coordinate points among the marked coordinate points, the first line segment can be obtained by connecting (x0, y0) and (x1, y1). Taking the comparison between the first line segment and the line segments between (xL, yL) and (xF, yF) as an example, the entire process of determining the intersection of line segments is described. In this embodiment, the problem of determining the intersection between line segments can be converted into determining the positional relationship between lines and points. When two connecting lines intersect, the positions of the two coordinate points of one of the line segments are on both sides of the straight line where the other line segment is located, and the range of intersection also exists on the line segment.

[0039] Calculate the positional relationship between the straight line where the coordinate points (xL, yL) and (xF, yF) are located and the points (x0, y0) and (x1, y1). Determine whether (x0, y0) and (x1, y1) are on the same side of the straight line where (xL, yL) and (xF, yF) are located. If they are on the same side, they do not intersect. Otherwise, they do intersect. The specific calculation formula is as follows:

[0040] equation_R_1=((yL-yF) / (xL-xF))*x0-((yL-yF) / (xL-xF))*xF+yF

[0041] equation_L_1=y0

[0042] equation_R_2=((yL-yF) / (xL-xF))*x1-((yL-yF) / (xL-xF))*xF+yF

[0043] equation_L_2=+y1

[0044] (equation_L_1-equation_R_1)*(equation_L_2-equation_R_2)<=0

[0045] Through the above formula, we can obtain the position range of the coordinate point (xF, yF) when the two points (x0, y0) and (x1, y1) are on both sides of the straight line (xL, yL) and (xF, yF).

[0046] Calculate the positional relationship between the straight line (x0, y0), (x1, y1) and the coordinate points (xL, yL), (xF, yF):

[0047] equation_R_3=((y1-y0) / (x1-x0))*xF-((y1-y0) / (x1-x0))*x0+y0

[0048] equation_L_3=yF

[0049] equation_R_4=((y1-y0) / (x1-x0))*xL-((y1-y0) / (x1-x0))*x0+y0

[0050] equation_L_4=+yL

[0051] (equation_L_3-equation_R_3)*(equation_L_4-equation_R_4)<=0

[0052] Through the above formula, we can obtain the position range of the coordinate point (xF, yF) when the two coordinate points (xL, yL) and (xF, yF) are on both sides of the straight line (x0, y0) and (x1, y1).

[0053] Recursively compare (xL, yL), (xF, yF) with all connected line segments to see if there is an intersection. For example, temp stores [(x0, y0), (x1, y1), (x3, y3), (x4, y4), …, (x L-2 ), (y L-2 ),(x L-1 ), (y L-1 ),(xL,yL)], then after comparing whether the line segment between (x0,y0) and (x1,y1) intersects, it is necessary to continue comparing whether the line segment between (x1,y1) and (x2,y2) intersects, and so on. L-2 ), (y L-2 ) and (x L-1 ), (y L-1 ) and finally calculate all the conditions for the establishment. Figure 5 The figure is a schematic diagram of a set of annotated positions of coordinate points in an image according to an embodiment of the present invention. The positions of the coordinate points in the entire target image are assumed to be a set A, and all (xF, yF) that satisfy the above conditions are set B. This means that when (xF, yF) is in set B, there is an intersection of line segments in the polygon. Assuming that set C is the complement of set B in set A, it means that when (xF, yF) is in set C, there will be no intersection of line segments in the polygon.

[0054] Optionally, when the Nth line segment has an intersection with a line segment in the first line segment set, a prompt message is displayed, wherein the prompt message is used to indicate that the coordinate point to be marked is an invalid coordinate point; and / or when the Nth line segment has an intersection with a line segment in the first line segment set, the coordinate point to be marked is cancelled from being displayed on the target image.

[0055] As an optional implementation, assuming that the value of N is 4, and the first line segment set includes line segment A and line segment B, then when the fourth line segment intersects line segment A, or the fourth line intersects line segment B, a prompt message is displayed. The prompt message may be a pop-up warning box prompting "Marking is prohibited", which is used to prompt that the point to be marked is an invalid coordinate point.

[0056] When the fourth line segment and line segment A have an intersection, or the fourth line and line segment B have an intersection, the coordinate point to be marked is determined to be an invalid coordinate point, and the coordinate point to be marked displayed on the picture is cancelled.

[0057] Optionally, after determining the coordinate point to be marked as the N+1th marked coordinate point, the method further includes: displaying the Nth line segment between the N+1th marked coordinate point and the Nth marked coordinate point.

[0058] As an optional implementation, the position of the coordinate point to be marked in the current target image is determined, and if it does not cause the line segments of the drawn polygon to intersect, the coordinate point to be marked is determined to be a valid coordinate point, and the marking of the coordinate point to be marked is completed, and the coordinate point to be marked is taken as the N+1th marked coordinate point, and the Nth line segment between the N+1th marked coordinate point and the Nth marked coordinate point is displayed accordingly. Assuming that the value of N is 3, the coordinate point to be marked is taken as the 4th marked coordinate point, and the 3rd line segment between the 4th marked coordinate point and the 3rd marked coordinate point is displayed accordingly.

[0059] Optionally, the Nth line segment and the N-1th line segment are displayed, wherein the N-1th line segment includes the N-2 line segment and the N-1th line segment, the N-1th line segment is a line segment obtained by connecting the Nth labeled coordinate point and the N-1th labeled coordinate point, and the N-1th labeled coordinate point is the previous labeled coordinate point of the Nth labeled coordinate point.

[0060] As an optional implementation, when annotating the target image, it can be annotated by drawing polygons. When drawing each edge of the polygon, it is necessary to display the corresponding position of each edge in the target image. Assuming that the drawing of 4 line segments has been completed, it is necessary to display the corresponding 4th line segment and the previously drawn 3 line segments. The annotated coordinate points are annotated sequentially, that is, the 3rd line segment drawn is the line segment obtained by connecting the 3rd annotated coordinate point and the 4th annotated coordinate point, and the 3rd annotated coordinate point is the previous annotated coordinate point of the 4th annotated coordinate point.

[0061] Optionally, when it is determined that the N+1th marked coordinate point is the last marked coordinate point, the N+1th marked coordinate point is connected to the first marked coordinate point among the N marked coordinate points to form the N+1th line segment.

[0062] As an optional implementation, when annotating the target image, a closed polygonal annotation box can be used to annotate the image. When it is determined that the current node to be annotated is a valid node and the last node, the polygonal annotation box is closed. Assuming that N is 3, when it is determined that the fourth annotated coordinate point is the last annotated coordinate point, the fourth annotated coordinate point is connected to the first annotated coordinate point to form the fourth line segment, which is the last edge of the polygonal annotation box, and the drawing of the image polygonal annotation box is completed.

[0063] Optionally, the N marked coordinate points and the N+1th marked coordinate point are stored in a target array in a marking order.

[0064] As an optional implementation, when annotating the target image, the initial click position of the mouse can be defined as the annotation starting point, that is, the first coordinate point that has been annotated. The next coordinate point is selected and connected according to the annotation starting point, and the most recently selected coordinate point is called the annotation starting point. Each coordinate point that has been annotated is stored in the target array in turn to form an ordered data set. Left and right pointers can be defined, and the data in the entire target array can be connected in order by moving the pointers in turn through the target array. When it is determined that the drawn figure needs to be closed, the head and tail of the queue are found, the first coordinate point and the last coordinate point in the target array are connected, and the closing operation is performed to complete the drawing of the polygon annotation box.

[0065] As an optional implementation, Figure 6 The figure is a flow chart of the overall method for labeling coordinate points in an image that can be selected according to an embodiment of the present invention. In the image labeling interface, the selected image can be displayed in the image labeling interface by clicking the Select Picture button, and the initial marking point can be marked by the mouse as the first marked coordinate point, and the next coordinate point to be labeled can be marked. When the sum of the number of the current coordinate point to be labeled and the number of the marked coordinate points is less than, the current coordinate point to be labeled is directly connected to the last marked coordinate point, and the next coordinate point can be labeled.

[0066] When the sum of the current coordinate points to be marked and the number of marked coordinate points is greater than or equal to 4, it is necessary to determine whether the closing condition is met. The closing condition is to determine that all line segments formed by the current marked coordinate points do not intersect, and the current coordinate point to be marked is the last marked coordinate point. Connect the last marked coordinate point with the first marked coordinate point to complete the drawing of the polygonal marking box.

[0067] In the case where the above closing conditions are not met, it is determined whether the line segment between the position of the current coordinate point to be marked and the last marked coordinate point intersects with all the previously drawn line segments. If so, the current coordinate point to be marked is determined to be an invalid coordinate point, the display of the current coordinate point to be marked is cancelled, and the coordinate point is redrawn. The redrawn coordinate point is coordinate point A. In the case that the line segment between the redrawn coordinate point A and the last marked coordinate point does not intersect with all the previously drawn line segments, the last marked coordinate point is connected, and the marking of the next coordinate point to be marked is continued, and the process is repeated as follows. Figure 6 The process is repeated until the polygon annotation box is drawn.

[0068] When marking points, the present invention detects the user's trajectory and intelligently determines whether there is an intersection. If there is an intersection, the point drawing will not be performed. The operation is relatively reduced and there is no need for a rollback operation. If the marked graphics that have been drawn have abnormal conditions such as missing graphics, the corresponding points can be adjusted to solve the abnormal problems. In the drawing process, the points are connected after marking to achieve a visual operation process. By judging the relationship between the points, the intersection is denied in advance. The marking form of the points makes it more convenient to adjust the drawing results. The connecting lines of the points can achieve visual operations.

[0069] As an optional implementation, assuming that N is 3, when it is determined that the fourth marked coordinate point is the last marked coordinate point, the fourth marked coordinate point is connected to the first marked coordinate point to form a fourth line segment, which is the last edge of the polygonal marking box, and the drawing of the first figure is completed. The first figure can be a polygonal marking box of the image. After the drawing of the polygonal marking box of the image is completed, the annotator determines whether the polygonal marking box can accurately mark the irregular objects in the image. If the drawn polygonal marking box meets the conditions for accurately marking the irregular objects in the image, the image in the polygonal marking box in the target image is determined as the image to be annotated. An annotation mark can be added to the image to be annotated. The annotation mark can be entered in the edit box. For example, the "face sample" to be identified in the image recognition model can be entered, and the "face sample" is used as the annotation mark. The target mark "face sample" is obtained in the edit box, and the target mark is used to annotate the image to be annotated.

[0070] As an optional implementation, assuming that N is 3, after the fourth line segment is drawn, the fourth line segment is the last edge of the polygonal annotation box, and the drawing of the first figure is completed. The first figure can be a polygonal annotation box of the image. After the drawing of the polygonal annotation box of the image is completed, it is determined whether the polygonal annotation box meets the conditions for accurately marking the irregular objects in the image. If the drawn first figure does not meet the conditions for accurately marking the irregular objects in the image, the first figure needs to be adjusted. The shape of the first image can be adjusted by adjusting the coordinate points marked in the first image. For example, the second figure can be obtained by modifying the coordinate data of the marked coordinate points. The second figure is the adjusted polygonal annotation box. It should be noted that all the line segments in the polygonal annotation box in the second figure do not intersect with each other. The image in the second figure in the target image is determined as the image to be annotated. A annotation identifier can be added to the image to be annotated. The annotation identifier can be entered in the edit box. For example, the "face sample" to be recognized in the image recognition model can be entered, and the "face sample" is used as the annotation identifier. The target identifier "face sample" is obtained in the edit box, and the target identifier is used to annotate the image to be annotated.

[0071] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.

[0072] In this embodiment, a device for marking coordinate points in an image is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made are not repeated here. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0073] Figure 7 is a structural block diagram of an optional device for marking coordinate points in an image according to an optional embodiment of the present invention. Figure 7As shown, the device includes: an acquisition module 72, used for acquiring a coordinate point to be marked on a target image; a connection module 74, used for connecting the coordinate point to be marked with the Nth marked coordinate point among N marked coordinate points to obtain an Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3; a determination module 76, used for determining the coordinate point to be marked as the N+1th marked coordinate point when there is no intersection between the Nth line segment and the line segments in the first line segment set, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and the N-2 line segments do not intersect.

[0074] Optionally, the above-mentioned device also includes: a first display module, used to display a prompt message when the Nth line segment has an intersection with the line segments in the first line segment set, wherein the prompt message is used to indicate that the coordinate point to be marked is an invalid coordinate point; a second display module, used to cancel the display of the coordinate point to be marked on the target image when the Nth line segment has an intersection with the line segments in the first line segment set.

[0075] Optionally, the above-mentioned device is also used to display a prompt message when the Nth line segment has an intersection with the line segments in the first line segment set, wherein the prompt message is used to indicate that the coordinate point to be marked is an invalid coordinate point; and when the Nth line segment has an intersection with the line segments in the first line segment set, cancel the display of the coordinate point to be marked on the target image.

[0076] Optionally, the above device is further used to display the Nth line segment between the N+1th marked coordinate point and the Nth marked coordinate point.

[0077] Optionally, the above-mentioned device is also used to display the Nth line segment and the N-1th line segment, wherein the N-1th line segment includes the N-2 line segment and the N-1th line segment, the N-1th line segment is a line segment obtained by connecting the Nth labeled coordinate point and the N-1th labeled coordinate point, and the N-1th labeled coordinate point is the previous labeled coordinate point of the Nth labeled coordinate point.

[0078] Optionally, the above-mentioned device is also used to connect the N+1th marked coordinate point with the first marked coordinate point among the N marked coordinate points to form the N+1th line segment when it is determined that the N+1th marked coordinate point is the last marked coordinate point.

[0079] Optionally, the above device is further used to store the N marked coordinate points and the N+1th marked coordinate point in a target array according to the marking order.

[0080] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0081] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0082] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0083] S1, obtain the coordinate points to be marked on the target image;

[0084] S2, connecting the coordinate point to be marked with the Nth marked coordinate point among the N marked coordinate points to obtain an Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3;

[0085] S3. When there is no intersection between the Nth line segment and the line segments in the first line segment set, the coordinate point to be marked is determined as the N+1th marked coordinate point, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and the N-2 line segments do not intersect.

[0086] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.

[0087] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0088] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0089] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

[0090] S1, obtain the coordinate points to be marked on the target image;

[0091] S2, connecting the coordinate point to be marked with the Nth marked coordinate point among the N marked coordinate points to obtain an Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3;

[0092] S3. When there is no intersection between the Nth line segment and the line segments in the first line segment set, the coordinate point to be marked is determined as the N+1th marked coordinate point, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and the N-2 line segments do not intersect.

[0093] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

[0094] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0095] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for marking coordinate points in an image, characterized in that: include: Get the coordinate points to be marked on the target image; Connecting the coordinate point to be marked with the Nth marked coordinate point among the N marked coordinate points to obtain an Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3; In the case that there is no intersection between the Nth line segment and the line segments of the first line segment set except the Nth marked coordinate point, the coordinate point to be marked is determined as the N+1th marked coordinate point, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and there is no intersection between the N-2 line segments except the marked coordinate points; Wherein, the method further comprises: When the Nth line segment and the line segments in the first line segment set have an intersection other than the Nth marked coordinate point, display a prompt message, wherein the prompt message is used to prompt that the coordinate point to be marked is an invalid coordinate point; and / or In the case where the Nth line segment has an intersection with a line segment in the first line segment set, the coordinate point to be marked is cancelled from being displayed on the target image.

2. The method according to claim 1, characterized in that After determining the coordinate point to be marked as the N+1th marked coordinate point, the method further includes: The Nth line segment between the N+1th marked coordinate point and the Nth marked coordinate point is displayed.

3. The method according to claim 1, characterized in that The method further comprises: The N-th line segment and the N-1-th line segment are displayed, wherein the N-1-th line segment includes the N-2-th line segment and the N-1-th line segment, wherein the N-1-th line segment is a line segment obtained by connecting the N-th labeled coordinate point and the N-1-th labeled coordinate point, and the N-1-th labeled coordinate point is the previous labeled coordinate point of the N-th labeled coordinate point.

4. The method according to claim 1, characterized in that: The method further comprises: When it is determined that the N+1th marked coordinate point is the last marked coordinate point, the N+1th marked coordinate point is connected with the first marked coordinate point among the N marked coordinate points to form the N+1th line segment.

5. The method according to claim 1, characterized in that The method further comprises: The N marked coordinate points and the N+1th marked coordinate point are stored in the target array according to the marking order.

6. A device for marking coordinate points in an image, characterized in that: include: An acquisition module is used to acquire coordinate points to be marked on the target image; a connection module, used for connecting the coordinate point to be marked with the Nth marked coordinate point among the N marked coordinate points to obtain the Nth line segment, wherein the Nth marked coordinate point is the last marked coordinate point among the N marked coordinate points, and N is greater than or equal to 3; a determination module, configured to determine the coordinate point to be marked as the N+1th marked coordinate point when there is no intersection between the Nth line segment and the line segments of the first line segment set except the Nth marked coordinate point, wherein the first line segment set includes N-2 line segments formed by N-1 marked coordinate points in a marking order, the N-1 marked coordinate points are coordinate points among the N marked coordinate points except the Nth marked coordinate point, and there is no intersection between the N-2 line segments except the marked coordinate points; The device is also used to display a prompt message when the Nth line segment has an intersection with a line segment in the first line segment set except the Nth marked coordinate point, wherein the prompt message is used to prompt that the coordinate point to be marked is an invalid coordinate point; and / or when the Nth line segment has an intersection with a line segment in the first line segment set, cancel the display of the coordinate point to be marked on the target image.

7. A storage medium, characterized in that: The storage medium stores a computer program, wherein the program can be executed by a terminal device or a computer to execute the method described in any one of claims 1 to 5.

8. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 5.