Simulation ship and real scene image synthesis method for SAR target detection

By combining adaptive histogram equalization and morphological operations with a method to smooth transition regions, the problems of energy distortion and visual continuity in SAR image synthesis are solved, generating high-quality SAR images of multiple ship targets and improving the robustness of the detection algorithm and the diversity of sample data.

CN121527211APending Publication Date: 2026-02-13BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511701555.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-02-13

AI Technical Summary

Technical Problem

Existing SAR image synthesis methods suffer from energy mixing distortion, poor visual continuity, and poor robustness of detection algorithms when there is a large energy difference between the ship target and the background, thus failing to meet the verification requirements of target detection and recognition algorithms.

Method used

Adaptive histogram equalization is used to enhance contrast, and ship masks are extracted by combining morphological operations. Weights are calculated through smooth transition regions and exponential decay functions to achieve smooth transition between targets and background and continuity of energy distribution, generating high-quality multi-ship target SAR images.

Benefits of technology

It achieves a realistic reflection of the energy of the ship target and the background, eliminates grayscale abrupt changes, improves the visual continuity of the image and the stability of the detection algorithm, and provides diverse sample data for algorithm verification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121527211A_ABST
    Figure CN121527211A_ABST
Patent Text Reader

Abstract

The invention discloses a simulation ship and real scene image synthesis method for SAR target detection. The method comprises the following steps: inputting a simulation target, a real scene image and various parameters; according to the distance field distribution of the target edge area, generating a smooth window which gradually changes from inside to outside in the ship mask area for controlling the energy attenuation of the ship signal in the edge transition area; meanwhile, a complementary smooth window is constructed in a background area and used for balancing energy transition of background signals, smooth connection and natural transition of the target and the background are achieved at the fusion boundary, and finally a ship target detection SAR image with high authenticity and detection value is output and parameters of the ship target detection SAR image and the target are marked. According to the method, smooth transition of an edge region can be realized while target and background energy is ensured not to be distorted, so that continuity of a target boundary and rationality of overall energy distribution are kept, and a synthetic image not only truly reflects ship scattering characteristics, but also gives consideration to a background connection effect.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of synthetic aperture radar (SAR) image processing, and particularly relates to a simulation ship and real scene image synthesis method for SAR target detection. BACKGROUND

[0002] SAR images have important applications in ship monitoring, sea target identification, and marine environment perception. To verify the effectiveness of target detection and identification algorithms, a large number of sample images are needed, i.e. SAR images containing various ship targets in different scenes. In sample generation, real SAR scene data of scene images is relatively easy to obtain, while the imaging of ship targets is affected by multiple factors such as attitude, material, and motion state, making it difficult to fully cover in real data. Therefore, the method of ship simulation and real SAR scene synthesis becomes a more reasonable strategy, i.e. using real SAR scene images as background and superimposing simulation-generated ship targets to ensure scene authenticity while achieving controllable modeling of ship targets. Sample images not only need to maintain high fidelity in visual performance and statistical characteristics, but also should have application value for target detection and identification algorithm verification to ensure the reliability and generality of subsequent detection and identification algorithms. In the sample synthesis process, due to the large energy difference between the ship target and the background, the specific synthesis method needs to be reasonably designed, and an interactive parameter control interface needs to be provided to flexibly set the ship head direction, number, distribution, and specific position according to the requirements, so as to synthesize sample images that meet the expectations and obtain the labeled boxes required for target detection.

[0003] In existing SAR image synthesis, gray superposition and region replacement methods are commonly used, but there are obvious deficiencies in practical applications. For the gray superposition method, the ship gray signal and the real scene signal are directly linearly superimposed in the ship area, which leads to the fact that the fusion image cannot truly reflect the physical occlusion relationship between the target and the background, and the target energy and background energy are mixed and distorted. For the region replacement method, although it can avoid the problems caused by the above gray superposition, after setting the ship mask region to zero and covering the ship image, due to the fact that the ship signal energy is usually much higher than the background signal, there will be obvious gray mutations at the mask boundary, forming an obvious boundary band; such boundary mutation not only destroys the visual continuity of the image, but also leads to discontinuous energy distribution, thereby reducing the robustness and accuracy of the subsequent target detection algorithm. SUMMARY

[0004] In view of the deficiencies in the prior art, the application provides a simulated ship and real scene image synthesis method for SAR target detection, which can ensure the fidelity of target and background energy, realize smooth transition of the edge region, maintain the continuity of the target boundary and the rationality of the overall energy distribution, make the synthesized image truly reflect the ship scattering characteristics and take into account the background connection effect, and take into account the needs of multiple ship targets, so that the method can be flexibly applied to multiple target scenes according to the position, number, heading and size set by the user, and provide high-quality and controllable sample images for various target detection and identification algorithms.

