Infrared small target rapid detection method based on three-layer gradient kernel and related equipment thereof
By constructing a hierarchical gradient kernel for infrared image processing, generating a gradient map, and performing adaptive threshold binarization and aggregation, the problems of background suppression and target aggregation in infrared small target detection are solved, achieving stable localization and rapid detection in complex backgrounds.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-14
AI Technical Summary
Existing infrared small target detection methods struggle to achieve effective background suppression, adaptive and stable segmentation, and complete aggregation of decomposed targets under complex backgrounds and low signal-to-noise ratio conditions, leading to frequent false alarms, missed detections, and misdetections.
A detection method based on a three-layer gradient kernel is adopted. By constructing a layered gradient kernel for convolution processing, a gradient map is generated. An adaptive threshold is determined and binarized. Finally, the candidate target regions are aggregated to output an infrared small target detection set.
Achieve rapid extraction and stable localization of small infrared targets under complex backgrounds and low signal-to-noise ratio conditions, reduce false detection rate, and improve real-time detection capabilities.
Smart Images

Figure CN121861645A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of infrared small target detection, and in particular to a rapid infrared small target detection method, device, electronic device and storage medium based on a three-layer gradient kernel. Background Technology
[0002] Infrared small target detection is widely used in scenarios such as early warning and surveillance, infrared search and tracking, and unmanned platform perception. Since infrared imaging usually lacks obvious texture and shape details, small targets in the image are characterized by small size, low contrast, and weak edges. Existing technologies usually adopt a single-frame detection method, and achieve the extraction and localization of suspected target areas by processing infrared images such as feature enhancement, background suppression, and threshold segmentation.
[0003] In real-world complex backgrounds and low signal-to-noise ratio conditions, existing single-frame detection methods often face problems such as strong background clutter and numerous local bright noise interferences. On the one hand, traditional filtering or gradient enhancement methods have limited ability to suppress background and noise, easily leading to false alarms. On the other hand, fixed thresholds or simple threshold strategies are difficult to adapt to grayscale distribution changes in different scenes, resulting in both missed detections and false detections. In addition, when the target shape is not an ideal spot or when response splitting occurs during convolution / enhancement, the lack of an effective aggregation mechanism can cause incomplete localization or the target to be segmented into multiple fragments, affecting the reliability and usability of the detection results.
[0004] Therefore, existing rapid infrared target detection methods have the problem of failing to simultaneously achieve effective background suppression, adaptive and stable segmentation, and complete aggregated output of decomposed targets under complex background and low signal-to-noise ratio conditions. Summary of the Invention
[0005] This invention provides a fast infrared small target detection method based on a three-layer gradient kernel, which solves the problem that existing fast infrared small target detection methods cannot simultaneously achieve effective background suppression, adaptive stable segmentation, and complete aggregated output of decomposed targets under complex background and low signal-to-noise ratio conditions.
[0006] In a first aspect, the present invention provides a method for rapid detection of small infrared targets based on a three-layer gradient kernel, the method comprising the following steps: Acquire an input infrared image and preprocess the input infrared image to obtain a target input infrared image; Based on the target size of a pre-defined small target, a hierarchical gradient kernel is constructed; Based on the hierarchical gradient kernel, the target input infrared image is convolved to generate a gradient map; Based on the gradient graph, determine the adaptive threshold; The gradient map is binarized based on the adaptive threshold to obtain multiple candidate target regions. The multiple candidate target regions are aggregated to obtain an aggregation result, and an infrared small target detection set is output based on the aggregation result.
[0007] Optionally, acquiring the input infrared image and preprocessing the input infrared image to obtain the target input infrared image includes: The input infrared image is subjected to frame extraction processing to obtain the target frame image; The target frame image is format-normalized to obtain the target input infrared image.
[0008] Optionally, constructing a hierarchical gradient kernel based on the target size of a preset small target includes: Based on the target size of the preset small target, the kernel size of the hierarchical gradient kernel is determined; Within the kernel size, a three-layer partition structure is set, which includes a target layer, a protective layer, and a background layer; Kernel coefficients are configured for the target layer, the protective layer, and the background layer respectively. The kernel coefficient of the target layer is positive, the kernel coefficient of the protective layer is 0, and the kernel coefficient of the background layer is negative. The sum of the kernel coefficients of the layered gradient kernels is 0. The hierarchical gradient kernel is constructed based on its kernel size and kernel coefficients.
[0009] Optionally, the step of performing convolution processing on the target input infrared image based on the hierarchical gradient kernel to generate a gradient map includes: The target input infrared image is subjected to sliding convolution operation through the hierarchical gradient kernel to obtain the convolution response value at the corresponding pixel position in the target input infrared image. A gradient map is constructed based on the convolution response values corresponding to each pixel position in the target input infrared image.
[0010] Optionally, determining the adaptive threshold based on the gradient map includes: Statistical feature calculations are performed on the gradient plot to obtain statistical feature parameters, including the mean and standard deviation of the gradient plot. The adaptive threshold is generated based on the mean and standard deviation of the gradient graph according to a preset adaptive threshold algorithm.
[0011] Optionally, the step of binarizing the gradient map based on the adaptive threshold to obtain multiple candidate target regions includes: Based on the adaptive threshold, a threshold determination is performed on the pixel response values in the gradient map to generate a binary image; Based on the binary image, determine the foreground pixel set; Perform region connectivity analysis on the foreground pixel set to obtain multiple candidate target regions.
[0012] Optionally, the step of aggregating the multiple candidate target regions to obtain an aggregation result, and outputting an infrared small target detection set based on the aggregation result, includes: Based on the spatial adjacency relationship between the multiple candidate target regions, the multiple candidate target regions are merged to obtain at least one aggregated target region; Based on the at least one aggregated target region, the positioning information of the infrared small target is determined, and the positioning information is aggregated into the infrared small target detection set for output.
[0013] Secondly, the present invention also provides a rapid infrared small target detection device based on a three-layer gradient kernel, the rapid infrared small target detection device based on a three-layer gradient kernel comprising: The first acquisition module is used to acquire an input infrared image and preprocess the input infrared image to obtain a target input infrared image; The first construction module is used to construct a hierarchical gradient kernel based on the target size of a preset small target; The first generation module is used to perform convolution processing on the target input infrared image based on the hierarchical gradient kernel to generate a gradient map; The first determining module is used to determine an adaptive threshold based on the gradient map; The second acquisition module is used to perform binarization processing on the gradient map based on the adaptive threshold to obtain multiple candidate target regions. The aggregation module is used to aggregate the multiple candidate target regions to obtain the aggregation result, and output the infrared small target detection set based on the aggregation result.
[0014] Thirdly, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the rapid infrared small target detection method based on a three-layer gradient kernel provided by the present invention.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps in the infrared small target rapid detection method based on a three-layer gradient kernel provided by the invention.
[0016] This invention acquires an input infrared image and preprocesses it to obtain a target input infrared image. Based on a preset target size for small targets, a hierarchical gradient kernel is constructed. The target input infrared image is then convolved using the hierarchical gradient kernel to generate a gradient map. An adaptive threshold is determined based on the gradient map. The gradient map is then binarized based on the adaptive threshold to obtain multiple candidate target regions. These candidate target regions are then aggregated to obtain an aggregation result, and an infrared small target detection set is output based on the aggregation result. Through these steps, rapid extraction and stable localization of infrared small targets can be achieved under complex backgrounds and low signal-to-noise ratio conditions, reducing false detections and improving real-time detection capabilities. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a rapid infrared small target detection method based on a three-layer gradient kernel provided by an embodiment of the present invention; Figure 2 This is a schematic diagram illustrating the correlation between the number of erroneous targets and the parameter k provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of a nuclear structure feature provided in an embodiment of the present invention; Figure 4 This is an example diagram of a three-layer gradient kernel of different sizes provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the structure of a rapid infrared small target detection device based on a three-layer gradient kernel provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] like Figure 1 As shown, Figure 1This is a flowchart of a fast infrared small target detection method based on a three-layer gradient kernel, provided by an embodiment of the present invention. The fast infrared small target detection method based on a three-layer gradient kernel includes the following steps: 101. Acquire the input infrared image and preprocess it to obtain the target input infrared image.
[0021] In this embodiment of the invention, the above-mentioned rapid infrared small target detection method based on three-layer gradient kernel can be applied to a rapid infrared small target detection platform based on three-layer gradient kernel. The rapid infrared small target detection platform based on three-layer gradient kernel has functions such as infrared small target detection data processing, infrared small target detection data transmission and reception, and infrared small target detection data memory storage. It can be built based on a server or server cluster. The server or server cluster can be an electronic device with infrared small target detection data processing capability.
[0022] The aforementioned infrared image can refer to single or multiple frames of two-dimensional grayscale image data acquired by an infrared imaging device (such as an uncooled microbolometer camera or a cooled infrared camera), whose pixel grayscale values are used to characterize the infrared radiation intensity or temperature-related radiation response at the corresponding spatial location.
[0023] In this embodiment, the infrared small target fast detection platform based on the three-layer gradient kernel can also perform pre-normalization processing on the input infrared image before entering the three-layer gradient kernel convolution to ensure that the subsequent convolution kernel and image data can be directly matched in terms of time sequence and format, including but not limited to preprocessing methods such as "frame extraction" and "format normalization".
[0024] The aforementioned target input infrared image can refer to the preprocessed output of the infrared small target fast detection platform based on a three-layer gradient kernel, which is then used as the input image for subsequent layered gradient kernel convolution processing. Compared to the original input infrared image, its core difference lies in the fact that frame extraction and format standardization have been completed, thus satisfying the input constraints of the internal algorithm of the infrared small target fast detection platform based on a three-layer gradient kernel in terms of size, pixel arrangement, and data type.
[0025] For example, 16-bit grayscale frames from different cameras can be uniformly mapped / truncated to the data format required by the infrared small target rapid detection platform based on the three-layer gradient kernel, or frames of different resolutions can be scaled / cropped to a uniform processing size.
[0026] 102. Based on the target size of the preset small target, construct a hierarchical gradient kernel.
[0027] In this embodiment of the invention, the target size of the preset small target can refer to the target size range that the infrared small target fast detection platform based on the three-layer gradient kernel sets in advance for the typical pixel scale of the object to be detected in the infrared image, which is used to guide the selection of the kernel size and target layer size of the layered gradient kernel; for example, the target size of the preset small target can be on the order of 1×1, 2×2 or 3×3 pixels, and the infrared small target fast detection platform based on the three-layer gradient kernel can use the target size as a priori input for kernel configuration according to the application scenario, such as imaging distance, optical diffraction diffusion, sensor resolution, etc.
[0028] In one possible embodiment, the above-mentioned infrared small target fast detection platform based on three-layer gradient kernel can map the "target size prior" to the "kernel size, partitioning structure and kernel coefficients of the layered gradient kernel". Specifically, according to the corresponding constraints, such as three-layer partitioning, coefficient sign allocation, and the total coefficient sum being 0, a kernel matrix that can be directly used for convolution operations can be calculated and generated, thereby solidifying the detection strategy into an executable operator. Through the above method, the layered gradient kernel can be constructed.
[0029] Furthermore, the aforementioned hierarchical gradient kernel can be an m×m matrix operator used for convolution with the target input infrared image, having a three-layer partitioned structure: target layer T, protective layer G, and background layer B.
[0030] Among them, the target layer T can be used to capture the main energy response of small targets, and its kernel coefficient is positive; the protection layer G can be used to isolate the target from the interference of the neighborhood, and its kernel coefficient is 0 to reduce the invalid gradient contribution between the target layer T and the neighborhood; the background layer B can be used to capture the background around the target, and its kernel coefficient is negative (usually -1 in the disclosure document example).
[0031] Furthermore, the aforementioned infrared small target rapid detection platform based on three-layer gradient kernels can constrain the sum of all kernel coefficients of the target layer, protective layer and background layer to 0, so that the average response to a smooth background approaches zero, thereby structurally suppressing the background and relatively enhancing the response to small targets.
[0032] 103. Based on hierarchical gradient kernels, perform convolution processing on the target input infrared image to generate a gradient map.
[0033] In this embodiment of the invention, the above-mentioned infrared small target fast detection platform based on three-layer gradient kernel can use the layered gradient kernel as a sliding window to perform local weighted combination calculation on the target input infrared image.
[0034] Specifically, the infrared small target rapid detection platform based on the three-layer gradient kernel slides the layered gradient kernel position by position on the image. At each pixel position, it extracts the local neighbor pixels corresponding to the kernel size, multiplies them element by element with the kernel matrix coefficients and accumulates them to obtain the convolution response value at that pixel position. By repeating the above operation at each position of the image, the response result corresponding to the input image space is obtained, which is used to characterize the intensity of local gradient changes.
[0035] For example, the infrared small target fast detection platform based on three-layer gradient kernels can write the convolution response values corresponding to each pixel position into the output data structure according to the spatial position to form a new image matrix and obtain the corresponding gradient map.
[0036] The gradient map mentioned above can be the response map obtained by performing hierarchical gradient kernel convolution on the infrared input infrared image of the target based on the three-layer gradient kernel-based infrared small target fast detection platform. It is denoted as IGM, where each pixel value represents the gradient response intensity at the corresponding spatial location. It can be understood that since the sum of the coefficients of the hierarchical gradient kernel is 0, the smooth background region tends to have a low response after convolution, while the small target region shows a higher response due to local gray-level abrupt changes or energy concentration. Therefore, the gradient map provides the basic input for subsequent statistical threshold calculation and candidate target extraction.
[0037] 104. Determine the adaptive threshold based on the gradient graph.
[0038] In this embodiment of the invention, the infrared small target rapid detection platform based on the three-layer gradient kernel can calculate the threshold and output an adaptive threshold based on the statistical characteristics of the gradient map.
[0039] The aforementioned adaptive threshold can refer to the dynamic threshold parameter used by the infrared small target rapid detection platform based on the three-layer gradient kernel to distinguish between "potential target response" and "background / noise response". It is calculated in real time based on the statistical characteristics of the current gradient map, thereby adapting to different scenarios, different background complexities and different noise levels.
[0040] Furthermore, the aforementioned adaptive threshold Th is explained by the following formula: Where k is a parameter determined by the test image, and μIGM and σIGM represent the mean and standard deviation of the gradient map, respectively. The mean and standard deviation are shown below: ; where gi represents its value in the gradient map IGM.
[0041] It should be noted that by appropriately selecting the parameter k, where k is a threshold adjustment parameter (e.g., an empirical value within the range of 12 to 14), the number of erroneous targets can be reduced. Figure 2The diagram showing the correlation between the number of erroneous targets and the parameter k indicates that for a 256×200 image, a value of k in the range of 12 to 14 can reduce erroneous targets.
[0042] 105. Binarize the gradient map based on an adaptive threshold to obtain multiple candidate target regions.
[0043] In this embodiment of the invention, the aforementioned infrared small target fast detection platform based on a three-layer gradient kernel can convert the gradient map into a binary image using an adaptive threshold as the criterion. Specifically, the platform compares the response value of each pixel in the gradient map with the adaptive threshold. When the response value meets a preset condition (e.g., greater than or equal to the threshold), the pixel is marked as foreground (value 1); otherwise, it is marked as background (value 0), thus obtaining a binary image that retains only the high-response locations, providing discretized input for subsequent candidate target region extraction and aggregation.
[0044] Specifically, it can be done using the following formula: .
[0045] The aforementioned candidate target region can be one or more connected regions extracted from the foreground pixel set in a binary image based on the spatial connectivity relationship by the infrared small target fast detection platform based on the three-layer gradient kernel. The connected region can be understood as a foreground patch or a connected domain. Each candidate target region corresponds to a "suspected small target" location or a high-response region caused by noise. The aforementioned infrared small target rapid detection platform based on a three-layer gradient kernel can divide the foreground pixel set into several regions through connectivity analysis, such as analyzing whether it is 4-connected or 8-connected, and use the pixel set of each region or its bounding box / centroid as candidate output.
[0046] 106. Aggregate multiple candidate target regions to obtain the aggregation result, and output the infrared small target detection set based on the aggregation result.
[0047] In this embodiment of the invention, the infrared small target rapid detection platform based on three-layer gradient kernel can merge candidate target regions into a more complete target according to their spatial adjacency relationship, in cases where the candidate target region may be split by the layered gradient kernel convolution effect or multiple adjacent candidate regions may be caused by the non-ideal spot shape of the target.
[0048] For example, based on methods such as adjacent pixel expansion and 4-connected morphological merging, adjacent candidate regions are merged into a single aggregated target region to obtain the corresponding aggregated result, thereby improving the integrity and stability of target localization and reducing fragmented output.
[0049] The above aggregation result can refer to one or more aggregated target regions and their associated attribute sets obtained after the aggregation process is completed. It represents the final region-level representation that the infrared small target fast detection platform based on the three-layer gradient kernel believes should correspond to the "same real target". This includes, but is not limited to, the aggregated region pixel set, region bounding box, region centroid coordinates, and region area. It can be used as the direct basis for the final detection set output and as the input for subsequent tracking / alarm / display modules.
[0050] In one possible embodiment, the aforementioned infrared small target rapid detection platform based on a three-layer gradient kernel outputs a structured summary of the aggregation results to obtain an infrared small target detection set. Specifically, the aforementioned infrared small target detection set can be used to provide final detection results externally, including but not limited to a list / array structure of one or more target entries. Each target entry includes at least target location information, such as: target bounding box coordinates (xmin, ymin, xmax, ymax) and / or target centroid coordinates (cx, cy), and optionally includes fields such as target region area, target pixel set index, and target response intensity statistics.
[0051] In this embodiment of the invention, an input infrared image is acquired and preprocessed to obtain a target input infrared image. A hierarchical gradient kernel is constructed based on a preset target size for the small target. The target input infrared image is then convolved using the hierarchical gradient kernel to generate a gradient map. An adaptive threshold is determined based on the gradient map. The gradient map is then binarized based on the adaptive threshold to obtain multiple candidate target regions. These candidate target regions are then aggregated to obtain an aggregation result, and an infrared small target detection set is output based on the aggregation result. Through these steps, rapid extraction and stable localization of infrared small targets can be achieved under complex backgrounds and low signal-to-noise ratio conditions, reducing false detections and improving real-time detection capabilities.
[0052] Optionally, in the steps of acquiring the input infrared image and preprocessing the input infrared image to obtain the target input infrared image, the input infrared image can also be subjected to frame extraction processing to obtain the target frame image; and the target frame image can be subjected to format standardization processing to obtain the target input infrared image.
[0053] In this embodiment of the invention, the infrared small target fast detection platform based on a three-layer gradient kernel can select at least one frame image to be processed from the video stream or frame sequence according to a preset frame selection rule. For example, the infrared small target fast detection platform based on a three-layer gradient kernel can select one frame at a fixed frame rate interval, such as every N frames, according to a timestamp interval, or according to a trigger condition, such as detecting a change in the image or receiving an external trigger signal, to extract frames from the input infrared image, thereby avoiding the computational burden caused by processing all frames one by one, and ensuring that the image targeted by subsequent processing is a valid frame, thus obtaining the target frame image.
[0054] The aforementioned target frame image can refer to a single infrared frame image selected for performing subsequent steps such as hierarchical gradient kernel convolution and threshold segmentation. It has a clear frame number / timestamp identifier and can be used as a direct input object for subsequent algorithm processing.
[0055] In another possible embodiment, the aforementioned infrared small target rapid detection platform based on a three-layer gradient kernel can perform a data format unification operation on the target frame image to ensure that the target frame image meets the preset image data specifications and matches the subsequent convolution operation, statistical feature calculation, and storage interface. For example, the format standardization process may include unifying the target frame image to a preset resolution size, a uniform grayscale bit depth, such as 8-bit or 16-bit grayscale representation, a uniform pixel arrangement and channel format, such as a single-channel grayscale matrix, and a uniform data type and storage order, such as row-major matrix storage, thereby obtaining the target input infrared image as the input for subsequent convolution processing, ensuring that infrared images from different sources and of different specifications have a consistent data expression and processing basis before entering the detection process.
[0056] Optionally, the step of constructing a hierarchical gradient kernel based on the target size of a preset small target may further include determining the kernel size of the hierarchical gradient kernel based on the target size of the preset small target; setting a three-layer partition structure within the kernel size; configuring kernel coefficients for the target layer, the protective layer, and the background layer respectively; and constructing the hierarchical gradient kernel based on the kernel size and kernel coefficients of the hierarchical gradient kernel.
[0057] In this embodiment of the invention, the kernel size can refer to the two-dimensional matrix size of the hierarchical gradient kernel, such as m×m, used to limit the local neighborhood range participating in the weighted calculation during convolution. The kernel size can be selected according to the target size of the preset small target, so that the kernel window can cover the small target and its surrounding background. Generally, it can be set to 2-9, and a three-layer partitioning structure can be adopted.
[0058] Specifically, the aforementioned three-layer partitioning structure can refer to dividing the kernel window, which is defined by the kernel size, into three nested partitions according to their spatial location, so as to configure different kernel coefficients for different regions and achieve layered response and background suppression.
[0059] It can be done as follows Figure 3 The schematic diagram of the kernel structure shown above illustrates the structure, which includes a target layer, a protective layer, and a background layer. The target layer is the partition located at the center of the kernel window in the three-layer partition structure, and is used to correspond to the area where the preset small target may appear. In this embodiment, the kernel coefficient of the target layer is set to positive, so that the pixels in the target area have a positive enhancement effect in the weighted summation of convolution, thereby improving the saliency of the small target in the gradient response. The aforementioned protective layer is a buffer zone surrounding the target layer and located between the target layer and the background layer. It is used to weaken the direct coupling between the target layer and the background layer and reduce the interference of neighborhood noise on the target response. In this embodiment, the kernel coefficient of the protective layer is set to 0, so that the pixels in this zone do not contribute to the response in the convolution calculation, thereby achieving isolation and interference suppression. The aforementioned background layer is a partition located outside the kernel window in the three-layer partition structure, usually corresponding to the outermost ring of the kernel window, used to characterize the influence of background pixels around the target; in this embodiment, the kernel coefficient of the background layer is set to negative, so that the background pixels have a canceling effect on the convolution response, thereby suppressing the average response of smooth background or slowly changing background.
[0060] The kernel coefficients of the target layer are positive, the kernel coefficients of the protective layer are 0, the kernel coefficients of the background layer are negative, and the sum of the kernel coefficients of the layered gradient kernels is 0.
[0061] The aforementioned kernel coefficients can refer to the weight values of each element in the aforementioned hierarchical gradient kernel, used to characterize the magnitude and direction of the contribution of the corresponding pixel to the convolution response value in the convolution operation. In this embodiment, the target layer kernel coefficient is positive, the guard layer kernel coefficient is 0, the background layer kernel coefficient is negative, and the sum of the kernel coefficients of the hierarchical gradient kernels is 0. This makes the positive and negative contributions cancel each other out and the response approach zero when the kernel window covers a smooth background area, while the positive contribution of the target layer significantly enhances the response when the kernel window covers an area containing small targets.
[0062] In another possible embodiment, the size of the hierarchical gradient kernel is m*m, where m is determined by the expected target size, typically between 5 and 9. The width of the background layer is fixed at one pixel, i.e., the outermost layer, and all coefficients are set to -1. All coefficients of the protective layer are set to 0, indicating that the gradient between the target layer and the protective layer does not need to be calculated. The sum of all coefficients of the target layer, the protective layer, and the background layer equals zero.
[0063] In practice, the size of the entire hierarchical gradient kernel and the size of the target layer can be defined first. For example, when the size of the hierarchical gradient kernel is m*m, the coefficients of the outermost background layer are all -1, and they are added together to be -4*(m-1). If the size of the target layer is n*n, then the coefficient of each target layer element is 4*(m-1) / (n*n), and the coefficients of the protective layer are all 0. At this time, it can be guaranteed that all coefficients are added together to be 0.
[0064] like Figure 4 Example diagrams of three-layer gradient kernels of different sizes are shown, illustrating examples of the proposed three-layer gradient kernels with different sizes. (a) and (c) are kernels expected to detect 1x1 small infrared targets. (b) is a kernel expected to detect 2x2 infrared targets. For a 1x1 small target, the kernel may detect noise effects with high brightness at the single-pixel size and detect interfering noise.
[0065] Therefore, the kernel size can be set to at least 6*6 or larger, and the target layer size can be set to 2*2. This embodiment does not limit the size of the different layers mentioned above. The specific implementation can be adjusted according to specific requirements, but it is necessary to ensure that the sum of the coefficients is zero, and to ensure that the average response to the smooth background approaches zero.
[0066] Optionally, in the step of generating a gradient map by performing convolution processing on the target input infrared image based on the hierarchical gradient kernel, the method further includes performing sliding convolution operation on the target input infrared image using the hierarchical gradient kernel to obtain the convolution response value at the corresponding pixel position in the target input infrared image; and constructing a gradient map based on the convolution response value corresponding to each pixel position in the target input infrared image.
[0067] In this embodiment of the invention, the above-mentioned infrared small target fast detection platform based on three-layer gradient kernels can use the layered gradient kernels as the calculation window, move the layered gradient kernels point by point on the target input infrared image according to the pixel position, and perform a convolution calculation once within the local neighborhood covered by each kernel window to complete the sliding convolution operation.
[0068] For example, the infrared small target fast detection platform based on the three-layer gradient kernel aligns the current pixel position with the center of the kernel window, and performs a weighted combination and summation of the local neighboring pixels covered by the kernel window and the kernel coefficients to obtain the local gradient response of the pixel position.
[0069] Furthermore, higher gradient values indicate a larger sum of local gradients, suggesting a higher probability that the target is located at that location. A hierarchical gradient kernel K can be used. G The gradient map is obtained by convolving the input infrared image I with the image, as shown in the following equation:
[0070] Where (x,y) and (u,v) are the original infrared image I and the hierarchical gradient kernel K, respectively. G The size of the kernel. The computational range of each element. a≤u≤a, b≤v≤b.
[0071] The aforementioned convolution response value can refer to the numerical result obtained by weighting and combining the local neighboring pixels corresponding to that pixel position with the coefficients of the hierarchical gradient kernel for a certain pixel position in the target input infrared image during sliding convolution operation.
[0072] The above convolution response value can be used to characterize the gradient response intensity at the pixel location. It usually shows a small or near-zero value in smooth background areas, while in areas containing small targets, due to the positive contribution of the target layer and the negative cancellation relationship of the background layer, a relatively more significant response peak will be formed, forming a threshold segmentation basis.
[0073] In one possible embodiment, the infrared small target fast detection platform based on three-layer gradient kernel can organize the convolution response values calculated at each pixel position on the target input infrared image into a two-dimensional response matrix in a one-to-one correspondence with its pixel position, and output the two-dimensional response matrix as a gradient map; wherein each pixel value of the gradient map is the convolution response value at the corresponding position, so that the gradient map can intuitively represent the gradient response distribution at each position in space, which is convenient for subsequent calculation of adaptive threshold based on statistical features and execution of binarized candidate target extraction.
[0074] Optionally, the step of determining the adaptive threshold based on the gradient graph may further include calculating the statistical features of the gradient graph to obtain statistical feature parameters; and generating an adaptive threshold based on the mean and standard deviation of the gradient graph according to a preset adaptive threshold algorithm.
[0075] In this embodiment of the invention, the aforementioned infrared small target rapid detection platform based on a three-layer gradient kernel can perform overall statistical analysis on the pixel response values in the gradient map to obtain statistical quantities that characterize the current gradient response distribution level and fluctuation degree. Generally, the gradient map can be regarded as a data set composed of a large number of pixel response values, and statistical operations can be performed on this data set to obtain the corresponding statistical feature parameters.
[0076] The aforementioned statistical feature parameters include at least the mean and / or standard deviation of the gradient plot. These can be a set of parameters calculated from statistical features and used in threshold generation. In this embodiment, the statistical feature parameters include at least the mean μ and standard deviation σ of the gradient plot, where the mean μ characterizes the baseline level of the overall gradient plot response, and the standard deviation σ characterizes the dispersion or fluctuation intensity of the gradient response, thereby providing an aligned threshold adjustment basis when different background complexities and noise levels change.
[0077] The aforementioned preset adaptive threshold algorithm can be a pre-set calculation rule used to generate an adaptive threshold based on statistical feature parameters. In this embodiment, the aforementioned preset adaptive threshold algorithm can adopt the formula Th=μ+kσ, where Th is the adaptive threshold, μ is the mean of the gradient map, σ is the standard deviation of the gradient map, and k is the threshold adjustment parameter. The platform uses this algorithm to make the threshold automatically change with the overall response level and fluctuation of the gradient map, thereby achieving adaptive differentiation between candidate targets and background noise in different scenarios.
[0078] Optionally, the step of binarizing the gradient map based on an adaptive threshold to obtain multiple candidate target regions further includes: determining a threshold based on the pixel response value in the gradient map to generate a binary image; determining a foreground pixel set based on the binary image; and performing regional connectivity analysis on the foreground pixel set to obtain multiple candidate target regions.
[0079] In this embodiment of the invention, the threshold determination refers to the process by which the infrared small target rapid detection platform based on a three-layer gradient kernel compares and judges the response values of each pixel in the gradient map using an adaptive threshold as a comparison benchmark. Specifically, the response value of each pixel can be compared with the adaptive threshold, and the pixel can be determined as a target candidate or background based on the comparison result, thereby achieving the screening of high-response pixels.
[0080] The data product is generated based on the threshold determination output and can be directly called by subsequent steps. The determination result of each pixel is mapped to a binary value and the output is organized to obtain a structured binary image as the input for subsequent foreground pixel extraction and connected component analysis.
[0081] The aforementioned binary image can refer to the binarized result image obtained by thresholding the gradient map, where each pixel takes only two state values to represent the candidate target pixel and the background pixel respectively; for example, pixels that meet the threshold determination condition are marked as foreground (can be denoted as 1), and pixels that do not meet the condition are marked as background (can be denoted as 0), thereby forming discrete foreground patches in the image by high response regions.
[0082] The aforementioned foreground pixel set can refer to the set of all pixels marked as foreground states in a binary image; this set corresponds to the set of pixel locations with high gradient responses that may contain small infrared targets. The infrared small target fast detection platform based on a three-layer gradient kernel can use this as the basic input for candidate region extraction and further group them according to connectivity rules.
[0083] In one possible embodiment, the aforementioned infrared small target rapid detection platform based on a three-layer gradient kernel can perform connectivity grouping on the foreground pixel set according to a preset pixel adjacency rule, so as to merge mutually adjacent or connected foreground pixels into the same candidate region. For example, this analysis can be used to divide the foreground pixel set into multiple unconnected connected regions, and each connected region can be determined as a candidate target region.
[0084] The aforementioned preset pixel adjacency rules generally allow for 4-adjacency (4-connectivity): only adjacent pixels in the "top, bottom, left, and right" directions are considered connected; diagonal pixels are not counted. This is suitable for suppressing diagonal noise that forms a continuous block, resulting in a more "compact" connected domain. 8-adjacency (8-connectivity): Treats the top, bottom, left, right, and four diagonals as connected. This makes it easier to merge diagonally connected pixels, resulting in a wider connected domain.
[0085] Optionally, the steps of aggregating multiple candidate target regions to obtain an aggregation result and outputting an infrared small target detection set based on the aggregation result may further include merging multiple candidate target regions based on the spatial adjacency relationship between them to obtain at least one aggregated target region; determining the positioning information of the infrared small target based on the at least one aggregated target region; and aggregating the positioning information into an infrared small target detection set for output.
[0086] In this embodiment of the invention, the aforementioned spatial adjacency relationship refers to the determination criterion used by the infrared small target fast detection platform based on a three-layer gradient kernel to determine whether different candidate target regions belong to the same target in the image space or should be merged. Specifically, the infrared small target fast detection platform based on a three-layer gradient kernel can determine the spatial adjacency relationship between candidate target regions based on conditions such as whether there is pixel-level connectivity between candidate target regions, whether they are adjacent within a preset distance threshold, or whether the bounding boxes of candidate target regions intersect / are adjacent.
[0087] For example, if two candidate target regions become connected after a slight expansion / expansion on the binary map (or originally share a boundary / have a connected path), then they are determined to satisfy the spatial adjacency relationship and should be merged into the same target; Alternatively, calculate the minimum pixel distance between two candidate target regions (e.g., the minimum Euclidean / Manhattan distance from any point to any point in another region), for example, set the distance threshold to d=1 or d=2 pixels: when the minimum distance between the two regions is ≤ d, determine that they satisfy the spatial adjacency relationship and merge them.
[0088] In one possible embodiment, the infrared small target fast detection platform based on three-layer gradient kernel can merge multiple candidate target regions that meet the conditions into the same target region after determining that the candidate target regions satisfy the spatial adjacency relationship. Specifically, the pixel set of the candidate target regions that are determined to be merged is combined in union, or their bounding boxes are merged and updated, thereby forming a more complete region representation to reduce fragmented candidate output caused by convolution response splitting, noise breakage, etc.
[0089] The aforementioned aggregated target region can refer to the region-level result obtained by merging processing. It can be used to characterize the final spatial occupancy range of a small infrared target in an image and can serve as a direct basis for subsequent location information calculation and detection result output.
[0090] The aforementioned positioning information can refer to the structured information used to describe the position and range of infrared small targets in the image, calculated by the infrared small target rapid detection platform based on the aggregated target region. This information includes, but is not limited to, the bounding box coordinates of the aggregated target region (such as the coordinates of the upper left and lower right corners), the centroid coordinates of the target, the area of the target region, or the number of pixels. The infrared small target rapid detection platform based on the three-layer gradient kernel can aggregate the aforementioned positioning information into an infrared small target detection set according to target items and output it for use by the upper-layer display, alarm, or tracking modules.
[0091] like Figure 5 As shown, this embodiment of the invention also provides a rapid infrared small target detection device 500 based on a three-layer gradient kernel, which includes: The first acquisition module 501 is used to acquire an input infrared image and preprocess the input infrared image to obtain a target input infrared image; The first construction module 502 is used to construct a hierarchical gradient kernel based on the target size of a preset small target; The first generation module 503 is used to perform convolution processing on the target input infrared image based on the hierarchical gradient kernel to generate a gradient map; The first determining module 504 is used to determine an adaptive threshold based on the gradient map; The second acquisition module 505 is used to perform binarization processing on the gradient map based on the adaptive threshold to obtain multiple candidate target regions. The aggregation module 506 is used to perform aggregation processing on the multiple candidate target regions to obtain the aggregation result, and output the infrared small target detection set according to the aggregation result.
[0092] Optionally, the first acquisition module 501 mentioned above includes: The first acquisition submodule is used to perform frame extraction processing on the input infrared image to obtain the target frame image; The second acquisition submodule is used to perform format standardization processing on the target frame image to obtain the target input infrared image.
[0093] Optionally, the first construction module 502 mentioned above includes: The first construction submodule is used to determine the kernel size of the hierarchical gradient kernel based on the target size of the preset small target; The second construction submodule is used to set a three-layer partition structure within the kernel size, the three-layer partition structure including a target layer, a protection layer and a background layer; The third construction submodule is used to configure kernel coefficients for the target layer, the protective layer and the background layer respectively. The kernel coefficient of the target layer is positive, the kernel coefficient of the protective layer is 0, the kernel coefficient of the background layer is negative, and the sum of the kernel coefficients of the layered gradient kernels is 0. The fourth construction submodule is used to construct the hierarchical gradient kernel based on the kernel size and kernel coefficients of the hierarchical gradient kernel.
[0094] Optionally, the first generation module 503 mentioned above includes: The first generation submodule is used to perform sliding convolution operation on the target input infrared image through the hierarchical gradient kernel to obtain the convolution response value at the corresponding pixel position in the target input infrared image; The second generation submodule is used to construct a gradient map based on the convolution response values corresponding to each pixel position in the target input infrared image.
[0095] Optionally, the first determining module 504 mentioned above includes: The first determining submodule is used to perform statistical feature calculations on the gradient graph to obtain statistical feature parameters, the statistical feature parameters including the mean and standard deviation of the gradient graph; The second determining submodule is used to generate the adaptive threshold based on the mean and standard deviation of the gradient graph according to a preset adaptive threshold algorithm.
[0096] Optionally, the second acquisition module 505 mentioned above includes: The third acquisition submodule is used to perform threshold determination on the pixel response values in the gradient map based on the adaptive threshold, and generate a binary image; The fourth acquisition submodule is used to determine the foreground pixel set based on the binary image; The fifth acquisition submodule is used to perform regional connectivity analysis on the foreground pixel set to obtain multiple candidate target regions.
[0097] Optionally, the aggregation module 506 mentioned above includes: The first aggregation submodule is used to merge the multiple candidate target regions based on the spatial adjacency relationship between them to obtain at least one aggregated target region. The second aggregation submodule is used to determine the positioning information of infrared small targets based on the at least one aggregation target area, and to aggregate the positioning information into the infrared small target detection set for output.
[0098] like Figure 6 As shown, this embodiment of the invention also provides an electronic device 600, including a processor, which can execute any of the above-mentioned rapid infrared small target detection methods based on three-layer gradient kernels.
[0099] Specifically, it includes a processor 601 and a memory 602, as well as a computer program stored in the memory 602 and capable of running on the processor 601, which executes a fast infrared small target detection method based on a three-layer gradient kernel, wherein: The processor 601 executes the calculator program stored in the memory 602, which is a fast infrared small target detection method based on a three-layer gradient kernel, and performs the following steps: Acquire an input infrared image and preprocess the input infrared image to obtain a target input infrared image; Based on the target size of a pre-defined small target, a hierarchical gradient kernel is constructed; Based on the hierarchical gradient kernel, the target input infrared image is convolved to generate a gradient map; Based on the gradient graph, determine the adaptive threshold; The gradient map is binarized based on the adaptive threshold to obtain multiple candidate target regions. The multiple candidate target regions are aggregated to obtain an aggregation result, and an infrared small target detection set is output based on the aggregation result.
[0100] Optionally, the processor 601 executes the acquisition of the input infrared image and preprocesses the input infrared image to obtain the target input infrared image, including: The input infrared image is subjected to frame extraction processing to obtain the target frame image; The target frame image is format-normalized to obtain the target input infrared image.
[0101] Optionally, the processor 601 executes the construction of a hierarchical gradient kernel based on the target size of a preset small target, including: Based on the target size of the preset small target, the kernel size of the hierarchical gradient kernel is determined; Within the kernel size, a three-layer partition structure is set, which includes a target layer, a protective layer, and a background layer; Kernel coefficients are configured for the target layer, the protective layer, and the background layer respectively. The kernel coefficient of the target layer is positive, the kernel coefficient of the protective layer is 0, and the kernel coefficient of the background layer is negative. The sum of the kernel coefficients of the layered gradient kernels is 0. The hierarchical gradient kernel is constructed based on its kernel size and kernel coefficients.
[0102] Optionally, the processor 601 performs convolution processing on the target input infrared image based on the hierarchical gradient kernel to generate a gradient map, including: The target input infrared image is subjected to sliding convolution operation through the hierarchical gradient kernel to obtain the convolution response value at the corresponding pixel position in the target input infrared image. A gradient map is constructed based on the convolution response values corresponding to each pixel position in the target input infrared image.
[0103] Optionally, the processor 601 performs the determination of the adaptive threshold based on the gradient map, including: Statistical feature calculations are performed on the gradient plot to obtain statistical feature parameters, including the mean and standard deviation of the gradient plot. The adaptive threshold is generated based on the mean and standard deviation of the gradient graph according to a preset adaptive threshold algorithm.
[0104] Optionally, the processor 601 performs the binarization processing of the gradient map based on the adaptive threshold to obtain multiple candidate target regions, including: Based on the adaptive threshold, a threshold determination is performed on the pixel response values in the gradient map to generate a binary image; Based on the binary image, determine the foreground pixel set; Perform region connectivity analysis on the foreground pixel set to obtain multiple candidate target regions.
[0105] Optionally, the processor 601 performs the aggregation processing on the plurality of candidate target regions to obtain an aggregation result, and outputs an infrared small target detection set based on the aggregation result, including: Based on the spatial adjacency relationship between the multiple candidate target regions, the multiple candidate target regions are merged to obtain at least one aggregated target region; Based on the at least one aggregated target region, the positioning information of the infrared small target is determined, and the positioning information is aggregated into the infrared small target detection set for output.
[0106] This invention also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the various processes of the infrared small target fast detection method based on a three-layer gradient kernel provided in this invention, or the application-side infrared small target fast detection method based on a three-layer gradient kernel, and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0107] Those skilled in the art will understand that implementing all or part of the processes in the above embodiments can be done by a computer program instructing related hardware, and can be stored in a computer-readable storage medium. When executed, the program can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0108] The above description discloses only preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. Therefore, equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A rapid infrared target detection method based on a three-layer gradient kernel, characterized in that, include: Acquire an input infrared image and preprocess the input infrared image to obtain a target input infrared image; Based on the target size of the preset small target, a hierarchical gradient kernel is constructed; Based on the hierarchical gradient kernel, the target input infrared image is convolved to generate a gradient map; Based on the gradient graph, determine the adaptive threshold; The gradient map is binarized based on the adaptive threshold to obtain multiple candidate target regions. The multiple candidate target regions are aggregated to obtain an aggregation result, and an infrared small target detection set is output based on the aggregation result.
2. The rapid infrared small target detection method based on a three-layer gradient kernel as described in claim 1, characterized in that, The step of acquiring the input infrared image and preprocessing the input infrared image to obtain the target input infrared image includes: The input infrared image is subjected to frame extraction processing to obtain the target frame image; The target frame image is format-normalized to obtain the target input infrared image.
3. The rapid infrared small target detection method based on a three-layer gradient kernel as described in claim 1, characterized in that, The construction of a hierarchical gradient kernel based on the target size of a preset small target includes: Based on the target size of the preset small target, the kernel size of the hierarchical gradient kernel is determined; Within the kernel size, a three-layer partition structure is set, which includes a target layer, a protective layer, and a background layer; Kernel coefficients are configured for the target layer, the protective layer, and the background layer respectively. The kernel coefficient of the target layer is positive, the kernel coefficient of the protective layer is 0, and the kernel coefficient of the background layer is negative. The sum of the kernel coefficients of the layered gradient kernels is 0. The hierarchical gradient kernel is constructed based on its kernel size and kernel coefficients.
4. The rapid infrared small target detection method based on a three-layer gradient kernel as described in claim 1, characterized in that, The step of convolving the target input infrared image based on the hierarchical gradient kernel to generate a gradient map includes: The target input infrared image is subjected to sliding convolution operation through the hierarchical gradient kernel to obtain the convolution response value at the corresponding pixel position in the target input infrared image. A gradient map is constructed based on the convolution response values corresponding to each pixel position in the target input infrared image.
5. The rapid infrared small target detection method based on a three-layer gradient kernel as described in claim 1, characterized in that, The step of determining the adaptive threshold based on the gradient map includes: Statistical feature calculations are performed on the gradient plot to obtain statistical feature parameters, including the mean and standard deviation of the gradient plot. The adaptive threshold is generated based on the mean and standard deviation of the gradient graph according to a preset adaptive threshold algorithm.
6. The rapid infrared small target detection method based on a three-layer gradient kernel as described in claim 1, characterized in that, The gradient map is binarized based on the adaptive threshold to obtain multiple candidate target regions, including: Based on the adaptive threshold, a threshold determination is performed on the pixel response values in the gradient map to generate a binary image; Based on the binary image, determine the foreground pixel set; Perform region connectivity analysis on the foreground pixel set to obtain multiple candidate target regions.
7. The rapid infrared small target detection method based on a three-layer gradient kernel as described in claim 1, characterized in that, The process of aggregating the multiple candidate target regions to obtain an aggregation result, and outputting an infrared small target detection set based on the aggregation result, includes: Based on the spatial adjacency relationship between the multiple candidate target regions, the multiple candidate target regions are merged to obtain at least one aggregated target region; Based on the at least one aggregated target region, the positioning information of the infrared small target is determined, and the positioning information is aggregated into the infrared small target detection set for output.
8. A rapid infrared small target detection device based on a three-layer gradient kernel, characterized in that, include: The first acquisition module is used to acquire an input infrared image and preprocess the input infrared image to obtain a target input infrared image; The first construction module is used to construct a hierarchical gradient kernel based on the target size of a preset small target; The first generation module is used to perform convolution processing on the target input infrared image based on the hierarchical gradient kernel to generate a gradient map; The first determining module is used to determine an adaptive threshold based on the gradient map; The second acquisition module is used to perform binarization processing on the gradient map based on the adaptive threshold to obtain multiple candidate target regions. The aggregation module is used to aggregate the multiple candidate target regions to obtain the aggregation result, and output the infrared small target detection set based on the aggregation result.
9. An electronic device, characterized in that, include: The memory, the processor, and the computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the rapid infrared small target detection method based on a three-layer gradient kernel as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps in the rapid infrared small target detection method based on a three-layer gradient kernel as described in any one of claims 1 to 7.