A target detection method against a sea and sky background
By performing visibility grading on field-of-view images against a sea and sky background and using an improved Canny algorithm, the problem of detecting distant ship targets that are difficult to distinguish with the naked eye against a sea and sky background was solved, achieving stable and effective detection under different visibility conditions.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING HUAHANG RADIO MEASUREMENT & RES INST
- Filing Date
- 2022-01-27
- Publication Date
- 2026-05-26
AI Technical Summary
Against a sea-sky background, existing technologies struggle to effectively detect distant ship targets that are difficult to distinguish with the naked eye. In particular, the performance of detection algorithms degrades under sea clutter or intense light, and weather visibility has a significant impact on target detection against a sea-sky background.
A visibility grading method is adopted to classify the field of view images against the sea and sky background. Different target detection strategies are used for images with different visibility levels, including target edge extraction and image segmentation in images with good and average visibility, and target detection in images with poor visibility through continuous frame difference operation and centroid search.
It improves the accuracy and efficiency of target detection, reduces false positives, and achieves stable and effective detection under different visibility conditions.
Smart Images

Figure CN116563197B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing and target detection technology, and specifically relates to a target detection method against a sea and sky background. Background Technology
[0002] In recent years, ship target detection has been a research hotspot in the field of target detection. As the most important mode of transportation in international logistics, maritime transport has seen a rapid increase in the number of ships entering and leaving ports with the rapid development of my country's maritime trade. The importance of ship target detection in improving maritime traffic order and maintaining maritime safety is growing daily, especially the detection of distant ship targets that are difficult to distinguish with the naked eye and require optical detectors. When sea clutter or fish scale light is strong, the gray intensity of many wave peaks in the field of view image is close to, or even equal to, or greater than the maximum gray value of the target pixel, significantly reducing the performance of detection algorithms. Furthermore, weather visibility against a sea-sky background has a significant impact on target detection, requiring comprehensive consideration of visibility conditions for target detection. Summary of the Invention
[0003] Based on the above analysis, the present invention aims to disclose a target detection method against a sea and sky background, solving the problem of target detection that is difficult to distinguish with the naked eye and requires recording with an optical detector.
[0004] This invention discloses a target detection method against a sea and sky background, comprising:
[0005] The visibility of the acquired field-of-view images against the sea and sky background is classified into three levels: poor, average, and good. Images with poor visibility are classified as difficult samples and no target detection is performed. Images with average or good visibility are then subjected to subsequent target detection.
[0006] On the sea-line in images with moderate and good visibility, a target search area is captured near the sea-line to detect targets that are difficult to distinguish with the naked eye and need to be recorded by an optical detector; target edges are extracted in the captured target search area; after the target edges are extracted, image segmentation is performed according to the target edges to obtain the target image.
[0007] Furthermore, for images with good visibility and general field of view, the Canny operator is used within the cropped target search area to extract the target edge through processing including filtering, gradient calculation, non-maximum suppression, and double thresholding.
[0008] Furthermore, for images with average visibility that are affected by sea surface and weather, making it impossible to complete target detection through single-frame target edge extraction, the following approach is used: extracting information from consecutive frames, performing difference operations on consecutive frames to extract binary images; filtering the binary images to eliminate the influence of sea surface and weather, then determining candidate target regions through centroid search, and using the relationship between target grayscale feature changes and the overall average grayscale of the image in the candidate target regions to detect moving targets.
[0009] Furthermore, a method for visibility classification of the acquired field-of-view image against a sea and sky background includes:
[0010] The input field-of-view image undergoes preprocessing including resolution reduction, target gradient feature extraction, and gradient normalization.
[0011] Extract edge points from the image based on the gradient normalization result;
[0012] Based on the number and length information of the edge points, it is determined whether the sea-line area in the image can be extracted;
[0013] For images of the sea-line that can be extracted, the visibility of the image is graded according to the magnitude of the maximum gradient.
[0014] Furthermore, the preprocessing includes:
[0015] The input field-of-view image is down-resolution processed to obtain a down-resolution image; and the visibility of images with a gray-scale mean value less than the gray-scale threshold in the down-resolution image is classified as poor.
[0016] An adaptive Gaussian filter is applied to a down-resolution image with a grayscale mean not less than a grayscale threshold to calculate the target gradient feature set of the image, including the horizontal gradient, vertical gradient, and maximum gradient.
[0017] Images with a maximum gradient value less than the first gradient threshold are classified as having poor visibility.
[0018] For images whose maximum gradient value is not less than the first gradient threshold, the gradient normalization result is obtained by performing a gradient normalization operation.
[0019] Furthermore, gradient normalization is performed based on the maximum gradient tiers, specifically including:
[0020] Five normalization factors are derived from the maximum gradient to complete gradient normalization. The normalization factors are shown in the following formula: In the formula, the grading constants are va1 < va2 < va3 < va4 < va5; value is the median value of the image gradient; and max_grad is the maximum gradient.
[0021] When the maximum gradient max_grad is greater than th1, the gradient is normalized to value1; otherwise, when the maximum gradient is greater than th2, the gradient is normalized to value2; otherwise, when the maximum gradient is greater than th3, the gradient is normalized to value3; otherwise, when the maximum gradient is greater than th4, the gradient is normalized to value4; when none of the above conditions are met, the gradient is directly normalized to value5.
[0022] Furthermore, the edge point extraction in the image employs the Canny algorithm; during edge point extraction, non-maximum suppression in the Canny algorithm is performed using adaptive horizontal and vertical gradient sets.
[0023] Furthermore, during edge point extraction of the image, gradient normalization results are used to perform gradient high and low threshold detection using the Canny algorithm; high threshold detection is used to reduce false edges in the image; low threshold detection is used to collect edge points whose contours meet the requirements to form new edges, thereby achieving edge closure of the image.
[0024] Furthermore, the method for determining whether the sea-line area in the image can be extracted based on the number and length information of the edge points includes:
[0025] The number of points and length information of each edge are obtained by eight-neighbor labeling. When the number of edges is greater than the threshold, the sea line is extracted by Hough transform. Images whose number and range of sea lines do not meet the conditions are identified as images of sea lines that cannot be extracted, and the visibility is classified as poor.
[0026] Furthermore, images whose number and range of sea-line antennas meet the conditions are identified as images of sea-line antennas that can be extracted. For images of sea-line antennas that can be extracted, the maximum gradient of the image is used for threshold comparison. When the maximum gradient of the image is less than the second gradient threshold, the visibility of the image is classified as poor and classified as a difficult sample, and no target detection is performed. When the maximum gradient of the image is between the second and third gradient thresholds, the visibility of the image is classified as average. When the maximum gradient of the image is greater than the third gradient threshold, the visibility of the image is classified as good.
[0027] This invention can achieve at least one of the following beneficial effects:
[0028] This invention performs visibility classification on the acquired field-of-view images against a sea and sky background. Images with poor visibility are classified as difficult samples and are not subject to target detection, while images with moderate or good visibility are subject to subsequent target detection, thereby increasing the detection probability.
[0029] Furthermore, this invention improves the Canny algorithm to establish a gradient adaptive planning method based on the maximum gradient calculation of the acquired image and the weighted texture to complete the visibility judgment of the sea and sky background, thus achieving a more stable and effective visibility judgment. Attached Figure Description
[0030] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.
[0031] Figure 1 This is a flowchart of the target detection method against a sea and sky background in an embodiment of the present invention;
[0032] Figure 2 This is a flowchart of the image visibility classification method in an embodiment of the present invention;
[0033] Figure 3 This is a flowchart of the preprocessing method in an embodiment of the present invention;
[0034] Figure 4 This is a flowchart of the gradient normalization method in an embodiment of the present invention;
[0035] Figure 5 This is a flowchart of the image visibility classification method in an embodiment of the present invention. Detailed Implementation
[0036] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and, together with the embodiments of the present invention, serve to illustrate the principles of the present invention.
[0037] One embodiment of the present invention discloses a target detection method against a sea and sky background, such as... Figure 1 As shown, it includes:
[0038] Visibility grading steps: The visibility of the acquired field-of-view image against the sea and sky background is graded, and the visibility levels include poor, average, and good. Images with poor visibility are classified as difficult samples and no target detection is performed. Images with average and good visibility are subjected to subsequent target detection.
[0039] Target detection steps: On the horizon in images with moderate or good visibility, a target search area is extracted near the horizon to detect targets that are difficult to distinguish with the naked eye and need to be recorded by an optical detector; target edges are extracted in the extracted target search area; after the target edges are extracted, image segmentation is performed according to the target edges to obtain the target image.
[0040] Specifically, in the visibility grading step, the method for grading the visibility of the acquired field-of-view image against a sea and sky background is as follows: Figure 2 As shown, including
[0041] Step S201: Perform preprocessing on the input field of view image, including resolution reduction, target gradient feature extraction, and gradient normalization.
[0042] Step S202: Extract the edge points of the image based on the gradient normalization result;
[0043] Step S203: Based on the number and length information of the edge points, determine whether the sea-line area in the image can be extracted;
[0044] Step S204: For images of the sea-line that can be extracted, classify the visibility of the image according to the magnitude of the maximum gradient.
[0045] Specifically, such as Figure 3 As shown, the preprocessing includes:
[0046] Step S301: Reduce the resolution of the input field of view image to obtain a reduced resolution image; and classify the visibility of images with a gray mean value less than the gray threshold in the reduced resolution image as poor level.
[0047] The original input image (640*480 resolution) is down-resolution processed to obtain a down-resolution image (320*240 resolution), thereby reducing the computational load. At the same time, when the average gray level of the image is less than the gray level threshold Gray_TH, the visibility of the image is classified as "poor".
[0048] Step S302: Perform adaptive Gaussian filtering on the down-resolution image with a grayscale mean not less than the grayscale threshold to calculate the target gradient feature set of the image, including the horizontal gradient, vertical gradient and maximum gradient of the image.
[0049] The Gaussian filter is an n*n matrix. Combining this with the sigma parameter of the Canny operator, the Gaussian filter is: dgau2D=-x·*exp(-(x·*x+x) T ·*x T ) / (2*canny_sigma)) / (2*π*canny_sigma 2 );
[0050] Where x is the input data of the Gaussian filter, a two-dimensional n*n vector.
[0051] The horizontal gradient set and the vertical gradient set dx and dy are:
[0052] The intermediate value of the image gradient is: value = sqrt(dx.*dx + dy.*dy);
[0053] The maximum gradient is: max_grad = max(value);
[0054] I represents the pixel matrix of the image after downscaling.
[0055] Step S303: Classify the visibility of images whose maximum gradient value is less than the first gradient threshold grad1 as poor level;
[0056] Step S304: For the image whose maximum gradient value is not less than the first gradient threshold grad1, perform gradient normalization operation to obtain the gradient normalization result.
[0057] This embodiment employs gradient normalization based on the maximum gradient level to achieve fine classification of seascape background images; specifically, it includes:
[0058] Five normalization factors are derived from the maximum gradient to perform gradient normalization. The normalization factors are: In the formula, the grading constants are va1 < va2 < va3 < va4 < va5;
[0059] Specifically, the normalization process is as follows: Figure 4 As shown, when the maximum gradient max_grad is greater than th1, the gradient is normalized to value1; otherwise, when the maximum gradient is greater than th2, the gradient is normalized to value2; otherwise, when the maximum gradient is greater than th3, the gradient is normalized to value3; otherwise, when the maximum gradient is greater than th4, the gradient is normalized to value4; when none of the above conditions are met, the gradient is directly normalized to value5.
[0060] th1, th2, th3, and th4 are four thresholds for gradient grading, which are set according to specific application scenarios.
[0061] Normalization by using the maximum gradient value can achieve fine classification of seascape background images, thereby completing visibility grading. This reduces misjudgments of image quality and improves the accuracy of visibility assessment.
[0062] Specifically, in step S202, when extracting image edge points based on the gradient normalization result, the Canny algorithm is used for image edge point extraction. Furthermore, by improving the Canny algorithm using the obtained gradient normalization result, non-maximum suppression and double threshold detection, which are included in the Canny adaptive algorithm, can be achieved.
[0063] More specifically, when extracting edge points in the image, the horizontal and vertical gradient sets are calculated using adaptive Gaussian filtering, and non-maximum suppression is performed in the Canny algorithm to retain the points with the largest local gradients, thereby achieving the purpose of refining the edges.
[0064] When extracting edge points in the image, the gradient normalization result is used to perform high and low threshold detection of the gradient using the Canny algorithm. High threshold detection is used to reduce false edges in the image, but it also produces the phenomenon of unclosed image edges. Then, edge points that meet the contour requirements are collected by low threshold detection to form new edges, thereby achieving image edge closure.
[0065] Preferably, when detecting high and low thresholds, a histogram is established based on the normalized gradient according to the principle of 16 equal parts and proportions, and the high and low thresholds of the gradient that meet the conditions are extracted using the histogram.
[0066] high_thresold = find(add(counts)>canny_higth*Δrow*Δline,1,first);
[0067] Gradient low threshold low_thresold = canny_lowth * high_thresold;
[0068] Here, `counts` represents the normalized gradient histogram, `canny_higth` and `canny_lowth` represent the preset high and low gradient thresholds, respectively, and `Δrow` and `Δline` refer to the pixel width and height after removing image boundaries such as black and white borders, respectively. `find()` is a MATLAB function used for searching; `add()` is a MATLAB function for summing.
[0069] Specifically, in step S203, the method for determining whether the sea-line area in the image can be extracted based on the number and length information of the edge points includes:
[0070] The number of points and length information of each edge are obtained by eight-neighbor labeling. When the number of edges is greater than the threshold, the sea line is extracted by Hough transform. Images whose number and range of sea lines do not meet the conditions are identified as images of sea lines that cannot be extracted, and the visibility is classified as poor.
[0071] Specifically, in step S204, images whose number and range of sea-line antennas meet the conditions are identified as images of sea-line antennas that can be extracted. For images of sea-line antennas that can be extracted, the maximum gradient of the image is used for threshold comparison. When the maximum gradient of the image is less than the second gradient threshold grad2, the visibility of the image is classified as poor and classified as a difficult sample, so no target detection is performed. When the maximum gradient of the image is between the second gradient threshold grad2 and the third gradient threshold grad3, the visibility of the image is classified as average. When the maximum gradient of the image is greater than the third gradient threshold grad3, the visibility of the image is classified as good.
[0072] like Figure 5 The diagram shown is a more detailed flowchart of the image visibility grading method for a background including sea and sky in this embodiment.
[0073] In the target detection step, target detection is performed on images with moderate to good visibility. Specifically, this includes:
[0074] 1) For images with average or good visibility, establish a target search area near the horizon line in the image for image cropping;
[0075] When the field of view is small, a single target search region is used; when the field of view is large, the horizon line in the image is divided into multiple target search regions on an even scale, with the area near the horizon line being the target search region.
[0076] Preferably, for the detection of ship targets on the sea surface, the target search area is a rectangular area close to the horizon, that is, the width direction is greater than the height direction, so as to facilitate the search for ship targets and reduce the amount of computation required for the search.
[0077] 2) Extract the target edges within the captured target search area;
[0078] Within the extracted target search area, the Canny operator is used to extract the target edge through processing including filtering, gradient calculation, nonmaximum suppression, and double thresholding.
[0079] 3) After the target edge extraction is completed, the image is segmented according to the target edge to obtain the target image.
[0080] In a preferred embodiment, when a field of view image with general visibility is affected by sea surface and weather, making it impossible to complete target detection through single-frame target edge extraction, the following steps are taken: extracting continuous frame information, performing difference operations on consecutive frame images and extracting binary images; filtering the binary images to eliminate the influence of sea surface and weather, determining candidate target regions through centroid search, and using the relationship between target grayscale feature changes and the overall average grayscale of the image in the candidate target regions to detect moving targets.
[0081] Specifically, moving target detection includes:
[0082] 1) Extract continuous frame information, perform difference operation on the images of consecutive frames and extract binary images;
[0083] 2) Filter the binary image to eliminate the effects of the sea surface and weather;
[0084] Let the filtered m×n dimensional binary image be I(x,y), where the target region is A and the background region is B, i.e.:
[0085]
[0086] 3) Determine candidate target regions through centroid search;
[0087] The target region in a binary image is composed of many pixels. Centroid search is used to group pixels belonging to the same target into one target, thus determining the center of the target region. Candidate target regions are then determined using this center; each candidate target region contains all pixels classified as a single target.
[0088] By using centroid search, the number of suspected targets formed by the same target due to the relatively dispersed pixels is reduced in the next detection process, thereby reducing the complexity of the process and improving the processing speed.
[0089] 4) Obtain the grayscale feature change values of the image in the candidate target region;
[0090] The candidate target region is restored to the field of view image, and the grayscale feature change values of the previous and next frame images are obtained.
[0091] 5) When the grayscale feature change value of the image is greater than the overall average grayscale value of the field of view image, it is determined that the candidate target area includes a moving target.
[0092] In summary, the target detection method under a sea and sky background according to the embodiments of the present invention performs visibility classification on the acquired field-of-view image under the sea and sky background. Images with poor visibility are classified as difficult samples and are not subject to target detection, while images with moderate or good visibility are subject to subsequent target detection; thus improving the detection probability.
[0093] Furthermore, this invention improves the Canny algorithm to establish a gradient adaptive planning method based on the maximum gradient calculation of the acquired image and the weighted texture to complete the visibility judgment of the sea and sky background, thus achieving a more stable and effective visibility judgment.
[0094] 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 changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for target detection in sea-sky background, characterized in that, include: The visibility of the acquired field-of-view images against the backdrop of the sea and sky is classified into three levels: poor, fair, and good. Images with poor visibility are classified as difficult samples and no target detection is performed on them; images with moderate or good visibility are subject to subsequent target detection. On the sea-line in images with moderate and good visibility, a target search area is selected near the sea-line to detect targets that are difficult to distinguish with the naked eye and need to be recorded by an optical detector; target edges are extracted in the selected target search area; after the target edges are extracted, image segmentation is performed according to the target edges to obtain the target image; Methods for visibility classification of acquired field-of-view images against a sea and sky background include: The input field-of-view image undergoes preprocessing including resolution reduction, target gradient feature extraction, and gradient normalization. Extract edge points from the image based on the gradient normalization result; Based on the number and length information of the edge points, it is determined whether the sea-line area in the image can be extracted; For images of the sea-line that can be extracted, the visibility of the image is graded according to the magnitude of the maximum gradient.
2. The target detection method according to claim 1, characterized in that, For images with good visibility and general field of view, the Canny operator is used within the cropped target search area to extract the target edge through processing including filtering, gradient calculation, non-maximum suppression, and double thresholding.
3. The target detection method according to claim 1, characterized in that, When the visibility of a field of view image is generally poor and the interference from the sea surface and weather makes it impossible to complete target detection through single-frame target edge extraction, the information of consecutive frames is extracted, the images of consecutive frames are differentially processed and binary images are extracted. After filtering the binary images to eliminate the influence of the sea surface and weather, candidate target regions are determined by centroid search, and the candidate target regions are restored to the field of view image. Moving targets are detected in the candidate target regions by using the relationship between the changes in target gray-scale features and the overall average gray-scale of the image.
4. The target detection method according to claim 1, characterized in that, The preprocessing includes: The input field-of-view image is down-resolution processed to obtain a down-resolution image; and the visibility of images with a gray-scale mean value less than the gray-scale threshold in the down-resolution image is classified as poor. An adaptive Gaussian filter is applied to a down-resolution image with a grayscale mean not less than a grayscale threshold to calculate the target gradient feature set of the image, including the horizontal gradient, vertical gradient, and maximum gradient. Images with a maximum gradient value less than the first gradient threshold are classified as having poor visibility. For images whose maximum gradient value is not less than the first gradient threshold, the gradient normalization result is obtained by performing a gradient normalization operation.
5. The target detection method according to claim 4, characterized in that, Gradient normalization is performed based on the maximum gradient tier, specifically including: Five normalization factors are derived from the maximum gradient to complete gradient normalization. The normalization factors are shown in the following formula: In the formula, the grading constant is... ; This represents the median value of the image gradient. The maximum gradient; When the maximum gradient Greater than When the gradient is normalized to Otherwise, when the maximum gradient is greater than When the gradient is normalized to Otherwise, when the maximum gradient is greater than When the gradient is normalized to Otherwise, when the maximum gradient is greater than When the gradient is normalized to When none of the above conditions are met, the gradient is directly normalized to... .
6. The target detection method according to claim 1, characterized in that, The edge point extraction in the image uses the Canny algorithm; during edge point extraction, non-maximum suppression in the Canny algorithm is performed by adaptive horizontal and vertical gradient sets.
7. The target detection method according to claim 6, characterized in that, When extracting edge points in the image, the gradient normalization result is used to perform high and low threshold detection of the gradient using the Canny algorithm; high threshold detection is used to reduce false edges in the image; low threshold detection is used to collect edge points that meet the contour requirements to form new edges, thereby achieving edge closure of the image.
8. The target detection method according to claim 1, characterized in that, The methods for determining whether the sea-line area in the image can be extracted based on the number and length information of the edge points include: The number of points and length information of each edge are obtained by eight-neighbor labeling. When the number of edges is greater than the threshold, the sea line is extracted by Hough transform. Images whose number and range of sea lines do not meet the conditions are identified as images of sea lines that cannot be extracted, and the visibility is classified as poor.
9. The target detection method according to claim 8, characterized in that, Images that meet the criteria for the number and range of sea-line antennas are identified as images from which sea-line antennas can be extracted. For images from which sea-line antennas can be extracted, a threshold comparison is performed using the maximum gradient of the image. When the maximum gradient of the image is less than the second gradient threshold, the visibility of the image is classified as poor and is categorized as a difficult sample, thus not subject to target detection. When the maximum gradient of the image is between the second and third gradient thresholds, the visibility of the image is classified as average. When the maximum gradient of the image is greater than the third gradient threshold, the visibility of the image is classified as good.