Image annotation method, device, electronic device, and computer-readable medium

By calculating the color value difference based on the angle coordinates and color values ​​in image annotation, the labeling box is automatically corrected, which solves the problem of labeling inaccuracy caused by manual dragging and improves the accuracy of image annotation.

CN114399627BActive Publication Date: 2025-08-19BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111556455.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-17
Publication Date
2025-08-19
Estimated Expiration
2041-12-17

AI Technical Summary

Technical Problem

In the prior art, the user manually drags the labeling box when annotating an image, which can easily lead to inaccurate labeling.

Method used

By determining the pixel coordinates and color values ​​of the initial annotation frame based on the first angle coordinates and the second angle coordinates, after the movement process, the color value difference value is calculated, and the target annotation image is determined in response to the difference value being greater than the threshold value.

Benefits of technology

Improve the accuracy of image annotation and realize the correction of user annotation areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114399627B_ABST
    Figure CN114399627B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose an image annotation method, device, electronic device, and computer-readable medium. A specific implementation of the method includes: determining the pixel coordinates of each pixel point included in each initial annotation box boundary line of the initial annotation box in the target image to obtain a pixel coordinate group; based on the color value corresponding to each pixel point in the target image, determining the initial color value corresponding to each obtained pixel coordinate group; performing movement processing on the first angular coordinate and the second angular coordinate respectively; based on the first moving angular coordinate and the second moving angular coordinate, determining the color value difference between the moving color value corresponding to each moving annotation box boundary line of the moving annotation box and the initial color value; in response to the determined respective color value difference values being greater than or equal to a preset threshold, determining the target image containing the moving annotation box as the target annotation image. This implementation realizes the correction of the image area annotated by the user, thereby improving the accuracy of image annotation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and more particularly to an image annotation method, apparatus, electronic device, and computer-readable medium. Background Art

[0002] Image annotation is the process of labeling a specific area in an image. This is usually done through the annotation function provided by a data annotation platform. Currently, the annotation function provided by data annotation platforms usually requires users to draw the annotation area in the image.

[0003] However, the above-mentioned method of annotating images usually has the following technical problems: when correcting the annotated area, the user is required to manually drag the annotation box, which easily causes inaccurate image annotation. Summary of the Invention

[0004] The content of this disclosure is used to briefly introduce concepts that will be described in detail in the detailed description section below. The content of this disclosure is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] Some embodiments of the present disclosure provide image annotation methods, devices, electronic devices, and computer-readable media to solve one or more of the technical problems mentioned in the above background technology section.

[0006] In a first aspect, some embodiments of the present disclosure provide an image annotation method, the method comprising: determining, based on first angular coordinates and second angular coordinates, the pixel coordinates of each pixel point included in each initial annotation box boundary line of an initial annotation box in a target image to obtain a pixel coordinate group, wherein the first angular coordinates and the second angular coordinates are the pixel coordinates of two diagonal vertices of the initial annotation box; determining, based on the color value corresponding to each pixel point in the target image, an initial color value corresponding to each obtained pixel coordinate group; performing the following processing steps for the first angular coordinates and the second angular coordinates: performing movement processing on the first angular coordinates and the second angular coordinates respectively to obtain first moved angular coordinates and second moved angular coordinates; determining, based on the first moved angular coordinates and the second moved angular coordinates, a color value difference between a moved color value corresponding to each moving annotation box boundary line of the moving annotation box and the corresponding initial color value; and determining, in response to each determined color value difference value being greater than or equal to a preset threshold, the target image containing the moving annotation box as the target annotation image.

[0007] Optionally, before determining the pixel coordinates of each pixel point included in each initial annotation box boundary line of the initial annotation box in the target image based on the first angular coordinate and the second angular coordinate to obtain the pixel coordinate group, the method further includes: performing color value quantization processing on the image input by the user to generate a quantized image as the target image; obtaining the color value corresponding to each pixel point in the above target image; and receiving the first angular coordinate and the second angular coordinate corresponding to the above target image input by the user.

[0008] Optionally, the above-mentioned determination of the initial color value corresponding to each pixel coordinate group obtained based on the color value corresponding to each pixel point in the above-mentioned target image includes: determining the color value of the pixel point corresponding to each pixel coordinate in the above-mentioned pixel coordinate group to obtain a color value group; performing color value conversion processing on each color value in the above-mentioned color value group based on a preset color value format to generate a converted color value to obtain a converted color value group; and determining the median converted color value in the above-mentioned converted color value group as the initial color value corresponding to the above-mentioned pixel coordinate group.

[0009] Optionally, the above-mentioned first angular coordinate and the above-mentioned second angular coordinate are moved respectively to obtain a first moving angular coordinate and a second moving angular coordinate, including: moving the ordinate and the abscissa of the above-mentioned first angular coordinate by preset unit values respectively to obtain the moving first angular coordinate; in response to the absolute value of the coordinate difference between the above-mentioned moving first angular coordinate and the above-mentioned first angular coordinate being less than or equal to the preset difference, determining the above-mentioned moving first angular coordinate as the first moving angular coordinate; moving the ordinate and the abscissa of the above-mentioned second angular coordinate by preset unit values respectively to obtain the moving second angular coordinate; in response to the absolute value of the coordinate difference between the above-mentioned moving second angular coordinate and the above-mentioned second angular coordinate being less than or equal to the preset difference, determining the above-mentioned moving second angular coordinate as the second moving angular coordinate.

[0010] Optionally, the above-mentioned determining the color value difference between the moving color value corresponding to each moving annotation box boundary line of the moving annotation box and the corresponding initial color value based on the above-mentioned first moving angle coordinate and the above-mentioned second moving angle coordinate includes: constructing a moving annotation box based on the above-mentioned first moving angle coordinate and the above-mentioned second moving angle coordinate; for each moving annotation box boundary line in the above-mentioned moving annotation box, determining the pixel coordinates of each pixel point included in the above-mentioned moving annotation box boundary line as the moving pixel coordinates, and obtaining a moving pixel coordinate group; based on the color value corresponding to each pixel point in the above-mentioned target image, determining the moving color value corresponding to each obtained moving pixel coordinate group; determining the color value difference between the moving color value corresponding to each moving annotation box boundary line of the above-mentioned moving annotation box and the corresponding initial color value.

[0011] Optionally, the above-mentioned determination of the moving color value corresponding to each moving pixel coordinate group obtained based on the color value corresponding to each pixel point in the above-mentioned target image includes: determining the color value of the pixel point corresponding to each pixel coordinate in the above-mentioned moving pixel coordinate group as the moving pixel color value to obtain the moving pixel color value group; performing color value conversion processing on each moving pixel color value in the above-mentioned moving pixel color value group based on a preset color value format to generate a converted moving pixel color value to obtain a converted moving pixel color value group; determining the target converted moving pixel color value as the moving color value corresponding to the above-mentioned moving pixel coordinate group, wherein the above-mentioned target converted moving pixel color value is the median converted moving pixel color value in the above-mentioned converted moving pixel color value group.

[0012] Optionally, the above method also includes: in response to the determined color value difference values being less than the above preset threshold value, and the loop count value being an odd number, taking the sum of the above preset unit value and the preset value as the preset unit value, and performing the above processing steps again.