[0005] The application discloses a simulated ship and real scene image synthesis method for SAR target detection, comprising: Step 1, image input and parameter initialization: Input multiple simulated ship target images and a real SAR scene image, determine the position and number of the selected ship targets in the real SAR scene image, and set the ship head direction and size scaling to obtain a ship SAR image; Step 2, ship mask extraction: First, perform adaptive histogram equalization processing on the ship SAR image to enhance the contrast of the target and the background and reasonably select the weak scattering energy of the ship edge; then, obtain a preliminary binary image according to a gray threshold value, and combine morphological operation to remove noise and connect the edge, so as to extract a complete mask area of the ship; perform rotation and scaling operation on the complete mask area of the ship to match the preset ship attitude and size parameters, and obtain a final target mask of the ship; Step 3, smooth transition region determination: On the basis of the final target mask of the ship, generate an outer expansion boundary and an inner contraction boundary by setting certain expansion and contraction distances, and the annular region between the outer expansion boundary and the inner contraction boundary is the smooth transition region, which is used to realize the smooth fusion of the image edge; Step 4, edge smoothing window calculation: According to the distance of each pixel in the smooth transition region to the inner and outer boundaries, inner and outer distance fields are respectively constructed; the fusion weight of each pixel is calculated for the target edge and the background edge by using an exponential decay function, and a target smoothing window and a background complementary window are constructed; Step 5, image synthesis and parameter output: Each ship target in the test requirement is sequentially executed from step 2 to step 4, the ship image and the scene image are respectively windowed and processed, and then synthesized, and finally a multiple ship target SAR image that can be used for target detection is obtained, and the label frame coordinates of each ship target are output.

[0006] As a further improvement of the application, the step 1 specifically comprises: Step 101, read a plurality of simulation generated ship target images and import a real SAR scene image, the ship target images include ships of different types, sizes and attitudes, and the real SAR scene image is used as a fused background image; Step 102, selecting a ship type to determine the specific simulation image used; through an interactive interface, clicking the expected position of the ship in the real SAR scene image according to the demand, then mapping the screen coordinates to the image coordinates, so as to determine the number and arrangement of the targets; at the same time, setting the heading direction and size scaling parameters for each target to obtain the ship SAR image; Step 103, saving various parameters, including the selected simulation ship image file name, the specific position of each ship, the size scaling and the heading direction, for subsequent calculation.

[0007] As a further improvement of the application, the step 2 specifically comprises: Step 201, using a contrast limited adaptive histogram equalization (CLAHE) algorithm to enhance the ship image ; Step 202, calculating the target segmentation threshold of the enhanced image , and obtaining a preliminary binary mask image according to the threshold , wherein (1) Step 203, performing a closing operation on the binary mask image with a circular template as the structural element; wherein, first, the foreground region is expanded outward through the dilation operation to fill the small gaps between the target edges and connect adjacent parts; then, the eroding operation is performed to shrink the expanded region back to the original size and remove the redundant expanded edges; this process can make the ship contour more coherent and complete while maintaining the overall shape; that is: (2) Step 204, extracting the largest area connected domain from to obtain the complete mask region of the ship; Step 205, calling the imresize() function in matlab to perform scaling operation and the imrotate () function in matlab to perform rotation operation on the complete mask region of the ship, so as to match the set ship sailing direction and target size, thereby obtaining the final target mask of the ship.

[0008] As a further improvement of the present application, the step 3 specifically comprises: Step 301, determining the number of pixels of the inward retraction distance of the target edge, the inward retracted edge being the target core area, the energy of which is directly represented by the target energy, denoted as ; Step 302, determining the number of pixels of the outward expansion distance of the target edge, the outward expanded edge being the background area, the energy of which is directly represented by the scene energy, denoted as ; Step 303, smoothing the transition area between the inward retracted boundary of the ship and the outward expanded boundary, i.e. (3).

[0009] As a further improvement of the present application, the step 4 specifically comprises: Step 401, calculating the target outward expanded area ; Step 402, calculating the minimum Euclidean distance of each pixel point in the target outward expanded area to the target boundary , to construct the external distance field of the target ; (4) Step 402, calculating the minimum Euclidean distance of each pixel point in the target outward expanded area to the target boundary , to construct the external distance field of the target ; (5) Step 403, in the smoothing transition area , the calculation results of the internal and external distance fields are integrated to perform weight calculation on each pixel point, to generate the decay weight on the side of the ship target , i.e. (6) wherein, is a decay control parameter, is a minimum weight to avoid a gap caused by too low weight; Through the decay weight distribution on the side of the target, energy decreases from inside to outside on the edge of the ship target, thereby constructing a target smoothing window; Step 404, to further improve the smoothing connection effect of the edge, a Sigmoid nonlinear function is introduced to establish a complementary distribution weight of the target weight for the pixel points in the area , to generate the decay weight on the side of the background , i.e. (7) wherein the parameters control the steepness of the curve, is the transition center position; through the non-linear mapping, a smooth transition weight complementary to the target window can be formed in the edge area, and the target and background energy is realized in space Smooth connection; finally, the background complementary window is composed of the weight distribution of each pixel point.

