Object detection method, apparatus, computing device, and storage medium

By using a processing window of a preset scale to slide through infrared images and calculate contrast differences, a contrast gradient map is generated and target regions are filtered, which solves the problem of low detection accuracy of weak targets in infrared images and achieves higher detection accuracy and coverage.

CN113888562BActive Publication Date: 2026-02-10BEIJING INST OF ENVIRONMENTAL FEATURES
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111226407.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-21
Publication Date
2026-02-10
Estimated Expiration
2041-10-21

AI Technical Summary

Technical Problem

Existing technologies have low accuracy in detecting small targets in infrared images, especially when there is high background noise.

Method used

By using a processing window of a preset scale to slide through the infrared image, each processing window is divided into a central sub-window and a neighboring sub-window. The contrast difference between the central sub-window and the neighboring sub-window is calculated to generate a contrast gradient map, and the target region is selected using a feature threshold.

Benefits of technology

It improves the detection accuracy of small targets in infrared images, ensures coverage of the entire image area and detection accuracy, and reduces false alarm rate and mis-alarm rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113888562B_ABST
    Figure CN113888562B_ABST
Patent Text Reader

Abstract

The application provides a target detection method and device, a computing device and a storage medium, wherein the method comprises: slidingly traversing an infrared image by using a preset scale processing window; for each processing window traversed, dividing the processing window into a center sub-window and a neighborhood sub-window; the center sub-window is surrounded by the neighborhood sub-window; calculating the contrast difference between the center sub-window and the neighborhood sub-window in each processing window to obtain a contrast gradient graph of the infrared image; determining a feature threshold according to the contrast gradient graph, and determining a target region according to the feature threshold and the contrast gradient graph. According to the scheme, a small weak target can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a target detection method, apparatus, computing device and storage medium. Background Technology

[0002] Infrared target detection technology has broad application prospects in both military and civilian fields. By detecting targets in infrared images, target searching and tracking can be achieved. However, when targets are relatively weak, they are often obscured by the background due to their low signal-to-noise ratio. Therefore, the current accuracy rate for detecting weak targets in infrared images is relatively low. Summary of the Invention

[0003] This invention provides a target detection method, apparatus, computing device, and storage medium, which can improve the detection accuracy of small targets in infrared images.

[0004] In a first aspect, embodiments of the present invention provide a target detection method, comprising:

[0005] The infrared image is traversed by sliding through a processing window of a preset size.

[0006] For each processing window reached during the sliding traversal, the processing window is divided into a central sub-window and neighboring sub-windows; the central sub-window is surrounded by the neighboring sub-windows.

[0007] Calculate the contrast difference between the central sub-window and the neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image;

[0008] A feature threshold is determined based on the contrast gradient map, and a target region is determined based on the feature threshold and the contrast gradient map.

[0009] Preferably, the step of sliding through the infrared image using a processing window of a preset size includes:

[0010] The infrared image is traversed by a processing window of a preset size according to a preset sliding interval; the preset sliding interval is no greater than 1 / 3 of the preset size.

[0011] Preferably, dividing the processing window into a central sub-window and neighboring sub-windows includes:

[0012] The processing window is divided into 9 equal sub-windows, which are arranged in a 3x3 pattern within the processing window. The sub-window in the 2nd row and 2nd column of the processing window is designated as the center sub-window, and the other sub-windows are designated as neighboring sub-windows.

[0013] Preferably, calculating the contrast difference between the central sub-window and neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image includes:

[0014] For each processing window, the nine sub-windows in the processing window are divided into several observation groups. Each observation group includes two neighboring sub-windows that are symmetrical about the central sub-window and the central sub-window.

[0015] For each observation group, calculate the difference between the mean image grayscale values ​​of the central sub-window and the two neighboring sub-windows in the observation group, and calculate the product of the two differences in the observation group;

[0016] If the product of all the observation groups is greater than 0, then the minimum value among the products of the observation groups is determined as the contrast difference of the processing window; otherwise, the contrast difference of the processing window is determined to be 0.