[0013] Optionally, the method further includes: in response to each of the determined color value difference values being less than the preset threshold value, and the loop count value being an even number, taking the opposite of the preset unit value as the preset unit value, and executing the processing step again.

[0014] In a second aspect, some embodiments of the present disclosure provide an image annotation device, comprising: a coordinate determination unit configured to determine, based on first and second angular coordinates, the pixel coordinates of each pixel point included in each initial annotation box boundary line of an initial annotation box in a target image, to obtain a pixel coordinate group, wherein the first and second angular coordinates are the pixel coordinates of two diagonal vertices of the initial annotation box; a color value determination unit configured to determine, based on the color value corresponding to each pixel point in the target image, an initial color value corresponding to each obtained pixel coordinate group; a movement unit configured to perform the following processing steps on the first and second angular coordinates: performing movement processing on the first and second angular coordinates, respectively, to obtain first and second moved angular coordinates; and determining, based on the first and second moved angular coordinates, a color value difference between a moved color value corresponding to each moving annotation box boundary line of the moving annotation box and the corresponding initial color value; and an image determination unit configured to determine, in response to each determined color value difference being greater than or equal to a preset threshold, the target image containing the moving annotation box as the target annotation image.

[0015] Optionally, before the coordinate determination unit, the device also includes: a color value quantization unit, configured to perform color value quantization processing on the image input by the user to generate a quantized image as a target image; an acquisition unit, configured to obtain the color value corresponding to each pixel point in the above target image; and a receiving unit, configured to receive the first angular coordinates and second angular coordinates corresponding to the above target image input by the user.

[0016] Optionally, the color value determination unit is further configured to: determine the color value of the pixel point corresponding to each pixel coordinate in the above-mentioned pixel coordinate group to obtain a color value group; based on a preset color value format, perform color value conversion processing on each color value in the above-mentioned color value group to generate a converted color value to obtain a converted color value group; determine the median converted color value in the above-mentioned converted color value group as the initial color value corresponding to the above-mentioned pixel coordinate group.

[0017] Optionally, the moving unit is further configured to: move the ordinate and abscissa of the above-mentioned first angular coordinate by preset unit values respectively to obtain the moved first angular coordinate; in response to the absolute value of the coordinate difference between the above-mentioned moved first angular coordinate and the above-mentioned first angular coordinate being less than or equal to the preset difference, determine the above-mentioned moved first angular coordinate as the first moved angular coordinate; move the ordinate and abscissa of the above-mentioned second angular coordinate by preset unit values respectively to obtain the moved second angular coordinate; in response to the absolute value of the coordinate difference between the above-mentioned moved second angular coordinate and the above-mentioned second angular coordinate being less than or equal to the preset difference, determine the above-mentioned moved second angular coordinate as the second moved angular coordinate.

[0018] Optionally, the moving unit is further configured to: construct a moving annotation box based on the above-mentioned first moving angle coordinates and the above-mentioned second moving angle coordinates; for each moving annotation box boundary line in the above-mentioned moving annotation box, determine the pixel coordinates of each pixel point included in the above-mentioned moving annotation box boundary line as the moving pixel coordinates to obtain a moving pixel coordinate group; based on the color value corresponding to each pixel point in the above-mentioned target image, determine the moving color value corresponding to each obtained moving pixel coordinate group; determine the color value difference between the moving color value corresponding to each moving annotation box boundary line of the above-mentioned moving annotation box and the corresponding initial color value.

[0019] Optionally, the moving unit is further configured to: determine the color value of the pixel point corresponding to each pixel coordinate in the above-mentioned moving pixel coordinate group as the moving pixel color value, and obtain a moving pixel color value group; based on a preset color value format, perform color value conversion processing on each moving pixel color value in the above-mentioned moving pixel color value group to generate a converted moving pixel color value, and obtain a converted moving pixel color value group; determine the target converted moving pixel color value as the moving color value corresponding to the above-mentioned moving pixel coordinate group, wherein the above-mentioned target converted moving pixel color value is the median converted moving pixel color value in the above-mentioned converted moving pixel color value group.

[0020] Optionally, the device also includes: a first processing unit, configured to, in response to the determined color value difference values being less than the above-mentioned preset threshold value and the loop count value being an odd number, take the sum of the above-mentioned preset unit value and the preset value as the preset unit value, and execute the above-mentioned processing steps again.

[0021] Optionally, the device also includes: a second processing unit, configured to, in response to the determined color value difference values being less than the above-mentioned preset threshold value and the loop count value being an even number, use the opposite number of the above-mentioned preset unit value as the preset unit value and execute the above-mentioned processing steps again.

[0022] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation of the first aspect above.

[0023] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation of the first aspect is implemented.

[0024] The above-described various embodiments of the present disclosure have the following beneficial effects: Through the image annotation methods of some embodiments of the present disclosure, corrections to user-annotated image regions are achieved, thereby improving the accuracy of image annotation. Specifically, inaccurate image annotations are caused by the user manually dragging the annotation box when correcting the annotated region, which can easily lead to inaccurate image annotations. Based on this, the image annotation methods of some embodiments of the present disclosure first determine the pixel coordinates of each pixel point included in each initial annotation box boundary line of an initial annotation box in a target image based on first and second angular coordinates, thereby obtaining a pixel coordinate group. This facilitates determining the color value corresponding to each pixel coordinate. Next, based on the color value corresponding to each pixel point in the target image, the initial color value corresponding to each obtained pixel coordinate group is determined. This allows the initial color value of the initial annotation box to be determined, facilitating subsequent corrections to the annotation box. Then, the following processing steps are performed on the first and second angular coordinates: First, the first and second angular coordinates are respectively moved to obtain first and second moved angular coordinates. Thus, the two angular coordinates after the movement can be used to construct a moving annotation frame to achieve the correction of the initial annotation frame in the target image. Then, based on the above-mentioned first moving angular coordinates and the above-mentioned second moving angular coordinates, the color value difference between the moving color value corresponding to each moving annotation frame boundary line of the moving annotation frame and the corresponding initial color value is determined. Thus, the similarity between the color value (moving color value) of the moving annotation frame boundary line of the moving annotation frame and the initial color value can be determined. Therefore, when the similarity is low, it means that the color value of the annotation frame boundary line has changed, and the correction of the annotation frame can be completed. Finally, in response to the fact that each of the determined color value difference values is greater than or equal to a preset threshold, the target image containing the above-mentioned moving annotation frame is determined as the target annotation image. Thus, the correction of the image area annotated by the user is achieved, and the accuracy of image annotation is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0026] Figure 1 is a schematic diagram of an application scenario of the image annotation method in some embodiments of the present disclosure;

[0027] Figure 2 is a flowchart of some embodiments of the image annotation method according to the present disclosure;

[0028] Figure 3 is a flowchart of other embodiments of the image annotation method according to the present disclosure;

[0029] Figure 4 are flowcharts of further embodiments of the image annotation method according to the present disclosure;

[0030] Figure 5 is a schematic structural diagram of some embodiments of the image annotation device according to the present disclosure;

[0031] Figure 6 It is a structural diagram of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0032] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.

[0033] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.

[0034] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0035] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0036] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0037] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0038] Figure 1 is a schematic diagram of an application scenario of the image annotation method according to some embodiments of the present disclosure.