[0010] As a further improvement of the present application, the step 5 specifically comprises: Step 501, sequentially performing steps 2 to 4 for each ship target to generate a respective target smoothing window and background complementary window; Step 502, reading the target position recorded in step 1 to determine the specific position of each ship target in the background image and the background area involved; then, the target and its corresponding background area are locally windowed and superimposed, and arranged into the real background image to obtain the final synthesized image ; In order to retain the weak scattering information of the ship edge, the ship energy outside the mask is superimposed as the background, that is, (8) Step 503, ship target rectangular annotation box coordinate calculation: According to the physical size parameters of the selected simulation ship (including ship length , ship width ), combined with the SAR image resolution and size scaling factor , the actual physical size of the ship is converted into pixel size in the image: (9) wherein and respectively represent the pixel length and width corresponding to the ship in the image azimuth direction and range direction; Considering the ship head direction angle when arranging, the minimum circumscribed rectangular annotation box size after rotation in the image coordinate system can be expressed as: (10) According to the ship target center point coordinates recorded in step 1, let the pixel coordinates of a target in the image be , then the left upper corner and right lower corner coordinates of the rectangular annotation box are: (11) Thus, the rectangular annotation box parameters of the ship target are obtained: (12) When the normalized coordinates need to be output, if the width and height of the scene image are 、 , then the normalized center coordinates and width and height of the rectangular mark box are: (13) The normalized rectangular mark box parameters are finally obtained: (14) The rectangular mark box coordinates and can be used as the geometric calibration results of the ship target, and can be used for subsequent performance evaluation of the target detection algorithm.

[0011] Compared with the prior art, the beneficial effects of the present application are: The image synthesis method of the present application can avoid the energy mixing distortion caused by the direct gray scale superposition of the target and the background, so that the ship and the scene signal are more physically real and the energy distribution is more reasonable; at the same time, the gray scale mutation in the region replacement method is effectively eliminated, and the visual continuity of the image and the test stability of the subsequent detection algorithm can be effectively improved.

[0012] The image synthesis method of the present application can flexibly arrange multiple ship targets, and can synthesize according to the test requirements in terms of ship type, size, posture and ship head direction, so that the obtained SAR image scene is diversified, rich and diverse sample data are provided for performance verification of the target detection and recognition algorithm, and the comprehensiveness and reliability of the algorithm evaluation are improved. BRIEF DESCRIPTION OF DRAWINGS

[0013] Figure 1 The step flow chart of the simulation ship and the real scene image synthesis method of the present application is shown in the figure; Figure 2 The simulation ship target schematic diagram (has been rotated according to the required ship head direction) is shown in the figure; Figure 3 The real scene schematic diagram is shown in the figure; Figure 4 The target position interactive point selection schematic diagram is shown in the figure; Figure 5 The ship target histogram enhancement schematic diagram is shown in the figure; Figure 6 The ship target mask extraction schematic diagram is shown in the figure; Figure 7 The ship target contour extraction schematic diagram is shown in the figure; Figure 8 The smooth area schematic diagram is shown in the figure; Figure 9 The ship target smoothing window schematic diagram is shown in the figure; Figure 10A schematic diagram of a scene complementary window; Figure 11 A schematic diagram of a single ship target and scene synthesis; Figure 12a A schematic diagram of a one-dimensional profile of a single ship target, a scene, and a synthesized image in the range direction of a target area; Figure 12b A schematic diagram of a one-dimensional profile of a single ship target, a scene, and a synthesized image in the azimuth direction of a target area; Figure 13 A schematic diagram of a ship target detection SAR image synthesis result; Figure 14 A schematic diagram of a bounding box calculation result. DETAILED DESCRIPTION

[0014] To make the objectives, technical solutions, and advantages of embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0015] The present application will be described in further detail below with reference to the drawings: As shown in the drawings, Figure 1 The present application provides a simulated ship and real scene image synthesis method for SAR target detection, comprising: Step 1, image input and parameter initialization: Multiple simulated generated ship target images are read, and a real SAR scene image is imported as a background; according to test requirements, the position of the ship target in the real SAR scene image is selected through an interactive mode, so as to determine the number of targets; and the heading direction and size scaling parameters are set; so as to ensure that the arrangement mode and size of the ship target in the real SAR scene image meet the expectations, and finally the parameters are saved for subsequent calculation.

[0016] Specifically, it comprises: Step 101, reading multiple simulated generated ship target images and importing a real SAR scene image, the ship target images comprising ship targets of different types, sizes, and attitudes, and the real SAR scene image serving as a background image for fusion; Step 102, selecting a ship body type to determine the specific simulated image used; through an interactive interface, the expected position of the ship target in the real SAR scene image is clicked according to requirements, and then the screen coordinates are mapped to the image coordinates, so as to determine the number of targets and the arrangement mode; at the same time, the heading direction and size scaling parameters are set for each target; Step 103, save the parameters, including the selected simulation ship image file name, the specific location of each ship, the size scaling and the ship head direction, for subsequent calculation.