[0017] Based on the contrast difference of each processing window, a contrast gradient map of the infrared image is obtained.

[0018] Preferably, determining the feature threshold based on the contrast gradient map includes:

[0019] The mean and standard deviation of the infrared image are calculated based on the contrast difference of each processing window in the contrast gradient map.

[0020] The product of the standard deviation and the set coefficient, and the sum of the product and the mean, are used to determine the feature threshold.

[0021] Preferably, determining the feature threshold based on the contrast gradient map includes:

[0022] Based on the contrast difference of each processing window in the contrast gradient map, the foreground and background regions of the infrared image are identified using the Otsu method, and the inter-class variance between the foreground and background regions is calculated. The inter-class variance is then determined as the feature threshold.

[0023] Preferably, determining the target region based on the feature threshold and the contrast gradient map includes:

[0024] Based on the contrast difference of each processing window in the contrast gradient map, the processing windows with a contrast difference greater than the feature threshold are determined as candidate windows;

[0025] The target region in the infrared image is determined based on the position of the intermediate sub-windows included in each candidate window in the infrared image.

[0026] Secondly, embodiments of the present invention also provide a target detection device, comprising:

[0027] The window traversal unit is used to slide and traverse the infrared image using a processing window of a preset size;

[0028] A sub-window partitioning unit is used to divide each processing window that is traversed by the sliding motion into a central sub-window and neighboring sub-windows; the central sub-window is surrounded by the neighboring sub-windows.

[0029] The calculation unit is used to calculate the contrast difference between the central sub-window and the neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image.

[0030] The target region determination unit is used to determine a feature threshold based on the contrast gradient map, and to determine a target region based on the feature threshold and the contrast gradient map.

[0031] Thirdly, embodiments of the present invention also provide a computing device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, it implements the method described in any embodiment of this specification.

[0032] Fourthly, embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the methods described in any embodiment of this specification.

[0033] This invention provides a target detection method, apparatus, computing device, and storage medium. By using a processing window of a preset size to slide through an infrared image, the entire infrared image is traversed, ensuring no region is missed. Each processing window is divided into a central sub-window and neighboring sub-windows, with the central sub-window surrounded by the neighboring sub-windows. Assuming a weak target is located within the central sub-window, due to the smaller area occupied by the processing window in the infrared image, the central sub-window will exhibit a significant difference in brightness compared to its neighboring sub-windows, i.e., a larger contrast difference. Therefore, by calculating the contrast difference between the central and neighboring sub-windows within each processing window, a contrast gradient map can be obtained. Using a feature threshold and the contrast gradient map for screening and confirmation, weak targets can be accurately detected. Attached Figure Description

[0034] 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 some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0035] Figure 1 This is a flowchart of a target detection method provided in an embodiment of the present invention;

[0036] Figure 2 This is a schematic diagram of dividing a processing window into sub-windows according to an embodiment of the present invention;

[0037] Figure 3 This is a hardware architecture diagram of a computing device provided in an embodiment of the present invention;

[0038] Figure 4 This is a structural diagram of a target detection device provided in an embodiment of the present invention. Detailed Implementation

[0039] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, 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 some embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of the present invention.

[0040] As mentioned earlier, when targets are weak in infrared images, they are often obscured by the background due to their low signal-to-noise ratio. Furthermore, infrared images lack specific shape and texture, making it impossible to detect weak targets based on shape or texture features. Considering the large area of ​​an infrared image, and the very small proportion occupied by weak targets, detecting them across the entire image is difficult. Dividing the infrared image into smaller regions and sequentially detecting weak targets within each region improves accuracy compared to detecting them across the entire image. Additionally, when detecting weak targets within smaller regions, if a target is present within that region, that region exhibits a significant contrast between its bright and dark areas and its surroundings. Therefore, the target region in the infrared image can be detected by calculating the contrast difference between it and its surrounding areas.

[0041] The specific implementation of the above concept is described below.

[0042] Please refer to Figure 1 This invention provides a target detection method, which includes:

[0043] Step 100: Use a processing window of a preset size to slide through the infrared image;

