Small target rapid enhancement detection method and device based on image hotspot area, equipment and medium
By dynamically locating and updating hotspot areas in high-speed monitoring, and combining the methods of difference maps and integral maps, slice detection is performed only on densely populated areas of small targets, which solves the problems of low detection rate, high computational cost and long inference delay of small targets, and achieves efficient and real-time small target detection.
Patent Information
- Application Number
- CN202511204267.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2026-04-24
- Estimated Expiration
- 2045-08-26
AI Technical Summary
Existing technologies for small target detection in high-speed monitoring suffer from high computational overhead, low processing efficiency, and poor real-time performance, especially in resource-constrained edge computing platforms where it is difficult to meet the requirements for detection accuracy and real-time performance.
This paper proposes a fast enhancement detection method for small targets based on image hotspot regions. It utilizes asynchronous threads to maintain hotspot regions and combines difference maps and integral maps to dynamically locate and update hotspot regions. It only performs slice detection on densely populated areas of small targets, and integrates target detection and results in parallel. A sliding window mechanism is used to maintain the historical state of hotspot regions.
It achieves improved detection rate and accuracy of small targets with low computational cost, reduces computational load, and improves detection efficiency and real-time performance, making it suitable for monitoring scenarios with high real-time requirements such as highways.
Smart Images

