Image data annotation method, device, equipment and readable storage medium
By mapping the labeling area in a high -resolution image to a low resolution image, the problem that the target is difficult to mark in the low -resolution image is solved, the accuracy and efficiency of the data label is improved, and the efficiency of the construction of the training data set is improved. Essence
Patent Information
- Application Number
- CN202010879901.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-08-27
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-08-27
AI Technical Summary
The target objects in low-resolution images are difficult to be manually marked, resulting in poor results in training and recognition models.
By mapping the labeling area in a high -resolution image to a low resolution image, the clear targets in high -resolution images are used to mark the labeling data of low -resolution images.
The accuracy and efficiency of low -resolution image data labeling is improved, the cost and time of manual labeling are reduced, and the construction efficiency of the training data set is significantly improved.
Smart Images

Figure CN111985430B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an image data annotation method, device, equipment and readable storage medium. Background Art
[0002] With the development of image recognition technology, image recognition of vegetation, buildings and other targets based on images taken by high-altitude shooting equipment such as drones and remote sensing satellites has become a hot research direction. At present, in many application scenarios, it is necessary to identify targets based on low-resolution images, and then it is necessary to train an image recognition model based on low-resolution images with target annotations. However, in low-resolution images, such as 10m resolution remote sensing images, targets are often only presented in the form of 1 or 2 pixels, which cannot be distinguished by the human eye. Therefore, it is impossible to annotate low-resolution images with target data. It is obviously difficult to train a target recognition model with good recognition effect without annotated data or with only a small amount of annotated data. Therefore, the annotation of target data in low-resolution images has become a problem that needs to be solved urgently. Summary of the invention
[0003] The main purpose of the present invention is to provide an image data annotation method, device, equipment and readable storage medium, aiming to solve the problem that it is currently difficult to annotate target object data in low-resolution images.
[0004] To achieve the above object, the present invention provides an image data annotation method, which comprises the following steps:
[0005] Acquire a first annotated region in the high-resolution image;
[0006] Mapping the first annotated area to a low-resolution image to be annotated to obtain a second annotated area in the low-resolution image, wherein the low-resolution image and the actual area corresponding to the high-resolution image are the same, and the resolution of the low-resolution image is lower than that of the high-resolution image;
[0007] The second annotated area in the low-resolution image is annotated to obtain image annotated data.
[0008] Furthermore, the step of mapping the first annotated area to the low-resolution image to be annotated to obtain the second annotated area in the low-resolution image includes:
[0009] Acquire an absolute coordinate interval corresponding to the first marked area, wherein the absolute coordinate interval is in a preset absolute coordinate system, and each pixel point in the low-resolution image and the high-resolution image obeys the preset absolute coordinate system;
[0010] An area defined by the absolute coordinate interval in the low-resolution image is used as a second marked area.
[0011] Furthermore, the step of mapping the first annotated area to the low-resolution image to be annotated to obtain the second annotated area in the low-resolution image includes:
[0012] Acquire a first relative coordinate interval of the first annotated area, wherein the first relative coordinate interval is in a first preset relative coordinate system constructed based on the high-resolution image;
[0013] According to a mapping relationship between the first preset relative coordinate system and the second preset relative coordinate system, mapping the first relative coordinate interval to a second relative coordinate interval, wherein the second relative coordinate interval is in the second preset relative coordinate system constructed based on the low-resolution image;
[0014] An area defined by the second relative coordinate interval in the low-resolution image is used as a second marked area.
[0015] Furthermore, the step of acquiring the first annotated area in the high-resolution image includes:
[0016] Inputting the high-resolution image into a preset high-resolution image recognition model for recognition processing to obtain each first annotated region in the high-resolution image and an annotation category corresponding to each first annotated region;
[0017] The step of annotating the second annotated area in the low-resolution image to obtain image annotation data comprises:
[0018] Each of the second annotation regions in the low-resolution image is annotated according to the annotation category to obtain image annotation data.
[0019] Furthermore, before the step of acquiring the first annotated area in the high-resolution image, the method further includes:
[0020] Divide the low-resolution total image to be annotated into various image regions;
[0021] Selecting a target image area from each of the image areas in turn as the low-resolution image to be labeled, and acquiring a high-resolution image corresponding to the same actual area as the low-resolution image;
[0022] After the step of annotating the second annotated area in the low-resolution image to obtain image annotation data, the method further includes:
[0023] The image annotation data corresponding to each of the image regions are combined to obtain the image annotation data corresponding to the overall image to be annotated.
[0024] Furthermore, after the step of annotating the second annotated area in the low-resolution image to obtain image annotation data, the step further includes:
[0025] Constructing a training data set according to the plurality of low-resolution images and the image annotation data corresponding to each of the low-resolution images;
[0026] The training data set is used to train a preset image recognition model to obtain a low-resolution image recognition model.
[0027] Furthermore, when the second annotated area includes a vegetation area and a non-vegetation area in the low-resolution image, and the image annotation data includes data characterizing whether each pixel in the low-resolution image belongs to a vegetation area, after the step of using the training data set to train the preset image recognition model to obtain the low-resolution image recognition model, the method further includes:
[0028] The low-resolution image to be identified is input into the low-resolution image recognition model to obtain a semantic segmentation result of the low-resolution image to be identified, wherein the semantic segmentation result includes data characterizing whether each pixel point in the low-resolution image to be identified belongs to a vegetation area.
[0029] To achieve the above object, the present invention provides an image data annotation device, the device comprising:
[0030] An acquisition module, used for acquiring a first marked area in a high-resolution image;
[0031] a mapping module, configured to map the first annotated area to a low-resolution image to be annotated, so as to obtain a second annotated area in the low-resolution image, wherein the actual area corresponding to the low-resolution image is the same as that of the high-resolution image, and the resolution of the low-resolution image is lower than that of the high-resolution image;
[0032] The annotation module is used to annotate the second annotation area in the low-resolution image to obtain image annotation data.
[0033] To achieve the above-mentioned purpose, the present invention also provides an image data annotation device, which includes: a memory, a processor, and an image data annotation program stored in the memory and executable on the processor, wherein the image data annotation program implements the steps of the image data annotation method described above when executed by the processor.
[0034] In addition, to achieve the above-mentioned purpose, the present invention also proposes a computer-readable storage medium, on which an image data annotation program is stored, and when the image data annotation program is executed by a processor, the steps of the image data annotation method described above are implemented.
[0035] In the present invention, by obtaining a first annotation area in a high-resolution image, for a low-resolution image to be annotated corresponding to the same actual area as the high-resolution image, the first annotation area is mapped to the low-resolution image to obtain a second annotation area, and the second annotation area in the low-resolution image is annotated to obtain image annotation data, thereby completing the data annotation of the low-resolution image. In the present invention, the data of the low-resolution image is annotated with the help of the high-resolution image. Since the target object in the high-resolution image is clearly visible, it can be accurately mapped to the low-resolution image, thereby achieving accurate annotation of the target object in the low-resolution image. That is, compared with the existing method of manually annotating low-resolution image data, the data annotation method of the present invention will not have the problem that the target object in the low-resolution image is blurred and cannot be annotated. While improving the accuracy of data annotation, it also realizes an automated image data annotation method. In the scenario where massive image training data is required, the efficiency of constructing the training data set is greatly improved, and the labor cost and time cost are reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 A schematic diagram of the structure of the hardware operating environment involved in the embodiment of the present invention;
[0037] Figure 2 It is a schematic diagram of the flow chart of the first embodiment of the image data annotation method of the present invention;
[0038] Figure 3 It is a functional schematic module diagram of a preferred embodiment of the image data annotation device of the present invention.
[0039] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0040] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0041] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0042] It should be noted that the image data annotation device in the embodiment of the present invention can be a smart phone, a personal computer, a server and other devices, and no specific limitation is made here.
[0043] like Figure 1 As shown, the image data annotation device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0044] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation on the image data annotation device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0045] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and an image data annotation program. The operating system is a program that manages and controls the hardware and software resources of the device and supports the operation of the image data annotation program and other software or programs. Figure 1 In the device shown, the user interface 1003 is mainly used to communicate data with the client; the network interface 1004 is mainly used to establish a communication connection with the server; the processor 1001 can be used to call the image data annotation program stored in the memory 1005 and perform the following operations:
[0046] Acquire a first annotated region in the high-resolution image;
[0047] Mapping the first annotated area to a low-resolution image to be annotated to obtain a second annotated area in the low-resolution image, wherein the low-resolution image and the actual area corresponding to the high-resolution image are the same, and the resolution of the low-resolution image is lower than that of the high-resolution image;
[0048] The second annotated area in the low-resolution image is annotated to obtain image annotated data.
[0049] Furthermore, the step of mapping the first annotated area to the low-resolution image to be annotated to obtain the second annotated area in the low-resolution image includes:
[0050] Acquire an absolute coordinate interval corresponding to the first marked area, wherein the absolute coordinate interval is in a preset absolute coordinate system, and each pixel point in the low-resolution image and the high-resolution image obeys the preset absolute coordinate system;
[0051] An area defined by the absolute coordinate interval in the low-resolution image is used as a second marked area.
[0052] Furthermore, the step of mapping the first annotated area to the low-resolution image to be annotated to obtain the second annotated area in the low-resolution image includes:
[0053] Acquire a first relative coordinate interval of the first annotated area, wherein the first relative coordinate interval is in a first preset relative coordinate system constructed based on the high-resolution image;
[0054] According to a mapping relationship between the first preset relative coordinate system and the second preset relative coordinate system, mapping the first relative coordinate interval to a second relative coordinate interval, wherein the second relative coordinate interval is in the second preset relative coordinate system constructed based on the low-resolution image;
[0055] An area defined by the second relative coordinate interval in the low-resolution image is used as a second marked area.
[0056] Furthermore, the step of acquiring the first annotated area in the high-resolution image includes:
[0057] Inputting the high-resolution image into a preset high-resolution image recognition model for recognition processing to obtain each first annotated region in the high-resolution image and an annotation category corresponding to each first annotated region;
[0058] The step of annotating the second annotated area in the low-resolution image to obtain image annotation data comprises:
[0059] Each of the second annotation regions in the low-resolution image is annotated according to the annotation category to obtain image annotation data.
[0060] Furthermore, before the step of acquiring the first annotated area in the high-resolution image, the processor 1001 may also be used to call the image data annotation program stored in the memory 1005 and perform the following operations:
[0061] Divide the low-resolution total image to be annotated into various image regions;
[0062] Selecting a target image area from each of the image areas in turn as the low-resolution image to be labeled, and acquiring a high-resolution image corresponding to the same actual area as the low-resolution image;
[0063] After the step of annotating the second annotated area in the low-resolution image to obtain image annotation data, the processor 1001 may also be used to call the image data annotation program stored in the memory 1005, and perform the following operations:
[0064] The image annotation data corresponding to each of the image regions are combined to obtain the image annotation data corresponding to the overall image to be annotated.
[0065] Further, after the step of annotating the second annotated area in the low-resolution image to obtain image annotation data, the processor 1001 may also be used to call an image data annotation program stored in the memory 1005, and perform the following operations:
[0066] Constructing a training data set according to the plurality of low-resolution images and the image annotation data corresponding to each of the low-resolution images;
[0067] The training data set is used to train a preset image recognition model to obtain a low-resolution image recognition model.
[0068] Further, when the second annotated area includes a vegetation area and a non-vegetation area in the low-resolution image, and the image annotation data includes data characterizing whether each pixel in the low-resolution image belongs to a vegetation area, after the step of using the training data set to train the preset image recognition model to obtain the low-resolution image recognition model, the processor 1001 can also be used to call the image data annotation program stored in the memory 1005, and perform the following operations:
[0069] The low-resolution image to be identified is input into the low-resolution image recognition model to obtain a semantic segmentation result of the low-resolution image to be identified, wherein the semantic segmentation result includes data characterizing whether each pixel point in the low-resolution image to be identified belongs to a vegetation area.
[0070] Based on the above structure, various embodiments of the image data annotation method are proposed.
[0071] Reference Figure 2 , Figure 2 The flowchart of the first embodiment of the image data annotation method of the present invention is shown in the flowchart. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described can be performed in a different order than here. The execution subject of the image data annotation method of the present invention can be a device such as a smart phone, a personal computer, and a server. The execution subject is omitted in the following embodiments. In this embodiment, the image data annotation method includes:
[0072] Step S10, obtaining a first annotated area in the high-resolution image;
[0073] In this embodiment, the high-resolution image and the low-resolution image are relative, that is, as long as the resolution of the high-resolution image is higher than that of the low-resolution image, there is no specific limit on the resolution of the high-resolution image and the low-resolution image. For example, when the resolution of the low-resolution image is 10m (indicates that one pixel represents a range of 10m*10m of the actual geographical area), the resolution of the high-resolution image can be greater than 10m. It should be noted that the larger the resolution is in numerical value, the lower the resolution is. For example, a resolution of 10m is lower than a resolution of 0.3m.
[0074] In this embodiment, the low-resolution image is annotated with the help of the high-resolution image. Specifically, a high-resolution image can be obtained first. The high-resolution image can be obtained from a remote sensing satellite or from a map software, which is not limited in this embodiment. The first annotated area in the high-resolution image is obtained. Among them, the first annotated area can be a target area or a non-target area in the high-resolution image, and the target object is the target object of image recognition, such as vegetation, buildings or roads, etc. When there are multiple targets, the target area is further specifically divided into areas corresponding to the multiple targets. The first annotated area can be manually marked in the high-resolution image, or it can be determined according to the area mark in the map software. For example, some map software will mark the road area with corresponding road signs.
[0075] The first annotated area can be defined by a coordinate interval in a relative coordinate system such as a pixel interval in a high-resolution image, or by a coordinate interval in an absolute coordinate system such as a longitude and latitude interval, and is not specifically limited in this embodiment. It can be understood that the relative coordinate system is a coordinate system constructed based on a single image, and the coordinate points therein are irrelevant to other images. The absolute coordinate system is a coordinate system constructed based on an actual geographical area, and any point in an image has a corresponding coordinate point in the absolute coordinate system. In addition to a coordinate system constructed with pixels in an image as units, the relative coordinate system can also be a coordinate system constructed with length units such as centimeters or millimeters, and the origin of the relative coordinate system can be any point in the high-resolution image. In addition to the longitude and latitude system, the absolute coordinate system can also be a coordinate system commonly used in other maps, or a custom map coordinate system.
[0076] Step S20, mapping the first annotated area to a low-resolution image to be annotated to obtain a second annotated area in the low-resolution image, wherein the actual area corresponding to the low-resolution image is the same as that of the high-resolution image, and the resolution of the low-resolution image is lower than that of the high-resolution image;
[0077] The high-resolution image corresponds to a low-resolution image, and the actual geographical area corresponding to the low-resolution image is the same as the actual geographical area corresponding to the high-resolution image. Then, due to the different resolutions, the size of the high-resolution image is larger than the size of the low-resolution image, and the size ratio is inversely proportional to its resolution. It should be noted that the size mentioned here is the number of pixels in length and width. The low-resolution image corresponding to the high-resolution image is used as the image to be annotated, and the first annotated area is mapped to the low-resolution image to be annotated to obtain the second annotated area in the low-resolution image. Among them, there are many mapping methods. When the first annotated area is limited by a relative coordinate system, it is mapped according to the conversion relationship between the relative coordinate systems of the high-resolution and low-resolution images. When the first annotated area is limited by an absolute coordinate system, it is mapped according to the absolute coordinate interval of the first annotated area. In this embodiment, there is no restriction on the mapping method.
[0078] It should be noted that when the first labeled area is the target area, the second labeled area refers to the target area in the low-resolution image; when the first labeled area is the non-target area, the second labeled area refers to the non-target area in the low-resolution image.
[0079] Step S30: annotate the second annotated area in the low-resolution image to obtain image annotated data.
[0080] The second annotated area in the low-resolution image is annotated to obtain image annotation data. Specifically, the image annotation data may be data indicating whether each pixel in the low-resolution image belongs to the target object area. Then, the second annotated area is annotated to indicate whether each pixel in the second annotated area in the low-resolution image belongs to the target object area. Specifically, when the second annotated area is the target object area, all pixels in the second annotated area are annotated as belonging to the target object area, for example, annotated as 1. Further, all pixels outside the second annotated area in the low-resolution image are annotated as belonging to the non-target object area, for example, annotated as 0. When the second annotated area is the non-target object area, all pixels in the second annotated area are annotated as belonging to the non-target object area, for example, annotated as 0. Further, all pixels outside the second annotated area in the low-resolution image are annotated as belonging to the target object area, for example, annotated as 1.
[0081] Furthermore, after obtaining image annotation data corresponding to multiple low-resolution images using the above-mentioned data annotation method, a training data set can be constructed based on the multiple low-resolution images and the corresponding image annotation data, and the training data set can be used to train a target object recognition model. The trained target object recognition model can recognize targets in low-resolution images.
[0082] In this embodiment, by obtaining a first annotation area in a high-resolution image, for a low-resolution image to be annotated corresponding to the same actual area as the high-resolution image, the first annotation area is mapped to the low-resolution image to obtain a second annotation area, and the second annotation area in the low-resolution image is annotated to obtain image annotation data, thereby completing the data annotation of the low-resolution image. In this embodiment, the data of the low-resolution image is annotated with the help of the high-resolution image. Since the target object in the high-resolution image is clearly visible, it can be accurately mapped to the low-resolution image, thereby achieving accurate annotation of the target object in the low-resolution image. That is, compared with the existing method of manually annotating low-resolution image data, the data annotation method in this embodiment will not have the problem that the target object in the low-resolution image is blurred and cannot be annotated. While improving the accuracy of data annotation, it also realizes an automated image data annotation method. In the scenario where massive image training data is required, the efficiency of constructing the training data set is greatly improved, and the labor cost and time cost are reduced.
[0083] Further, based on the above first embodiment, a second embodiment of the image data annotation method of the present invention is proposed. In this embodiment, step S20 includes:
[0084] Step S201, obtaining an absolute coordinate interval corresponding to the first marked area, wherein the absolute coordinate interval is in a preset absolute coordinate system, and each pixel point in the low-resolution image and the high-resolution image obeys the preset absolute coordinate system;
[0085] In this embodiment, the first marked area is mapped to the second marked area in the following manner:
[0086] An absolute coordinate system may be pre-set, and the absolute coordinate system may be a latitude and longitude coordinate system, or other commonly used map coordinate systems, or a custom map coordinate system. It is understandable that, whether it is a low-resolution image or a high-resolution image, each pixel in the image obeys the absolute coordinate system, that is, each pixel in the image has a corresponding coordinate point in the absolute coordinate system.
[0087] Get the absolute coordinate interval corresponding to the first marked area, that is, the first marked area corresponds to an absolute coordinate interval in the absolute coordinate system, and the absolute coordinate interval can be an interval defined by multiple coordinate points. For example, when the first marked area is a rectangle, the absolute coordinate interval is an interval defined by the coordinate points corresponding to the four vertices of the matrix.
[0088] Step S202: taking the area defined by the absolute coordinate interval in the low-resolution image as a second marked area.
[0089] Since each pixel point in the low-resolution image has a corresponding coordinate point in the absolute coordinate system, conversely, the coordinate points corresponding to each point in the actual geographical area corresponding to the low-resolution image in the absolute coordinate system can all correspond to the pixel points in the low-resolution image. Therefore, the area defined by the absolute coordinate interval can be found in the low-resolution image and used as the second annotation area.
[0090] In this embodiment, by obtaining the absolute coordinate interval of the first annotated area in the high-resolution image, and taking the area defined by the absolute coordinate interval in the low-resolution image as the second annotated area, the first annotated area in the high-resolution image is mapped to the second annotated area in the low-resolution image, thereby annotating the target object in the low-resolution image with the help of the high-resolution image. Since the target object in the high-resolution image is clearly visible, the position of the first annotated area in the high-resolution image is accurate, and the second annotated area obtained by mapping the first annotated area according to the absolute coordinate system is also accurate, thereby achieving accurate annotation of the target object in the low-resolution image. However, the existing method of manually identifying the target object in the low-resolution image by naked eyes is obviously unable to accurately find the second annotated area because the target object in the low-resolution image is blurred.
[0091] Further, based on the above-mentioned first and / or second embodiments, a third embodiment of the image data annotation method of the present invention is proposed. In this embodiment, the step S20 includes:
[0092] Step S203, obtaining a first relative coordinate interval of the first marked area, wherein the first relative coordinate interval is in a first preset relative coordinate system constructed based on the high-resolution image;
[0093] In this embodiment, the first marked area is mapped to the second marked area in the following manner:
[0094] A first preset relative coordinate system is constructed based on the high-resolution image. The first preset relative coordinate system can be a coordinate system constructed using pixels as units, or a coordinate system constructed using length units such as millimeters and centimeters. It is understandable that since it is a coordinate system constructed solely based on the high-resolution image, the coordinate points in the first preset relative coordinate system are only meaningful in the high-resolution image. Any point in the high-resolution image can be used as the origin of the first preset coordinate system. For the convenience of calculation, one of the four vertices in the high-resolution image can be taken as the origin.
[0095] Each point in the high-resolution image corresponds to a coordinate point in the first preset relative coordinate system, so the first annotated area in the high-resolution image corresponds to a coordinate interval in the first preset relative coordinate system, and the coordinate interval is defined by multiple coordinate points. For example, when the first annotated area is a rectangle, the coordinate interval is defined by the coordinate points corresponding to the four vertices of the rectangle. This coordinate interval is called the first relative coordinate interval for distinction.
[0096] Step S204: mapping the first relative coordinate interval to a second relative coordinate interval according to a mapping relationship between the first preset relative coordinate system and the second preset relative coordinate system, wherein the second relative coordinate interval is in the second preset relative coordinate system constructed based on the low-resolution image;
[0097] A second preset relative coordinate system is also constructed based on the low-resolution image. Similarly, the second preset relative coordinate system can also be a coordinate system constructed using pixels as units, or a coordinate system constructed using length units such as millimeters and centimeters. It can be understood that since it is a coordinate system constructed based on the low-resolution image alone, the coordinate points in the second preset relative coordinate system are only meaningful in the low-resolution image. Any point in the low-resolution image can be used as the origin of the second preset coordinate system. For the convenience of calculation, one of the four vertices in the low-resolution image can be taken as the origin.
[0098] The actual geographical area corresponding to the high-resolution image and the low-resolution image is the same, but the resolutions of the two images are different. There is a mapping relationship between the first preset relative coordinate system and the second preset relative coordinate system, that is, which coordinate points in the first preset relative coordinate system correspond to which coordinate points in the second preset relative coordinate system. The mapping relationship can be expressed as f(x), where x is the horizontal axis coordinate value or the vertical axis coordinate value of the coordinate point in the first preset relative coordinate system. The mapping relationship is determined based on the resolution ratio of the high-resolution image and the low-resolution image, the origin position of the two coordinate systems, and the units of the two coordinate systems. For example, when the resolution ratio of the high-resolution image to the low-resolution image is 0.5, the origins of the two coordinate systems are both the lower left corner vertices in the corresponding images, and the units of the two coordinate systems are both in pixels, then f(x) = 0.5x, then the coordinate point (10, 20) in the first preset relative coordinate system is mapped to the coordinate point (5, 10) in the second preset relative coordinate system.
[0099] Step S205: taking the area defined by the second relative coordinate interval in the low-resolution image as a second marked area.
[0100] An area defined by the second relative coordinate interval in the low-resolution image is used as a second labeled area, and the second labeled area is then labeled.
[0101] Furthermore, in one embodiment, when the lower left corner vertex is used as the coordinate origin in both the high-resolution image and the low-resolution image, and pixels are used as units, the pixel interval corresponding to the first annotation interval can be directly reduced to obtain the pixel interval of the second annotation area in the low-resolution image, and the reduction ratio multiplied during the reduction is the resolution ratio of the high-resolution image to the low-resolution image.
[0102] In this embodiment, by constructing a first relative coordinate system in a high-resolution image and a second relative coordinate system in a low-resolution image, according to the mapping relationship between the first relative coordinate system and the second relative coordinate system, the first relative coordinate interval of the first annotated area in the high-resolution image in the first relative coordinate system is mapped to the second relative coordinate interval in the second relative coordinate system, and the area defined by the second relative coordinate interval in the low-resolution image is used as the second annotated area, so as to achieve mapping of the first annotated area in the high-resolution image to the second annotated area in the low-resolution image, thereby achieving annotation of the target in the low-resolution image with the help of the high-resolution image. Since the target in the high-resolution image is clearly visible, the position of the first annotated area in the high-resolution image is accurate, and the second annotated area obtained based on the mapping relationship between the two relative coordinate systems and the mapping of the first annotated area is also accurate, thereby achieving accurate annotation of the target in the low-resolution image, while the existing method of manually identifying the target in the low-resolution image by naked eyes obviously cannot accurately find the second annotated area because the target in the low-resolution image is blurred.
[0103] Further, based on the above-mentioned first, second and / or third embodiments, a fourth embodiment of the image data annotation method of the present invention is proposed. In this embodiment, the step S10 includes:
[0104] Step S101, inputting a high-resolution image into a preset high-resolution image recognition model for recognition processing, and obtaining each first annotated region in the high-resolution image and an annotation category corresponding to each first annotated region;
[0105] In this embodiment, a preset high-resolution image recognition model can be used to obtain the first annotated area in the high-resolution image. Specifically, the high-resolution image recognition model can be a recognition model that has been pre-trained to recognize targets in high-resolution images, and the model structure can be a commonly used semantic segmentation model. The high-resolution image is input into the preset high-resolution image recognition model for recognition processing, and each first annotated area in the high-resolution image and the annotation category corresponding to each first annotated area can be obtained. Among them, the number of first annotated areas may be multiple; when there is only one target object to be identified, the first annotated area includes two areas, the annotation category of one area is the target area, and the annotation category of the other area is the non-target area; when there are multiple targets to be identified, the first annotated area includes multiple areas, and the annotation categories of various areas are the target areas and non-target areas. Then, after being processed by the high-resolution image recognition model, multiple first annotated areas in the high-resolution image and the annotation category corresponding to each first annotated area are obtained.
[0106] The step S30 comprises:
[0107] Step S301 : annotating each of the second annotated regions in the low-resolution image according to the annotation category to obtain image annotation data.
[0108] After the second annotation area is obtained based on the mapping of the first annotation area, the annotation category of the first annotation area is also the annotation category of the second annotation area corresponding to the first annotation area. For example, if the annotation category of a first annotation area is a target object area, then the annotation category of the second annotation area obtained based on the mapping of the first annotation area is also a target object area. The image annotation data is obtained by annotating each second annotation area in the low-resolution image according to the annotation category corresponding to the second annotation area, that is, the second annotation area is annotated with the category corresponding to the annotation category. Furthermore, if the image annotation data is pixel-level annotation data, all pixels in the second annotation area are marked as the annotation category.
[0109] In this embodiment, an image recognition model is used to perform recognition processing on a high-resolution image to obtain a first annotated area in the high-resolution image. Compared with a method of manually annotating a high-resolution image, this embodiment improves the efficiency of obtaining the first annotated area in the high-resolution image, thereby improving the annotation efficiency of the low-resolution image.
[0110] Furthermore, before step S10, the method further includes:
[0111] Step S40, dividing the low-resolution overall image to be annotated into various image regions;
[0112] In this embodiment, for a low-resolution image (hereinafter referred to as the total image to be annotated, to distinguish it from the low-resolution image in the above embodiment), the total image to be annotated is divided to obtain various image areas. It should be noted that the total image to be annotated is an image at a low resolution. If the resolution of the corresponding high-resolution image is much larger than the low resolution, then the size of the corresponding high-resolution image will also be much larger than the size of the total image to be annotated, and its data volume will also be very large. Loading a large amount of data at one time may cause insufficient memory and fail to complete data annotation. Therefore, in this embodiment, in order to prevent the size of the high-resolution image processed at one time from being too large, the total image to be annotated can be divided into multiple small image areas. The division method can adopt grid division, and loading and processing the high-resolution image corresponding to each small image area is within the memory operation range.
[0113] Step S50, selecting a target image area from each of the image areas in turn as the low-resolution image to be labeled, and acquiring a high-resolution image corresponding to the same actual area as the low-resolution image;
[0114] A target image area is selected from each image area as a low-resolution image to be annotated, and a high-resolution image of the same actual area as the low-resolution image is obtained. Specifically, a high-resolution image of the same actual area as the low-resolution image can be obtained from a map software or a high-resolution remote sensing satellite according to the longitude and latitude coordinates corresponding to the four vertices in the low-resolution image.
[0115] The low-resolution image is annotated according to the high-resolution image to obtain image annotation data corresponding to the low-resolution image.
[0116] After performing the above-mentioned annotation processing on each image region, the image annotation data corresponding to each image region can be obtained.
[0117] After step S30, the method further includes:
[0118] Step S60: combining the image annotation data corresponding to each of the image regions to obtain the image annotation data corresponding to the overall image to be annotated.
[0119] The image annotation data corresponding to each image area are combined to obtain the image annotation data corresponding to the total image to be annotated. According to the rules for dividing the total image to be annotated, each image area is spliced and restored, and the image annotation data of each image area is also spliced to obtain the image annotation data of the total image to be annotated. For example, a 100*200 total image to be annotated is divided from the middle to obtain two 100*100 image areas. When the image annotation data includes the category annotation of each pixel in the image, the image annotation data of the left image area remains unchanged, and the horizontal coordinates of each pixel in the image annotation data of the right image area are added by 100, thereby obtaining the image annotation data of the total image to be annotated.
[0120] The same method as above is adopted to obtain the image annotation data of multiple total images to be annotated, and a training data set is constructed according to each total image to be annotated and the image annotation data corresponding to each total image to be annotated. The training data set can be used to train a recognition model for identifying targets in low resolution.
[0121] In this embodiment, the total image to be annotated is divided into multiple small image areas, and data is annotated for each image area using the low-resolution image data annotation method in the above embodiment. The image annotation data of each image area is then combined to obtain image annotation data corresponding to the total image to be annotated. This avoids the situation where insufficient memory is caused by loading too much high-resolution images at one time when the resolution of the high-resolution image is much larger than the resolution of the image to be annotated, thereby reducing the occupancy of device memory resources.
[0122] Furthermore, in one embodiment, for the multiple image regions obtained by division, each image region may be output and displayed first, and a user interaction interface for the user to select is provided, so that the user can select the image region to be annotated, and only the image region selected by the user is annotated according to the above-mentioned low-resolution image data annotating method, and for the unselected image region, the image region may be annotated as a non-target object region as a whole. That is, the user can observe each image region with the naked eye, and for the image region that obviously does not have the target object, the user may choose not to annotate the image, thereby avoiding useless image data annotation.
[0123] Further, based on the first, second, third and / or fourth embodiments above, a fifth embodiment of the image data annotation method of the present invention is proposed. In this embodiment, the method further includes:
[0124] Step S70, constructing a training data set according to the plurality of low-resolution images and the image annotation data corresponding to each of the low-resolution images;
[0125] In this embodiment, after obtaining multiple low-resolution images and image annotation data corresponding to each low-resolution image through the low-resolution image data annotation method in the above embodiments, a training data set can be constructed based on the multiple low-resolution images and the corresponding image annotation data. Specifically, a low-resolution image and the image annotation data corresponding to the low-resolution image are used as a piece of training data, and multiple pieces of training data constitute a training data set.
[0126] In one embodiment, a general map to be labeled and image annotation data corresponding to the general map to be labeled can be used as a piece of training data, multiple pieces of training data can be obtained according to multiple general maps to be labeled, and a training data set can be constructed based on the multiple pieces of training data.
[0127] Step S80: Use the training data set to train a preset image recognition model to obtain a low-resolution image recognition model.
[0128] The preset image recognition model is trained using the constructed training data set. During the training process, the model parameters in the preset image recognition model are continuously optimized and updated until it is detected that the updated preset image recognition model meets the training objectives, and the updated preset image recognition model is used as the low-resolution image recognition model. Specifically, the preset image recognition model can adopt a commonly used image recognition model structure, such as an image semantic segmentation model, etc. The target object can be vegetation, buildings or roads, etc. The training method for the preset image recognition model can adopt a commonly used machine learning model training method, which will not be described in detail here.
[0129] Furthermore, when the second annotated area includes a vegetation area and a non-vegetation area in the low-resolution image, and the image annotation data includes data indicating whether each pixel in the low-resolution image belongs to a vegetation area, the method further includes:
[0130] Step S90, inputting the low-resolution image to be identified into the low-resolution image recognition model to obtain a semantic segmentation result of the low-resolution image to be identified, wherein the semantic segmentation result includes data characterizing whether each pixel in the low-resolution image to be identified belongs to a vegetation area.
[0131] Furthermore, when the target object is vegetation, the second annotated area may include vegetation areas and non-vegetation areas in the low-resolution image. Then, by annotating the second annotated area in the low-resolution image, the image annotation data obtained may include data characterizing whether each pixel in the low-resolution image belongs to a vegetation area. The low-resolution image recognition model trained based on the low-resolution image and the corresponding image annotation data can be used to identify vegetation areas in low-resolution images. For the low-resolution image to be identified, the image can be input into the low-resolution image recognition model for identification to obtain the semantic segmentation result of the low-resolution image recognition model, and the semantic segmentation result may include data characterizing whether each pixel in the low-resolution image to be identified belongs to a vegetation area, such as a semantic map. In this embodiment, the vegetation as the target object may refer to a certain type of plant, such as a palm tree or a camphor tree, or may refer to the sum of all plants.
[0132] In this embodiment, by automatically labeling vegetation in low-resolution images with the help of high-resolution images, a large number of labeled low-resolution images for training low-resolution image recognition models can be obtained, and a model with high accuracy in vegetation area recognition can be trained.
[0133] In addition, the present invention also provides an image data annotation device, referring to Figure 3 , the device comprises:
[0134] An acquisition module 10, configured to acquire a first annotated area in a high-resolution image;
[0135] A mapping module 20, configured to map the first annotated area to a low-resolution image to be annotated, to obtain a second annotated area in the low-resolution image, wherein the actual area corresponding to the low-resolution image is the same as that of the high-resolution image, and the resolution of the low-resolution image is lower than that of the high-resolution image;
[0136] The labeling module 30 is used to label the second labeling area in the low-resolution image to obtain image labeling data.
[0137] Furthermore, the mapping module 20 includes:
[0138] A first acquisition unit is used to acquire an absolute coordinate interval corresponding to the first marked area, wherein the absolute coordinate interval is in a preset absolute coordinate system, and each pixel point in the low-resolution image and the high-resolution image obeys the preset absolute coordinate system;
[0139] The first determining unit is configured to use the area defined by the absolute coordinate interval in the low-resolution image as a second marked area.
[0140] Furthermore, the mapping module 20 includes:
[0141] A second acquisition unit, configured to acquire a first relative coordinate interval of the first marked area, wherein the first relative coordinate interval is in a first preset relative coordinate system constructed based on the high-resolution image;
[0142] a mapping unit, configured to map the first relative coordinate interval to a second relative coordinate interval according to a mapping relationship between the first preset relative coordinate system and the second preset relative coordinate system, wherein the second relative coordinate interval is in the second preset relative coordinate system constructed based on the low-resolution image;
[0143] The second determining unit is configured to use the area defined by the second relative coordinate interval in the low-resolution image as a second marked area.
[0144] Furthermore, the acquisition module 10 includes:
[0145] A recognition unit, configured to input the high-resolution image into a preset high-resolution image recognition model for recognition processing, and obtain each first annotated region in the high-resolution image and an annotation category corresponding to each first annotated region;
[0146] The marking module 30 includes:
[0147] A labeling unit is used to label each of the second labeling areas in the low-resolution image according to the labeling category to obtain image labeling data.
[0148] Furthermore, the device also includes:
[0149] A division module is used to divide the low-resolution overall image to be annotated into various image regions;
[0150] The acquisition module is also used to sequentially select a target image area from each of the image areas as the low-resolution image to be labeled, and acquire a high-resolution image corresponding to the same actual area as the low-resolution image;
[0151] The device also includes:
[0152] The combination module is used to combine the image annotation data corresponding to each of the image regions to obtain the image annotation data corresponding to the overall image to be annotated.
[0153] Furthermore, the device also includes:
[0154] A construction module, used to construct a training data set according to the plurality of low-resolution images and the image annotation data corresponding to each of the low-resolution images;
[0155] The training module is used to train a preset image recognition model using the training data set to obtain a low-resolution image recognition model.
[0156] Further, when the second annotated area includes a vegetation area and a non-vegetation area in the low-resolution image, and the image annotation data includes data indicating whether each pixel in the low-resolution image belongs to the vegetation area, the device further includes:
[0157] The recognition module is used to input the low-resolution image to be identified into the low-resolution image recognition model to obtain the semantic segmentation result of the low-resolution image to be identified, wherein the semantic segmentation result includes data characterizing whether each pixel point in the low-resolution image to be identified belongs to the vegetation area.
[0158] The extended contents of the specific implementation manner of the image data annotation device of the present invention are basically the same as the above-mentioned embodiments of the image data annotation method, and will not be elaborated here.
[0159] In addition, an embodiment of the present invention further proposes a computer-readable storage medium, on which an image data annotation program is stored. When the image data annotation program is executed by a processor, the steps of the image data annotation method described below are implemented.
[0160] The various embodiments of the image data annotation device and the computer-readable storage medium of the present invention may refer to the various embodiments of the image data annotation method of the present invention, and will not be described in detail here.
[0161] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0162] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0163] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the embodiments of the present invention.
[0164] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for labeling image data, characterized in that: The method comprises the following steps: Acquire a first annotated area in the high-resolution image, wherein the first annotated area is a target object area or a non-target object area; Mapping the first annotated area to a low-resolution image to be annotated to obtain a second annotated area in the low-resolution image, wherein the low-resolution image and the actual area corresponding to the high-resolution image are the same, and the resolution of the low-resolution image is lower than the resolution of the high-resolution image, and when the first annotated area is a target object area, the second annotated area is a target object area; when the first annotated area is a non-target object area, the second annotated area is a non-target object area; The second annotated area in the low-resolution image is annotated to obtain image annotation data, wherein, when the second annotated area is a target object area, all pixels in the second annotated area are annotated as belonging to the target object area, and all pixels outside the second annotated area are annotated as belonging to the non-target object area; when the second annotated area is a non-target object area, all pixels in the second annotated area are annotated as belonging to the non-target object area, and all pixels outside the second annotated area are annotated as belonging to the target object area.
2. The image data annotation method according to claim 1, characterized in that: The step of mapping the first annotated area to the low-resolution image to be annotated to obtain the second annotated area in the low-resolution image comprises: Acquire an absolute coordinate interval corresponding to the first marked area, wherein the absolute coordinate interval is in a preset absolute coordinate system, and each pixel point in the low-resolution image and the high-resolution image obeys the preset absolute coordinate system; An area defined by the absolute coordinate interval in the low-resolution image is used as a second marked area.
3. The image data annotation method according to claim 1, characterized in that: The step of mapping the first annotated area to the low-resolution image to be annotated to obtain the second annotated area in the low-resolution image comprises: Acquire a first relative coordinate interval of the first annotated area, wherein the first relative coordinate interval is in a first preset relative coordinate system constructed based on the high-resolution image; According to a mapping relationship between the first preset relative coordinate system and the second preset relative coordinate system, mapping the first relative coordinate interval to a second relative coordinate interval, wherein the second relative coordinate interval is in the second preset relative coordinate system constructed based on the low-resolution image; An area defined by the second relative coordinate interval in the low-resolution image is used as a second marked area.
4. The image data annotation method according to claim 1, characterized in that: The step of acquiring the first annotated area in the high-resolution image comprises: Inputting the high-resolution image into a preset high-resolution image recognition model for recognition processing to obtain each first annotated region in the high-resolution image and an annotation category corresponding to each first annotated region; The step of annotating the second annotated area in the low-resolution image to obtain image annotation data comprises: Each of the second annotation regions in the low-resolution image is annotated according to the annotation category to obtain image annotation data.
5. The image data annotation method according to claim 1, characterized in that: Before the step of obtaining the first annotated area in the high-resolution image, the method further includes: Divide the low-resolution total image to be annotated into various image regions; Selecting a target image area from each of the image areas in turn as the low-resolution image to be labeled, and acquiring a high-resolution image corresponding to the same actual area as the low-resolution image; After the step of annotating the second annotated area in the low-resolution image to obtain image annotation data, the method further includes: The image annotation data corresponding to each of the image regions are combined to obtain the image annotation data corresponding to the overall image to be annotated.
6. The image data annotation method according to any one of claims 1 to 5, characterized in that: After the step of annotating the second annotated area in the low-resolution image to obtain image annotation data, the method further includes: Constructing a training data set according to the plurality of low-resolution images and the image annotation data corresponding to each of the low-resolution images; The training data set is used to train a preset image recognition model to obtain a low-resolution image recognition model.
7. The image data annotation method according to claim 6, characterized in that: When the second annotated area includes a vegetation area and a non-vegetation area in the low-resolution image, and the image annotation data includes data indicating whether each pixel in the low-resolution image belongs to a vegetation area, after the step of using the training data set to train the preset image recognition model to obtain the low-resolution image recognition model, the step further includes: The low-resolution image to be identified is input into the low-resolution image recognition model to obtain a semantic segmentation result of the low-resolution image to be identified, wherein the semantic segmentation result includes data characterizing whether each pixel point in the low-resolution image to be identified belongs to a vegetation area.
8. An image data annotation device, characterized in that: The device comprises: An acquisition module, used for acquiring a first annotated area in the high-resolution image, wherein the first annotated area is a target object area or a non-target object area; a mapping module, configured to map the first annotated area to a low-resolution image to be annotated, to obtain a second annotated area in the low-resolution image, wherein the low-resolution image and the actual area corresponding to the high-resolution image are the same, and the resolution of the low-resolution image is lower than the resolution of the high-resolution image, and when the first annotated area is a target object area, the second annotated area is a target object area; when the first annotated area is a non-target object area, the second annotated area is a non-target object area; The annotation module is used to annotate the second annotation area in the low-resolution image to obtain image annotation data, wherein, when the second annotation area is a target object area, all pixels in the second annotation area are annotated as belonging to the target object area, and all pixels outside the second annotation area are annotated as belonging to the non-target object area; when the second annotation area is a non-target object area, all pixels in the second annotation area are annotated as belonging to the non-target object area, and all pixels outside the second annotation area are annotated as belonging to the target object area.
9. An image data annotation device, characterized in that: The image data annotation device comprises: a memory, a processor, and an image data annotation program stored in the memory and executable on the processor. When the image data annotation program is executed by the processor, the steps of the image data annotation method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores an image data annotation program, and when the image data annotation program is executed by a processor, the steps of the image data annotation method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Image segmentation network training method, image segmentation method and storage medium
CN111583264A