[0039] exist Figure 1In an application scenario, first, the computing device 101 can determine the pixel coordinates of each pixel point included in each initial annotation box boundary line 104101 of the initial annotation box 1041 in the target image 104 based on the first angular coordinate 102 and the second angular coordinate 103, thereby obtaining a pixel coordinate group 105. The first angular coordinate 102 and the second angular coordinate 103 are the pixel coordinates of the two diagonal vertices of the initial annotation box 1041. Next, the computing device 101 can determine the initial color value 106 corresponding to each pixel coordinate group 105 based on the color value corresponding to each pixel point in the target image 104. Then, the computing device 101 can perform the following processing steps on the first angular coordinate 102 and the second angular coordinate 103: First, the first angular coordinate 102 and the second angular coordinate 103 are respectively moved to obtain a first moved angular coordinate 107 and a second moved angular coordinate 108. Then, based on the first moving angle coordinate 107 and the second moving angle coordinate 108, a color value difference between the moved color value corresponding to each boundary line of the moving annotation box and the corresponding initial color value is determined. Finally, in response to each of the determined color value differences being greater than or equal to a preset threshold, the computing device 101 may determine the target image containing the moving annotation box as the target annotated image 109.

[0040] It should be noted that the computing device 101 can be either hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitations are given here.

[0041] It should be understood that Figure 1 The number of computing devices in the embodiment is merely illustrative. Any number of computing devices may be provided according to implementation requirements.

[0042] Continue to refer Figure 2 , shows a process 200 of some embodiments of the image annotation method according to the present disclosure. The image annotation method includes the following steps:

[0043] Step 201 : Based on the first corner coordinate and the second corner coordinate, the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image are determined to obtain a pixel coordinate group.