[0017] Step 2, ship mask extraction: For the input ship SAR image: first, the adaptive histogram equalization algorithm is used to enhance the contrast between the target and the background, and the weak scattering energy of the ship edge is reasonably selected; then, according to the enhanced gray distribution, a suitable gray threshold is set to separate the ship main body from the background, and a preliminary binary mask is generated; in order to further improve the integrity and continuity of the mask, morphological method is used to remove isolated noise and correct the ship edge contour, to ensure the accuracy and closure of the target boundary, so as to extract the complete mask area of the ship; finally, according to the scene arrangement requirement, the extracted complete mask area of the ship is rotated and scaled to match the preset ship attitude and size parameters.

[0018] Specifically, it includes: Step 201, using the adaptive histogram equalization algorithm with limited contrast (CLAHE), the ship image is divided into several local small blocks, and the histogram equalization operation is performed on each local area separately, and the maximum histogram height is limited to avoid excessive enhancement of the surrounding weak scattering area, and the enhanced image pixel gray is denoted as ; Step 202, the target segmentation threshold is calculated according to the enhanced image , and the preliminary binary mask image is obtained according to the threshold, wherein (1) Step 203, the binary mask image is closed with a circular template as the structural element; wherein, first, the foreground area is expanded outward by the dilation operation, filling the small gap between the target edges and connecting the adjacent parts; then, the erosion operation is performed to shrink the expanded area to the original size, removing the redundant expanded edge; this process can make the ship contour more coherent and complete while keeping the overall shape; that is: (2) Step 204, the extracts the largest area connected domain, so as to obtain the complete mask area of the ship; Step 205, calling the imresize() function in matlab to scale the complete mask area of the ship, and calling the imrotate() function in matlab to rotate the operation, so as to match the set ship sailing direction and target size, thereby obtaining the final target mask of the ship .

[0019] Step 3, smooth transition area determination: After extracting the final target mask of the ship, in order to realize the natural transition between the target and the background, a buffer zone is established outside and inside the mask boundary by setting the outward expansion and inward contraction distance; the outward expansion boundary is used to define the transition starting point of the target and the background, and the inward contraction boundary is used to limit the effective range of the target body, and the annular region between the two is used as the smooth transition area. The smooth transition area plays a role in gradually attenuating the target signal to the background in space, and is a key part of controlling the smoothness of fusion and the continuity of energy distribution. By reasonably setting the outward expansion and inward contraction distance parameters, the width of the smooth area can be adaptively adjusted according to different ship sizes and background complexity.

[0020] Specifically, it includes: Step 301, determining the number of pixels of the inward contraction distance of the target edge, the inward edge is the target core area, and the energy of this area is directly represented by the target energy, denoted as ; Step 302, determining the number of pixels of the outward expansion distance of the target edge, the area outside the outward expansion edge is the background area, and the energy of this area is directly represented by the scene energy, denoted as ; Step 303, smooth transition area is the pixel area between the inward boundary of the ship and the outward boundary of the ship, that is: (3) Step 4, edge smoothing window calculation: Specifically, it includes: In order to realize the smooth connection between the ship target and the background, the distance quantization and weight distribution of the pixel points on both sides of the ship boundary are performed. Specifically, first, the ship mask boundary is taken as the reference, and the minimum Euclidean distance of the pixel points inside and outside the mask to the boundary is calculated, respectively, to construct the internal distance field of the target and the external distance field . On this basis, exponential decay and Sigmoid function are introduced to give the pixel in the smooth area a continuously changing weight, so that the area close to the boundary has a gentle energy transition; finally, according to the calculation result, the smooth window of the ship target and the complementary window of the scene background are generated, realizing the natural transition from the ship to the background.

[0021] Step 401, calculating the target outward expansion area From each pixel to the target boundary The minimum Euclidean distance is used to describe the proximity of pixels inside the target relative to the boundary, thereby constructing the interior distance field. ; (4) Step 402: Calculate the target expansion area From each pixel to the target boundary The minimum Euclidean distance is used to construct the external range field of the target. ; (5) Step 403, in the smooth transition area Internally, based on the calculation results of both internal and external distance fields, weights are calculated for each pixel to generate attenuation weights for the ship target side. ,Right now: (6) in, For attenuation control parameters, Minimize the weight to avoid gaps caused by excessively low weights; Attenuation weights on the target side The distribution can achieve energy reduction from the inside out at the edge of the ship target, thereby creating a smooth window for the target; Step 404: To further improve the smooth transition effect at the edges, targeting... For pixels within the region, a complementary distribution of target weights is established using a sigmoid nonlinear function, generating attenuation weights on the background side. ,Right now: (7) Among them, parameters Control the steepness of the curve, This is the location of the transition center; Through nonlinear mapping, a smooth transition weight complementary to the target window can be formed in the edge region, achieving a smooth connection between the target and background energy in space; finally, the background complementary window is formed by the weight distribution of each pixel.