[0044] Step 102: For each processing window that is traversed by the sliding motion, the processing window is divided into a central sub-window and neighboring sub-windows; the central sub-window is surrounded by the neighboring sub-windows.

[0045] Step 104: Calculate the contrast difference between the central sub-window and the neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image.

[0046] Step 106: Determine the feature threshold based on the contrast gradient map, and determine the target region based on the feature threshold and the contrast gradient map.

[0047] In this embodiment of the invention, an infrared image is traversed by using a processing window of a preset size, ensuring that the entire infrared image is covered without missing any regions. Each processing window is divided into a central sub-window and neighboring sub-windows, with the central sub-window surrounded by the neighboring sub-windows. Assuming a weak target is located in the central sub-window, since the processing window occupies a smaller area in the infrared image, the central sub-window will have a significant difference in brightness compared to the neighboring sub-windows, i.e., a larger contrast difference. Therefore, by calculating the contrast difference between the central sub-window and the neighboring sub-windows in each processing window, a contrast gradient map can be obtained. Using a feature threshold and the contrast gradient map for screening and confirmation, weak targets can be accurately detected.

[0048] The following description Figure 1 The execution method of each step is shown.

[0049] First, for step 100, the infrared image is traversed by sliding through a processing window of a preset size.

[0050] The preset scale can be set based on the prior size of the small target. For example, if the small target is generally no more than 9*9 pixels, then the preset scale can be no more than 3 times the size of the small target, that is, the preset scale can be 27*27 pixels.

[0051] Sliding traversal uses the processing window to start from the first row and first column of the infrared image and slides through the infrared image at preset intervals until the last row and last column of the infrared image is reached. During the sliding traversal, every pixel in the infrared image will be traversed.

[0052] In one embodiment of the present invention, the preset sliding interval is no greater than 1 / 3 of the preset scale. It is understood that the smaller the preset sliding interval, the higher the computational load of the detection process, but the higher the accuracy of the detection result. Preferably, the preset sliding interval can be equal to 1 / 3 of the preset scale. At this preset sliding interval, the difference between the preset sliding interval and the size of the weak target is small. If the weak target is located in the overlapping area of ​​two adjacent processing windows, the weak target can be detected better, and the computational load in the detection process is also more appropriate.

[0053] To illustrate the sliding traversal process, let's take an infrared image containing 300*280 pixels as an example. The processing window size is 27*27, and the sliding interval is 3 phase velocities. Then, the vertices of the first processing window traversed by the sliding traversal are the pixels in the 1st row and 1st column, the 1st row and 27th column, the 27th row and 1st column, and the 27th row and 27th column of the infrared image. The vertices of the second processing window traversed by the sliding traversal are the phase velocity in the 1st row and 4th column, the pixel in the 1st row and 30th column, the pixel in the 27th row and 30th column, and the 27th row and 30th column of the infrared image; and so on.

[0054] Then, for step 102, for each processing window that is traversed by the sliding motion, the processing window is divided into a central sub-window and a neighboring sub-window; the central sub-window is surrounded by the neighboring sub-window.

[0055] Please refer to Figure 2 This is a schematic diagram of a processing window. The central child window is child window T, and the neighboring child windows include child windows B1, B2, ..., B8. As can be seen, the central child window is surrounded by the neighboring child windows.

[0056] In one embodiment of the present invention, when dividing the processing window into a central sub-window and neighboring sub-windows, to facilitate calculation and comparison, step 102 may at least include: dividing the processing window into nine equal sub-windows, arranging these nine sub-windows in a 3x3 pattern within the processing window, and determining the sub-window in the second row and second column of the processing window as the central sub-window, and determining the other sub-windows as neighboring sub-windows. That is... Figure 2 The nine child windows in the middle are all the same size.

[0057] The processing window is divided into 9 equal sub-windows, and these 9 sub-windows are arranged in a 3*3 pattern within the processing window. Since each sub-window contains an equal number of pixels, the contrast difference between the central sub-window and each neighboring sub-window can be directly compared in subsequent processes without considering the difference in the number of pixels, resulting in lower computational complexity.

