An optimization method and system for removing false alarms of a SAR image detection target mask
By calculating the intersection area between the SAR image and the mask file, false alarm targets are removed, improving detection accuracy and reducing computational load, making it suitable for domestic systems.
Patent Information
- Application Number
- CN202410234676.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-01
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2044-03-01
AI Technical Summary
False alarms in SAR images affect detection accuracy, and existing technologies struggle to effectively remove them.
By reading the intersection area of the image and the mask file, the pixel coordinates of the intersection area are calculated, and it is determined whether the target center is within the intersection area. Targets within the intersection area are retained, while false alarm targets outside the intersection area are removed.
It improves the accuracy of target detection in SAR images, reduces the computational load and hardware storage resource consumption, and is suitable for domestically produced systems.
Smart Images

Figure CN118247499B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and specifically to an optimized method and system for removing false alarms from target masks in SAR image detection. Background Technology
[0002] Masking for false alarm removal primarily involves eliminating false alarm targets from an image. Due to the imaging scattering characteristics of SAR images, many objects similar to the target will appear in the image. These objects will become false detections during SAR target detection, affecting detection accuracy. How to effectively remove false alarms is an important issue in the field of detection and recognition. Summary of the Invention
[0003] To address the technical problems existing in the background art, this invention proposes an optimized method and system for removing false alarms from target masks in SAR image detection.
[0004] This invention proposes an optimized method for removing false alarms using a target mask in SAR image detection, comprising the following steps: S1: Input the image data to be detected, the target file to be detected, and the mask file; S2: Read the latitude and longitude coordinates of the four corner points of the image, as well as the image width and image height; S3: Read all mask regions in the mask file and determine whether each mask region intersects with the image; S4: Calculate the intersection region between the mask region and the image; S5: Convert the latitude and longitude coordinates of all vertices in the intersection region to pixel coordinates relative to the image data; S6: Read the pixel coordinates of the target in the target file and calculate the center coordinates of the target; S7: Determine whether the target center coordinates are within the intersection area, retain targets within the intersection area, and remove targets outside the intersection area; S8: Obtain the target file after removing false alarms.
[0005] Preferably, in step S1, the image data is an image data file with latitude and longitude coordinates; the target detection file is a txt file A, where each line of the txt file is [x1 y1 x2 y2 score label], where x1 and y1 are the pixel coordinates of the upper left corner of the target, x2 and y2 are the pixel coordinates of the lower right corner of the target, label is the target type, and score is the probability value of the target type label; the mask file is a txt file B, which is the prior detection region, where each line of the txt file is [namelon_1 lat_1 lon_2 lat_2 … lon_n lat_n], where name is the name of the prior region, lon_1 and lat_2 are the longitude and latitude of the first vertex of the mask region, and lon_n and lat_n are the longitude and latitude of the nth vertex of the mask region.
[0006] Preferably, in step S1, the method for obtaining the mask file includes the following steps: S11: Draw the prior region on the satellite base map and obtain a vector mask file in shp format; S12: Read the latitude and longitude coordinates of all vertices of the drawing area in the vector mask file; S13: Save the latitude and longitude coordinates to a txt file B in a fixed format; S14: Read the next vector mask file, loop through S12~S14. After all vector mask files are read, the loop ends and a txt file B is obtained, so that the obtained txt file B contains the drawing areas from all the vector mask files.
[0007] Preferably, in step S3, the method for calculating the intersection includes the following steps: S31: Convert all points in the image data, including the latitude and longitude coordinates of the four corner points, into polygon region 1; S32: Read one line from the mask file and obtain the latitude and longitude coordinates of all vertices; S33: Convert all points with the obtained vertex latitude and longitude coordinates into polygon region 2; S34: Determine whether polygon region 1 and polygon region 2 overlap. If they overlap, they are considered to have an intersection; otherwise, they are considered not to have an intersection.
[0008] Preferably, in step S4, if an intersection is determined, the latitude and longitude coordinates of the intersecting vertices of the intersection region are obtained.
[0009] Preferably, in step S5, the latitude and longitude coordinates of the intersecting vertices of the obtained intersection region are converted into pixel coordinates relative to the image data. The specific steps are as follows: S51: Input the latitude and longitude coordinates of the four corner points of the image, the image width, the image height, and the latitude and longitude coordinates of the corner points of the intersection region; S52: Convert the latitude and longitude coordinates of the four corner points of the image to geodetic coordinates (1); S53: Calculate the affine relationship between the pixel coordinates of the four corner points of the image and the geodetic coordinates 1, and extract the affine transformation coefficients; S54: Convert the latitude and longitude coordinates of the intersection vertices of the intersection region to geodetic coordinates 2; S55: Convert the geodetic coordinates 2 to the corresponding pixel coordinates using affine transformation coefficients.
[0010] Preferably, in step S6, the center coordinates of the target are calculated by reading the pixel coordinates of the upper left and lower right corners of the target in the target file.
[0011] Preferably, in step S6, the method for calculating the coordinates of the target center point includes the following steps: S61: The top left corner pixel coordinates are (x_lu, y_lu), and the bottom right corner pixel coordinates are (x_rd, y_rd). S62: Calculated using the following formula: x_c = (x_lu + x_rd) / 2 y_c = (y_lu + y_rd) / 2 Obtain the coordinates (x_c, y_c) of the target center point.
[0012] Preferably, in step S7, removing the target means deleting the line containing the target in the txt file A.
[0013] Preferably, in step S8, the target file after removing false alarms contains targets within the intersection region.
[0014] This invention discloses an optimized system for removing false alarms from target masks in SAR image detection, used to execute the method described above. It includes: an input module, a preprocessing module, a removal module, and an output module, wherein: The input module is used to input the image data to be detected, the target file to be detected, and the mask file; The preprocessing module is used to read image parameters and obtain the intersection area between the image and the mask area; The elimination module is used to determine whether the target is within the intersection area and to remove false alarm targets that are not within the intersection area; The output module is used to output the file after false alarms have been removed.
[0015] This invention uses a mask file to calculate the mask area on the image, retaining the detected target within the mask area, thereby achieving the purpose of removing false alarms and improving the accuracy of target detection. It converts the latitude and longitude coordinates of the mask area into pixel coordinates instead of converting the target pixel coordinates into latitude and longitude coordinates, and uses the target center point coordinates to replace the target, reducing the number of conversions and the amount of computation. Attached Figure Description
[0016] Figure 1 This is a flowchart illustrating an optimized method for removing false alarms using a target mask in SAR image detection, as proposed in this invention. Figure 2 This is a flowchart illustrating the mask file acquisition method in the optimized method for removing false alarms using a SAR image target mask proposed in this invention. Figure 3 This is a schematic diagram of the process of converting latitude and longitude coordinates to pixel coordinates in the optimized method for removing false alarms by target mask in SAR image detection proposed in this invention. Detailed Implementation
[0017] Reference Figure 1 The present invention proposes an optimized method for removing false alarms from SAR image target detection masks, comprising the following steps: S1: Input the image data to be detected, the target file to be detected, and the mask file; S2: Read the latitude and longitude coordinates of the four corner points of the image, as well as the image width and image height from the image data; S3: Read all mask regions in the mask file and determine whether each mask region intersects with the image; S4: If the mask region intersects with the image, calculate the intersection area between the mask region and the image, and proceed to the next step; if there is no intersection, the execution ends. S5: Convert the latitude and longitude coordinates of all vertices in the intersection region to pixel coordinates relative to the image data; S6: Read the pixel coordinates of the target in the target file and calculate the center coordinates of the target; S7: Determine if the target's center coordinates are within the intersection area. If they are, keep the target; otherwise, remove the target. S8: Obtain the target file after removing false alarms.
[0018] In a further embodiment, in step S1, the image data is an image data file with latitude and longitude coordinates; the target detection file is a txt file A, where each line of txt file A is [x1 y1 x2 y2 scorelabel], where x1 and y1 are the pixel coordinates of the upper left corner of the target, x2 and y2 are the pixel coordinates of the lower right corner of the target, label is the target type, and score is the probability value of the target type label; the mask file is a txt file B, which is the prior detection region, where each line of txt file B is [name lon_1 lat_1 lon_2 lat_2 … lon_n lat_n], where name is the name of the prior region, lon_1 and lat_1 are the longitude and latitude of the first vertex of the mask region, and lon_n and lat_n are the longitude and latitude of the nth vertex of the mask region.
[0019] Reference Figure 2 In step S1, the method for obtaining the mask file is as follows: S11: Use the argis software to draw the prior region on the satellite base map and obtain a vector mask file in shp format; S12: Read the latitude and longitude coordinates of all vertices of the drawing area in the vector mask file; S13: Save the latitude and longitude coordinates to a txt file B in a fixed format; S14: Read the next vector mask file. Loop through S12~S14. After all vector mask files are read, the loop ends and a txt file B is obtained. The obtained txt file B contains the drawing areas from all the vector mask files.
[0020] In step S2, the method for calculating the intersection in step S3 is as follows: S31: Convert all points at the four corners of the image into polygon region 1; S32: Read one line from the mask file and obtain the latitude and longitude coordinates of all vertices; S33: Convert all obtained vertex latitude and longitude coordinates and all points into polygon region 2; S34: Determine whether polygon region 1 and polygon region 2 overlap. If they overlap, they are considered to have an intersection; otherwise, they are considered not to have an intersection.
[0021] In step S4, if an intersection is determined, the latitude and longitude coordinates of the intersecting vertices of the intersection region are obtained.
[0022] Reference Figure 3 In step S5, the latitude and longitude coordinates of the intersection vertices of the intersection region are converted into pixel coordinates relative to the image data. The specific steps are as follows: S51: Input the latitude and longitude coordinates of the four corner points of the image, the image width, the image height, and the latitude and longitude coordinates of the corner points of the intersection region; S52: Convert the latitude and longitude coordinates of the four corner points of the image to geodetic coordinates (1); S53: Calculate the affine relationship between the pixel coordinates of the four corner points of the image and the geodetic coordinates 1, and extract the affine transformation coefficients; S54: Convert the latitude and longitude coordinates of the intersection vertices of the intersection region to geodetic coordinates 2; S55: Convert the geodetic coordinates 2 to the corresponding pixel coordinates using affine transformation coefficients.
[0023] In step S6, the center coordinates of the target are calculated by reading the pixel coordinates of the top left and bottom right corners of the target in the target file. The specific coordinate calculation method is as follows: S61: The top left corner pixel coordinates are (x_lu, y_lu), and the bottom right corner pixel coordinates are (x_rd, y_rd). S62: Calculated using the following formula: x_c = (x_lu + x_rd) / 2 y_c = (y_lu + y_rd) / 2 Obtain the coordinates (x_c, y_c) of the target center point.
[0024] In step S7, removing the target involves deleting the line containing the target information in the txt file A.
[0025] In step S8, the target file after removing false alarms is removed, wherein the target is contained within the mask area.
[0026] This invention discloses an optimized system for removing false alarms from target masks in SAR image detection. This system is used to execute the methods described above and includes: an input module, a preprocessing module, a removal module, and an output module, wherein: The input module is used to input the image data to be detected, the target file to be detected, and the mask file; The preprocessing module is used to read image parameters and obtain the intersection area between the image and the mask area; The elimination module is used to determine whether the target is within the intersection area and to remove false alarm targets that are not within the intersection area; The output module is used to output the file after false alarms have been removed.
[0027] As can be seen from the above, this invention uses a mask region to solve the problem of excessive false alarms and improves the accuracy of target detection. This invention converts the latitude and longitude coordinates of the mask region into pixel coordinates instead of converting the target pixel coordinates into latitude and longitude coordinates, and uses the target center point coordinates instead of the target itself, reducing the number of conversions and the computational load. Furthermore, the use of a self-made mask file facilitates mask region reading, reduces hardware storage resource consumption, and is easier to implement on domestically developed systems.
[0028] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. An optimized method for removing false alarms using a target mask in SAR image detection, characterized in that, Includes the following steps: S1: Input the image data to be detected, the target file to be detected, and the mask file; S2: Read the latitude and longitude coordinates of the four corner points of the image, as well as the image width and image height; S3: Read all mask regions in the mask file and determine whether each mask region intersects with the image; Specific methods for calculating the intersection include: S31: Convert all points with latitude and longitude coordinates at the four corners of the image into polygon region 1; S32: Read one line from the mask file and obtain the latitude and longitude coordinates of all vertices; S33: Convert all obtained vertex latitude and longitude coordinates and all points into polygon region 2; S34: Determine whether polygon region 1 and polygon region 2 overlap. If they overlap, they are considered to have an intersection; otherwise, they are considered not to have an intersection. S4: Calculate the intersection region between the mask region and the image; if an intersection is found, obtain the latitude and longitude coordinates of the intersection vertices; S5: Convert the latitude and longitude coordinates of all vertices in the intersection region to pixel coordinates relative to the image data; convert the latitude and longitude coordinates of the intersecting vertices in the intersection region to pixel coordinates relative to the image data. The specific steps are as follows: S51: Input the latitude and longitude coordinates of the four corner points of the image, the image width, the image height, and the latitude and longitude coordinates of the corner points of the intersection region; S52: Convert the latitude and longitude coordinates of the four corner points of the image to geodetic coordinates (1); S53: Calculate the affine relationship between the pixel coordinates of the four corner points of the image and the geodetic coordinates 1, and extract the affine transformation coefficients; S54: Convert the latitude and longitude coordinates of the intersection vertices of the intersection region to geodetic coordinates 2; S55: Convert geodetic coordinates 2 to corresponding pixel coordinates using affine transformation coefficients; S6: Read the pixel coordinates of the target in the target file and calculate the center coordinates of the target; S7: Determine whether the target center coordinates are within the intersection area, retain targets within the intersection area, and remove targets outside the intersection area; S8: Obtain the target file after removing false alarms.
2. The optimized method for removing false alarms from SAR image target mask detection according to claim 1, characterized in that, In step S1, the image data is an image data file with latitude and longitude coordinates; the target detection file is a txt file A, where each line of the txt file is [x1 y1 x2 y2 score label], where x1 and y1 are the pixel coordinates of the upper left corner of the target, x2 and y2 are the pixel coordinates of the lower right corner of the target, label is the target type, and score is the probability value of the target type label; the mask file is a txt file B, which is the prior detection region, where each line of the txt file is [name lon_1 lat_1 lon_2 lat_2 … lon_n lat_n], where name is the name of the prior region, lon_1 and lat_2 are the longitude and latitude of the first vertex of the mask region, and lon_n and lat_n are the longitude and latitude of the nth vertex of the mask region.
3. The optimized method for removing false alarms from SAR image target mask detection according to claim 1, characterized in that, In step S1, the method for obtaining the mask file is as follows: S11: Draw the prior region on the satellite base map and obtain a vector mask file in shp format; S12: Read the latitude and longitude coordinates of all vertices of the drawing area in the vector mask file; S13: Save the latitude and longitude coordinates to a txt file B in a fixed format; S14: Read the next vector mask file, loop through S12~S14. After all vector mask files are read, the loop ends and a txt file B is obtained, so that the obtained txt file B contains the drawing areas from all the vector mask files.
4. The optimized method for removing false alarms from target mask in SAR image detection according to claim 2, characterized in that, In step S6, the center coordinates of the target are calculated by reading the pixel coordinates of the top left and bottom right corners of the target in the target file. The coordinates of the target center point are calculated as follows: S61: The top left corner pixel coordinates are (x_lu, y_lu), and the bottom right corner pixel coordinates are (x_rd, y_rd). S62: Calculated using the following formula: x_c = (x_lu + x_rd) / 2 y_c = (y_lu + y_rd) / 2 Obtain the coordinates (x_c, y_c) of the target center point.
5. An optimized method for removing false alarms from target mask in SAR image detection according to claim 2, characterized in that, In step S7, removing the target involves deleting the line containing the target information in the txt file A.
6. An optimized method for removing false alarms from target mask in SAR image detection according to claim 1, characterized in that, In step S8, the target files after removing false alarms are included in the intersection region.
7. An optimized system for removing false alarms from target masks in SAR image detection, characterized in that, The system is used to perform the method as described in any one of claims 1-6, comprising: an input module, a preprocessing module, a rejection module, and an output module, wherein: The input module is used to input the image data to be detected, the target file to be detected, and the mask file; The preprocessing module is used to read image parameters and obtain the intersection area between the image and the mask area; The elimination module is used to determine whether the target is within the intersection area and to remove false alarm targets that are not within the intersection area; The output module is used to output the file after false alarms have been removed.
Citation Information
Patent Citations
Improved SAR image region registration method based on LSD and template matching
CN114972453A
SAR active deception jamming detection method based on interferometric phase under short baseline
CN115407282A