[0022] Step 5: Image Combining and Parameter Output: For each ship target, steps 2 through 4 are executed sequentially to generate its target smoothing window and background complementary window. Based on the position recorded in step 1, the target image is then processed. Corresponding background area After local windowing and overlay, it is placed onto the real background image. In the process, the final synthesized image is obtained. Calculate and output the coordinates of the rectangular bounding box for each target (in words). indicates, and can also output normalized coordinates as needed ).

[0023] Specifically includes: Step 501, for each ship target, sequentially execute steps 2 to 4 to generate a respective target smoothing window and background complementary window; Step 502, read the target position recorded in step 1, determine the specific position of each ship target in the background image and the involved background area; then, for the target and its corresponding background area Local windowing superposition is performed, and is arranged into the real background image to obtain the final synthesized image ; In order to preserve the weak scattering information of the ship edge, the ship energy outside the mask is superimposed as the background, that is, (8) Step 503, ship target rectangular annotation box coordinate calculation: According to the physical size parameters of the selected simulation ship (including ship length , ship width ), combined with the SAR image resolution and size scaling factor , the actual physical size of the ship is converted into pixel size in the image: (9) Wherein, and respectively represent the pixel length and width corresponding to the ship in the image azimuth direction and range direction; Considering the ship head direction angle when arranging, the minimum circumscribed rectangular annotation box size after rotation in the image coordinate system can be expressed as: (10) According to the ship target center point coordinates recorded in step 1, let the pixel coordinates of a target in the image be , then the left upper corner and right lower corner coordinates of the rectangular annotation box are: (11) From which the rectangular annotation box parameters of the ship target can be obtained: (12) When normalized coordinates need to be output, if the width and height of the scene image are , , then the rectangular annotation box center coordinates and width and height after normalization are: (13) The normalized rectangular mark box parameters are finally obtained: (14) The rectangular mark box coordinates And Can be used as the geometric calibration result of the ship target, and can be used for subsequent target detection algorithm performance evaluation.

[0024] Example 1: The application provides a simulation ship and real scene image synthesis method for SAR target detection images. In order to test various target detection and recognition algorithms, a large number of SAR images containing various ship bodies in the scene are needed. The real SAR data of the scene image is relatively easy to obtain, and the imaging of the ship target is affected by many factors such as attitude, material and motion state, and it is difficult to fully cover in the measured data. Therefore, the method of synthesizing the ship simulation and the real SAR scene becomes a more reasonable strategy. In the sample generation process, because there is a large energy difference between the ship target and the background, the specific synthesis method needs to be reasonably designed; at the same time, in order to meet different test requirements, an interactive parameter control interface should be provided to flexibly adjust the ship head direction, number, distribution and specific position according to the user setting, so as to synthesize the sample image meeting the expectation.

[0025] The application mainly includes five steps of image input and parameter initialization, ship mask extraction, smooth region determination, edge smoothing window calculation, image synthesis and parameter output. First, input multiple simulation ship target images and a real SAR scene image, and set the position, number, ship head direction and size parameters of each ship target in the background through an interactive mode, and save the parameters for subsequent use. Then, mask extraction is performed on each ship target, including adaptive histogram enhancement, threshold segmentation and morphological processing, and the mask is rotated and scaled to match the target direction and size. Then, the target core region, background region and target edge smoothing region are determined, the inner and outer distance fields are calculated, and the target smoothing window and background complementary window are generated by combining exponential decay and nonlinear mapping. Finally, according to the position information recorded in step 1, each ship target image and the corresponding background region are locally windowed and superimposed, and arranged in the scene to synthesize the final multi-ship target SAR image, and the target mark box coordinates are output.

[0026] In order to more clearly show the process and effect, the embodiment gives a single target effect schematic diagram ( Figures 5-11 ) and a one-dimensional profile comparison diagram ( Figures 12a~12b ). And finally gives a target detection SAR image containing multiple ship targets ( Figure 13 ). The synthesis method comprises: Step 1, image input and parameter initialization: Read several simulation generated ship target images, while importing a real SAR scene image as background. Among them, the simulation ship target image (as shown in Figure 2 ) is , and the real scene image (as shown in Figure 3 ) is . According to the test requirements, the position of the ship target in the scene is selected by interactive mode, so as to determine the number of targets and set the ship head direction, size scaling parameter. To ensure that the arrangement of the ship in the scene and the size meet the expectations. Finally, the parameters are saved for subsequent calculation.