[0058] Of course, the sub-windows after division do not have to be equal. They just need to be adjusted according to the proportion of the number of pixels contained in each sub-window when calculating the contrast difference.

[0059] Next, for step 104, the contrast difference between the central sub-window and the neighboring sub-windows in each processing window is calculated to obtain the contrast gradient map of the infrared image.

[0060] In one embodiment of the present invention, assuming that the weak target is located in the central sub-window T, the central sub-window and the neighboring sub-windows will have obvious differences in brightness. Therefore, the contrast difference between the central sub-window and the neighboring sub-windows can be calculated by the average grayscale values ​​of the images of the central sub-window and the neighboring sub-windows.

[0061] Furthermore, if a weak target is located within the central sub-window T, then regardless of the direction from which the central sub-window is observed in the processing window, there will be a significant difference in brightness between this central sub-window and its neighboring sub-windows located on either side of the central sub-window in that observation direction. Continuing with... Figure 2 Taking the processing window shown as an example, if observed from the B2-T-B6 observation direction, the central sub-window T has a significant difference in brightness compared to its neighboring sub-windows B2 and B6; similarly, if observed from the B1-T-B5 observation direction, the central sub-window T has a significant difference in brightness compared to its neighboring sub-windows B1 and B5. It can be understood that when the central sub-window T has a significant difference in brightness compared to its eight surrounding neighboring sub-windows in any direction, it can be determined that the target is likely located within the central sub-window T. Of course, whether it is truly located within the central sub-window T requires further screening and confirmation to ensure detection accuracy.

[0062] Based on this, in one embodiment of the present invention, the contrast gradient map of an infrared image can be obtained using the following method:

[0063] S1: For each processing window, divide the 9 sub-windows in the processing window into several observation groups. Each observation group includes two neighboring sub-windows that are symmetrical about the central sub-window and the central sub-window.

[0064] The observation groups may include two or more of the following observation groups:

[0065] Observation group 1: Neighborhood sub-window B1, center sub-window T, and neighborhood sub-window B5;

[0066] Observation group 2: Neighborhood sub-window B2, center sub-window T, and neighborhood sub-window B6;

[0067] Observation group three: neighborhood sub-window B3, central sub-window T, and neighborhood sub-window B7;

[0068] Observation group four: neighborhood sub-window B4, central sub-window T, and neighborhood sub-window B8.

[0069] Preferably, the plurality of observation groups can be observation group two and observation group four as described above.

[0070] More preferably, the plurality of observation groups can be the aforementioned four observation groups.

[0071] This embodiment uses the above four observation groups as an example for illustration.

[0072] S2: For each observation group, calculate the difference between the mean grayscale values ​​of the central sub-window and the two neighboring sub-windows in the observation group, and calculate the product of the two differences in the observation group.

[0073] First, calculate the average grayscale value of the image in each sub-window within each observation group. Since several observation groups cover every sub-window in the processing window, the average grayscale value of the image in the i-th (i = 1, 2, ..., 9) sub-window within that processing window can be calculated using the following formula:

[0074]

[0075] Where, m i Let N be the average grayscale value of the image in the i-th sub-window. u This represents the number of pixels within the sub-window. Let be the grayscale value of the j-th pixel in the i-th sub-window.

[0076] Then, the difference between the mean image grayscale value of the central sub-window and the mean image grayscale value of each neighboring sub-window in each observation group is calculated. Similarly, the mean image grayscale value of the central sub-window and the mean image grayscale value of each neighboring sub-window in the processing window can be calculated. The difference between the mean image grayscale value of the central sub-window and the i-th (i = 1, 2, ..., 8) neighboring sub-window in the processing window is denoted by d(T, Bi), and d(T, Bi) is calculated as follows:

[0077] d(T, Bi) = m T -m Bi (i = 1, 2, ..., 8)

[0078] Where, m T m is the average grayscale value of the image in the center sub-window. Bi Let be the average gray value of the image in the i-th (i = 1, 2, ..., 8) neighboring sub-window.

[0079] Finally, the product of the two differences in each observation group is calculated. For the four observation groups, the product of the two differences in each observation group is as follows:

[0080]

[0081] Where, product It is used to describe the relationship between the central sub-window and the two neighboring sub-windows in the observation group, that is, the relationship between the target region and the background region.

[0082] S3: If the product of the observation groups is greater than 0, then the minimum value among the products of the observation groups is determined as the contrast difference of the processing window; otherwise, the contrast difference of the processing window is determined to be 0.

[0083] From the formula for the product above, we know that when d(T, Bi) and d(T, Bi+4) have the same sign (both positive or both negative), This means that regardless of whether a weak infrared target is brighter or darker than its surroundings, it can be effectively filtered out. In practical situations involving a single bright or dark target, the following formula should be used to... Restrictions will be imposed:

[0084]

[0085] In small target detection, the signal-to-noise ratio between the target region and the background region should be as large as possible. At the same time, a single target should have a significant difference in brightness compared to its neighbors regardless of the viewing direction. Therefore, it is necessary to calculate the local optimal contrast between the central sub-window and the neighboring sub-windows in the processing window.

[0086] According to the above formula, if the product of the four observation groups is greater than 0, the minimum value among the products of the observation groups is determined as the contrast difference of the processing window, that is, the contrast difference of the processing window is determined by the following formula; otherwise, the contrast difference of the processing window is determined to be 0.

[0087]

[0088] Among them, D(T) (i,j) This is used to handle the contrast differences of windows.

[0089] S4: Based on the contrast difference of each processing window, obtain the contrast gradient map of the infrared image.

[0090] The contrast difference of each processing window is used to characterize the corresponding processing window, and the resulting image is the contrast gradient map of the infrared image.

[0091] Finally, for step 106, the feature threshold is determined based on the contrast gradient map, and the target region is determined based on the feature threshold and the contrast gradient map.

[0092] As can be seen from the contrast gradient map obtained in step 104 above, the contrast gradient map may include multiple processing windows with contrast differences greater than 0. Due to the presence of noise, not all central sub-windows in processing windows with contrast differences greater than 0 are target regions, and feature thresholds are needed for filtering.

[0093] In one embodiment of the present invention, the method for determining the feature threshold may include at least the following two:

[0094] Method 1: Calculate the feature threshold using fixed coefficients.

[0095] Method 2: The feature threshold is calculated using the Otsu method.

[0096] The two methods described above will be explained separately below.

[0097] In Method 1, specifically, the mean and standard deviation of the infrared image are calculated based on the contrast difference of each processing window in the contrast gradient map; the product of the standard deviation and a set coefficient, and the sum of the product and the mean, are used to determine the feature threshold.

[0098] In this first method, the following formula can be used for calculation:

[0099] τ=μ+kδ

[0100]

[0101]

[0102] Where τ is the feature threshold, μ is the mean of the contrast gradient map, δ is the standard deviation of the contrast gradient map, k is a set coefficient, and p1q1 are the total number of rows and columns of pixels in the processing window, respectively.

[0103] In this method, the coefficient k is set to a fixed value. By comparing the contrast differences of each processing window in the gradient map and substituting them into the above formula, the feature threshold can be quickly calculated, thus improving the speed of target detection.

[0104] In the detection of weak infrared targets, the feature threshold is related to the false alarm rate and the false alarm rate, so the value of the feature threshold is very important. After the gradient map is determined, the mean and standard deviation can be calculated. At this point, setting the value of the coefficient k is a key part. If the value of the coefficient k is fixed, it will be difficult to adapt to complex infrared images with different backgrounds when detecting weak targets. Therefore, in order to improve the accuracy of weak target detection, an adaptive feature threshold can be selected, i.e., in Method 2, the feature threshold is determined using Otsu's method.

[0105] In Method 2, specifically, based on the contrast difference of each processing window in the contrast gradient map, the Otsu method is used to identify the foreground and background regions of the infrared image, and the inter-class variance between the foreground and background regions is calculated, and the inter-class variance is determined as the feature threshold.