[0044] In some embodiments, the execution subject of the image annotation method (eg Figure 1The computing device 101 shown in the figure can determine the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image based on the first angular coordinate and the second angular coordinate to obtain a pixel coordinate group. The first angular coordinate and the second angular coordinate are the pixel coordinates of the two diagonal vertices of the initial annotation frame. Here, the initial annotation frame boundary line of the initial annotation frame can refer to the annotation frame boundary line of the initial annotation frame. Here, the first angular coordinate and the second angular coordinate can be the pixel coordinates of two pixel points in the target image input by the user, which are used to determine the initial annotation frame in the target image. Here, the target image can be an image input by the user to the above-mentioned execution subject or an image drawn by the user through the canvas tool (canvas) in the above-mentioned execution subject. Here, the ordinate and abscissa of the first angular coordinate are different from the ordinate and abscissa of the second angular coordinate. In practice, first, the above-mentioned execution subject can use the first angular coordinate and the second angular coordinate as the diagonal vertices of the initial annotation frame to be drawn to construct a rectangular initial annotation frame in the target image. Next, the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame may be determined using the coordinate values of the first corner coordinate and the second corner coordinate to obtain a pixel coordinate group.

[0045] Step 202 : Based on the color value corresponding to each pixel point in the target image, determine the initial color value corresponding to each obtained pixel coordinate group.

[0046] In some embodiments, the execution entity may determine the initial color value corresponding to each obtained pixel coordinate group based on the color value corresponding to each pixel in the target image. Here, the color value corresponding to each pixel in the target image may be a pre-acquired color value of each pixel in the target image. Here, the color value format may be a three-primary color (Red, Green, Blue, RGB) color value format.

[0047] In practice, based on the color value corresponding to each pixel in the target image, the execution entity may determine the initial color value corresponding to each pixel coordinate group obtained by the following steps:

[0048] The first step is to determine the color value of the pixel point corresponding to each pixel coordinate in the above pixel coordinate group to obtain a color value group. For example, the color value of the pixel point corresponding to the pixel coordinate (15, 20) can be (255, 250, 240).

[0049] In the second step, the average value of each color value in the color value group is determined as the initial color value of the pixel coordinate group. For example, the color value group can be: (255, 250, 240), (187, 255, 255), (174, 238, 238), (152, 245, 255). The average value "192" of the first numerical value (R value) "255, 187, 174, 152" of each color value in the color value group can be determined as the first numerical value (R value) of the initial color value. The average value "247" of the second numerical value (G value) "250, 255, 238, 245" of each color value in the color value group can be determined as the second numerical value (G value) of the initial color value. The average value "247" of the third numerical value (B value) "240, 255, 238, 255" of each color value in the color value group can be determined as the third numerical value (B value) of the initial color value. Thus, the initial color value (192, 247, 247) of the above pixel coordinate group can be obtained.

[0050] Step 203: For the first angle coordinate and the second angle coordinate, perform the following processing steps:

[0051] Step 2031 : performing movement processing on the first angular coordinate and the second angular coordinate respectively to obtain a first movement angular coordinate and a second movement angular coordinate.

[0052] In some embodiments, the execution entity may perform movement processing on the first angular coordinate and the second angular coordinate, respectively, to obtain a first moved angular coordinate and a second moved angular coordinate. Here, the movement processing may refer to shifting the ordinate and abscissa of the first angular coordinate and the ordinate and abscissa of the second angular coordinate, respectively, by a preset value. The direction of the coordinate movement is not specified. The preset value is less than the absolute value of the difference between the ordinate of the first angular coordinate and the ordinate of the second angular coordinate, and less than the absolute value of the difference between the abscissa of the first angular coordinate and the abscissa of the second angular coordinate. In practice, the execution entity may shift the ordinate and abscissa of the first angular coordinate in the positive direction of the coordinate axis by a preset value to obtain the first moved angular coordinate. And shift the ordinate and abscissa of the second angular coordinate in the positive direction of the coordinate axis by a preset value to obtain the second moved angular coordinate. In practice, the execution entity may also shift the ordinate and abscissa of the first angular coordinate in the negative direction of the coordinate axis by a preset value to obtain the first moved angular coordinate. And the ordinate and abscissa included in the second angular coordinate are moved along the coordinate axis in the negative direction by a preset value, thereby obtaining the second moved angular coordinate. For example, the first angular coordinate may be (25, 52), and the ordinate "25" and abscissa "52" included in the first angular coordinate may be moved along the coordinate axis in the positive direction by a preset value "1", thereby obtaining the first moved angular coordinate (26, 53). For example, the second angular coordinate may be (63, 9), and the ordinate "63" and abscissa "9" included in the second angular coordinate may be moved along the coordinate axis in the positive direction by a preset value "1", thereby obtaining the second moved angular coordinate (64, 10).

[0053] Step 2032 : Based on the first moving angle coordinate and the second moving angle coordinate, determine the color value difference between the moving color value corresponding to each moving annotation box boundary line and the corresponding initial color value.

[0054] In some embodiments, the execution entity may determine a color value difference between a moving color value corresponding to each moving annotation box boundary line and a corresponding initial color value based on the first moving angle coordinate and the second moving angle coordinate.

[0055] In practice, first, a rectangular moving annotation box can be constructed in the target image with the first moving angle coordinate and the second moving angle coordinate as diagonal vertices.

[0056] Then, the execution entity may determine the color value difference between the moving color value corresponding to each moving annotation box boundary line and the corresponding initial color value through the following steps:

[0057] The first step is to determine the pixel coordinates of each pixel point included in the boundary line of the moving annotation box as the moving pixel coordinates to obtain a moving pixel coordinate group.

[0058] In the second step, the color value of the pixel point corresponding to each moving pixel coordinate in the moving pixel coordinate group is determined as the target color value to obtain a target color value group.

[0059] The third step is to determine the average value of each target color value in the target color value group as the moving color value of the moving pixel coordinate group. Here, the implementation method of determining the moving color value can refer to the implementation method in step 202 and will not be repeated here.

[0060] The fourth step is to determine the color value difference between the above-mentioned moving color value and the initial color value of the initial annotation box boundary line corresponding to the above-mentioned moving annotation box boundary line. Here, the orientation of the above-mentioned initial annotation box boundary line in the initial annotation box is the same as the orientation of the above-mentioned moving annotation box boundary line in the moving annotation box. For example, if the moving annotation box boundary line is the left border boundary line of the above-mentioned moving annotation box, then the initial annotation box boundary line corresponding to the above-mentioned moving annotation box boundary line is the left border boundary line of the initial annotation box. In practice, the above-mentioned execution entity can determine the color value difference between the above-mentioned moving color value and the initial color value of the initial annotation box boundary line corresponding to the above-mentioned moving annotation box boundary line through various color value difference calculation formulas. For example, the color value difference calculation formula can be: Euclidean distance formula, cosine distance formula.

[0061] Step 204 : In response to the determined color value difference values being greater than or equal to a preset threshold, the target image including the moving annotation frame is determined as a target annotated image.

[0062] In some embodiments, the execution entity may determine the target image containing the moving annotation frame as the target annotated image in response to the determined color value difference values being greater than or equal to a preset threshold. The setting of the preset threshold is not limited. For example, the preset threshold may be 2.

[0063] The above-described various embodiments of the present disclosure have the following beneficial effects: Through the image annotation methods of some embodiments of the present disclosure, corrections to user-annotated image regions are achieved, thereby improving the accuracy of image annotation. Specifically, inaccurate image annotations are caused by the user manually dragging the annotation box when correcting the annotated region, which can easily lead to inaccurate image annotations. Based on this, the image annotation methods of some embodiments of the present disclosure first determine the pixel coordinates of each pixel point included in each initial annotation box boundary line of an initial annotation box in a target image based on first and second angular coordinates, thereby obtaining a pixel coordinate group. This facilitates determining the color value corresponding to each pixel coordinate. Next, based on the color value corresponding to each pixel point in the target image, the initial color value corresponding to each obtained pixel coordinate group is determined. This allows the initial color value of the initial annotation box to be determined, facilitating subsequent corrections to the annotation box. Then, the following processing steps are performed on the first and second angular coordinates: First, the first and second angular coordinates are respectively moved to obtain first and second moved angular coordinates. Thus, the two angular coordinates after the movement can be used to construct a moving annotation frame to achieve the correction of the initial annotation frame in the target image. Then, based on the above-mentioned first moving angular coordinates and the above-mentioned second moving angular coordinates, the color value difference between the moving color value corresponding to each moving annotation frame boundary line of the moving annotation frame and the corresponding initial color value is determined. Thus, the similarity between the color value (moving color value) of the moving annotation frame boundary line of the moving annotation frame and the initial color value can be determined. Therefore, when the similarity is low, it means that the color value of the annotation frame boundary line has changed, and the correction of the annotation frame can be completed. Finally, in response to the fact that each of the determined color value difference values is greater than or equal to a preset threshold, the target image containing the above-mentioned moving annotation frame is determined as the target annotation image. Thus, the correction of the image area annotated by the user is achieved, and the accuracy of image annotation is improved.

[0064] Further references Figure 3 , showing some other embodiments of the image annotation method according to the present disclosure. The image annotation method includes the following steps:

[0065] Step 301 : performing color value quantization processing on an image input by a user to generate a quantized image as a target image.

[0066] In some embodiments, the execution subject of the image annotation method (eg Figure 1The computing device 101 shown in the figure can perform color quantization processing on the image input by the user to generate a quantized image as the target image. In practice, the execution entity can perform color quantization processing on the image input by the user using a color quantization algorithm to generate a quantized image as the target image. Here, the color quantization algorithm can be a uniform quantization method or a popularity algorithm.

[0067] In this way, the number of colors in the image can be reduced, making it easier to calculate the color value difference of the marked box in the image.

[0068] Step 302: Obtain the color value corresponding to each pixel in the target image.

[0069] In some embodiments, the execution entity may obtain the color information of the target image input by the user through a wired connection or a wireless connection, wherein the color information includes the color value corresponding to each pixel in the target image.

[0070] Step 303: Receive the first corner coordinate and the second corner coordinate corresponding to the target image input by the user.

[0071] In some embodiments, the execution entity may receive first and second angular coordinates of the target image input by a user. The first and second angular coordinates may be pixel coordinates of two pixels in the target image input by the user, used to determine an initial annotation box in the target image. The ordinate and abscissa of the first angular coordinate are different from the ordinate and abscissa of the second angular coordinate.

[0072] Step 304 : Based on the first corner coordinate and the second corner coordinate, the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image are determined to obtain a pixel coordinate group.

[0073] In some embodiments, the specific implementation of step 304 and the resulting technical effects can be referred to Figure 2 The corresponding step 201 in the embodiments will not be described in detail here.

[0074] Step 305 : Based on the color value corresponding to each pixel point in the target image, determine the initial color value corresponding to each obtained pixel coordinate group.

[0075] In some embodiments, based on the color value corresponding to each pixel in the target image, the execution entity may determine the initial color value corresponding to each pixel coordinate group obtained by the following steps:

[0076] The first step is to determine the color value of the pixel point corresponding to each pixel coordinate in the above pixel coordinate group to obtain a color value group.

[0077] In the second step, based on a preset color value format, each color value in the above color value group is subjected to color value conversion processing to generate a converted color value and obtain a converted color value group. Here, the preset color value format can be a pre-set color format. For example, the preset color value format can be an HSV (Hue, Saturation, Value) format. In practice, the above execution entity can convert each color value in the above color value group into a preset color value format through a color conversion method (for example, a colorsys module) to generate a converted color value and obtain a converted color value group.

[0078] The third step is to determine the median converted color value in the above-mentioned converted color value group as the initial color value corresponding to the above-mentioned pixel coordinate group. In practice, first, the median of the first value included in each converted color value in the above-mentioned converted color value group can be determined as the first value of the initial color value. Then, the median of the second value included in each converted color value in the above-mentioned converted color value group can be determined as the second value of the initial color value. Then, the median of the third value included in each converted color value in the above-mentioned converted color value group can be determined as the third value of the initial color value. Thus, the initial color value corresponding to the above-mentioned pixel coordinate group is obtained. For example, the converted color value group can be: (233, 50, 74), (232, 55, 62), (231, 50, 65), (225, 65, 100), (255, 10, 55). Thus, the median "232" of the first values "233, 232, 231, 225, 255" of the converted color values in the above converted color value group can be determined as the first value of the initial color value. The median "50" of the second values "50, 55, 50, 65, 10" of the converted color values in the above converted color value group can be determined as the second value of the initial color value. The median "65" of the third values "74, 62, 65, 100, 55" of the converted color values in the above converted color value group can be determined as the third value of the initial color value. Thus, the initial color value corresponding to the above pixel coordinate group is (232, 50, 65).

[0079] Therefore, the characteristic of the median, that is, the characteristic of not being affected by extreme values, can be utilized, so that the determined initial color value can accurately represent the color of the boundary line of the initial annotation box.

[0080] Step 306: For the first angular coordinate and the second angular coordinate, perform the following processing steps: perform movement processing on the first angular coordinate and the second angular coordinate respectively to obtain a first moving angular coordinate and a second moving angular coordinate; based on the first moving angular coordinate and the second moving angular coordinate, determine the color value difference between the moving color value corresponding to each moving annotation box boundary line and the corresponding initial color value.

[0081] Step 307 : In response to the determined color value difference values being greater than or equal to a preset threshold, the target image including the moving annotation frame is determined as a target annotated image.

[0082] In some embodiments, the specific implementation of steps 306-307 and the resulting technical effects can be referred to Figure 2 The corresponding steps 203-204 in the embodiments are not described in detail here.

[0083] from Figure 3 It can be seen that with Figure 2 Compared with the description of some corresponding embodiments, Figure 3 In some corresponding embodiments, process 300 can perform color quantization on an image, reducing the number of colors in the image and calculating the color value differences of the labeled frame in the image. Furthermore, by converting the color values into a preset color value format, when the initial labeled frame is modified (i.e., modified into a moving labeled frame), the boundaries of the color changes during the movement of the initial labeled frame can be accurately identified. This improves the accuracy of image annotation.

[0084] Further references Figure 4 , showing some further embodiments of the image annotation method according to the present disclosure. The image annotation method comprises the following steps:

[0085] Step 401 : Based on the first corner coordinate and the second corner coordinate, the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image are determined to obtain a pixel coordinate group.

[0086] Step 402 : Based on the color value corresponding to each pixel point in the target image, determine the initial color value corresponding to each obtained pixel coordinate group.

[0087] In some embodiments, the specific implementation of steps 401-402 and the resulting technical effects can be referred to Figure 2 The corresponding steps 201-202 in the embodiments are not described in detail here.

[0088] Step 403: For the first angle coordinate and the second angle coordinate, perform the following processing steps:

[0089] Step 4031 : Perform movement processing on the first angular coordinate and the second angular coordinate respectively to obtain a first movement angular coordinate and a second movement angular coordinate.

[0090] In some embodiments, the execution entity may perform movement processing on the first angular coordinate and the second angular coordinate respectively through the following steps to obtain a first movement angular coordinate and a second movement angular coordinate:

[0091] In the first step, the ordinate and abscissa of the first angular coordinate are shifted by a preset unit value to obtain a shifted first angular coordinate. Here, the preset unit value can be a preset value for shifting the ordinate and abscissa. For example, the preset unit value can be 1.

[0092] In the second step, in response to the absolute value of the coordinate difference between the above-mentioned moving first angular coordinate and the above-mentioned first angular coordinate being less than or equal to the preset difference, the above-mentioned moving first angular coordinate is determined as the first moving angular coordinate. In practice, first, the above-mentioned execution entity can determine the absolute value of the coordinate difference between the above-mentioned moving first angular coordinate and the above-mentioned first angular coordinate, that is, the absolute value of the coordinate difference. Here, the absolute value of the coordinate difference includes the absolute value of the ordinate difference and the absolute value of the abscissa difference. That is, the above-mentioned execution entity can determine the absolute value of the ordinate difference between the ordinate of the above-mentioned moving first angular coordinate and the ordinate of the above-mentioned first angular coordinate. The above-mentioned execution entity can determine the absolute value of the abscissa difference between the abscissa of the above-mentioned moving first angular coordinate and the abscissa of the above-mentioned first angular coordinate.

[0093] In the third step, the ordinate and abscissa of the second angular coordinate are respectively moved by preset unit values to obtain the moved second angular coordinate.

[0094] In the fourth step, in response to the absolute value of the coordinate difference between the second moving angular coordinate and the second angular coordinate being less than or equal to the preset difference, the second moving angular coordinate is determined as the second moving angular coordinate. The specific implementation of the fourth step can refer to the description of the second step above.

[0095] Step 4032 : Based on the first moving angle coordinate and the second moving angle coordinate, determine the color value difference between the moving color value corresponding to each moving annotation box boundary line and the corresponding initial color value.

[0096] In some embodiments, based on the first moving angle coordinate and the second moving angle coordinate, the execution entity may determine the color value difference between the moving color value corresponding to each moving annotation box boundary line and the corresponding initial color value by the following steps:

[0097] The first step is to construct a moving annotation box based on the first moving angle coordinate and the second moving angle coordinate. In practice, the execution entity can construct the moving annotation box using the first moving angle coordinate and the second moving angle coordinate as the pixel coordinates of the diagonal vertices of the annotation box to be constructed.

[0098] In the second step, for each moving annotation frame boundary line in the moving annotation frame, the pixel coordinates of each pixel point included in the moving annotation frame boundary line are determined as moving pixel coordinates to obtain a moving pixel coordinate group.

[0099] The third step is to determine the moving color value corresponding to each moving pixel coordinate group based on the color value corresponding to each pixel point in the target image.

[0100] In practice, the third step includes the following sub-steps:

[0101] The first sub-step is to determine the color value of the pixel point corresponding to each pixel coordinate in the above-mentioned moving pixel coordinate group as the moving pixel color value, and obtain the moving pixel color value group.

[0102] In the second sub-step, based on a preset color value format, each moving pixel color value in the above-mentioned moving pixel color value group is subjected to color value conversion processing to generate a converted moving pixel color value, thereby obtaining a converted moving pixel color value group. Here, the preset color value format may be a pre-set color format. For example, the preset color value format may be an HSV (Hue, Saturation, Value) format. In practice, the above-mentioned execution subject may perform color value conversion processing on each moving pixel color value in the above-mentioned moving pixel color value group by a color conversion method (for example, a colorsys module) to generate a converted moving pixel color value, thereby obtaining a converted moving pixel color value group.

[0103] The third sub-step is to determine the target converted moving pixel color value as the moving color value corresponding to the above moving pixel coordinate group. The target converted moving pixel color value is the median converted moving pixel color value in the above converted moving pixel color value group. For the specific implementation of the third sub-step, please refer to Figure 3 Step 305 in the corresponding embodiments will not be described again here.

[0104] The fourth step is to determine the color value difference between the moving color value corresponding to each moving annotation box boundary line of the above-mentioned moving annotation box and the corresponding initial color value. Here, the orientation of the initial annotation box boundary line corresponding to the above-mentioned initial color value in the initial annotation box is the same as the orientation of the above-mentioned moving annotation box boundary line in the moving annotation box. For example, the moving annotation box boundary line is the left border boundary line of the above-mentioned moving annotation box, and the initial annotation box boundary line corresponding to the above-mentioned initial color value is the left border boundary line of the initial annotation box. In practice, the above-mentioned execution entity can determine the color value difference between the moving color value corresponding to each moving annotation box boundary line of the above-mentioned moving annotation box and the corresponding initial color value through various color value difference calculation formulas. For example, the color value difference calculation formula can be: Euclidean distance formula, cosine distance formula.

[0105] In step 404 , in response to the determined color value difference values being less than the preset threshold and the loop count value being an odd number, the sum of the preset unit value and the preset value is used as the preset unit value, and the above processing steps are executed again.

[0106] In some embodiments, in response to the determined color value difference values being less than the preset threshold and the loop count being an odd number, the execution entity may use the sum of the preset unit value and the preset value as the preset unit value and execute the processing step again. The setting of the preset value is not limited. For example, the preset value may be 1. The initial value of the loop count is 0. The loop count may count the number of times the processing step is repeated, with the loop count increasing by 1 each time the processing step is executed.

[0107] In step 405 , in response to the determined color value difference values being smaller than the preset threshold and the loop count value being an even number, the opposite of the preset unit value is used as the preset unit value, and the above processing steps are executed again.

[0108] In some embodiments, in response to the determined color value difference values being less than the preset threshold and the loop count being an even number, the execution entity may use the opposite of the preset unit value as the preset unit value and execute the processing step again. The loop count may be initialized to 0. The loop count may count the number of times the processing step is repeated, with the loop count increasing by 1 each time the processing step is executed.

[0109] Optionally, in response to the determined color value difference values not all being greater than or equal to the color value difference value of the preset threshold, the following moving step is performed for each of the color value difference values:

[0110] In the first step, the color value difference values greater than or equal to the preset threshold value among the above color value difference values are determined as target color value difference values to obtain a target color value difference value group.

[0111] In some embodiments, the execution entity may, in response to the presence of a color value difference value greater than or equal to the preset threshold value among the determined color value difference values, determine the color value difference value greater than or equal to the preset threshold value among the determined color value difference values as the target color value difference value, thereby obtaining a target color value difference value group.

[0112] In the second step, the initial annotation box boundary line corresponding to each target color value difference value in the target color value difference value group is determined as a fixed initial annotation box boundary line to obtain a fixed initial annotation box boundary line group.

[0113] In some embodiments, the execution entity may determine the initial annotation box boundary line of the initial annotation box corresponding to each target color value difference value in the target color value difference value group as a fixed initial annotation box boundary line to obtain a fixed initial annotation box boundary line group.

[0114] In the third step, the initial annotation frame boundary lines that meet the target condition among the initial annotation frame boundary lines are determined as the initial annotation frame boundary lines to be adjusted, thereby obtaining a group of initial annotation frame boundary lines to be adjusted. The target condition is that the initial annotation frame boundary lines are different from the fixed initial annotation frame boundary lines in the fixed initial annotation frame boundary line group.

[0115] In the fourth step, the sub-coordinates in the initial angular coordinates corresponding to each initial labeling frame boundary line to be adjusted in the above-mentioned initial labeling frame boundary line group to be adjusted are determined as the sub-coordinates to be moved. Here, the initial angular coordinates can be the above-mentioned first angular coordinates or the above-mentioned second angular coordinates. Here, the sub-coordinates in the initial angular coordinates can be the ordinate or abscissa of the initial angular coordinates. In practice, for each initial labeling frame boundary line to be adjusted in the above-mentioned initial labeling frame boundary line group to be adjusted, in response to the above-mentioned first angular coordinate being the upper left corner vertex of the above-mentioned initial labeling frame, and the second angular coordinate being the lower right corner vertex of the above-mentioned initial labeling frame, according to the boundary line type of the above-mentioned initial labeling frame boundary line to be adjusted, the sub-coordinates in the initial angular coordinates corresponding to the above-mentioned initial labeling frame boundary line to be adjusted are determined. Here, the boundary line type can include: the left side of the initial labeling frame, the right side of the initial labeling frame, the upper side of the initial labeling frame, and the lower side of the initial labeling frame. For example, when the boundary line type of the initial labeling frame boundary line to be adjusted is the left side of the initial labeling frame, the first angular coordinate can be determined as the initial angular coordinate corresponding to the initial labeling frame boundary line to be adjusted, and the horizontal coordinate of the first angular coordinate can be determined as the sub-coordinate in the initial angular coordinate corresponding to the initial labeling frame boundary line to be adjusted. For another example, when the boundary line type of the initial labeling frame boundary line to be adjusted is the right side of the initial labeling frame, the second angular coordinate can be determined as the initial angular coordinate corresponding to the initial labeling frame boundary line to be adjusted, and the horizontal coordinate of the second angular coordinate can be determined as the sub-coordinate in the initial angular coordinate corresponding to the initial labeling frame boundary line to be adjusted. When the boundary line type of the initial labeling frame boundary line to be adjusted is the upper side of the initial labeling frame, the first angular coordinate can be determined as the initial angular coordinate corresponding to the initial labeling frame boundary line to be adjusted, and the vertical coordinate of the first angular coordinate can be determined as the sub-coordinate in the initial angular coordinate corresponding to the initial labeling frame boundary line to be adjusted. In practice, the sub-coordinate to be moved of the initial labeling frame boundary line to be adjusted can be determined based on the vertices actually corresponding to the first angular coordinate and the second angular coordinate, and the boundary line type actually corresponding to the initial labeling frame boundary line to be adjusted.

[0116] Step 5: Update the target values of the sub-coordinates to be moved in the first angular coordinate and the sub-coordinates to be moved in the second angular coordinate using the first angular coordinate and the second angular coordinate to obtain first and second updated angular coordinates. The initial value of the target value is the opposite of the preset unit value.

[0117] In step 6, based on the first updated angle coordinate and the second updated angle coordinate, a color difference between the boundary color values corresponding to the label frame boundary lines of the updated label frame corresponding to the set of initial label frame boundary lines to be adjusted and the corresponding initial color values is determined as the updated color difference value. The implementation of step 6 can be specifically described in step 4032.

[0118] Step 7: Add 1 to the moving step loop count, where the initial value of the moving step loop count is 0.

[0119] Optionally, in response to the determined updated color value difference values not all being greater than or equal to the preset threshold, the updated color value difference values are used as the color value difference values, and in response to the loop count of the moving step being an odd number, the sum of the target value and the preset value is used as the target value, and the moving step is performed again.

[0120] Optionally, in response to the determined updated color value difference values not all being greater than or equal to the updated color value difference value of the preset threshold, the updated color value difference values are used as the color value difference values, and in response to the loop count of the moving step being an even number, the opposite of the target value is used as the target value, and the moving step is performed again.

[0121] Step 406 : In response to the determined color value difference values being greater than or equal to a preset threshold, the target image including the moving annotation frame is determined as a target annotated image.

[0122] In some embodiments, the specific implementation of step 406 and the resulting technical effects can be referred to Figure 2 Step 204 in the corresponding embodiments will not be described in detail here.

[0123] from Figure 4 It can be seen that with Figure 2 Compared with the description of some corresponding embodiments, Figure 4 In some corresponding embodiments, the process 400 may continuously move the initial annotation frame within a preset movable range, so that the moved annotation frame is located at the boundary of the color change, thereby completing the correction of the image annotation frame.

[0124] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an image annotation device. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0125] like Figure 5As shown, the image tagging apparatus 500 of some embodiments includes: a coordinate determination unit 501 , a color value determination unit 502 , a movement unit 503 and an image determination unit 504 . The coordinate determination unit 501 is configured to determine the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image based on the first angular coordinate and the second angular coordinate to obtain a pixel coordinate group, wherein the first angular coordinate and the second angular coordinate are the pixel coordinates of two diagonal vertices of the initial annotation frame; the color value determination unit 502 is configured to determine the initial color value corresponding to each obtained pixel coordinate group based on the color value corresponding to each pixel point in the target image; the movement unit 503 is configured to perform the following processing steps on the first angular coordinate and the second angular coordinate: respectively move the first angular coordinate and the second angular coordinate to obtain first moved angular coordinates and second moved angular coordinates; and determine a color value difference between a moved color value corresponding to each moving annotation frame boundary line of the moving annotation frame and the corresponding initial color value based on the first moved angular coordinate and the second moved angular coordinate; and the image determination unit 504 is configured to determine the target image containing the moving annotation frame as the target annotation image in response to each determined color value difference being greater than or equal to a preset threshold.

[0126] Optionally, before the coordinate determination unit 501, the device 500 also includes: a color value quantization unit, configured to perform color value quantization processing on the image input by the user to generate a quantized image as a target image; an acquisition unit, configured to obtain the color value corresponding to each pixel point in the above-mentioned target image; and a receiving unit, configured to receive the first angular coordinates and second angular coordinates corresponding to the above-mentioned target image input by the user.

[0127] Optionally, the color value determination unit 502 is further configured to: determine the color value of the pixel point corresponding to each pixel coordinate in the above-mentioned pixel coordinate group to obtain a color value group; based on a preset color value format, perform color value conversion processing on each color value in the above-mentioned color value group to generate a converted color value to obtain a converted color value group; determine the median converted color value in the above-mentioned converted color value group as the initial color value corresponding to the above-mentioned pixel coordinate group.

[0128] Optionally, the moving unit 503 is further configured to: move the ordinate and abscissa of the above-mentioned first angular coordinate by preset unit values respectively to obtain the moved first angular coordinate; in response to the absolute value of the coordinate difference between the above-mentioned moved first angular coordinate and the above-mentioned first angular coordinate being less than or equal to the preset difference, determine the above-mentioned moved first angular coordinate as the first moved angular coordinate; move the ordinate and abscissa of the above-mentioned second angular coordinate by preset unit values respectively to obtain the moved second angular coordinate; in response to the absolute value of the coordinate difference between the above-mentioned moved second angular coordinate and the above-mentioned second angular coordinate being less than or equal to the preset difference, determine the above-mentioned moved second angular coordinate as the second moved angular coordinate.

[0129] Optionally, the moving unit 503 is further configured to: construct a moving annotation box based on the above-mentioned first moving angle coordinates and the above-mentioned second moving angle coordinates; for each moving annotation box boundary line in the above-mentioned moving annotation box, determine the pixel coordinates of each pixel point included in the above-mentioned moving annotation box boundary line as the moving pixel coordinates to obtain a moving pixel coordinate group; based on the color value corresponding to each pixel point in the above-mentioned target image, determine the moving color value corresponding to each obtained moving pixel coordinate group; determine the color value difference between the moving color value corresponding to each moving annotation box boundary line of the above-mentioned moving annotation box and the corresponding initial color value.

[0130] Optionally, the moving unit 503 is further configured to: determine the color value of the pixel point corresponding to each pixel coordinate in the above-mentioned moving pixel coordinate group as the moving pixel color value, and obtain a moving pixel color value group; based on a preset color value format, perform color value conversion processing on each moving pixel color value in the above-mentioned moving pixel color value group to generate a converted moving pixel color value, and obtain a converted moving pixel color value group; determine the target converted moving pixel color value as the moving color value corresponding to the above-mentioned moving pixel coordinate group, wherein the above-mentioned target converted moving pixel color value is the median converted moving pixel color value in the above-mentioned converted moving pixel color value group.

[0131] Optionally, the device 500 also includes: a first processing unit, configured to, in response to the determined color value difference values being less than the above-mentioned preset threshold value and the loop count value being an odd number, take the sum of the above-mentioned preset unit value and the preset value as the preset unit value, and execute the above-mentioned processing steps again.

[0132] Optionally, the device 500 also includes: a second processing unit, configured to, in response to the determined color value difference values being less than the above-mentioned preset threshold value and the loop count value being an even number, use the opposite number of the above-mentioned preset unit value as the preset unit value and execute the above-mentioned processing steps again.

[0133] It is understood that the units described in the device 500 are similar to those in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be repeated here.

[0134] Reference below Figure 6 , which shows an electronic device (eg, Figure 1The electronic devices in some embodiments of the present disclosure may include, but are 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), and fixed terminals such as digital TVs and desktop computers. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0135] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 are also stored in the RAM 603. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0136] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as needed.