[0027] Specifically, it includes: Step 101, read 36 simulation generated ship target images, including four types of ship body and various attitudes; while importing a real SAR scene image as the background image of fusion; Step 102, select the ship body type and determine the specific simulation image used. Through the interactive interface, click the expected position of the ship in the scene image according to the test requirements (as shown in Figure 4 ), then map the screen coordinates to the image coordinates, get the coordinate settings: [351, 223], [392, 214], [433, 209], [468, 225], [493, 252], [519, 280], [544, 301], so as to determine that there are 7 ship targets arranged in the scene, the size scaling parameter is set to 0.4, and the ship head direction angle is set to 83°, 300°, 201°, 195°, 103°, 330°, 54°. Among them, the reference zero direction of the direction angle is defined as the direction from large to small distance to the pixel value, and the positive direction increases in the clockwise direction; Step 103, save the parameters, including the selected simulation ship image file name, the specific position of each ship, size scaling, ship head direction, for subsequent calculation.

[0028] Step 2, ship mask extraction: For the input ship SAR amplitude image, first, the local contrast of the image is enhanced by using adaptive histogram equalization algorithm. Then, according to the gray distribution of the enhanced image, a suitable threshold is set to separate the ship body from the background and generate a preliminary binary mask. In order to further improve the integrity and continuity of the mask, morphological method is used to remove isolated noise and correct the ship edge profile, so as to ensure the accuracy and closure of the target boundary. Finally, according to the scene arrangement requirements, rotate and scale the extracted ship mask to match the preset ship attitude and size parameters.

[0029] Specifically, it includes: Step 201: Employ an adaptive histogram equalization algorithm with contrast limitations, limiting the maximum histogram height to 0.05; [This step involves] processing the ship image. Appropriate enhancement is applied to areas with weak scattering in the surrounding image. The enhanced image pixel grayscale is denoted as... ,like Figure 5 As shown; Step 202: Enhance the image The target segmentation threshold is calculated using the Otsu's method (OTSU). Then, appropriately lower the threshold to 0.7. And based on this, a preliminary binary mask image is obtained. ,Right now; (15) Step 203: Process the binary image The structural element is a circular template. Closing operation, template The radius is set to 3 pixels, and the discontinuous parts of the ship target's energy are connected through an expansion corrosion process; Step 204, for Extract the connected components with the largest area to obtain the final target mask. ,like Figure 6 As shown, the target contour extraction is as follows: Figure 7 As shown; Step 205: Use the `imresize()` function in MATLAB to scale the target mask and the `imrotate()` function in MATLAB to rotate it, matching the set ship's sailing direction with the target size, thus obtaining the final target mask. ; Step 3: Determine the smoothing region: After extracting the ship target mask, to achieve a natural transition between the target and the background, this step establishes buffer zones on the outer and inner sides of the mask boundary by setting outward and inward expansion distances, respectively. The outward expansion boundary defines the transition starting point between the target and the background, while the inward expansion boundary limits the effective range of the target body. The annular region between the two serves as the smooth transition region. Spatially, this region plays a role in the gradual attenuation of the target signal towards the background and is a key part of controlling the smoothness of fusion and the continuity of energy distribution. By reasonably setting the outward and inward expansion distance parameters, the width of the smooth region can be adaptively adjusted according to different ship sizes and background complexity.

[0030] Specifically, it includes: Step 301: Based on the target size, select an indentation distance of 2 pixels for the target edge; Step 302: Based on the target size, select an outer edge extension distance of 4 pixels for the target; Step 303, smooth the area between the inboard boundary and the outboard boundary of the ship As shown in Figure 8 , where the red line is the target contour; Step 4, edge smoothing window calculation: To achieve smooth connection between the ship target and the background, this step quantifies the distance and assigns weights to the pixel points on both sides of the ship boundary. Specifically, first, taking the ship mask boundary as the reference, the minimum Euclidean distance of the internal and external pixel points to the boundary is calculated respectively, and the internal distance field of the target and the external distance field are constructed. On this basis, exponential decay and sigmoid function are introduced to give the pixels in the smoothing area a continuously changing weight, so that the area close to the boundary has a gentle energy transition. Finally, according to the calculation results, the smoothing window of the ship target and the complementary window of the scene background are generated, realizing the natural transition from the ship to the background.

[0031] Specifically includes: Step 401, construct the internal distance field of the target ; Step 402, construct the external distance field of the target ; Step 403, for each pixel point in the area, combine the distance field calculation results to generate the decay weight of the ship target , the decay control parameter is set to 2, and the minimum weight is set to 0.002, that is, (16) Thus, the smoothing window of the target area is as shown in Figure 9 ; Step 404, generate the decay weight of the scene background for each pixel point in the area. To further improve the edge transition effect, sigmoid nonlinear mapping is introduced to construct , the curve steepness parameter is set to 2, and the curve transition center is set to 0.8, so that the weight reaches the balance point at the position where the edge of the ship is strong, realizing the smooth connection of the edge area. That is, (17) Thus, the complementary window of the background area is as shown in Figure 10 ; Step 5, image synthesis and parameter output: Steps 2 to 4 are performed on the seven ship targets in turn to generate their target smoothing window and background complementary window, and according to the position recorded in step 1, the target image is combined with the corresponding background area The local windowed superimposition is arranged into a real background image The final composite image is obtained The rectangular bounding box coordinates of each target are calculated and output (in pixel coordinates) The normalized coordinates can also be output as needed ).