[0106] Otsu's method, also known as the maximum inter-class variance method, is used because the inter-class variance between the foreground and background regions is maximized after image binarization segmentation based on the feature thresholds obtained by Otsu's method.

[0107] For the obtained contrast gradient map, Otsu's method can be used to identify the foreground and background regions of the infrared image based on the contrast difference of each processing window in the contrast gradient map. The proportion of pixels in the background region to the total number of pixels in the infrared image (ω1) and the proportion of pixels in the foreground region to the total number of pixels in the infrared image (ω2) can be determined. Additionally, the mean grayscale value μ1 of the background region, μ2 of the foreground region, and μ0 of the infrared image can be calculated. The inter-class variance refers to the difference between the foreground and background regions; the larger the difference, the better the separation. In this embodiment of the invention, the inter-class variance... The calculation formula is as follows:

[0108]

[0109] μ0=ω1*μ1+ω2*μ2

[0110] ω1+ω2=1

[0111] The above formulas are then rearranged to obtain the following formula for calculating the inter-class variance:

[0112]

[0113] The value of the inter-class variance can be calculated using the above formula, and this inter-class variance can be determined as the feature threshold.

[0114] Regardless of whether the feature threshold is calculated using method one or method two, when determining the target region based on the feature and the gradient map, specifically, it includes: determining the processing window with a contrast difference greater than the feature threshold as a candidate window based on the contrast difference of each processing window in the gradient map; and determining the target region in the infrared image based on the position of the intermediate sub-window included in each candidate window in the infrared image.

[0115] In one embodiment of the present invention, when determining the target region in the infrared image based on the position of the intermediate sub-windows included in each candidate window in the infrared image, it may at least include: if, based on the position of the intermediate sub-windows included in each candidate window in the infrared image, there are discrete intermediate sub-windows, then the discrete intermediate sub-windows can be filtered out, and the target region can be determined from the continuous intermediate sub-windows.

[0116] In another embodiment of the present invention, the target detection method can be applied to the tracking of weak infrared targets. When determining the target region in an infrared image based on the positions of the intermediate sub-windows included in each candidate window within the infrared image, the target region in the current infrared image can also be determined based on the target region in the previous infrared image adjacent to the current infrared image. For example, relative to the target region in the previous infrared image, the target region in this infrared image exhibits a certain change in pixel position, and this change is within a certain area; therefore, intermediate sub-windows outside this area can be filtered out.

[0117] Furthermore, for consecutive intermediate sub-windows, if an intermediate sub-window is surrounded by eight other intermediate sub-windows adjacent to it, then the intermediate sub-window can be merged with the eight surrounding intermediate sub-windows, while the intermediate sub-windows that are not merged are filtered out. The intermediate sub-windows that are not filtered out are determined as the target region.

[0118] like Figure 3 , Figure 4 As shown, this embodiment of the invention provides a target detection device. The device embodiment can be implemented through software, hardware, or a combination of both. From a hardware perspective, as... Figure 3 The diagram shown is a hardware architecture diagram of a computing device housing a target detection device according to an embodiment of the present invention. (Except for...) Figure 3 In addition to the processor, memory, network interface, and non-volatile memory shown, the computing device in the embodiment may also include other hardware, such as a forwarding chip responsible for processing packets. Taking software implementation as an example, such as... Figure 4 As shown, a device in a logical sense is formed by the CPU of its computing device reading the corresponding computer program from non-volatile memory into memory and running it. This embodiment provides a target detection device, including:

[0119] The window traversal unit 401 is used to slide traverse the infrared image using a processing window of a preset size;

[0120] The sub-window partitioning unit 402 is used to partition each processing window that is traversed by the sliding process into a central sub-window and a neighboring sub-window; the central sub-window is surrounded by the neighboring sub-windows.

[0121] The calculation unit 403 is used to calculate the contrast difference between the central sub-window and the neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image.

[0122] The target region determination unit 404 is used to determine a feature threshold based on the contrast gradient map, and to determine a target region based on the feature threshold and the contrast gradient map.

[0123] In one embodiment of the present invention, the window traversal unit 401 is specifically used to traverse the infrared image by using a processing window of a preset size according to a preset sliding interval; the preset sliding interval is not greater than 1 / 3 of the preset size.