[0137] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network via the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are performed.

[0138] It should be noted that the computer-readable medium described in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0139] In some embodiments, the client and server can communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0140] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device is caused to: determine the pixel coordinates of each pixel point included in each initial annotation box boundary line of the initial annotation box in the target image based on first angular coordinates and second angular coordinates to obtain a pixel coordinate group, wherein the first angular coordinates and the second angular coordinates are the pixel coordinates of two diagonal vertices of the initial annotation box; determine the initial color value corresponding to each obtained pixel coordinate group based on the color value corresponding to each pixel point in the target image; and perform the following processing steps for the first angular coordinates and the second angular coordinates: respectively perform movement processing on the first angular coordinates and the second angular coordinates to obtain first moved angular coordinates and second moved angular coordinates; determine a color value difference between a moved color value corresponding to each moving annotation box boundary line of the moving annotation box and the corresponding initial color value based on the first moved angular coordinates and the second moved angular coordinates; and in response to each determined color value difference value being greater than or equal to a preset threshold, determine the target image containing the moving annotation box as the target annotation image.

[0141] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0142] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0143] The units described in some embodiments of the present disclosure may be implemented by software or by hardware. The units described may also be provided in a processor. For example, they may be described as follows: a processor includes a coordinate determination unit, a color value determination unit, a movement unit, and an image determination unit. The names of these units do not, in some cases, constitute limitations on the units themselves. For example, the color value determination unit may also be described as "a unit that determines the initial color value corresponding to each pixel coordinate group obtained based on the color value corresponding to each pixel point in the target image."