[0032] Specifically, it includes: Step 501, steps 2 to 4 are performed on the seven ship targets in turn to generate respective target smooth windows and background complementary windows; Step 502, read the target position recorded in step 1 to determine the specific position of each ship target in the background image and the involved background area. Then, the target and the corresponding background area are locally windowed and superimposed, and arranged into a real background image The processing result of a single ship target is shown in Figure 11 In addition, in order to clarify the transition effect of the edge area, the one-dimensional profile of the ship image, the scene image and the composite image in the target area in the distance direction (such as Figure 12a ) and the azimuth direction (such as Figure 12b ) are compared. The composite image can better transition in the edge area while reasonably preserving the target energy. After the processing of all target images is completed, the final composite image is obtained, as shown in Figure 13 .

[0033] Step 503, calculate the rectangular bounding box coordinates of the ship target.

[0034] Take the ship target in Figure 2 as an example. This target corresponds to the sixth target from left to right in the composite image. The length of the ship is 170m, the width is 15m, the simulation image resolution is 3m, and the size coefficient is 0.4. The actual physical size of the ship is converted to the pixel scale in the image: (18) The ship head direction angle is 330°, and the size of the smallest circumscribed rectangular bounding box after rotation in the image coordinate system can be represented as: (19) According to the center point coordinates of the ship target recorded in step 1, the pixel coordinates of the center in the image are [519, 280], and the coordinates of the top left corner and the bottom right corner of the rectangular bounding box are: (20) Therefore, the rectangular bounding box parameters of this ship target are .

[0035] When normalized coordinates are required, given that the width and height of the scene image are 800 pixels and 600 pixels respectively, the parameters of the normalized rectangular bounding box can be obtained as follows: .

[0036] Coordinates of the rectangular bounding boxes of all targets The results are as follows and can be used for subsequent performance evaluation of object detection algorithms.

[0037] Finally, the calculation results of the rectangular annotation box are visualized, such as... Figure 14 As shown.

[0038] This invention primarily focuses on the synthesis of multi-ship target SAR images with high realism and detection value. These images can be used to test various target detection and recognition algorithms. During the synthesis process, simulated targets, real-world scene images, and various parameters are first input, specifically including the position and quantity of each ship target in the real-world scene. The bow direction and size scaling are also set, and these settings can be interactively configured according to testing requirements to achieve a reasonable layout and realistic presentation of ship targets within the scene. Based on the range field distribution of the target edge region, a smooth window with a gradual transition from the inside to the outside is generated in the ship mask region to control the energy attenuation of the ship signal in the edge transition region. Simultaneously, a complementary smooth window is constructed in the background region to balance the energy transition of the background signal, enabling a smooth connection and natural transition between the target and the background at the fusion boundary. This results in the output of a ship target detection SAR image and target annotation parameters with high realism and detection value. This invention implements a method for synthesizing simulated ship and real-world scene images for target detection SAR images.

[0039] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for synthesizing simulated ship and real scene images for SAR target detection, characterized in that, The method comprises the following steps: Step 1, image input and parameter initialization: Input multiple simulated ship target images and a real SAR scene image, determine the position and number of selected ship targets in the real SAR scene image, and set the ship head direction and size scaling to obtain a ship SAR image; Step 2, ship mask extraction: First, the ship SAR image is subjected to adaptive histogram equalization processing, then a preliminary binary image is obtained according to a gray threshold value, and morphological operation is combined to remove noise and connect edges, and the complete mask area of the ship is extracted; the complete mask area of the ship is subjected to rotation and scaling operation to match the preset ship attitude and size parameters, and the final target mask of the ship is obtained; Step 3, smooth transition region determination: On the basis of the final target mask of the ship, an outer boundary and an inner boundary are respectively generated by setting a certain outer expansion and inner contraction distance, and the annular region between the outer boundary and the inner boundary is the smooth transition region; Step 4, edge smoothing window calculation: According to the distance of each pixel in the smooth transition region to the inner and outer boundaries, inner and outer distance fields are respectively constructed; the fusion weight of each pixel is calculated for the target edge and the background edge by using an exponential decay function, and a target smoothing window and a background complementary window are constructed; Step 5, image synthesis and parameter output: For each ship target in the test requirement, steps 2 to 4 are sequentially executed, and the ship image and the scene image are respectively subjected to windowing processing and then synthesized to finally obtain a multi-ship target SAR image which can be used for target detection, and the label box coordinates of each ship target are output.