[0124] In one embodiment of the present invention, the sub-window division unit 402 is specifically used to divide the processing window into 9 equal sub-windows, the 9 sub-windows are arranged in a 3*3 pattern in the processing window, the sub-window in the second row and second column of the processing window is determined as the center sub-window, and the other sub-windows are determined as neighboring sub-windows.

[0125] In one embodiment of the present invention, the calculation unit 403 is specifically configured to, for each processing window, divide the nine sub-windows in the processing window into several observation groups, each observation group including two neighboring sub-windows symmetrical about the central sub-window and the central sub-window; for each observation group, calculate the difference between the mean image grayscale values ​​of the central sub-window and the two neighboring sub-windows in the observation group, and calculate the product of the two differences in the observation group; if the product of the several observation groups is greater than 0, then the minimum value among the products of the several observation groups is determined as the contrast difference of the processing window; otherwise, the contrast difference of the processing window is determined to be 0; based on the contrast difference of each processing window, the contrast gradient map of the infrared image is obtained.

[0126] In one embodiment of the present invention, when the calculation unit 403 performs the function of determining the feature threshold based on the contrast gradient map, it is specifically used to: calculate the mean and standard deviation of the infrared image based on the contrast difference of each processing window in the contrast gradient map; and determine the feature threshold by multiplying the standard deviation by a set coefficient and the mean.

[0127] In one embodiment of the present invention, when the calculation unit 403 performs the function of determining the feature threshold based on the contrast gradient map, it is specifically used to: identify the foreground region and background region of the infrared image using the Otsu method based on the contrast difference of each processing window in the contrast gradient map, calculate the inter-class variance between the foreground region and the background region, and determine the inter-class variance as the feature threshold.

[0128] In one embodiment of the present invention, the target region determination unit 404 is specifically used to determine the processing window with a contrast difference greater than the feature threshold as a candidate window based on the contrast difference of each processing window in the contrast gradient map; and to determine the target region in the infrared image based on the position of the intermediate sub-window included in each candidate window in the infrared image.

[0129] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on a target detection device. In other embodiments of the present invention, a target detection device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0130] The information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the method embodiment of the present invention, and the specific details can be found in the description of the method embodiment of the present invention, and will not be repeated here.

[0131] This invention also provides a computing device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, it implements a target detection method according to any embodiment of this invention.

[0132] This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform a target detection method according to any embodiment of this invention.

[0133] Specifically, a system or apparatus equipped with a storage medium may be provided, on which software program code implementing the functions of any of the embodiments described above is stored, and the computer (or CPU or MPU) of the system or apparatus may read and execute the program code stored in the storage medium.

[0134] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of the present invention.

[0135] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.

[0136] Furthermore, it should be clear that not only can the program code read by the computer be executed, but also the operating system or other components operating on the computer can be instructed based on the program code to perform some or all of the actual operations, thereby realizing the function of any of the embodiments described above.

[0137] Furthermore, it is understood that the program code read from the storage medium is written to the memory set in the expansion board inserted into the computer or to the memory set in the expansion module connected to the computer. Then, based on the instructions of the program code, the CPU or other components installed on the expansion board or expansion module execute some and all of the actual operations, thereby realizing the function of any of the above embodiments.

[0138] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0139] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as ROM, RAM, magnetic disk, or optical disk.