[0144] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0145] The above description is only an illustration of some preferred embodiments of the present disclosure and the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure.

Claims

1. An image annotation method, comprising: Determining pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image based on the first corner coordinate and the second corner coordinate to obtain a pixel coordinate group, wherein the first corner coordinate and the second corner coordinate are the pixel coordinates of two diagonal vertices of the initial annotation frame; Determining an initial color value corresponding to each pixel coordinate group based on the color value corresponding to each pixel point in the target image; For the first angular coordinate and the second angular coordinate, perform the following processing steps: Performing movement processing on the first angular coordinate and the second angular coordinate respectively to obtain a first moving angular coordinate and a second moving angular coordinate; Determining a color value difference between a moving color value corresponding to each moving annotation box boundary line and a corresponding initial color value based on the first moving angle coordinate and the second moving angle coordinate; In response to the determined color value difference values being greater than or equal to a preset threshold, determining the target image including the mobile annotation frame as a target annotated image; The step of determining the color value difference between the moving color value corresponding to each moving annotation box boundary line and the corresponding initial color value based on the first moving angle coordinate and the second moving angle coordinate includes: Constructing a moving annotation box based on the first moving angle coordinate and the second moving angle coordinate; For each moving annotation box boundary line in the moving annotation box, determining pixel coordinates of each pixel point included in the moving annotation box boundary line as moving pixel coordinates to obtain a moving pixel coordinate group; Determining a moving color value corresponding to each obtained moving pixel coordinate group based on a color value corresponding to each pixel point in the target image; A color value difference between a moving color value corresponding to each moving mark box boundary line of the moving mark box and a corresponding initial color value is determined.