Figure CN121147038B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of high-speed surveillance intelligent detection technology, and in particular to a method, apparatus, equipment and medium for rapid enhancement detection of small targets based on image hotspot areas. Background Technology
[0002] With the continuous development of intelligent transportation systems, road surveillance cameras have been widely deployed in scenarios such as highways and urban expressways to collect real-time road operation data and assist in traffic management and abnormal event analysis. In these application environments, cameras are usually installed at high positions to monitor traffic flow from a top-down perspective. Due to the long viewing distance, dense targets, and high movement speed, the scale differences of targets in the images are significant, especially in distant areas, where targets such as vehicles and pedestrians often appear as small targets, posing a considerable challenge to subsequent intelligent detection and recognition.
[0003] Traditional object detection methods often employ whole-image detection strategies or improve the recognizability of small objects through image pyramids, multi-scale feature fusion, and other means. Although these methods improve detection performance to some extent, they generally suffer from high computational overhead and low processing efficiency, especially on resource-constrained edge computing platforms, making it difficult to simultaneously meet the requirements of detection accuracy and real-time performance.
[0004] To improve detection efficiency and accuracy, some recent studies have attempted to select key regions (i.e., "hotspot regions") from images for priority detection through methods such as region segmentation, attention mechanisms, or reinforcement learning, thereby enhancing the system's ability to perceive key targets. However, existing methods still have the following main problems:
[0005] While the fixed grid tiling strategy can improve the detection rate of small targets, it lacks dynamic adaptive capabilities, easily processes a large number of invalid regions, and leads to a waste of computational resources.
[0006] While attention-based or learning-based region scoring methods possess a certain degree of intelligence, they typically require traversing and evaluating multiple candidate regions, resulting in complex reasoning processes, significant latency, and difficulty in meeting real-time detection requirements.
[0007] While multi-scale feature enhancement or super-resolution reconstruction methods can help improve the recognizability of small targets, they often rely on additional network structures or training processes, which increases system complexity and is not conducive to rapid deployment and application.
[0008] Even if hotspot areas can be initially identified, existing methods still lack an efficient and low-latency overall process in terms of sliced images of hotspot areas, data organization, model inference, and result fusion. This results in problems such as poor real-time performance, high false detection rate, and difficulty in edge deployment during small target detection.
[0009] The information disclosed in this background section is intended only to enhance the understanding of the general background of the invention and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0010] This invention provides a method, apparatus, device, and medium for rapid enhancement detection of small targets based on image hotspot regions, thereby effectively solving the problems in the background art.
[0011] To achieve the above objectives, the technical solution adopted by this invention is: a method for rapid enhancement and detection of small targets based on image hotspot regions, comprising the following steps:
[0012] S10: Pull the video stream from the camera deployed in the road monitoring scenario, and decode the video stream on the embedded GPU platform to obtain image frame data;
[0013] S20: Obtain the hot spot region maintained by the asynchronous thread. The hot spot region is a region in the image where small targets are densely distributed, represented by a rectangular box of fixed size. In the current image frame data, slice the image according to the position of the hot spot region.
[0014] S30: Combine the original image and the sliced image to form an image array, and input it as a batch into the object detection model that supports batch inference for parallel object detection;
[0015] S40: Receive the detection results of the original image and the slice image output by the target detection model, and map the target box coordinates in the slice image back to the original image coordinate system; then perform fusion processing on the target detection results of the original image and the slice image, and output the final target detection result;
[0016] S50: In an asynchronous thread, select key targets based on the target detection results, calculate candidate slice window regions in reverse according to the positions of the key targets, and record the positions of the candidate slice windows in an incremental manner to a difference map with the same size as the image.
[0017] S60: Determine whether the difference map meets the hotspot region update condition. If not, output the historical hotspot region. If yes, perform integral calculation on the difference map to generate an integral map, and determine the hotspot region based on the maximum value in the integral map. At the same time, maintain the historical state of the hotspot region based on the sliding window mechanism, and output the updated hotspot region information. Provide the hotspot region information to step S20. The hotspot region information is used for slice image processing of the next frame image.
[0018] Furthermore, in step S20, the hotspot region is dynamically determined by an asynchronous thread based on the target detection results of the previous few frames of images. The target detection results include the position and size information of the target box. The position of the rectangular box of the hotspot region is comprehensively analyzed and adjusted according to the spatial density distribution and size characteristics of the target box, which is used to guide the slice image processing of the current image frame.
[0019] Further, in step S30, the image array is composed of the original image and the cropped slice image in sequence, forming batch input data, which is used to input into the YOLOv11 object detection model that supports batch inference to perform parallel inference operations.
[0020] Further, in step S40, the target detection results of the original image and the sliced image are fused, specifically including the following steps:
[0021] S41: Map the coordinates of the target bounding box in the sliced image back to the original image coordinate system;
[0022] S42: Remove the detection boxes located in the edge region of the sliced image;
[0023] S43: When the IoU between the target box in the sliced image and the target box in the original image exceeds a preset threshold, non-maximum suppression is performed to retain the detection results with higher confidence.
[0024] S44: Based on the original image and slice image of the target box and its position in the image, different confidence thresholds are used to filter and retain targets.
[0025] Further, in step S50, the candidate slice window region is calculated in reverse based on the location of the target of interest, and the position of the candidate slice window is recorded incrementally in a difference map with the same size as the image. This step includes:
[0026] S51: Select key target boxes that meet preset conditions from the target detection results. The selection conditions include target category, target box size or aspect ratio.
[0027] S52: For each selected target box, based on the geometric relationship of the slice window covering the target box, the upper left corner coordinate range of all candidate slice windows that can completely contain the target box is determined in reverse.
[0028] S53: The coordinate range of the upper left corner corresponding to the candidate slice window is marked incrementally to the difference map with the same size as the original image. The marking operation includes adding or subtracting pixel values on the four vertices in the difference map corresponding to the coordinate range to express the heat accumulation of the two-dimensional rectangular region.
[0029] S54: Repeat the above operation to record the candidate slice window information corresponding to all key targets in the difference graph.
[0030] Further, in step S50, in the high-speed monitoring image, the position of the candidate slice window is determined according to the asymmetrical redundancy boundary rule in the upper, lower, left, and right directions, and the coordinate range of the upper left corner of the candidate slice window satisfies:
[0031] x∈[max(0,x1+4w-Ws),min(x1-3w,W-Ws-1)];
[0032] y∈[max(0,y1+6h-Hs),min(y1-3h,H-Hs-1)];
[0033] And xmin <xmax,ymin<ymax;
[0034] In the formula, (W,H) is the assumed size of the original image, (Ws,Hs) is the size of the slice window, (w,h) is the size of the target bounding box, and (x1,y1) is the coordinate of the top left corner of the target bounding box.
[0035] Further, in step S60, the updating of the hotspot area includes the following steps:
[0036] S61: Perform periodic judgments based on the set fixed frame intervals, and trigger hot spot area updates only when the current frame number meets the update conditions;
[0037] S62: Construct an integral map based on the difference map corresponding to the current frame, wherein the value of each pixel in the integral map represents the heat accumulation of all candidate slice windows containing that pixel;
[0038] S63: Search for the pixel with the maximum cumulative value in the integral image, and use the pixel as the upper left corner coordinate of the hot spot area, and combine it with the preset slice window size to determine the boundary position of the hot spot area;
[0039] S64: Maintain candidate slice window information of the previous few frames through a sliding window mechanism. When the length of the sliding window reaches a preset value, remove the data corresponding to the oldest frame and perform an update in the difference graph that is the opposite of the original incremental marking operation.
[0040] S65: Store the updated hotspot region locations in an asynchronous thread and use them for slicing the next frame of the image.
[0041] The present invention also includes a device for rapid enhancement and detection of small targets based on image hotspot regions, using the method described above, comprising:
[0042] The image acquisition module is used to pull video streams from cameras deployed in road monitoring scenarios and decode the video streams on an embedded GPU platform to obtain image frame data.
[0043] The slice image module is used to obtain hotspot regions maintained by an asynchronous thread. The hotspot regions are areas in the image where small targets are densely distributed, represented by a rectangular box of fixed size. In the current image frame data, slice images are extracted based on the position of the hotspot regions.
[0044] The object detection module is used to combine the original image and the sliced image into an image array, which is then used as a batch input to the object detection model that supports batch inference for parallel object detection.
[0045] The result fusion module is used to receive the detection results of the original image and the slice image output by the target detection model, and map the target box coordinates in the slice image back to the original image coordinate system; then, it performs fusion processing on the target detection results of the original image and the slice image, and outputs the final target detection result.
[0046] The difference map update module is used to filter out key targets of interest based on the target detection results in an asynchronous thread, calculate the candidate slice window region in reverse according to the position of the key targets of interest, and record the position of the candidate slice window in an incremental manner into a difference map with the same size as the image.
[0047] The hotspot region update module is used to determine whether the difference map meets the hotspot region update conditions. If not, it outputs the historical hotspot region; if so, it performs integral calculation on the difference map to generate an integral map, and determines the hotspot region based on the maximum value in the integral map. At the same time, it maintains the historical state of the hotspot region based on the sliding window mechanism and outputs the updated hotspot region information.
[0048] The region control module is used to provide the hotspot region information to the slice image module for slice image processing of the next frame image.
[0049] The present invention also includes a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the method as described above.
[0050] The present invention also includes a storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as described above.
[0051] The beneficial effects of this invention are as follows:
[0052] By employing a hotspot region localization method based on difference maps and integral maps, an optimal slice detection region can be quickly selected from the entire map, avoiding redundant computations caused by full-map or multi-region slice detection, thus balancing detection accuracy and system operating efficiency. Combined with a hotspot region history management mechanism using sliding windows and fixed-frequency updates, smooth transition and temporal stability of hotspot regions are achieved. On this basis, this invention achieves effective enhanced detection of small targets with low computational cost, providing high-quality input support for subsequent target tracking, behavior analysis, event recognition, and other modules. Attached Figure Description
[0053] 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 recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart of a fast enhancement detection method for small targets based on image hotspot regions;
[0055] Figure 2 Example diagram for calculating the slice window range;
[0056] Figure 3 These are real photos of a highway side monitoring scene.
[0057] Figure 4 Example diagram of the conversion between difference-marked plot and integral plot;
[0058] Figure 5 This is a schematic diagram of a rapid enhancement and detection device for small targets based on image hotspot regions;
[0059] Figure 6 A schematic diagram of the structure of a computer device. Detailed Implementation
[0060] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0061] like Figures 1 to 4 As shown: A fast enhancement detection method for small targets based on image hotspot regions, comprising the following steps:
[0062] S10: Pull the video stream from the camera deployed in the road monitoring scenario, and decode the video stream on the embedded GPU (graphics processing unit, used to accelerate image processing and neural network inference) platform to obtain image frame data;
[0063] S20: Obtain the hot spot region maintained by the asynchronous thread. The hot spot region is the area in the image where small targets are densely distributed. It is represented by a rectangle of fixed size. In the current image frame data, slice the image according to the position of the hot spot region.
[0064] S30: Combine the original image and the sliced image to form an image array, and input it as a batch into the object detection model that supports batch inference for parallel object detection;
[0065] S40: Receive the detection results of the original image and the slice image output by the target detection model, and map the target box coordinates in the slice image back to the original image coordinate system; then perform fusion processing on the target detection results of the original image and the slice image, and output the final target detection result;
[0066] S50: In an asynchronous thread, select key targets based on the target detection results, calculate the candidate slice window region in reverse according to the location of the key targets, and record the candidate slice window position in an incremental manner to a difference map with the same size as the image.
[0067] S60: Determine whether the difference map meets the hot spot region update condition. If not, output the historical hot spot region. If yes, perform integral calculation on the difference map to generate an integral map, and determine the hot spot region based on the maximum value in the integral map. At the same time, maintain the historical state of the hot spot region based on the sliding window mechanism, and output the updated hot spot region information. Provide the hot spot region information to step S20. The hot spot region information is used for slice image processing of the next frame image.
[0068] This invention aims to address the challenges of accurately identifying small targets in highway surveillance images, as well as the performance limitations and low inference efficiency of existing enhanced detection strategies. It proposes a scheme that automatically locates key areas of interest for small targets in an image (i.e., hotspot areas, typically areas where distant vehicles or pedestrians are concentrated), and performs single-slice detection only on these areas. This improves the detection rate and accuracy of small targets with low computational burden, providing a stable and high-quality detection input foundation for subsequent modules such as target tracking, trajectory analysis, and anomaly detection.
[0069] This invention employs a hotspot region localization method based on difference maps and integral maps, enabling the rapid selection of an optimal slice detection region across the entire map. This avoids redundant computations associated with full-map or multi-region slice detection, thus balancing detection accuracy and system efficiency. Furthermore, by combining a sliding window and fixed-frequency update hotspot region history management mechanism, a smooth transition and temporal stability of hotspot regions are achieved. On this basis, this invention achieves effective enhanced detection of small targets with low computational cost, providing high-quality input support for subsequent target tracking, behavior analysis, and event recognition modules.
[0070] The image hotspot detection method of this invention prioritizes areas with densely distributed small targets, significantly improving the detection rate of small targets. Automatic hotspot localization allows the system to focus on densely populated areas rather than the entire image, thus avoiding missed detections. The hotspot localization method accurately selects the optimal detection area, avoiding computational redundancy from full-image scanning and multi-region processing, greatly reducing computational load. By performing slice detection only in hotspot areas, unnecessary computation is effectively reduced, improving detection efficiency. Through differential and integral image processing, rapid hotspot localization and small target detection are achieved with low computational burden, making it particularly suitable for scenarios with high real-time requirements, such as highway monitoring.
[0071] By employing hotspot region localization and a combination of differential and integral maps, this invention effectively addresses the problems mentioned in the background art, such as low detection rate of small targets, high computational overhead, and long inference latency. Its superior real-time performance, lower computational burden, and enhanced target tracking capabilities give it significant technical advantages in practical applications, making it particularly suitable for monitoring scenarios with high real-time requirements, such as highways.
[0072] As a preferred embodiment of the above, in step S20, the hot spot region is dynamically determined by an asynchronous thread based on the target detection results of the previous several frames of images. The target detection results include the position and size information of the target box. The position of the rectangular box of the hot spot region is comprehensively analyzed and adjusted according to the spatial density distribution and size characteristics of the target box, which is used to guide the slice image processing of the current image frame.
[0073] By limiting the generation of hotspot areas to be based on the target detection results of the previous few frames and combining the target density and size for dynamic positioning, the accuracy and stability of hotspot area positioning can be improved, further enhancing the effectiveness of small target detection and the overall inference efficiency of the system. This is especially suitable for road monitoring scenarios with dynamically changing target distribution or long-distance perspectives.
[0074] In step S30, the image array is composed of the original image and the cropped slice image in sequence, forming batch input data, which is used to input into the YOLOv11 object detection model that supports batch inference to perform parallel inference operations.
[0075] For each camera, the system runs an asynchronous thread in the background to locate and update hotspot areas. The asynchronous thread maintains the location of the hotspot area for that camera and stores it in the form of a rectangle. The size of the rectangle is consistent with the input size of the object detection model to avoid time consumption caused by image data resizing.
[0076] For each camera, when processing each frame of decoded image, the system first obtains the hotspot region location maintained by the asynchronous thread. If a hotspot region is found in the current camera, the hotspot region image block data is directly extracted from the GPU decoded original image data of that camera in this frame. This operation is also called slicing the original image. Then, the original image and the sliced image are stored in the same array, and their index in the array is recorded for subsequent fusion detection results. Finally, after processing all cameras, the image data that all cameras need to detect are stored in an array, forming a batch input, which is then fed into the YOLOv11 object detection model that supports batch inference.
[0077] In this embodiment, in step S40, the target detection results of the original image and the slice image are fused. The specific steps include:
[0078] S41: Map the coordinates of the bounding box in the sliced image back to the original image coordinate system;
[0079] S42: Remove detection boxes located at the edge regions of the sliced image;
[0080] S43: When the IoU (Intersection over Union) between the target bounding box in the sliced image and the target bounding box in the original image exceeds a preset threshold, perform non-maximum suppression (NMS) to retain the detection results with higher confidence.
[0081] S44: Based on the original image and slice image of the target bounding box and their positions in the image, different confidence thresholds are used to filter and retain targets.
[0082] The object detection model outputs an array of the same length as the input, containing the bounding boxes of the original image and the sliced images. Since there may be no hotspot areas where the camera does not need to slice, the sliced images need to be matched with the original image based on the previously recorded index. At this time, the bounding boxes in the sliced images use the top left corner of the sliced image, rather than the original image, as the origin of the coordinate system. The coordinates of the bounding boxes in the sliced images also need to be mapped back to the coordinate system of the original image.
[0083] For each camera's detection results, if a slice exists, the slice image and the original image's bounding box need to be fused. To ensure the integrity of the bounding box, all detection boxes close to the slice image boundary are removed. Then, Non-Mutual Search (NMS) deduplication is performed, which determines whether the bounding box of each slice image significantly overlaps with the bounding box in the original image (i.e., IoU is higher than a preset threshold). If overlap occurs, the corresponding original image bounding box is marked as excluded, and a lower confidence threshold is used to filter the slice bounding box. For non-overlapping slice bounding boxes, a higher confidence threshold is used to filter them to control false detections. The retention strategy for other original image bounding boxes depends on their location and confidence. If the bounding box is completely within the slice area, it must meet a higher confidence threshold to be retained. Other cases can be judged using a lower threshold. Finally, all qualified bounding boxes are summarized and output, and their source (original image or slice) is labeled for use in subsequent target tracking and behavior analysis modules.
[0084] By structurally defining the fusion process of detection results from the original image and the sliced image, this fusion strategy covers key technical steps such as target bounding box coordinate mapping, edge removal, IoU-based non-maximum suppression, and differential confidence screening. This fusion strategy not only improves the accuracy and completeness of the detection results and effectively reduces the false detection rate, but also enhances the system's robust recognition capability for small and edge targets, providing high-quality input support for subsequent target tracking and behavior analysis modules.
[0085] As a preferred embodiment of the above embodiment, in step S50, the candidate slice window region is calculated in reverse based on the location of the target of interest, and the candidate slice window position is recorded incrementally in a difference map with the same size as the image. The steps include:
[0086] S51: Select key target boxes that meet preset conditions from the target detection results. The selection conditions include target category, target box size or aspect ratio.
[0087] S52: For each selected target box, based on the geometric relationship of the slice window covering the target box, reverse the determination of the upper left corner coordinate range of all candidate slice windows that can completely contain the target box;
[0088] S53: The coordinate range of the upper left corner corresponding to the candidate slice window is incrementally marked to the difference map with the same size as the original image. The marking operation includes adding or subtracting pixel values on the four vertices corresponding to the coordinate range in the difference map to express the heat accumulation of the two-dimensional rectangular region.
[0089] S54: Repeat the above operation to record the candidate slice window information corresponding to all key targets in the difference graph.
[0090] By limiting the reverse derivation mechanism based on the location of the target bounding box and combining it with the differential labeling strategy of the candidate slice window, the method achieves rapid localization and efficient recording of candidate locations in hotspot areas. This method significantly reduces redundant computation, lowers the system burden, improves the adaptability of the target detection system to distant small targets, and provides high-quality, structured input data for subsequent integral map construction and hotspot area extraction. It is particularly suitable for edge deployment scenarios with high real-time requirements and limited resources.
[0091] In step S50, the position of the candidate slice window in the high-speed monitoring image is determined according to the asymmetric redundancy boundary rule in the upper, lower, left, and right directions. The coordinate range of the upper left corner of the candidate slice window satisfies:
[0092] x∈[max(0,x1+4w-Ws),min(x1-3w,W-Ws-1)];
[0093] y∈[max(0,y1+6h-Hs),min(y1-3h,H-Hs-1)];
[0094] And xmin <xmax,ymin<ymax;
[0095] In the formula, (W,H) is the assumed size of the original image, (Ws,Hs) is the size of the slice window, (w,h) is the size of the target bounding box, and (x1,y1) is the coordinate of the top left corner of the target bounding box.
[0096] Differential marker image: An image representation that marks the positions of rectangles using a two-dimensional difference method;
[0097] Integral image: An image representation obtained by calculating the two-dimensional prefix sum of image pixels;
[0098] Hotspot regions are areas of high interest where key targets (small targets such as distant vehicles or pedestrians) are concentrated. This invention first calculates multiple candidate slice windows based on the target bounding boxes, and then uses a differential labeling map to encode and record the positions of all candidate slice windows. This is then converted into an integral image to find the slice window with the highest heat, which is output as the final hotspot region. This hotspot region will cover as many key targets as possible. All calculations are performed asynchronously, and the specific steps are as follows:
[0099] Define the slice window size, which should be consistent with the input size of the object detection model (e.g., 640×640), and the size should be fixed. From the detection results of each frame, select the targets of interest, based on criteria such as category, target box size, and target box aspect ratio. For each selected target box, calculate all slice windows that can cover it. Assume the original image size is (W,H), the slice window size is (Ws,Hs), the target box size is (w,h), and the top-left corner coordinates of the target box are (x1,y1). For a slice window to completely cover the target box, the top-left corner coordinates (x,y) of the window must satisfy: x∈[x1+w-Ws,x1], y∈[y1+h-Hs,y1].
[0100] In practical applications, to ensure the integrity of the target at the slice boundary, a certain amount of redundancy needs to be retained. (See attached image.) Figure 2 As shown in the figure, in general scenarios, the slice window can be determined using the calculation example 1 in the figure, requiring that the slice window boundary and the target box maintain a distance of one width and height. In this case, the coordinates (x, y) of the top-left corner of the slice window must satisfy: x∈[x1+2w-Ws,x1-w], y∈[y1+2h-Hs,y1-h]. The highway side monitoring scenario is shown in the attached figure. Figure 3 As shown, the upper half of the image is the sky, where there are no valid targets. Detecting this section would be a waste of computing power, and small targets such as distant vehicles are generally clustered together. To address this characteristic, this invention uses an append-only... Figure 2 In Example 2 of the calculation, the slice window boundary is kept at 5 times the height of the top boundary of the target bounding box, and the other boundaries are kept at 3 times the width and height. At this point, the top-left corner coordinates (x, y) of the slice window must satisfy: x ∈ [x1 + 4w - Ws, x1 - 3w], y ∈ [y1 + 6h - Hs, y1 - 3h]. This calculation method can reduce the slice window size, effectively reducing repeated detection of invalid regions. The slice window must also be restricted to within the original image boundary. Finally, the top-left corner coordinates (x, y) of a valid slice window must satisfy: x ∈
[0101] [max(0,x1+4w-Ws),min(x1-3w,W-Ws-1)],y∈[max(0,y1+6h-Hs),min(y1-3h,H-Hs-1)], and xmin <xmax,ymin<ymax。
[0102] After determining the coordinate range of the top-left corner of the slice window, it can be described as a rectangular coordinate range [xmin, xmax] × [ymin, ymax]. To efficiently record the slice window positions corresponding to multiple target boxes, this method uses a two-dimensional difference method. A blank image with all pixel values of 0, the same size as the original image, is maintained; this is called the difference marker image. For each slice window, based on the rectangular coordinate range of its top-left corner, the pixel values of the following four points in the difference marker image are manipulated: D[xmin, ymin] += 1, D[xmax+1, ymin] -= 1, D[xmin, ymax+1] -= 1, D[xmax+1, ymax+1] += 1. Since the slice window size is fixed, recording the top-left corner coordinates of the slice window is equivalent to recording its position. The above operation is repeated to record the positions of all candidate slice windows for all key targets in the difference marker image.
[0103] By introducing asymmetric redundancy boundary rules applicable to high-speed surveillance images, the specific mathematical calculation method for the coordinates of the upper left corner of the candidate slice window is clarified, effectively compressing the search range of hotspot areas and avoiding repeated detection of invalid areas (such as the sky) in the image. This method not only improves the coverage density and recall capability of small targets, but also reduces the overall computational burden of the system and improves the accuracy of locating hotspot areas. It is particularly suitable for roadside surveillance scenarios with dense small targets at long distances and limited detection resources.
[0104] In this embodiment, the update of the hotspot area in step S60 includes the following steps:
[0105] S61: Perform periodic judgments based on the set fixed frame intervals, and trigger hot spot area updates only when the current frame number meets the update conditions;
[0106] S62: Construct an integral map based on the difference map corresponding to the current frame. The value of each pixel in the integral map represents the cumulative heat of all candidate slice windows containing the pixel.
[0107] S63: Search for the pixel with the maximum cumulative value in the integral image, and use the pixel as the upper left corner coordinate of the hot spot region. Combine this with the preset slice window size to determine the boundary position of the hot spot region.
[0108] S64: The candidate slice window information of the previous few frames is maintained by a sliding window mechanism. When the sliding window length reaches the preset value, the data corresponding to the oldest frame is removed, and an update opposite to the original incremental marking operation is performed in the difference map to offset the effect of the frame on the integral map.
[0109] S65: Store the updated hotspot region location in an asynchronous thread and use it for slicing the next frame of the image to enhance the stability and temporal continuity of the hotspot region.
[0110] To further improve the stability of detection results, enhance the continuity of target tracking, and reduce unnecessary hotspot computation overhead, this invention employs a fixed frame interval update strategy and a sliding window mechanism to asynchronously maintain hotspot regions. The specific implementation is as follows:
[0111] The system update frequency is set to a fixed frame interval (e.g., once every 5 frames). When the system accumulates to the set update frequency (e.g., a full 5 frames), the asynchronous thread performs a two-dimensional prefix sum accumulation on the differential marker map to construct its integral map. (See attached image.) Figure 4 The example in the text demonstrates that using a difference-marked image and then converting it into an integral image yields the same result as directly accumulating the pixel values within the rectangular area. However, it eliminates the need to traverse all rectangular pixels one by one, making the calculation more efficient. After obtaining the integral image, the maximum pixel value within the integral image is found. The coordinates of this pixel are the coordinates of the top-left corner of the finally located hotspot region. Since the size of the hotspot region is fixed, the position of the hotspot region's bounding box can be obtained, which is used for slice image detection.
[0112] The system also maintains a fixed-length sliding window queue of candidate slice results (e.g., queue length of 10 frames). After each frame is detected, the system calculates the range of all candidate slice windows for the target boxes of interest and records them in the difference map. At the same time, the coordinate range of the upper left corner of all candidate slice windows in that frame (represented as multiple rectangular coordinates) is recorded in the sliding window queue frame by frame. If the queue length exceeds the set upper limit, the oldest frame data is popped, and the opposite operation is performed on the difference map to remove its influence (i.e., a negative difference operation is performed), that is: D[xmin,ymin]-=1, D[xmax+1,ymin]+=1, D[xmin,ymax+1]+=1, D[xmax+1,ymax+1]-=1.
[0113] By introducing a hotspot region update strategy that combines fixed frame intervals with a sliding window mechanism, the stability of the detection system is improved while reducing the performance overhead caused by the high frequency of hotspot region updates. Through the collaborative operation of differential and integral maps, highly efficient and dynamically adjustable hotspot region localization is achieved. Furthermore, the asynchronous thread processing method effectively improves the system's concurrency performance and responsiveness, making it particularly suitable for roadside monitoring scenarios with sparse small targets and high real-time requirements.
[0114] The complete processing flow of this invention includes video decoding, hotspot localization, image slicing, batch organization, target detection, and result fusion, all completed on the GPU, avoiding the bottleneck caused by frequent image data transfer between the CPU and GPU. The entire system is built as an integrated end-to-end small target rapid enhancement detection device, with good edge deployment capabilities and engineering feasibility, suitable for application scenarios with high real-time and accuracy requirements, such as highway monitoring.
[0115] The present invention also includes a device for rapid enhancement and detection of small targets based on image hotspot regions, using the method described above, such as... Figure 5 As shown, it includes:
[0116] The image acquisition module is used to pull video streams from cameras deployed in road monitoring scenarios and decode the video streams on an embedded GPU platform to obtain image frame data;
[0117] The slice image module is used to obtain hotspot regions maintained by an asynchronous thread. Hotspot regions are areas in the image where small targets are densely distributed, represented by a rectangle of fixed size. In the current image frame data, slice images are extracted based on the location of the hotspot regions.
[0118] The object detection module is used to combine the original image and the sliced image into an image array, which is then used as a batch input to the object detection model that supports batch inference for parallel object detection.
[0119] The result fusion module receives the detection results of the original image and the slice image output by the target detection model, maps the target box coordinates in the slice image back to the original image coordinate system, and then performs fusion processing on the target detection results of the original image and the slice image to output the final target detection result.
[0120] The difference map update module is used in an asynchronous thread to filter out key targets of interest based on the target detection results, calculate the candidate slice window region in reverse according to the position of the key targets of interest, and record the position of the candidate slice window in an incremental manner into the difference map with the same size as the image.
[0121] The hotspot region update module is used to determine whether the difference map meets the hotspot region update conditions. If not, it outputs the historical hotspot regions; if so, it performs integral calculation on the difference map to generate an integral map, and determines the hotspot regions based on the maximum value in the integral map. At the same time, it maintains the historical state of the hotspot regions based on the sliding window mechanism and outputs the updated hotspot region information.
[0122] The region control module provides hotspot region information to the slice image module for slice image processing in the next frame.
[0123] Please see Figure 6 The diagram shows a structural schematic of a computer device provided in an embodiment of this application. An embodiment of this application provides a computer device 400, including a processor 410 and a memory 420. The memory 420 stores a computer program executable by the processor 410. When the computer program is executed by the processor 410, it performs the method described above.
[0124] This application embodiment also provides a storage medium 430, on which a computer program is stored, and the computer program is executed by a processor 410 to perform the above method.
[0125] The storage medium 430 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0126] In the description of this invention, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. "A plurality of" means two or more, unless otherwise explicitly specified.
[0127] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0128] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0129] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0130] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0131] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0132] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.
[0133] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for rapid enhancement and detection of small targets based on image hotspot regions, characterized in that, Includes the following steps: S10: Pull the video stream from the camera deployed in the road monitoring scenario, and decode the video stream on the embedded GPU platform to obtain image frame data; S20: Obtain the hot spot region maintained by the asynchronous thread. The hot spot region is a region in the image where small targets are densely distributed, represented by a rectangular box of fixed size. In the current image frame data, slice the image according to the position of the hot spot region. S30: Combine the original image and the sliced image to form an image array, and input it as a batch into the object detection model that supports batch inference for parallel object detection; S40: Receive the detection results of the original image and the sliced image output by the target detection model, and map the target box coordinates in the sliced image back to the original image coordinate system; The target detection results of the original image and the sliced image are then fused to output the final target detection result; S50: In an asynchronous thread, select key targets based on the target detection results, calculate candidate slice window regions in reverse according to the positions of the key targets, and record the positions of the candidate slice windows in an incremental manner to a difference map with the same size as the image. S60: Determine whether the difference map meets the hotspot region update condition. If not, output the historical hotspot region. If yes, perform integral calculation on the difference map to generate an integral map, and determine the hotspot region based on the maximum value in the integral map. At the same time, maintain the historical state of the hotspot region based on the sliding window mechanism, and output the updated hotspot region information. Provide the hotspot region information to step S20. The hotspot region information is used for slice image processing of the next frame image. In step S50, the candidate slice window region is calculated in reverse based on the location of the target of interest, and the position of the candidate slice window is recorded incrementally in a difference map with the same size as the image. The steps include: S51: Select key target boxes that meet preset conditions from the target detection results. The selection conditions include target category, target box size or aspect ratio. S52: For each selected target box, based on the geometric relationship of the slice window covering the target box, the upper left corner coordinate range of all candidate slice windows that can completely contain the target box is determined in reverse. S53: The coordinate range of the upper left corner corresponding to the candidate slice window is marked incrementally to the difference map with the same size as the original image. The marking operation includes adding or subtracting pixel values on the four vertices in the difference map corresponding to the coordinate range to express the heat accumulation of the two-dimensional rectangular region. S54: Repeat the above operation to record the candidate slice window information corresponding to all key targets in the difference plot in turn; In step S50, in the high-speed monitoring image, the position of the candidate slice window is determined according to the asymmetrical redundancy boundary rule in the upper, lower, left, and right directions, and the coordinate range of the upper left corner of the candidate slice window satisfies: x∈[max(0,x1+4w-Ws),min(x1-3w,W-Ws-1)]; y∈[max(0,y1+6h-Hs),min(y1-3h,H-Hs-1)]; And xmin <xmax,ymin<ymax; In the formula, (W,H) is the assumed size of the original image, (Ws,Hs) is the size of the slice window, (w,h) is the size of the target bounding box, and (x1,y1) is the coordinate of the top left corner of the target bounding box.
2. The method for rapid enhancement and detection of small targets based on image hotspot regions according to claim 1, characterized in that, In step S20, the hot spot region is dynamically determined by an asynchronous thread based on the target detection results of the previous few frames of images. The target detection results include the position and size information of the target box. The position of the rectangular box of the hot spot region is comprehensively analyzed and adjusted according to the spatial density distribution and size characteristics of the target box, which is used to guide the slice image processing of the current image frame.
3. The method for rapid enhancement and detection of small targets based on image hotspot regions according to claim 1, characterized in that, In step S30, the image array is composed of the original image and the cropped slice image in sequence, forming batch input data, which is used to input into the YOLOv11 object detection model that supports batch inference to perform parallel inference operations.
4. The method for rapid enhancement and detection of small targets based on image hotspot regions according to claim 1, characterized in that, In step S40, the target detection results of the original image and the sliced image are fused. The specific steps include: S41: Map the coordinates of the target bounding box in the sliced image back to the original image coordinate system; S42: Remove the detection boxes located in the edge region of the sliced image; S43: When the IoU between the target box in the sliced image and the target box in the original image exceeds a preset threshold, non-maximum suppression is performed to retain the detection results with high confidence. S44: Based on the original image and slice image of the target box and its position in the image, different confidence thresholds are used to filter and retain targets.
5. The method for rapid enhancement and detection of small targets based on image hotspot regions according to claim 1, characterized in that, In step S60, the hotspot area is updated, including the following steps: S61: Perform periodic judgments based on the set fixed frame intervals, and trigger hot spot area updates only when the current frame number meets the update conditions; S62: Construct an integral map based on the difference map corresponding to the current frame, wherein the value of each pixel in the integral map represents the heat accumulation of all candidate slice windows containing the pixel; S63: Search for the pixel with the maximum cumulative value in the integral image, and use the pixel as the upper left corner coordinate of the hot spot area, and combine it with the preset slice window size to determine the boundary position of the hot spot area; S64: Maintain candidate slice window information of the previous few frames through a sliding window mechanism. When the length of the sliding window reaches a preset value, remove the data corresponding to the oldest frame and perform an update in the difference graph that is the opposite of the original incremental marking operation. S65: Store the updated hotspot region locations in an asynchronous thread and use them for slicing the next frame of the image.
6. A device for rapid enhancement and detection of small targets based on image hotspot regions, characterized in that, Using the method as described in any one of claims 1 to 5, comprising: The image acquisition module is used to pull video streams from cameras deployed in road monitoring scenarios and decode the video streams on an embedded GPU platform to obtain image frame data. The slice image module is used to obtain hotspot regions maintained by an asynchronous thread. The hotspot regions are areas in the image where small targets are densely distributed, represented by a rectangular box of fixed size. In the current image frame data, slice images are extracted based on the position of the hotspot regions. The object detection module is used to combine the original image and the sliced image into an image array, which is then used as a batch input to the object detection model that supports batch inference for parallel object detection. The result fusion module is used to receive the detection results of the original image and the slice image output by the target detection model, and map the target box coordinates in the slice image back to the original image coordinate system; then, it performs fusion processing on the target detection results of the original image and the slice image, and outputs the final target detection result. The difference map update module is used to filter out key targets of interest based on the target detection results in an asynchronous thread, calculate the candidate slice window region in reverse according to the position of the key targets of interest, and record the position of the candidate slice window in an incremental manner into a difference map with the same size as the image. The hotspot region update module is used to determine whether the difference map meets the hotspot region update conditions. If not, it outputs the historical hotspot region; if so, it performs integral calculation on the difference map to generate an integral map, and determines the hotspot region based on the maximum value in the integral map. At the same time, it maintains the historical state of the hotspot region based on the sliding window mechanism and outputs the updated hotspot region information. The region control module is used to provide the hotspot region information to the slice image module for slice image processing of the next frame image.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method as described in any one of claims 1-5.
8. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Autonomous intelligent target dynamic detection system
CN117635637A
Real-time target detection and tracking method based on panoramic multichannel 4k video images
WO2021012757A1