[0140] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A target detection method, characterized in that, include: The infrared image is traversed by sliding through a processing window of a preset size. For each processing window reached during the sliding traversal, the processing window is divided into a central sub-window and neighboring sub-windows; the central sub-window is surrounded by the neighboring sub-windows. Calculate the contrast difference between the central sub-window and the neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image; A feature threshold is determined based on the contrast gradient map, and a target region is determined based on the feature threshold and the contrast gradient map. The step of determining the target region based on the feature threshold and the contrast gradient map includes: determining the processing window whose contrast difference is greater than the feature threshold as a candidate window based on the contrast difference of each processing window in the contrast gradient map; if there are discrete intermediate sub-windows determined based on the position of the intermediate sub-windows included in each candidate window in the infrared image, then the discrete intermediate sub-windows are filtered out, and the target region is determined from the continuous intermediate sub-windows. Specifically, for consecutive intermediate sub-windows, if there is an intermediate sub-window that is surrounded by several other intermediate sub-windows adjacent to it, then the intermediate sub-window is merged with the several intermediate sub-windows surrounding it, and the intermediate sub-windows that are not merged are filtered out. The intermediate sub-windows that are not filtered out are determined as the target area. The step of using a processing window of a preset size to slide through the infrared image includes: using a processing window of a preset size to slide through the infrared image at a preset sliding interval; the preset sliding interval is not greater than 1 / 3 of the preset size. The step of dividing the processing window into a central sub-window and neighboring sub-windows includes: dividing the processing window into 9 equal sub-windows, arranging the 9 sub-windows in a 3*3 pattern within the processing window, and determining the sub-window in the 2nd row and 2nd column of the processing window as the central sub-window, and determining the other sub-windows as neighboring sub-windows; The step of calculating the contrast difference between the central sub-window and its neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image includes: for each processing window, dividing the nine sub-windows in the processing window into several observation groups, each observation group including two neighboring sub-windows symmetrical about the central sub-window and the central sub-window; for each observation group, calculating the difference between the average grayscale values ​​of the central sub-window and the two neighboring sub-windows in the observation group, and calculating the product of the two differences in the observation group; if the product of the several observation groups is greater than 0, then the minimum value among the products of the several observation groups is determined as the contrast difference of the processing window; otherwise, the contrast difference of the processing window is determined to be 0; and obtaining the contrast gradient map of the infrared image based on the contrast difference of each processing window.

2. The method according to claim 1, characterized in that, Determining the feature threshold based on the contrast gradient map includes: The mean and standard deviation of the infrared image are calculated based on the contrast difference of each processing window in the contrast gradient map. The product of the standard deviation and the set coefficient, and the sum of the product and the mean, are used to determine the feature threshold.

3. The method according to claim 1, characterized in that, Determining the feature threshold based on the contrast gradient map includes: Based on the contrast difference of each processing window in the contrast gradient map, the foreground and background regions of the infrared image are identified using the Otsu method, and the inter-class variance between the foreground and background regions is calculated. The inter-class variance is then determined as the feature threshold.

4. A target detection device, characterized in that, To implement the target detection method as described in any one of claims 1-3 above, the method comprises: The window traversal unit is used to slide and traverse the infrared image using a processing window of a preset size; A sub-window partitioning unit is used to divide each processing window that is traversed by the sliding motion into a central sub-window and neighboring sub-windows; the central sub-window is surrounded by the neighboring sub-windows. The calculation unit is used to calculate the contrast difference between the central sub-window and the neighboring sub-windows in each processing window to obtain the contrast gradient map of the infrared image. A target region determination unit is used to determine a feature threshold based on the contrast gradient map, and to determine a target region based on the feature threshold and the contrast gradient map; The target region determination unit is specifically used to determine the processing windows with contrast differences greater than the feature threshold as candidate windows based on the contrast difference of each processing window in the contrast gradient map; if discrete intermediate sub-windows exist based on the positions of the intermediate sub-windows included in each candidate window in the infrared image, then the discrete intermediate sub-windows are filtered out, and the target region is determined from the continuous intermediate sub-windows; specifically, for continuous intermediate sub-windows, if there is an intermediate sub-window that is surrounded by several other intermediate sub-windows adjacent to it, then the intermediate sub-window is merged with the several intermediate sub-windows surrounding it, and the intermediate sub-windows that are not merged are filtered out, and the intermediate sub-windows that are not filtered out are determined as the target region.

5. A computing device comprising a memory and a processor, wherein the memory stores a computer program, and the processor, when executing the computer program, implements the method as described in any one of claims 1-3.

6. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method of any one of claims 1-3.

Citation Information

Patent Citations

  • Self-adaptive target detection method based on multi-scale optimal target contrast

    CN112598681A