2. The method according to claim 1, wherein Before determining the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image based on the first angular coordinate and the second angular coordinate to obtain the pixel coordinate group, the method further includes: Performing color value quantization processing on the image input by the user to generate a quantized image as a target image; Obtaining the color value corresponding to each pixel in the target image; Receive first corner coordinates and second corner coordinates corresponding to the target image input by a user.

3. The method according to claim 1, wherein The determining, based on the color value corresponding to each pixel point in the target image, the initial color value corresponding to each obtained pixel coordinate group includes: Determine the color value of the pixel point corresponding to each pixel coordinate in the pixel coordinate group to obtain a color value group; Based on a preset color value format, performing color value conversion processing on each color value in the color value group to generate a converted color value, thereby obtaining a converted color value group; The median converted color value in the converted color value group is determined as the initial color value corresponding to the pixel coordinate group.

4. The method according to claim 1, wherein The performing movement processing on the first angular coordinate and the second angular coordinate respectively to obtain the first movement angular coordinate and the second movement angular coordinate includes: Shifting the ordinate and abscissa of the first angular coordinate by preset unit values respectively to obtain a shifted first angular coordinate; In response to an absolute value of a coordinate difference between the moving first angular coordinate and the first angular coordinate being less than or equal to a preset difference, determining the moving first angular coordinate as a first moving angular coordinate; Shifting the ordinate and abscissa of the second angular coordinate by a preset unit value to obtain a shifted second angular coordinate; In response to the absolute value of the coordinate difference between the moving second angular coordinate and the second angular coordinate being less than or equal to the preset difference, the moving second angular coordinate is determined as the second moving angular coordinate.