2. The image compositing method of claim 1, wherein, The step 1 specifically comprises: Step 101, reading multiple simulated ship target images and importing a real SAR scene image, the ship target images comprising ships of different types, sizes and attitudes, and the real SAR scene image serving as a background image for fusion; Step 102, selecting a ship body type to determine the specific simulation image used; through an interactive interface, the expected position of the ship in the real SAR scene image is clicked according to the requirement, then the screen coordinates are mapped to the image coordinates to determine the number and arrangement of the targets; meanwhile, the head direction and size scaling parameters of each target are set to obtain a ship SAR image; Step 103, saving various parameters, including the file name of the selected simulation ship image, the specific position, size scaling and head direction of each ship, for subsequent calculation.

3. The image compositing method of claim 2, wherein, The step 2 specifically comprises: Step 201: Employ an adaptive histogram equalization algorithm with limited contrast to adjust the ship image. The image is divided into several local blocks. Histogram equalization is performed on each local region individually, with a limit on the maximum histogram height. The resulting enhancement of image pixel grayscale is denoted as... ; Step 202, enhancing the image Computing the target segmentation threshold and obtaining a preliminary binary mask image accordingly wherein, (1) Step 203: Process the binary mask image The structural element is a circular template. The closing operation involves first expanding the foreground region outward through a dilation operation to fill small gaps between the target edges and connect adjacent parts; then, an erosion operation is performed to shrink the expanded region back to its original size, removing excess outward edges; that is: (2) Step 204, extracting the maximum area connected domain, so as to obtain the complete mask area of the ship; extracting the maximum area connected domain, so as to obtain the complete mask area of the ship; Step 205, calling imresize() function in matlab to perform scaling operation on the complete mask area of the ship, calling imrotate() function in matlab to perform rotation operation, so as to match the set ship sailing direction and target size, thereby obtaining the final target mask of the ship .

4. The image compositing method of claim 3, wherein, The step 3 specifically comprises: Step 301, determine the number of pixels of the insetting distance of the target edge, the insetting edge is the target core area, and the energy of the area is directly represented by the target energy, denoted as ; Step 302, determine the number of pixels of the outward expansion distance of the target edge, the area outside the outward expansion edge is the background area, the energy of which is directly represented by the scene energy, denoted as ; Step 303, smoothing the transition area For the pixel area between the inwardly retracted boundary and the outwardly expanded boundary of the ship, that is: (3)。 5. The image compositing method of claim 4, wherein, The step 4 specifically comprises: Step 401, calculating an outer expansion region of the target The minimum Euclidean distance from each pixel point in the interior to the target boundary is used to describe the proximity of the pixel points in the interior relative to the boundary, thereby constructing an interior distance field ;​ (4) Step 402, calculating an outer expansion region of the target The minimum Euclidean distance from each pixel point in the inner region to the target boundary The outer distance field of the target is constructed ; (5) Step 403, in the smooth transition region In the inner, the calculation results of the inner and outer distance fields are combined to perform weight calculation on each pixel point to generate the attenuation weight of the ship target side That is: (6) wherein is a decay control parameter, is a minimum weight; Attenuation weights on target side Distribution, which can be achieved by the edge of the ship target from inside to outside energy decline, thus building a target smooth window; Step 404, targeting For pixels within the region, a complementary distribution of target weights is established using a sigmoid nonlinear function, generating attenuation weights on the background side. ,Right now: (7) wherein the parameters controlling the steepness of the curve, is the transition center position; Through nonlinear mapping, a smooth transition weight complementary to the target window can be formed in the edge region, realizing the smooth connection of the target and the background energy in space; finally, the background complementary window is composed of the weight distribution of each pixel point.

6. The image compositing method of claim 5, wherein, The step 5 specifically comprises: Step 501, sequentially executing steps 2 to 4 for each ship target to generate the target smoothing window and the background complementary window of each ship target; Step 502, read the target position recorded in step 1, determine the specific position of each ship target in the background image and the background area involved; then, perform local windowing superposition on the target and its corresponding background area , and arrange it into the real background image to obtain the final synthesized image ; in order to retain the weak scattering information of the ship edge, superimpose the ship energy outside the mask and the scene energy as the background, that is, (8) Step 503, ship target rectangular label box coordinate calculation: According to the physical size parameters of the selected simulated ship, in combination with the SAR image resolution of the simulated target and the size scaling coefficient , the actual physical size of the ship is converted into the pixel scale in the image: (9) wherein, with respectively represent the pixel length and width corresponding to the image azimuth and range directions of the ship. Consider the heading angle of the ship when it is arranged The size of the minimum bounding rectangle label frame after rotation in the image coordinate system is represented as: (10) According to the ship target center point coordinates recorded in step 1, the pixel coordinates of a certain target in the image are The upper left corner and the lower right corner coordinates of the rectangular marking frame are: (11) Thus, the rectangular label box parameters of the ship target are obtained: (12) When the normalized coordinates need to be output, if the width and height of the scene image are , , the normalized center coordinates and width and height of the rectangular marking box are: (13) Finally, the normalized rectangular label box parameters are obtained: (14) The rectangular mark frame coordinates With The geometric calibration results of the ship targets can be used for performance evaluation of subsequent target detection algorithms.