A remote sensing image change detection method and device
By automatically obtaining and labeling remote sensing image sample data, training the detection model and detecting the images, and screening the target difference area with the interchange ratio, the problems of large workload and low detection accuracy in the prior art are solved, and more efficient and accurate remote sensing image change detection is achieved.
Patent Information
- Application Number
- CN202411406434.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-10-10
AI Technical Summary
The existing remote sensing image change detection model requires manual labeling of the change zone before training. The workload is large and the detection accuracy is not high. The application conditions are harsh, and the time interval is long and the boundary characteristics of the difference zone are obvious.
By acquiring the first image sample data and the second image sample data, a detection model is obtained based on these data, the detection image is detected using these models, the target difference area image is obtained, and the target difference area is filtered by calculating the interleaving ratio to remove the pseudo-change area.
It reduces the workload of manual labeling, improves the accuracy of detection, and is suitable for remote sensing image change detection with short time intervals and insignificant boundary characteristics.
Smart Images

Figure CN118941964B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of image processing technology, and in particular, to a remote sensing image change detection method and device. Background Art
[0002] The existing technology obtains the difference in changes between two phases of remote sensing images through a detection model. The detection model needs to be trained with the first phase remote sensing image sample data and the second phase remote sensing image sample data before it is officially used. Both the first phase remote sensing image sample data and the second phase remote sensing image sample data require manual annotation of the change areas, which is a large workload. In addition, some unchanged areas in the first phase remote sensing image sample data and the second phase remote sensing image sample data are not involved in the training, so that the detection results of the detection model are likely to be erroneous during the actual detection process, that is, the detection accuracy is not very high. In addition, the application conditions of the detection model are relatively harsh, requiring a long time interval between the two phases of remote sensing images and obvious boundary features of the difference area, otherwise it will lead to a low detection accuracy of the detection model. Summary of the invention
[0003] In order to solve the above problems, one or more embodiments of this specification describe a remote sensing image change detection method and device.
[0004] According to a first aspect, a remote sensing image change detection method is provided, the method comprising:
[0005] Acquire first image sample data and second image sample data;
[0006] Acquire a first image detection model and a second image detection model based on the first image sample data and the second image sample data;
[0007] The first image to be detected is detected by a first image detection model to obtain a first target area image, the second image to be detected is detected by a second image detection model to obtain a second target area image, and a target difference area image is obtained through the first target area image and the second target area image;
[0008] Filter the target difference area on the target difference area image:
[0009] A target difference area on a target difference area image is obtained; a circumscribed rectangle of the target difference area is obtained, and the circumscribed rectangle is expanded to obtain a rectangular expansion frame; a first sub-image is captured on a first image to be detected based on the position information of the rectangular expansion frame, and a first sub-target area image is captured on the first target area image; a second sub-image is captured on a second image to be detected based on the position information of the rectangular expansion frame, and a second sub-target area image is captured on the second target area image; a first sub-detection target area image of the first sub-image is obtained through a sub-image detection model, and a second sub-detection target area image of the second sub-image is obtained through the sub-image detection model; an intersection-and-union ratio of a first sub-detection target area in the first sub-detection target area image to a first sub-target area in the first sub-target area image is calculated as one, and an intersection-and-union ratio of a second sub-detection target area in the second sub-detection target area image to a second sub-target area in the second sub-target area image is calculated as two, and when both the intersection-and-union ratio one and the intersection-and-union ratio two are greater than an intersection-and-union ratio threshold, the corresponding target difference area is removed.
[0010] Preferably, obtaining the first image sample data and the second image sample data specifically includes:
[0011] Acquire the original images of the first phase and the original images of the second phase;
[0012] Finding the target area of the second-phase original image, and marking the target area on the second-phase original image to obtain second image sample data;
[0013] Acquire a graphic file of a target area of the second image sample data;
[0014] The target area is marked on the first original image based on the graphic file to obtain first image sample data.
[0015] Preferably, acquiring the first image detection model and the second image detection model based on the first image sample data and the second image sample data specifically includes:
[0016] Using the second image sample data to train the image segmentation model 1 to obtain a second image detection model;
[0017] The first image sample data and the second image sample data are used together to train the second image segmentation model to obtain the first image detection model.
[0018] Preferably, obtaining the target difference area image through the first target area image and the second target area image specifically includes:
[0019] Acquire a first graphic file of a first target area on the first target area image, acquire a second graphic file of a second target area on the second target area image, and calculate a non-overlapping area between the first graphic file and the second graphic file to obtain a non-overlapping graphic file;
[0020] rasterizing the non-overlapping graphic files to obtain non-overlapping raster data, filtering the non-overlapping raster data, and converting the filtered non-overlapping raster data into a target difference graphic file;
[0021] Perform area filtering on the target difference graphic file: obtain the area value of the target difference graphic file, and when the area value is less than the area threshold, remove the corresponding target difference graphic file;
[0022] The remaining target difference graphic files are combined with the first image to be detected or the second image to be detected to obtain a target difference area image.
[0023] Preferably, expanding the circumscribed rectangle to obtain a rectangular expansion frame specifically includes:
[0024] The vertical side of the circumscribed rectangle is extended upward by a first length and downward by a second length, and the horizontal side of the circumscribed rectangle is extended to the left by a third length and to the right by a fourth length. When the first distance between the upper horizontal side of the circumscribed rectangle and the upper boundary of the second image to be detected is less than half of the vertical side length of the circumscribed rectangle, the first length is equal to the first distance, otherwise the first length is equal to half of the vertical side length of the circumscribed rectangle; when the second distance between the lower horizontal side of the circumscribed rectangle and the lower boundary of the second image to be detected is less than half of the vertical side length of the circumscribed rectangle, the second length is equal to the second distance, otherwise the second length is equal to half of the vertical side length of the circumscribed rectangle; when the third distance between the left vertical side of the circumscribed rectangle and the left boundary of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the third length is equal to the third distance, otherwise the third length is equal to half of the horizontal side length of the circumscribed rectangle; when the fourth distance between the right vertical side of the circumscribed rectangle and the right boundary of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the fourth length is equal to the fourth distance, otherwise the fourth length is equal to half of the horizontal side length of the circumscribed rectangle.
[0025] Preferably, screening the target difference area on the target difference area image further includes:
[0026] The SAM large model is used as the sub-image detection model;
[0027] Multiple prompt points are randomly generated in the target difference area. The minimum distance between each prompt point and the edge of the target difference area is equal, and the interval distance between every two prompt points is greater than the minimum distance threshold. The prompt points are used as prompt points of the SAM large model.
[0028] Preferably, the method further comprises:
[0029] Acquire an initial target difference area image through the first initial image and the second initial image, and mark a circumscribed rectangular frame on the initial target difference area of the initial target difference area image;
[0030] Setting a first circumscribed rectangular frame at a corresponding position of the first initial image according to the position information of the circumscribed rectangular frame, and setting a second circumscribed rectangular frame at a corresponding position of the second initial image according to the position information of the circumscribed rectangular frame;
[0031] intercepting a first sub-initial image by sliding a frame within a first circumscribed rectangular frame of the first initial image, intercepting a second sub-initial image by sliding a frame within a second circumscribed rectangular frame of the second initial image, and setting the first sub-initial image and the second sub-initial image at the same position as a group of image pairs;
[0032] Grouping the image pairs: when the first sub-initial image and the second sub-initial image of the image pair are real changes, the image pair is grouped into a first image pair group; when the first sub-initial image and the second sub-initial image of the image pair are pseudo changes, the image pair is grouped into a second image pair group;
[0033] A classification model is obtained by training the image pairs in the first image pair group and the second image pair group;
[0034] The target difference area on the target difference area image is secondary screened based on the classification model.
[0035] According to a second aspect, a remote sensing image change detection device is provided, the device comprising:
[0036] An image sample data acquisition module, used to acquire first image sample data and second image sample data;
[0037] An image detection model acquisition module, used to acquire a first image detection model and a second image detection model based on the first image sample data and the second image sample data;
[0038] A target difference area image acquisition module is used to detect the first image to be detected by using a first image detection model to obtain a first target area image, detect the second image to be detected by using a second image detection model to obtain a second target area image, and obtain a target difference area image through the first target area image and the second target area image;
[0039] The target difference area screening module is used to screen the target difference area on the target difference area image:
[0040] A target difference area on a target difference area image is obtained; a circumscribed rectangle of the target difference area is obtained, and the circumscribed rectangle is expanded to obtain a rectangular expansion frame; a first sub-image is captured on a first image to be detected based on the position information of the rectangular expansion frame, and a first sub-target area image is captured on the first target area image; a second sub-image is captured on a second image to be detected based on the position information of the rectangular expansion frame, and a second sub-target area image is captured on the second target area image; a first sub-detection target area image of the first sub-image is obtained through a sub-image detection model, and a second sub-detection target area image of the second sub-image is obtained through the sub-image detection model; an intersection-and-union ratio of a first sub-detection target area in the first sub-detection target area image to a first sub-target area in the first sub-target area image is calculated as one, and an intersection-and-union ratio of a second sub-detection target area in the second sub-detection target area image to a second sub-target area in the second sub-target area image is calculated as two, and when both the intersection-and-union ratio one and the intersection-and-union ratio two are greater than an intersection-and-union ratio threshold, the corresponding target difference area is removed.
[0041] According to a third aspect, there is provided an electronic device, comprising a processor and a memory;
[0042] The processor is connected to the memory;
[0043] A memory for storing executable program codes;
[0044] The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to execute the steps of the method provided in the first aspect or any possible implementation manner of the first aspect.
[0045] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. The computer-readable storage medium stores instructions, and when the instructions are executed on a computer or a processor, the computer or the processor executes the method provided in the first aspect or any possible implementation of the first aspect.
[0046] The method and device provided in the embodiments of the present specification, after obtaining the target difference area image, further screen the target difference area on the target difference area image by calculating the intersection-and-union ratio one between the first sub-detection target area in the first sub-detection target area image and the first sub-target area in the first sub-target area image, and calculating the intersection-and-union ratio two between the second sub-detection target area in the second sub-detection target area image and the second sub-target area in the second sub-target area image, and remove the target difference area whose intersection-and-union ratio one and intersection-and-union ratio two are both greater than the intersection-and-union ratio threshold, that is, it is possible to screen out some target difference areas with pseudo-changes, thereby improving the accuracy of remote sensing image change detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0048] Figure 1 It is a flowchart of a remote sensing image change detection method in one embodiment of the present specification.
[0049] Figure 2 It is a structural schematic diagram of a remote sensing image change detection device in one embodiment of this specification.
[0050] Figure 3 It is a structural diagram of an electronic device in one embodiment of this specification. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0052] In the following introduction, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The following introduction provides multiple embodiments of the present application, and different embodiments can be replaced or combined, so the present application can also be considered to include all possible combinations of the same and / or different embodiments recorded. Therefore, if one embodiment includes features A, B, and C, and another embodiment includes features B and D, then the present application should also be considered to include embodiments containing one or more of all other possible combinations of A, B, C, and D, although the embodiment may not be clearly recorded in the following text.
[0053] The following description provides examples and does not limit the scope, applicability or examples set forth in the claims. Changes may be made to the functions and arrangements of the elements described without departing from the scope of the present application. Various processes or components may be appropriately omitted, substituted or added to each example. For example, the described method may be performed in an order different from the order described, and various steps may be added, omitted or combined. In addition, features described in some examples may be combined in other examples.
[0054] Embodiment 1:
[0055] See also Figure 1 , Figure 1 : is a flow chart of a remote sensing image change detection method provided in an embodiment of the present application. In an embodiment of the present application, the method includes:
[0056] S101: Acquire first image sample data and second image sample data.
[0057] In the embodiment of this specification, obtaining the first image sample data and the second image sample data specifically includes:
[0058] The first-phase original images and the second-phase original images are obtained.
[0059] The first-period original image is the original image of the early stage, assuming that 17,000 first-period original images are obtained. The second-period original image is the original image of the later stage, assuming that 17,000 second-period original images are obtained. The first-period original image corresponds to the second-period original image one by one, that is, the same location in the same area corresponds to one first-period original image and one second-period original image. The size of the first-period original image and the second-period original image can be 512*512 pixels.
[0060] The first-phase original images and the second-phase original images have one or two or more types of objects such as buildings, grasslands, woodlands, water bodies and tea trees. The objects such as buildings, grasslands, woodlands, water bodies and tea trees are used as detection targets for the first-phase original images and the second-phase original images.
[0061] The target area of the second-phase original image is found, and the target area is marked on the second-phase original image to obtain second image sample data.
[0062] Take a second-phase original image (assuming it is the second-phase original image B) as an example, first manually find the target area on the second-phase original image B (the target area can be a building, grassland, woodland, water body, etc.), and then mark these target areas on the second-phase original image B (specifically, the outline of the target area can be marked and the mask can be filled in the outline of the target area). Assume that the second-phase original image B has a total of 3 target areas marked: target area b1, target area b2 and target area b3. When the second-phase original image B is marked, a second image sample data B is obtained.
[0063] After all 17,000 second-phase original images are labeled, 17,000 second-phase image sample data are obtained.
[0064] A graphic file of the target area of the second image sample data is obtained.
[0065] Taking a second image sample data (assuming it is the second image sample data B) as an example, the contour position information of three target areas can be obtained through the second image sample data B, and the contour position information can be represented by a SHP graphic file, that is, the graphic files of the three target areas can be obtained through the second image sample data B: graphic file B1, graphic file B2 and graphic file B3.
[0066] In short, for each second image sample data, a graphic file corresponding one-to-one to the target area of the second image sample data can be obtained.
[0067] The target area is marked on the first original image based on the graphic file to obtain first image sample data.
[0068] Take a first-period original image (assuming it is the first-period original image A, which corresponds to the second-period original image B) as an example, combine the graphic files B1, B2 and B3 with the first-period original image A, that is, automatically mark the target area a1 (corresponding to the target area b1), the target area a2 (corresponding to the target area b2) and the target area a3 (corresponding to the target area b3) on the first-period original image A according to the contour position information provided by the graphic files B1, B2 and B3, and automatically fill the mask in the target area contour. At this time, a first image sample data A is obtained.
[0069] After all 17,000 first-phase original images are labeled, 17,000 first-phase image sample data are obtained.
[0070] In summary, the first image sample data and the second image sample data can be obtained through step S101. The target area of the first image sample data does not need to be manually marked, but is automatically marked based on the graphic file obtained through the target area of the second image sample data, which greatly reduces the workload and saves manpower.
[0071] S102: Acquire a first image detection model and a second image detection model based on the first image sample data and the second image sample data.
[0072] In the embodiment of the present specification, obtaining the first image detection model and the second image detection model based on the first image sample data and the second image sample data specifically includes:
[0073] The second image sample data is used to train the image segmentation model 1 to obtain a second image detection model.
[0074] The first image sample data and the second image sample data are used together to train the second image segmentation model to obtain the first image detection model.
[0075] Image segmentation model 1 and image segmentation model 2 both use the Mask2Former model, and the learning rate of the Mask2Former model is set to 0.0001. The second image detection model is directly trained by the second image sample data. In order to improve the detection accuracy of the first image detection model, the first image detection model needs to be trained by the first image sample data and the second image sample data.
[0076] Through step S102, a trained first image detection model and a second image detection model can be obtained. The first image detection model is used for subsequent detection of early images, and the second image detection model is used for subsequent detection of late images.
[0077] Since the first image detection model is trained through the entire target area (including changed areas and unchanged areas), the second image detection model is also trained through the entire target area (including changed areas and unchanged areas), the detection accuracy of the first image detection model and the second image detection model is relatively high.
[0078] S103, detecting the first image to be detected by using the first image detection model to obtain a first target area image, detecting the second image to be detected by using the second image detection model to obtain a second target area image, and acquiring a target difference area image through the first target area image and the second target area image.
[0079] In the embodiment of this specification, the first image to be detected is an early image, and the second image to be detected is a late image. This embodiment takes a first image to be detected (assuming it is the first image to be detected C) and a corresponding second image to be detected (assuming it is the second image to be detected D) as an example.
[0080] After the first image C to be detected is input into the first image detection model (trained in step S102), a first target area image C can be obtained, which is an image of the first target area automatically labeled with the detected target area based on the first image C to be detected. Each target area has corresponding contour position information.
[0081] After the second image D to be detected is input into the second image detection model (trained in step S102), a second target area image D can be obtained, and the second target area image D is automatically labeled with the detected target area based on the second image D to be detected. Each target area has corresponding contour position information.
[0082] In the embodiment of the present specification, obtaining the target difference area image through the first target area image C and the second target area image D specifically includes:
[0083] A first graphic file of a first target area on a first target area image C is obtained, a second graphic file of a second target area on a second target area image D is obtained, and a non-overlapping area of the first graphic file and the second graphic file is calculated to obtain a non-overlapping image file.
[0084] Assume that there is a first target area c on the first target area image C, and the corresponding SHP graphic file (i.e., the first graphic file c) can be obtained through the contour position information of the first target area c. Assume that there is a second target area d on the second target area image D, and the corresponding SHP graphic file (i.e., the second graphic file d) can be obtained through the contour position information of the second target area d. Calculate the non-overlapping area of the first graphic file c and the second graphic file d to obtain a non-overlapping graphic file. This embodiment assumes that there are 5 non-overlapping areas, so there are also 5 corresponding non-overlapping graphic files: non-overlapping graphic file d1, non-overlapping graphic file d2, non-overlapping graphic file d3, non-overlapping graphic file d4, and non-overlapping graphic file d5.
[0085] The non-overlapping graphic files are rasterized to obtain non-overlapping raster data, the non-overlapping raster data are filtered, and the filtered non-overlapping raster data are converted into target difference graphic files.
[0086] Due to the influence of factors such as the shooting angle of the image data, the lighting direction of the shooting time, and the degree of subdivision of the edge area of the object sample, there will be certain errors at the edge of the object, especially at the edge of a large tract of woodland. After the two-phase image detection, there will be long strips of pseudo changes. These pseudo changes can be removed by this step. In this embodiment, the filter kernel size is set to 25*25 pixels. As for how to rasterize the non-overlapping graphic files, how to filter the non-overlapping raster data, and how to convert the filtered non-overlapping raster data into the target difference graphic files, the existing technology can be directly used.
[0087] Perform area filtering on the target difference graphic file: obtain the area value of the target difference graphic file, and when the area value is less than the area threshold, remove the corresponding target difference graphic file.
[0088] This embodiment assumes that the area threshold is 100 square meters. Assume that the area value of the target difference graphic file d1 obtained in this embodiment is greater than 100 square meters; the area value of the target difference graphic file d2 obtained is greater than 100 square meters; the area value of the target difference graphic file d3 obtained is less than 100 square meters; the area value of the target difference graphic file d4 obtained is less than 100 square meters; the area value of the target difference graphic file d5 obtained is greater than 100 square meters. Then the target difference graphic file d3 and the target difference graphic file d4 are removed, leaving the target difference graphic file d1, the target difference graphic file d2 and the target difference graphic file d5. This step can remove some small and fragmented target difference areas.
[0089] The remaining target difference graphic files are combined with the first image to be detected or the second image to be detected to obtain a target difference area image.
[0090] In this embodiment, the target difference graphic file d1, the target difference graphic file d2 and the target difference graphic file d5 are combined with the second image D to be detected, that is, the target difference area d1, the target difference area d2 and the target area difference area d5 are automatically marked on the second image D to be detected according to the contour position information provided by the target difference graphic file d1, the target difference graphic file d2 and the target difference graphic file d5, and the mask is automatically filled in the target difference area contour. At this time, the target difference area image is obtained.
[0091] After obtaining the target difference area through the first target area and the second target area, this step also performs rasterization filtering and area filtering on the target difference area, so that some pseudo-change target difference areas are removed, thereby improving the accuracy of target difference area detection.
[0092] S104, screening the target difference area on the target difference area image: S104 specifically includes steps 41 to 46, and each target difference area needs to perform steps 41 to 46 once. Following S103, when there are three target difference areas on the target difference area image (that is, when three target difference areas are obtained: target difference area d1, target difference area d2, and target difference area d5), steps 41 to 46 need to be performed three times in sequence.
[0093] This embodiment takes the target difference area d1 as an example and executes steps 41 to 46 once.
[0094] Step 41: Acquire a target difference area on the target difference area image.
[0095] Assume that in this step, the target different area d1 is found on the target different area image.
[0096] Step 42: Obtain the bounding rectangle of the target difference area, and expand the bounding rectangle to obtain a rectangular expansion frame.
[0097] In this step, a circumscribed rectangle is marked on the target difference area d1 of the target difference area image.
[0098] In the embodiment of the present specification, expanding the circumscribed rectangle to obtain a rectangular expansion frame specifically includes:
[0099] The vertical side of the circumscribed rectangle is extended upward by a first length and downward by a second length, and the horizontal side of the circumscribed rectangle is extended to the left by a third length and to the right by a fourth length. When the first distance between the upper horizontal side of the circumscribed rectangle and the upper boundary of the second image to be detected is less than half of the vertical side length of the circumscribed rectangle, the first length is equal to the first distance, otherwise the first length is equal to half of the vertical side length of the circumscribed rectangle; when the second distance between the lower horizontal side of the circumscribed rectangle and the lower boundary of the second image to be detected is less than half of the vertical side length of the circumscribed rectangle, the second length is equal to the second distance, otherwise the second length is equal to half of the vertical side length of the circumscribed rectangle; when the third distance between the left vertical side of the circumscribed rectangle and the left boundary of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the third length is equal to the third distance, otherwise the third length is equal to half of the horizontal side length of the circumscribed rectangle; when the fourth distance between the right vertical side of the circumscribed rectangle and the right boundary of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the fourth length is equal to the fourth distance, otherwise the fourth length is equal to half of the horizontal side length of the circumscribed rectangle.
[0100] In short, this step extends both the vertical and horizontal sides of the circumscribed rectangle. The length of the vertical side extended in a single direction is half of the length of the vertical side, and the length of the horizontal side extended in a single direction is half of the length of the horizontal side. If the extension process has reached the boundary of the second image to be detected, then the extension is stopped, and a rectangular expansion frame is obtained.
[0101] In this step, the corresponding SHP graphic file (ie, the rectangular extension frame graphic file) can be obtained through the outline position information of the rectangular extension frame.
[0102] Step 43: Based on the position information of the rectangular expansion frame, a first sub-image is captured on the first image to be detected, and a first sub-target area image is captured on the first target area image.
[0103] By combining the first image C to be detected with the rectangular extension frame graphic file, a rectangular extension frame can be obtained on the first image C to be detected, and the image within the rectangular extension frame is intercepted to obtain the first sub-image. By combining the first target area image C with the rectangular extension frame graphic file, a rectangular extension frame can be obtained on the first target area image C, and the image within the rectangular extension frame is intercepted to obtain the first sub-target area image.
[0104] Step 44: Based on the position information of the rectangular expansion frame, a second sub-image is captured on the second image to be detected, and a second sub-target area image is captured on the second target area image.
[0105] By combining the second image D to be detected with the rectangular extension frame graphic file, a rectangular extension frame can be obtained on the second image D to be detected, and the image within the rectangular extension frame is intercepted to obtain the second sub-image. By combining the second target area image D with the rectangular extension frame graphic file, a rectangular extension frame can be obtained on the second target area image D, and the image within the rectangular extension frame is intercepted to obtain the second sub-target area image.
[0106] Step 45: Acquire a first sub-detection target area image of the first sub-image through the sub-image detection model, and acquire a second sub-detection target area image of the second sub-image through the sub-image detection model.
[0107] This embodiment uses the SAM large model as the sub-image detection model. The SAM large model is an artificial intelligence model, the full name of which is Segment Anything Model, and is mainly used for image segmentation. After the first sub-image is input into the SAM large model, a first sub-detection target area image can be obtained. The first sub-detection target area image is automatically labeled with the detected target area based on the first sub-image. After the second sub-image is input into the SAM large model, a second sub-detection target area image can be obtained. The second sub-detection target area image is automatically labeled with the detected target area based on the second sub-image.
[0108] Step 46, calculate the intersection-and-union ratio (IOR) 1 between the first sub-detection target area in the first sub-detection target area image and the first sub-target area in the first sub-target area image, and calculate the intersection-and-union ratio (IOR) 2 between the second sub-detection target area in the second sub-detection target area image and the second sub-target area in the second sub-target area image; when both the IOR 1 and the IOR 2 are greater than the IOR threshold, remove the corresponding target difference area.
[0109] In this embodiment, the intersection-over-union ratio threshold is 0.4. When both the intersection-over-union ratio 1 and the intersection-over-union ratio 2 are greater than 0.4, it means that the target difference area belongs to the same category as its adjacent area within the rectangular expansion frame, and is a pseudo change.
[0110] Assuming that the I / O ratio 1 and I / O ratio 2 finally calculated for the target difference region d1 are both greater than 0.4, the target difference region d1 is removed.
[0111] Then, step 41 to step 46 are executed for the target difference area d2. Assuming that the I / O ratio 1 and I / O ratio 2 finally calculated for the target difference area d2 are not both greater than 0.4, the target difference area d2 is retained.
[0112] Then, step 41 to step 46 are performed again for the target difference area d5. Assuming that the I / O ratio 1 and I / O ratio 2 finally calculated for the target difference area d5 are not both greater than 0.4, the target difference area d5 is retained.
[0113] After screening the target difference areas on the target difference area image in this step, the target difference areas d2 and d5 are finally obtained. This step can remove some pseudo-changed target difference areas, further improving the accuracy of remote sensing image change detection.
[0114] In the embodiment of the present specification, screening the target difference area on the target difference area image further includes:
[0115] A plurality of prompt points are randomly generated in the target difference region, the minimum distance between each prompt point and the edge of the target difference region is equal, and the interval distance between every two prompt points is greater than the minimum distance threshold.
[0116] This is equivalent to setting a buffer zone in the target difference zone, which is the same shape as the target difference zone and is 2 meters smaller than the target difference zone. In this embodiment, the number of prompt points is 5, and the 5 prompt points are all set on the boundary of the buffer zone to prevent the prompt points from being too close to the boundary of the target difference zone. In addition, a certain distance needs to be maintained between the 5 prompt points to avoid the 5 random prompt points from being too concentrated.
[0117] After the five prompt points are generated, the position information of the five prompt points can be obtained based on the target difference area image. In this embodiment, these five prompt points are used as prompt points of the SAM large model, and these five prompt points assist the SAM large model in obtaining the first sub-detection target area image and the second sub-detection target area image.
[0118] Furthermore, the remote sensing image change detection method of this embodiment further includes: Step 51 to Step 56, wherein Step 51 to Step 55 need to be completed before S104, and Step 56 needs to be performed after S104.
[0119] Step 51 : obtaining an initial target difference area image through the first initial image and the second initial image, and marking a circumscribed rectangular frame on the initial target difference area of the initial target difference area image.
[0120] The first initial image is the early remote sensing image, assuming that 5000 first initial images are collected. The second initial image is the remote sensing image before and after the second initial image, assuming that 5000 second initial images are collected. And the first initial image corresponds to the second initial image one by one, that is, the same location in the same area corresponds to a first initial image and a second initial image. The size of the first initial image and the second initial image can be 512*512 pixels.
[0121] The first initial image and the second initial image have one or two or more types of objects such as buildings, grasslands, woodlands, water bodies and tea trees. The objects such as buildings, grasslands, woodlands, water bodies and tea trees are used as detection targets of the first initial image and the second initial image.
[0122] The initial target difference area image of the first initial image and the second initial image can be obtained through the first image detection model and the second image detection model in S102 and the same steps as S103. When the first initial image and the second initial image are 5000 images respectively, the final initial target difference area image is also 5000 images.
[0123] This step also requires annotating the initial target difference area with an external rectangular frame on the initial target difference area image. Taking an initial target difference area image E as an example, when there are three initial target difference areas (initial target difference area e1, initial target difference area e2, and initial target difference area e3) on the initial target difference area image E, an external rectangular frame e1 is annotated for the initial target difference area e1, an external rectangular frame e2 is annotated for the initial target difference area e2, and an external rectangular frame e3 is annotated for the initial target difference area e3.
[0124] Based on the contour position information of the three circumscribed rectangular frames, the corresponding three SHP graphic files can be obtained, that is, the three circumscribed rectangular frame graphic files can be obtained.
[0125] Step 52 : setting a first circumscribed rectangular frame at a corresponding position of the first initial image according to the position information of the circumscribed rectangular frame, and setting a second circumscribed rectangular frame at a corresponding position of the second initial image according to the position information of the circumscribed rectangular frame.
[0126] Based on the three external rectangular frame graphic files, three corresponding first external rectangular frames can be set on the first initial image: the first external rectangular frame e1-1 (corresponding to the external rectangular frame e1), the first external rectangular frame e2-1 (corresponding to the external rectangular frame e2), and the first external rectangular frame e3-1 (corresponding to the external rectangular frame e3); and at the same time, three corresponding second external rectangular frames can be set on the second initial image: the second external rectangular frame e1-2 (corresponding to the first external rectangular frame e1-1), the second external rectangular frame e2-2 (corresponding to the first external rectangular frame e2-1), and the second external rectangular frame e3-2 (corresponding to the first external rectangular frame e3-1).
[0127] When the first circumscribed rectangular frame is set, the length of its horizontal side and vertical side are automatically adjusted to multiples of 100 pixels. For example, if the actual length of the horizontal side of the first circumscribed rectangular frame e1-1 is 130 pixels, then the length of the horizontal side of the first circumscribed rectangular frame e1-1 is automatically adjusted to 200 pixels. For another example, if the actual length of the vertical side of the first circumscribed rectangular frame e1-1 is 80 pixels, then the length of the vertical side of the first circumscribed rectangular frame e1-1 is automatically adjusted to 100 pixels.
[0128] Similarly, when the second circumscribed rectangular frame is set, the horizontal and vertical lengths thereof are automatically adjusted to multiples of 100 pixels.
[0129] Step 53, intercepting the first sub-initial image by sliding the frame in the first circumscribed rectangular frame of the first initial image, intercepting the second sub-initial image by sliding the frame in the second circumscribed rectangular frame of the second initial image, and setting the first sub-initial image and the second sub-initial image at the same position as a group of image pairs.
[0130] In this embodiment, the size of the sliding frame is 100*100 pixels.
[0131] Taking the first circumscribed rectangular frame e1-1 and the corresponding second circumscribed rectangular frame e1-2 as an example, the first sliding frame is set at the upper left corner of the first circumscribed rectangular frame e1-1, and the second sliding frame is set at the upper left corner of the second circumscribed rectangular frame e1-2. At this time, the first sub-initial image and the second sub-initial image obtained by interception are corresponding, and the first sub-initial image and the second sub-initial image are bundled together to form a set of graphic pairs.
[0132] Next, slide frame No. 1 is moved rightward by a step length (may be 100 pixels) within the first circumscribed rectangular frame e1-1, and slide frame No. 2 is moved rightward by a step length (may be 100 pixels) within the second circumscribed rectangular frame e1-2. At this time, the first sub-initial image and the second sub-initial image obtained by interception are also corresponding, and the first sub-initial image and the second sub-initial image are bundled together to form a set of graphic pairs.
[0133] This step is repeated until all of the first sub-initial image and the second sub-initial image are intercepted, thus forming the last group of graphic pairs.
[0134] Step 54, grouping the image pairs: when the first sub-initial image and the second sub-initial image of the image pair are real changes, the image pair is grouped into the first image pair group; when the first sub-initial image and the second sub-initial image of the image pair are pseudo changes, the image pair is grouped into the second image pair group.
[0135] The first sub-initial image and the second sub-initial image in the image pair, in some image pairs, the first sub-initial image and the second sub-initial image are different ground objects, that is, the first sub-initial image and the second sub-initial image have undergone real changes; in some image pairs, the first sub-initial image and the second sub-initial image are actually the same ground object, that is, the first sub-initial image and the second sub-initial image have undergone pseudo changes.
[0136] This step requires manual grouping of the image pairs to distinguish between real-changed image pairs and pseudo-changed image pairs. The real-changed image pairs are grouped into the first image pair group, and the pseudo-changed image pairs are grouped into the second image pair group.
[0137] Step 55: Obtain a classification model based on the image pairs in the first image pair group and the second image pair group.
[0138] The classification model of this embodiment can be a neural network model, which uses the image pairs in the first image pair group and the second image pair group to train the classification model, and finally obtains a classification model with a classification accuracy that meets the requirements. When the classification model is used in detail, when the input image pair is a real change, the classification model outputs a result of "1"; when the input image pair is a pseudo change, the classification model outputs a result of "0".
[0139] Step 56: Perform secondary screening on the target difference area on the target difference area image based on the classification model.
[0140] First, the remaining target difference area on the current target difference area image is determined, and a first sub-initial image is obtained on the first image to be detected and a second sub-initial image is obtained on the second image to be detected according to the remaining target difference area, and the first sub-initial image and the second sub-initial image obtained by the same remaining target difference area are bundled one by one to form a plurality of graphic pairs.
[0141] In this embodiment, it is assumed that only the target difference area d2 and the target difference area d5 are left after S104 is executed, and then the remaining target difference areas on the current target difference area image are: the target difference area d2 and the target difference area d5.
[0142] For the target difference area d2, multiple first sub-initial images can be obtained on the first image to be detected C and multiple second sub-initial images can be obtained on the second image to be detected D through the same steps as steps 51, 52, and 53, and then the first sub-initial images and the second sub-initial images at the same position are bundled one by one to form multiple graphic pairs.
[0143] For the target difference area d5, multiple first sub-initial images can be obtained on the first image to be detected C and multiple second sub-initial images can be obtained on the second image to be detected D through the same steps as steps 51, 52, and 53, and then the first sub-initial images and the second sub-initial images at the same position are bundled one by one to form multiple graphic pairs.
[0144] Then, multiple graphic pairs obtained from the same remaining target difference region are input into the classification model, and the remaining target difference region is determined to be a real change or a false change according to the number of graphic pairs and the output result of the classification model.
[0145] For example, when the number of graphic pairs obtained for a certain remaining target difference area is 1-5, if there is 1 "1" in the output result of the classification model, the corresponding remaining target difference area is judged to be a real change; otherwise, the corresponding remaining target difference area is judged to be a false change.
[0146] For another example, when the number of graphic pairs obtained for a certain remaining target difference area is 6-10, if there are 2 "1"s in the output result of the classification model, the corresponding remaining target difference area is judged to be a real change; otherwise, the corresponding remaining target difference area is judged to be a false change.
[0147] When the determination result of the remaining target difference area is a false change, the corresponding remaining target difference area is removed; when the determination result of the remaining target difference area is a true change, the corresponding remaining target difference area is retained.
[0148] In this embodiment, it is assumed that the final determination result of the target difference area d2 is a false change, and the target difference area d2 is removed. It is assumed that the final determination result of the target difference area d5 is a real change, and the target difference area d2 is retained.
[0149] In this step, the target difference area on the target difference area image is screened twice to obtain the final target difference area. This step can further remove the target difference area with pseudo changes, and most of the retained difference areas are real change areas, which can further improve the accuracy and practical applicability of remote sensing image change detection.
[0150] Embodiment 2:
[0151] The following will be combined with the attached Figure 2 , the remote sensing image change detection device provided in the embodiment of the present application is introduced in detail. It should be noted that the attached Figure 2 The remote sensing image change detection device shown is used to execute the present application Figure 1 For the convenience of explanation, only the part related to the embodiment of the present application is shown. For the specific technical details not disclosed, please refer to the present application. Figure 1 The embodiment shown.
[0152] See also Figure 2 , Figure 2 Schematic diagram of a remote sensing image change detection device provided in an embodiment of the present application. Figure 2 As shown, the device comprises:
[0153] An image sample data acquisition module 201 is used to acquire first image sample data and second image sample data;
[0154] An image detection model acquisition module 202 is used to acquire a first image detection model and a second image detection model based on the first image sample data and the second image sample data;
[0155] The target difference area image acquisition module 203 is used to detect the first image to be detected by using the first image detection model to obtain a first target area image, detect the second image to be detected by using the second image detection model to obtain a second target area image, and obtain a target difference area image through the first target area image and the second target area image;
[0156] The target difference area screening module 204 is used to screen the target difference area on the target difference area image:
[0157] A target difference area on a target difference area image is obtained; a circumscribed rectangle of the target difference area is obtained, and the circumscribed rectangle is expanded to obtain a rectangular expansion frame; a first sub-image is captured on a first image to be detected based on the position information of the rectangular expansion frame, and a first sub-target area image is captured on the first target area image; a second sub-image is captured on a second image to be detected based on the position information of the rectangular expansion frame, and a second sub-target area image is captured on the second target area image; a first sub-detection target area image of the first sub-image is obtained through a sub-image detection model, and a second sub-detection target area image of the second sub-image is obtained through the sub-image detection model; an intersection-and-union ratio of a first sub-detection target area in the first sub-detection target area image to a first sub-target area in the first sub-target area image is calculated as one, and an intersection-and-union ratio of a second sub-detection target area in the second sub-detection target area image to a second sub-target area in the second sub-target area image is calculated as two, and when both the intersection-and-union ratio one and the intersection-and-union ratio two are greater than an intersection-and-union ratio threshold, the corresponding target difference area is removed.
[0158] In one possible implementation, the image sample data acquisition module 201 specifically includes:
[0159] An original image acquisition unit, used for acquiring the original image of the first period and the original image of the second period;
[0160] A second image sample data acquisition unit, used for finding the target area of the second-phase original image and marking the target area on the second-phase original image to obtain second image sample data;
[0161] A graphic file acquisition unit, used for acquiring a graphic file of a target area of the second image sample data;
[0162] The first image sample data acquisition unit is used to mark the target area on the first original image based on the graphic file to obtain the first image sample data.
[0163] In one possible implementation, the image detection model acquisition module 202 specifically includes:
[0164] A second image detection model acquisition unit, used for training the image segmentation model 1 with the second image sample data to obtain a second image detection model;
[0165] The first image detection model acquisition unit is used to train the second image segmentation model with the first image sample data and the second image sample data to obtain the first image detection model.
[0166] In one possible implementation, the target difference area image acquisition module 203 includes:
[0167] a non-overlapping graphic file acquisition unit, used for acquiring a first graphic file of a first target area on the first target area image, acquiring a second graphic file of a second target area on the second target area image, and calculating a non-overlapping area between the first graphic file and the second graphic file to obtain a non-overlapping graphic file;
[0168] A target difference graphic file acquisition unit is used to perform rasterization processing on the non-overlapping graphic file to obtain non-overlapping raster data, perform filtering processing on the non-overlapping raster data, and convert the filtered non-overlapping raster data into a target difference graphic file;
[0169] The target difference graphic file filtering unit is used to perform area filtering on the target difference graphic file: obtaining the area value of the target difference graphic file, and when the area value is less than the area threshold, removing the corresponding target difference graphic file;
[0170] The target difference area image acquisition unit is used to combine the remaining target difference graphic files with the first image to be detected or the second image to be detected to obtain the target difference area image.
[0171] In one embodiment, the target difference region screening module 204 includes:
[0172] A rectangular expansion frame acquisition unit is used to extend the vertical side of the circumscribed rectangle upward by a first length and downward by a second length, and to extend the horizontal side of the circumscribed rectangle to the left by a third length and to the right by a fourth length. When the first distance between the upper horizontal side of the circumscribed rectangle and the upper boundary of the second image to be detected is less than half of the length of the vertical side of the circumscribed rectangle, the first length is equal to the first distance, otherwise the first length is equal to half of the length of the vertical side of the circumscribed rectangle; when the second distance between the lower horizontal side of the circumscribed rectangle and the lower boundary of the second image to be detected is less than half of the length of the vertical side of the circumscribed rectangle , the second length is equal to the second distance, otherwise the second length is equal to half of the vertical side length of the circumscribed rectangle; when the third distance between the left vertical side of the circumscribed rectangle and the left border of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the third length is equal to the third distance, otherwise the third length is equal to half of the horizontal side length of the circumscribed rectangle; when the fourth distance between the right vertical side of the circumscribed rectangle and the right border of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the fourth length is equal to the fourth distance, otherwise the fourth length is equal to half of the horizontal side length of the circumscribed rectangle.
[0173] In one embodiment, the target difference region screening module 204 includes:
[0174] A sub-image detection model determination unit, used to adopt the SAM large model as the sub-image detection model;
[0175] The prompt point generation unit is used to randomly generate multiple prompt points in the target difference area, the minimum distance between each prompt point and the edge of the target difference area is equal, and the interval distance between every two prompt points is greater than the minimum distance threshold, and the prompt points are used as prompt points of the SAM large model.
[0176] Furthermore, the remote sensing image change detection device of this embodiment further includes:
[0177] An external rectangular frame acquisition module is used to acquire an initial target difference area image through the first initial image and the second initial image, and mark an external rectangular frame on the initial target difference area of the initial target difference area image;
[0178] An external rectangular frame setting module, used to set a first external rectangular frame at a corresponding position of the first initial image according to the position information of the external rectangular frame, and to set a second external rectangular frame at a corresponding position of the second initial image according to the position information of the external rectangular frame;
[0179] An image pair acquisition module, used to intercept a first sub-initial image by sliding a frame within a first circumscribed rectangular frame of a first initial image, intercept a second sub-initial image by sliding a frame within a second circumscribed rectangular frame of a second initial image, and set the first sub-initial image and the second sub-initial image at the same position as a group of image pairs;
[0180] An image pair grouping module, used for grouping the image pairs: when the first sub-initial image and the second sub-initial image of the image pair are real changes, the image pair is grouped into a first image pair group; when the first sub-initial image and the second sub-initial image of the image pair are pseudo changes, the image pair is grouped into a second image pair group;
[0181] A classification model acquisition module, used to obtain a classification model based on the image pairs in the first image pair group and the second image pair group;
[0182] The target difference area secondary screening module is used to perform secondary screening on the target difference area on the target difference area image based on the classification model.
[0183] Embodiment 3:
[0184] Those skilled in the art can clearly understand that the technical solutions of the embodiments of the present application can be implemented with the help of software and / or hardware. The "unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array (FPGA), an integrated circuit (IC), etc.
[0185] Each processing unit and / or module of the embodiments of the present application may be implemented by an analog circuit that implements the functions of the embodiments of the present application, or may be implemented by software that executes the functions of the embodiments of the present application.
[0186] See also Figure 3 , which shows a schematic diagram of the structure of an electronic device involved in an embodiment of the present application, the electronic device can be used to implement Figure 1 The method in the embodiment shown. Figure 3 As shown, the electronic device 300 may include: at least one processor 301 , at least one network interface 304 , a user interface 303 , a memory 305 , and at least one communication bus 302 .
[0187] The communication bus 302 is used to realize the connection and communication between these components.
[0188] The user interface 303 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 303 may also include a standard wired interface and a wireless interface.
[0189] The network interface 304 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0190] Among them, the processor 301 may include one or more processing cores. The processor 301 uses various interfaces and lines to connect various parts of the entire electronic device 300, and executes various functions and processes data of the electronic device 300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 305, and calling data stored in the memory 305. Optionally, the processor 301 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 301 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics central processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 301, and it can be implemented separately through a chip.
[0191] Among them, the memory 305 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 305 includes a non-transitory computer-readable storage medium. The memory 305 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 305 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 305 may also be optionally at least one storage device located away from the aforementioned processor 301. As Figure 3 As shown, the memory 305 as a computer storage medium may include an operating system, a network communication module, a user interface module, and program instructions.
[0192] exist Figure 3In the electronic device 300 shown, the user interface 303 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 301 can be used to call the remote sensing image change detection application stored in the memory 305, and specifically perform the following operations:
[0193] Acquire first image sample data and second image sample data;
[0194] Acquire a first image detection model and a second image detection model based on the first image sample data and the second image sample data;
[0195] The first image to be detected is detected by a first image detection model to obtain a first target area image, the second image to be detected is detected by a second image detection model to obtain a second target area image, and a target difference area image is obtained through the first target area image and the second target area image;
[0196] Filter the target difference area on the target difference area image:
[0197] A target difference area on a target difference area image is obtained; a circumscribed rectangle of the target difference area is obtained, and the circumscribed rectangle is expanded to obtain a rectangular expansion frame; a first sub-image is captured on a first image to be detected based on the position information of the rectangular expansion frame, and a first sub-target area image is captured on the first target area image; a second sub-image is captured on a second image to be detected based on the position information of the rectangular expansion frame, and a second sub-target area image is captured on the second target area image; a first sub-detection target area image of the first sub-image is obtained through a sub-image detection model, and a second sub-detection target area image of the second sub-image is obtained through the sub-image detection model; an intersection-and-union ratio of a first sub-detection target area in the first sub-detection target area image to a first sub-target area in the first sub-target area image is calculated as one, and an intersection-and-union ratio of a second sub-detection target area in the second sub-detection target area image to a second sub-target area in the second sub-target area image is calculated as two, and when both the intersection-and-union ratio one and the intersection-and-union ratio two are greater than an intersection-and-union ratio threshold, the corresponding target difference area is removed.
[0198] Embodiment 4:
[0199] The present application also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the above method are implemented. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), or any type of medium or device suitable for storing instructions and / or data.
[0200] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0201] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0202] In the several embodiments provided in the present application, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0203] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0204] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0205] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM), random access memory (RAM), mobile hard disk, disk or optical disk and other media that can store program codes.
[0206] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by entering a program to instruct related hardware, and the program may be stored in a computer-readable memory, which may include a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0207] The above are merely exemplary embodiments of the present application and are not intended to limit the scope of the present application.
Claims
1. A remote sensing image change detection method, characterized in that: The method comprises: Acquire first image sample data and second image sample data; Acquire a first image detection model and a second image detection model based on the first image sample data and the second image sample data; The first image to be detected is detected by the first image detection model to obtain a first target area image, the second image to be detected is detected by the second image detection model to obtain a second target area image, and a target difference area image is acquired by the first target area image and the second target area image; Screening the target difference area on the target difference area image: A target difference area on the target difference area image is obtained; a circumscribed rectangle of the target difference area is obtained, and the circumscribed rectangle is expanded to obtain a rectangular expansion frame; based on the position information of the rectangular expansion frame, a first sub-image is intercepted on the first image to be detected, and a first sub-target area image is intercepted on the first target area image; based on the position information of the rectangular expansion frame, a second sub-image is intercepted on the second image to be detected, and a second sub-target area image is intercepted on the second target area image; a first sub-detection target area image of the first sub-image is obtained through a sub-image detection model, and a second sub-detection target area image of the second sub-image is obtained through a sub-image detection model; an intersection-and-union ratio of a first sub-detection target area in the first sub-detection target area image to a first sub-target area in the first sub-target area image is calculated as one, and an intersection-and-union ratio of a second sub-detection target area in the second sub-detection target area image to a second sub-target area in the second sub-target area image is calculated as two, and when both the intersection-and-union ratio of the first and the intersection-and-union ratio of the second are greater than an intersection-and-union ratio threshold, the corresponding target difference area is removed.
2. The method according to claim 1, characterized in that Acquiring the first image sample data and the second image sample data specifically includes: Acquire the original images of the first phase and the original images of the second phase; Finding the target area of the second-phase original image, and marking the target area on the second-phase original image to obtain the second image sample data; Acquire a graphic file of a target area of the second image sample data; The target area is marked on the first original image based on the graphic file to obtain the first image sample data.
3. The method according to claim 2, characterized in that Acquiring a first image detection model and a second image detection model based on the first image sample data and the second image sample data specifically includes: Using the second image sample data to train an image segmentation model 1 to obtain a second image detection model; The first image sample data and the second image sample data are used together to train an image segmentation model 2 to obtain a first image detection model.
4. The method according to claim 1, characterized in that: Acquiring the target difference area image through the first target area image and the second target area image specifically includes: Acquire a first graphic file of a first target area on the first target area image, acquire a second graphic file of a second target area on the second target area image, and calculate a non-overlapping area between the first graphic file and the second graphic file to obtain a non-overlapping graphic file; rasterizing the non-overlapping graphic files to obtain non-overlapping raster data, filtering the non-overlapping raster data, and converting the filtered non-overlapping raster data into a target difference graphic file; Performing area filtering on the target difference graphic file: obtaining the area value of the target difference graphic file, and when the area value is less than an area threshold, removing the corresponding target difference graphic file; The remaining target difference graphic files are combined with the first image to be detected or the second image to be detected to obtain a target difference area image.
5. The method according to claim 1, characterized in that Expanding the circumscribed rectangle to obtain a rectangular expansion frame specifically includes: The vertical side of the circumscribed rectangle is extended upward by a first length and downward by a second length, and the horizontal side of the circumscribed rectangle is extended to the left by a third length and to the right by a fourth length. When a first distance between an upper horizontal side of the circumscribed rectangle and an upper boundary of the second image to be detected is less than half of the length of the vertical side of the circumscribed rectangle, the first length is equal to the first distance, otherwise the first length is equal to half of the length of the vertical side of the circumscribed rectangle; when a second distance between a lower horizontal side of the circumscribed rectangle and a lower boundary of the second image to be detected is less than half of the length of the vertical side of the circumscribed rectangle, the second length is equal to the second distance. When the third distance between the left vertical side of the circumscribed rectangle and the left border of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the third length is equal to the third distance, otherwise the third length is equal to half of the horizontal side length of the circumscribed rectangle; when the fourth distance between the right vertical side of the circumscribed rectangle and the right border of the second image to be detected is less than half of the horizontal side length of the circumscribed rectangle, the fourth length is equal to the fourth distance, otherwise the fourth length is equal to half of the horizontal side length of the circumscribed rectangle.
6. The method according to claim 1, characterized in that Screening the target difference area on the target difference area image further includes: The SAM large model is used as the sub-image detection model; A plurality of prompt points are randomly generated in the target difference area, the minimum distance between each prompt point and the edge of the target difference area is equal, and the interval distance between each two prompt points is greater than the minimum distance threshold, and the prompt points are used as prompt points of the SAM large model.
7. The method according to claim 1, characterized in that Also includes: Acquire an initial target difference area image through the first initial image and the second initial image, and mark a circumscribed rectangular frame on the initial target difference area of the initial target difference area image; Setting a first circumscribed rectangular frame at a corresponding position of the first initial image according to the position information of the circumscribed rectangular frame, and setting a second circumscribed rectangular frame at a corresponding position of the second initial image according to the position information of the circumscribed rectangular frame; intercepting a first sub-initial image by sliding a frame within a first circumscribed rectangular frame of the first initial image, intercepting a second sub-initial image by sliding a frame within a second circumscribed rectangular frame of the second initial image, and setting the first sub-initial image and the second sub-initial image at the same position as a group of image pairs; The image pairs are grouped: when the first sub-initial image and the second sub-initial image of the image pair are real changes, the image pair is grouped into a first image pair group; when the first sub-initial image and the second sub-initial image of the image pair are pseudo changes, the image pair is grouped into a second image pair group; Obtaining a classification model based on training of image pairs in the first image pair group and the second image pair group; A secondary screening is performed on the target difference area on the target difference area image based on the classification model.
8. A remote sensing image change detection device, characterized in that: The device comprises: An image sample data acquisition module, used to acquire first image sample data and second image sample data; An image detection model acquisition module, used to acquire a first image detection model and a second image detection model based on the first image sample data and the second image sample data; a target difference area image acquisition module, configured to detect the first image to be detected by using the first image detection model to obtain a first target area image, detect the second image to be detected by using the second image detection model to obtain a second target area image, and acquire a target difference area image by using the first target area image and the second target area image; The target difference area screening module is used to screen the target difference area on the target difference area image: A target difference area on the target difference area image is obtained; a circumscribed rectangle of the target difference area is obtained, and the circumscribed rectangle is expanded to obtain a rectangular expansion frame; based on the position information of the rectangular expansion frame, a first sub-image is intercepted on the first image to be detected, and a first sub-target area image is intercepted on the first target area image; based on the position information of the rectangular expansion frame, a second sub-image is intercepted on the second image to be detected, and a second sub-target area image is intercepted on the second target area image; a first sub-detection target area image of the first sub-image is obtained through a sub-first image detection model, and a second sub-detection target area image of the second sub-image is obtained through a sub-image detection model; an intersection-and-union ratio of a first sub-detection target area in the first sub-detection target area image to a first sub-target area in the first sub-target area image is calculated as one, and an intersection-and-union ratio of a second sub-detection target area in the second sub-detection target area image to a second sub-target area in the second sub-target area image is calculated as two, and when both the intersection-and-union ratio of the first and the intersection-and-union ratio of the second are greater than an intersection-and-union ratio threshold, the corresponding target difference area is removed.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer-readable storage medium has instructions stored therein, and when the instructions are executed on a computer or a processor, the computer or the processor executes the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and device for generating image change detection model and method and device for image change detection
CN112990045A
Remote sensing image comparative analysis method based on multi-view fusion
CN115830448A