An interactive labeling method for objects in images
By storing and compressing image data on the server side, and rendering and marking on the client side, the problem of multi-person collaborative marking and low loading efficiency of large image data in the existing technology is solved, and multi-person collaborative image marking in a network environment is realized. and hardware performance optimization.
Patent Information
- Application Number
- CN202110942463.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-17
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-08-17
AI Technical Summary
Existing image labeling tools are difficult to achieve collaborative labeling by multiple people, and large-size and large-volume image data are difficult to load smoothly on devices with low hardware configuration, affecting labeling efficiency.
Adopting a networked architecture, the image data is stored on the server side. The server compresses and scales the image to realize collaborative labeling by multiple people. Through client rendering and labeling, the labeling result coordinates are converted to the original image, which reduces the client hardware. Performance requirements.
It realizes multi-person collaborative image labeling in a network environment, reduces the hardware resource requirements of the client, and ensures the reliability of the labeling results.
Smart Images

Figure CN113763513B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision, and more specifically to an interactive marking method for a target object in an image. Background Art
[0002] Image labeling is a preprocessing process that assists in detecting objects in images. During this process, users can click, select, or plot specific objects in the image so that the object can be further processed by the computer. Image labeling tools can be used to create training data sets and are widely used in the fields of artificial intelligence and machine learning.
[0003] Currently, widely used image labeling tools include LabelMe (http: / / labelme.csail.mit.edu / Release3.0) and LabelImg (https: / / github.com / tzutalin / labelImg). LabelImg supports regular rectangle labeling, and the labeling results are saved as xml files in PASCAL VOC format by default. LabelMe supports polygon labeling by default, and also supports regular rectangle, point, line, and circle labeling. The labeling results are saved as json files by default.
[0004] Both of these tools require downloading the installation package for local installation, and can only open local image data, making it difficult to achieve collaborative labeling by multiple people. At the same time, when the amount of image data is large and the size of a single image is large, the local device needs a large storage space and memory to ensure smooth loading and labeling of the image.
[0005] Therefore, it is necessary to develop an image tagging method that can realize multi-person collaborative image tagging in a network environment and reduce the hardware performance requirements of local devices for large-size and large-volume image data. Summary of the invention
[0006] The purpose of the present invention is to provide an interactive marking method for targets in images, to realize multi-person collaborative image marking in a network environment, and at the same time to hand over the image storage and compression tasks to the server to reduce the hardware performance requirements of the client; it solves the problem that the marking tools and image data of existing image marking tools need to be installed or stored locally, making it difficult to realize multi-person collaborative marking, and when the amount of image data is large, the image is difficult to load smoothly on a device with low hardware configuration, affecting the marking efficiency.
[0007] In order to achieve the above object, the technical solution of the present invention is: an interactive marking method for a target object in an image, characterized in that: it comprises the following steps:
[0008] Step 1: Client image data loading;
[0009] The images that need to be marked are stored on the server side, and the images are published as services to the outside world. A networked architecture is adopted, and the image data is placed on the server side for external access. The marking results are stored in the database, which can realize collaborative marking by multiple people.
[0010] When the server-side image is requested to be loaded by the client, the server returns the compressed and first scaled version of the original image; after compression, the amount of data is reduced, and it can be better transmitted on the network under the premise that the target object is clearly identifiable, realizing multi-person collaborative tagging;
[0011] Step 2: Client image rendering and marking;
[0012] The client requests the image to be marked from the server (the image is a compressed and first scaled version of the original image), and renders the scaled image in the marked area;
[0013] After rendering is completed, the client performs interactive marking operations on the target objects in the image within the marking area to form a marking result;
[0014] Step 3: Marking result coordinate conversion and storage;
[0015] The point coordinates that make up the client marking result are local relative coordinates within the marking area and need to be converted to the pixel coordinates of the original image on the server.
[0016] The point coordinates that make up the client marking result are converted to the pixel coordinates of the server original image, and the converted results are stored in the database by calling the server interface (such as Figure 1 As shown); through the coordinate transformation of the marking result, the marking result of the target object is accurately calculated from the coordinates on the compressed image to the coordinates on the original image, thereby ensuring the reliability of the marking result.
[0017] In the above technical solution, in step 2, the interactive marking operation includes interactive clicking, box selection or drawing, etc.
[0018] In the above technical solution, in step 2, during the marking process, the image can be translated or scaled relative to the marked area.
[0019] In the above technical solution, if Figure 2 As shown, the point coordinates that make up the client marking result are converted to the pixel coordinates of the server original image. The specific method is as follows:
[0020] Assume that the first zoom factor of the original image is r, the second zoom factor in the client marked area is R, and the offset of the upper left corner of the second zoomed image relative to the upper left corner of the marked area is (Δx, Δy);
[0021] The relative coordinates of the points that make up the client marking result in the marking area are (X0, Y0), and the pixel coordinates of the corresponding points in the server original image are (x0, y0). The conversion relationship satisfies the following formula:
[0022]
[0023] In formula (1), when R>1, it means that the image is reduced in size for the second time in the marked area; when R<1, it means that the image is enlarged in the marked area for the second time; when R=1, it means that the image is displayed in the marked area at the original ratio for the second time.
[0024] The above-mentioned methods of compressing and scaling the original image on the server side, rendering the scaled image in the marked area, and storing the converted result in the database by calling the server side interface are all prior arts.
[0025] The present invention has the following advantages:
[0026] 1) It adopts a networked architecture, places image data on the server for external access, and stores the marking results in the database, which enables collaborative marking by multiple people. This overcomes the defects of the existing technology that the marking tools and image data need to be installed or stored locally, making it difficult to achieve collaborative marking by multiple people.
[0027] 2) Through image data compression and scaling on the server side, images are transmitted to the client with smaller data volume and size, effectively reducing the hardware requirements on the client such as network bandwidth, storage capacity and memory size; overcoming the defects of existing image tagging tools that when the image data volume is large, images are difficult to load smoothly on devices with low hardware configuration, affecting the tagging efficiency;
[0028] 3) Through the coordinate transformation of the marking results, the marking results of the target object are accurately calculated from the coordinates on the compressed image to the coordinates on the original image, thus ensuring the reliability of the marking results. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 It is a schematic diagram of the overall technical principle of the present invention.
[0030] Figure 2 Schematic diagram of coordinate transformation of marking results in the present invention.
[0031] Figure 3 Schematic diagram of interactive marking of targets in an embodiment of the present invention.
[0032] Figure 3 From left to right are Figure 3 (1) Figure 3 (2) Figure 3 (3); Figure 3 (1) is the original picture of this embodiment; Figure 3 (2) is the original image of this embodiment after compression and one-time scaling; Figure 3 (3) is the image and marked area after secondary scaling in this embodiment.
[0033] Figure 3 The light grey shading area in the outer circle of the image (3) is the marked area described in step 2. DETAILED DESCRIPTION
[0034] The following is a detailed description of the implementation of the present invention in conjunction with the accompanying drawings, but they do not constitute a limitation of the present invention and are only given as examples. At the same time, the advantages of the present invention are made clearer and easier to understand through the description.
[0035] This technical solution proposes an interactive marking method for targets in images. This method realizes multi-person collaborative image marking in a network environment through steps such as server-side image data compression and publishing, client-side image rendering and marking, and coordinate conversion and storage of marking results. At the same time, the image storage and compression tasks are handed over to the server, reducing the hardware performance requirements of the client.
[0036] Example
[0037] The present invention is now described in detail by taking the application of the present invention to interactive marking of a spherical lamp-shaped target in a certain image as an example, which also has a guiding role in the application of the present invention to interactive marking of targets in other images.
[0038] Based on the image data of a spherical lamp-shaped target, the effect of the test using this technical solution is as follows Figure 3 shown.
[0039] Figure 3 (1) is the original image data obtained by the image acquisition device, in BMP format, with a data volume of 19496KB and a size of 5472×3648. It can be seen that the data of a single original image is large. When the number is large, for traditional local marking, a larger hard disk and memory are required to ensure data storage and fast reading.
[0040] Figure 3 (2) The image data is compressed in jpg format and reduced by 10 times, with a data volume of 31KB and a size of 548 × 365. It can be seen that after compression, the data volume is reduced by more than 600 times. Under the premise that the target object is clearly identifiable, it can be better transmitted on the network to achieve multi-person collaborative tagging.
[0041] Figure 3 (3) The image data is transmitted and displayed in the marked area on the client. In the marked area, the user can zoom in and out and drag and pan the image. A rectangular frame is used to select and mark the spherical lamp-shaped target in the marked area. The marking result is as follows: Figure 3 (3) is shown in the solid line box. The coordinates of the four corner points of the rectangular box are transformed to restore them to the rectangular range in the original image. The final result is as follows Figure 3 (1) is shown in the dashed box.
[0042] This embodiment converts the coordinates of the marking result to accurately reverse-calculate the marking result of the spherical lamp-shaped target from the coordinates on the compressed image to the coordinates on the original image, thereby ensuring the reliability of the marking result.
[0043] Other parts not described belong to the prior art.
Claims
1. An interactive marking method for an object in an image, characterized in that: The following steps are included: Step 1: Client image data loading; The images to be marked are stored on the server side, and the images are published as services. A networked architecture is adopted, and the image data is placed on the server side for external access. The marking results are stored in the database, which can realize collaborative marking by multiple people. When the server-side image is requested to be loaded by the client, the server returns the compressed and first scaled version of the original image. After compression, the data volume is reduced, and it can be transmitted on the network while the target object is clearly identifiable, realizing multi-person collaborative tagging. Step 2: Client image rendering and marking; The client requests the server for the image to be marked, which is a compressed and first scaled version of the original image, and renders the scaled image in the marked area; After rendering is completed, the client performs interactive marking operations on the target objects in the image within the marking area to form a marking result; In step 2, during the marking process, the image is translated or scaled relative to the marked area; Step 3: Marking result coordinate conversion and storage; The point coordinates that make up the client's marking results are local relative coordinates within the marking area. The point coordinates that make up the client's marking results are converted to the pixel coordinates of the server's original image. By calling the server interface, the converted results are stored in the server database. Through the coordinate conversion of the marking results, the marking results of the target object are accurately calculated from the coordinates on the compressed image to the coordinates on the original image, ensuring the reliability of the marking results. Convert the point coordinates that make up the client's marking results to the pixel coordinates of the server's original image. The specific method is as follows: Assume that the first zoom factor of the original image is r, the second zoom factor in the client marked area is R, and the offset of the upper left corner of the second zoomed image relative to the upper left corner of the marked area is (Δx, Δy); The relative coordinates of the points that make up the client marking result in the marking area are (X0, Y0), and the pixel coordinates of the corresponding points in the server original image are (x0, y0). The conversion relationship satisfies the following formula: In formula (1), when R>1, it means that the image is reduced in size for the second time in the marked area; when R<1, it means that the image is enlarged in the marked area for the second time; when R=1, it means that the image is displayed in the marked area at the original ratio for the second time.
2. The interactive marking method for objects in an image according to claim 1, characterized in that: In step 2, the marking operation includes interactive clicking, box selection, and plotting.