5. The method according to claim 1, wherein The determining, based on the color value corresponding to each pixel point in the target image, the moving color value corresponding to each moving pixel coordinate group obtained includes: Determine the color value of the pixel point corresponding to each pixel coordinate in the moving pixel coordinate group as the moving pixel color value to obtain a moving pixel color value group; Based on a preset color value format, performing color value conversion processing on each moving pixel color value in the moving pixel color value group to generate a converted moving pixel color value, thereby obtaining a converted moving pixel color value group; The target converted moving pixel color value is determined as the moving color value corresponding to the moving pixel coordinate group, wherein the target converted moving pixel color value is the median converted moving pixel color value in the converted moving pixel color value group.

6. The method according to claim 4, wherein: The method further comprises: In response to the determined color value difference values being smaller than the preset threshold value and the loop count value being an odd number, the sum of the preset unit value and the preset value is used as the preset unit value, and the processing step is performed again.

7. The method according to claim 4, wherein: The method further comprises: In response to the determined color value difference values being smaller than the preset threshold value and the loop count value being an even number, the opposite of the preset unit value is used as the preset unit value, and the processing step is performed again.

8. An image annotation device, comprising: a coordinate determining unit configured to determine the pixel coordinates of each pixel point included in each initial annotation frame boundary line of the initial annotation frame in the target image based on the first angular coordinate and the second angular coordinate to obtain a pixel coordinate group, wherein the first angular coordinate and the second angular coordinate are the pixel coordinates of two diagonal vertices of the initial annotation frame; a color value determining unit configured to determine an initial color value corresponding to each obtained pixel coordinate group based on the color value corresponding to each pixel point in the target image; The moving unit is configured to perform the following processing steps on the first angular coordinate and the second angular coordinate: performing movement processing on the first angular coordinate and the second angular coordinate respectively to obtain a first moving angular coordinate and a second moving angular coordinate; and determining a color value difference between a moving color value corresponding to each moving annotation box boundary line and a corresponding initial color value based on the first moving angular coordinate and the second moving angular coordinate; the moving unit is further configured to: Constructing a moving annotation box based on the first moving angle coordinate and the second moving angle coordinate; For each moving annotation box boundary line in the moving annotation box, determining pixel coordinates of each pixel point included in the moving annotation box boundary line as moving pixel coordinates to obtain a moving pixel coordinate group; Determining a moving color value corresponding to each obtained moving pixel coordinate group based on a color value corresponding to each pixel point in the target image; Determine a color value difference between a moving color value corresponding to each moving markup box boundary line and a corresponding initial color value of the moving markup box; The image determination unit is configured to determine the target image containing the moving annotation frame as the target annotated image in response to the determined color value difference values being greater than or equal to a preset threshold.

9. The image annotation apparatus according to claim 8, wherein: Before the coordinate determination unit, the image annotation device further includes: a color value quantization unit configured to perform color value quantization processing on an image input by a user to generate a quantized image as a target image; an acquisition unit, configured to acquire a color value corresponding to each pixel in the target image; The receiving unit is configured to receive the first corner coordinate and the second corner coordinate corresponding to the target image input by the user.

10. The image annotation apparatus according to claim 8, wherein: The color value determination unit is further configured to: Determine the color value of the pixel point corresponding to each pixel coordinate in the pixel coordinate group to obtain a color value group; Based on a preset color value format, performing color value conversion processing on each color value in the color value group to generate a converted color value, thereby obtaining a converted color value group; The median converted color value in the converted color value group is determined as the initial color value corresponding to the pixel coordinate group.

11. The image tagging apparatus according to claim 8, wherein: The mobile unit is further configured to: Shifting the ordinate and abscissa of the first angular coordinate by preset unit values respectively to obtain a shifted first angular coordinate; In response to an absolute value of a coordinate difference between the moving first angular coordinate and the first angular coordinate being less than or equal to a preset difference, determining the moving first angular coordinate as a first moving angular coordinate; Shifting the ordinate and abscissa of the second angular coordinate by a preset unit value to obtain a shifted second angular coordinate; In response to the absolute value of the coordinate difference between the moving second angular coordinate and the second angular coordinate being less than or equal to the preset difference, the moving second angular coordinate is determined as the second moving angular coordinate.

12. The image annotation device according to claim 11, wherein: The mobile unit is further configured to: Determine the color value of the pixel point corresponding to each pixel coordinate in the moving pixel coordinate group as the moving pixel color value to obtain a moving pixel color value group; Based on a preset color value format, performing color value conversion processing on each moving pixel color value in the moving pixel color value group to generate a converted moving pixel color value, thereby obtaining a converted moving pixel color value group; The target converted moving pixel color value is determined as the moving color value corresponding to the moving pixel coordinate group, wherein the target converted moving pixel color value is the median converted moving pixel color value in the converted moving pixel color value group.

13. The image tagging apparatus according to claim 11, wherein: The image annotation device further includes: The first processing unit is configured to, in response to the determined color value difference values being less than the preset threshold and the loop count value being an odd number, take the sum of the preset unit value and the preset value as the preset unit value and execute the processing step again.

14. The image tagging apparatus according to claim 11, wherein: The image annotation device further includes: The second processing unit is configured to, in response to the determined color value difference values being less than the preset threshold and the loop count value being an even number, use the opposite of the preset unit value as the preset unit value and execute the processing step again.

15. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon; When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

16. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data labeling method and device, terminal equipment and storage medium

    CN112967359A