Moving target real-time distance measurement method, device and equipment and storage medium
By combining the KCF tracking algorithm and the YOLOv5 model, image recognition and tracking are run in parallel. Utilizing the HiSilicon Hi3559AV100 platform, the problem of insufficient real-time performance and accuracy of moving target detection on embedded platforms is solved, achieving stable tracking and recognition, and improving the system's real-time performance and accuracy.
Patent Information
- Application Number
- CN202511418074.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2025-12-26
AI Technical Summary
Existing moving target detection methods have shortcomings in terms of real-time performance and accuracy, especially when computing resources are limited on embedded platforms. The YOLOv5 algorithm has high latency and limited small target detection in high-precision tasks. Target recognition-based methods have long processing times, affecting real-time performance, while target tracking-based methods cannot achieve stable tracking for long periods in complex backgrounds.
An image acquisition module is used in conjunction with the KCF tracking algorithm and the YOLOv5 model. The image recognition and tracking algorithms run in parallel. By combining the recognition cache pool and the KCF tracking algorithm, real-time tracking and recognition of targets are achieved. The HiSilicon Hi3559AV100 platform is used to improve computing power, and a small target detection layer is added and feature fusion is optimized to improve the small target detection capability.
It achieves stable tracking and recognition of targets in complex backgrounds, reduces recognition box jitter, improves real-time performance and accuracy, adapts to small target detection, and reduces computational latency.
Smart Images

Figure CN121213635A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and artificial intelligence, and specifically relates to a method, device, equipment and storage medium for real-time ranging of moving targets. Background Technology
[0002] YoloV5 is a deep learning-based object detection algorithm. Its core idea is to treat object detection as a regression problem, directly predicting the bounding boxes and class probabilities of objects from images. YoloV5 object prediction encompasses multiple aspects, including object localization, classification, multi-scale detection, non-maximum suppression, loss function optimization, adaptive anchor boxes, multi-input source support, and visualization interaction. These features make YoloV5 perform exceptionally well in various application scenarios, making it one of the mainstream algorithms in the field of real-time object detection. While maintaining high accuracy, the YoloV5 algorithm offers faster inference speed, enabling it to process high-resolution images at real-time or near-real-time speeds, making it suitable for systems with high real-time requirements, such as observation. YoloV5 supports multi-scale detection, capable of simultaneously detecting objects of various sizes, effectively recognizing objects from small to large, and improving multi-scale detection capabilities through techniques such as FPN and CSP. Furthermore, YoloV5 adopts a modular design, allowing users to flexibly adjust the model structure according to their needs and easily deploy it to embedded devices. Despite the advantages of high precision and high inference speed, YoloV5 still requires high computing resources for certain high-precision tasks. In particular, it will produce high latency when running on embedded platforms with limited computing resources. In addition, although YoloV5 has multi-scale detection capabilities, it still has certain limitations in the detection of small targets and its detection performance for distant targets is not good.
[0003] While target recognition-based moving target ranging systems can adapt to complex backgrounds, the recognition processing time is longer than that of tracking, which severely impacts real-time performance. Furthermore, issues such as frame jitter and false detections significantly affect trajectory prediction accuracy, reducing both the accuracy and real-time performance of ranging. Conversely, target tracking-based moving target ranging systems offer shorter processing times, better real-time performance, and more stable tracking frames without jitter, which improves trajectory prediction accuracy and real-time performance. However, their drawback lies in their sensitivity to complex backgrounds and inability to maintain stable tracking for extended periods.
[0004] Therefore, there is an urgent need to develop a method, device, equipment, and storage medium for real-time ranging of moving targets. Summary of the Invention In view of the above problems, this application provides a method, apparatus, device and storage medium for real-time ranging of moving targets. The technical solutions adopted in the embodiments of this application are as follows.
[0005] On the one hand, this application provides a method for real-time ranging of moving targets. The image acquisition module acquires each frame of the video stream, and the following steps are performed on each frame: Get the current frame image; Image recognition algorithms are used to identify targets in frame images to detect whether there are targets in the frame images. If no target is detected in the frame image, return to the step of obtaining the current frame image and process the next frame image; If a target is detected in the frame image, the tracking status of the system is determined, and the tracking status is either normal tracking status or re-identification status. If the current tracking status is a re-identification status, then perform the following steps: Displays the current frame image and the identified target bounding boxes; Initialize the KCF tracker, using the identified target bounding box as the initial tracking bounding box; Set the current tracking status to normal tracking status; Return to the step of obtaining the current frame image; If the current tracking status is normal tracking status, then perform the following steps: Store the frame image and the target bounding box identified in the target recognition step into the recognition cache pool; The frame image is updated using the KCF tracking algorithm; Determine if the KCF tracking algorithm has lost track of the target; If the KCF tracking algorithm loses track of the target, it retrieves the frame image and target bounding box from the recognition cache pool, initializes the KCF tracking algorithm, sets the current tracking state to normal tracking state, and then returns to the step of retrieving the current frame image. If the KCF tracking algorithm does not lose track of the target, then save the target bounding box output by the KCF tracking algorithm. Perform trajectory prediction on the tracked target bounding box results; Display the predicted trajectory range points on the screen along with the tracking target bounding box and the current frame image; Return to the step of obtaining the current frame image.
[0006] In one specific implementation, when retrieving frame images and target bounding boxes from the recognition cache pool, the retrieved frame images and target bounding boxes are the most recent frame images and target bounding boxes stored in the cache pool after the target recognition algorithm successfully detected the target.
[0007] In one specific implementation, determining whether the target has been lost is based on comparing the response score output by the KCF tracking algorithm with a preset threshold of the KCF tracking algorithm.
[0008] In a specific feasible implementation, the recognition buffer pool adopts a first-in-last-out queue structure, and its capacity is set to store the frame images and recognition target boxes after N successful recognitions, where N is a positive integer greater than or equal to 1, and the capacity N is dynamically adjusted according to the frame rate of the video stream and the highest expected speed of the target movement.
[0009] In one specific implementation scheme, it is determined whether the target has been lost by calculating the peak sidelobe ratio of the response map of the KCF tracking algorithm and comparing the peak sidelobe ratio with a preset first threshold. The peak-to-sidelobe ratio of the response is the response score, which also includes the rate of change of the tracking box size. The determination of whether the target has been lost also includes: if the peak sidelobe ratio is lower than the first threshold, then it is further determined whether the size change rate of the tracking box exceeds the preset second threshold. If it exceeds the second threshold, it is determined that the target has been lost.
[0010] In one specific implementation, the method further includes: automatically setting the tracking state to a re-identification state when no target is detected in multiple consecutive frames.
[0011] In one specific implementation, the initialization steps of the KCF tracking algorithm include extracting the appearance features of the target and building a target bounding box model.
[0012] On the other hand, this application provides a real-time ranging device for moving targets, the device comprising: The image acquisition module is used to acquire frame images from the video stream; The target tracking module is used to execute the KCF tracking algorithm to track targets; The target recognition module runs in parallel with the target tracking module. It executes the target recognition algorithm to identify targets in the frame image. The target recognition module adopts a dual NNIE core parallel operation mechanism. The display module is used to display the processing results of the frame image; The target tracking module and the target recognition module share a recognition cache pool. The target tracking module includes: The status determination unit is used to determine whether the current tracking state is normal or the re-identification state. The KCF tracking unit is used to perform tracking updates and track loss detection under normal tracking conditions. The initialization unit is used to retrieve data from the identification cache pool to initialize the KCF tracking unit in the case of loss or re-identification.
[0013] In another aspect, this application provides a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement a real-time ranging method for moving targets.
[0014] In another aspect, this application provides a computer-readable storage medium, characterized in that the readable storage medium stores at least one instruction, at least one program, code set or instruction set, wherein the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement a real-time ranging method for moving targets.
[0015] The beneficial effects of the technical solution provided in this application include at least the following: by adopting the technical solution of this application, the jitter and false detection of the recognition box can be effectively reduced, and the accuracy and real-time performance can be improved. It can also be tracked stably for a long time. The target recognition of this application adopts a dual NNIE core parallel operation mechanism to improve computing power, reduce recognition processing time, and improve real-time performance. For small target detection, it is necessary to improve the small target detection capability by adding a small target detection layer, optimizing feature fusion, and data augmentation, so as to achieve accurate target recognition. Attached Figure Description
[0016] Figure 1 : Flowchart of target box acquisition according to an embodiment of this application; Figure 2 The main flowchart of real-time ranging of moving targets in this application embodiment; Figure 3 : A flowchart of the re-identification state in an embodiment of this application; Figure 4 : Flowchart of the normal tracking state in an embodiment of this application; Figure 5 : Real-time ranging effect diagram of moving target in an embodiment of this application; Figure 6 : Target tracking flowchart of an embodiment of this application; Figure 7 : Target recognition flowchart of an embodiment of this application; Figure 8 : Block diagram of computer device structure according to an embodiment of this application. Detailed Implementation
[0017] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0018] In this article, "multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. The character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0019] The following is in conjunction with the appendix Figures 1-8 The present invention will be described in further detail below.
[0020] On the one hand, this application provides a real-time ranging method for moving targets, such as... Figure 2 The main flowchart of real-time ranging of moving targets in this embodiment of the present application is shown below, and the specific steps are as follows: The image acquisition module acquires each frame of the video stream, and the following steps are performed on each frame: S1: Get the current frame image; S2: Use image recognition algorithms to identify targets in frame images and detect whether there are targets in the frame images; S3: If no target is detected in the frame image, return to step S1 to process the next frame image; S4: If a target is detected in the frame image, determine the tracking status of the system. The tracking status is either normal tracking status or re-identification status. S5: If the current tracking state is a re-identification state, then execute steps S51~S54, such as... Figure 3 The flowchart of the re-identification state in this embodiment of the application is shown below: S51: Displays the current frame image and the identified target bounding boxes; S52: Initialize the KCF tracker, using the identified target bounding box as the initial tracking bounding box; S53: Set the current tracking status to normal tracking status; S54: Return to step S1; S6: If the current tracking state is normal tracking state, then execute steps S61~S68, such as... Figure 4 The flowchart of the normal tracking state in this embodiment of the application is shown below: S61: Store the frame image and the target bounding box identified in step S2 into the recognition cache pool; S62: Update the frame image using the KCF tracking algorithm; S63: Determine if the KCF tracking algorithm has lost track of the target; The determination of whether a target has been lost is based on comparing the response score output by the KCF tracking algorithm with a preset threshold of the KCF tracking algorithm. The determination is made by calculating the peak-to-side-lobe ratio of the KCF tracking algorithm's response map and comparing it with a preset first threshold; the peak-to-side-lobe ratio is the response score, which also includes the rate of change of the tracking box size. Further determination of whether a target has been lost includes: if the peak-to-side-lobe ratio is lower than the first threshold, then further determining whether the rate of change of the tracking box size exceeds a preset second threshold; if it does, then the target is determined to have been lost.
[0021] S64: If the KCF tracking algorithm loses track of the target, the frame image and target bounding box are retrieved from the recognition cache pool, the KCF tracking algorithm is initialized, the current tracking state is set to normal tracking state, and then the process returns to step S1. The initialization steps of the KCF tracking algorithm include extracting the appearance features of the target and establishing the target bounding box model.
[0022] When retrieving frame images and target bounding boxes from the recognition buffer, the retrieved frame images and target bounding boxes are those stored in the buffer after the target recognition algorithm successfully detected the target most recently. The recognition buffer adopts a last-in-first-out queue structure, and its capacity is set to store frame images and target bounding boxes after N successful recognitions, where N is a positive integer greater than or equal to 1. The capacity N is dynamically adjusted according to the frame rate of the video stream and the highest expected speed of the target movement.
[0023] S65: If the KCF tracking algorithm does not lose track of the target, then save the tracking target bounding box result output by the KCF tracking algorithm; S66: Perform trajectory prediction on the tracked target bounding box results; S67: Display the predicted trajectory range points on the screen together with the tracking target bounding box and the current frame image; S68: Return to step S1.
[0024] The method also includes automatically setting the tracking state to a re-identification state when no target is detected in multiple consecutive frames.
[0025] This embodiment employs single-target tracking technology, specifically the KCF tracking algorithm. The KCF algorithm is based on kernel correlation filtering, combining the kernel trick and correlation filter concepts. It uses a kernel function to map linearly inseparable patterns in low-dimensional space to linearly separable patterns in high-dimensional space. A correlation filter is then trained using information from the current and previous frames, and its correlation with a new input frame is calculated. The resulting confidence map represents the predicted tracking result; clearly, the point with the highest score is the most likely tracking outcome. The KCF algorithm uses Discrete Fourier Transform to accelerate filter computation, resulting in fast operation. Furthermore, the KCF algorithm exhibits good adaptability to changes in target pose and scale, primarily due to the circulant matrix and kernel function techniques, allowing it to maintain stable tracking performance even when the target's appearance changes. In addition, by learning the relationship between the target's appearance features and its response, the KCF algorithm can accurately locate the target, demonstrating high accuracy and suitability for various complex tracking scenarios.
[0026] The KCF tracking algorithm boasts high speed, robustness, and accuracy, but it may have limitations when handling complex scenarios such as occlusion, scale changes, interference from similar targets, and rapid movement. First, when the target is severely occluded, the algorithm may treat the occluder as part of the target during filter updates, causing the filter to gradually deviate from the true target. Second, the algorithm's performance may degrade when the target undergoes significant scale changes, as the algorithm needs to determine the initial target scale during initialization; once the target's scale changes considerably, the filter needs to be readjusted to adapt to the new scale. Third, when other objects similar to the target exist in the scene, the KCF tracking algorithm may mistrack, as it relies heavily on the target's appearance features. If other objects have similar appearance features, the algorithm may mistake them for the target. Furthermore, since updating the filter takes time, if the target moves too quickly, the algorithm may fail to capture the target's new position in time.
[0027] Given the above limitations, strategies such as re-acquisition and anti-occlusion are added to the original KCF tracking algorithm to achieve perfect tracking of the target.
[0028] Regarding the choice of embedded platform, the real-time ranging method for moving targets in this application is developed using an AI embedded platform.
[0029] The selection of an AI embedded development platform needs to be considered from the perspectives of hardware, software, performance, and application scenarios. Hardware platform: Commonly used hardware platforms include ARM processors, DSPs, and FPGAs. ARM processors are widely used in embedded systems due to their low power consumption and high performance, especially in video processing. The ARM platform, combined with open-source processing algorithms (such as OpenCV), can meet some image processing needs. DSPs offer high performance and energy efficiency in video processing, particularly excelling in real-time processing and complex algorithms. FPGAs offer high flexibility and reconfigurability, making them suitable for video processing tasks requiring customized hardware acceleration, such as real-time video encoding, decoding, and image processing.
[0030] Software environment: Embedded system development requires an operating system, development tools, and related libraries. In resource-constrained environments, hardware and software resources are efficiently optimized by locally optimizing specific tasks, achieving optimal functionality with minimal resources. Embedded operating systems can easily handle multi-process and multi-threaded applications, simplifying complex programs. By entrusting the management of system hardware resources to the operating system, users only need to write applications according to a prescribed format to call these hardware resources, reducing software's hardware sensitivity, improving development efficiency, increasing stability and reliability, and enhancing program portability. Furthermore, a wealth of development tools and libraries (such as FFmpeg and OpenCV) provide rich multimedia processing capabilities for embedded platforms.
[0031] Performance requirements: (1) Performance and cost. High-performance requirements usually require high-end hardware (such as FPGA), but the cost is high. Low-cost solutions usually use ARM or DSP platforms. In addition, most ARM platforms have AI acceleration capabilities, and their CPUs support AI acceleration by working in conjunction with NPUs.
[0032] (2) Real-time performance and power consumption. Real-time video processing has high requirements for real-time performance. FPGA and DSP perform well in terms of real-time performance, while ARM platform has more advantages in low-power scenarios.
[0033] The selection of an embedded platform must also consider security, necessitating the use of a domestically produced embedded platform. Considering the application scenario—this device is intended for portable use—it needs to meet low power consumption requirements while possessing powerful video processing capabilities and sufficient computing power. Therefore, the HiSilicon Hi3559 embedded platform was chosen. The HiSilicon Hi3559AV100 is a professional ultra-high-definition mobile camera SOC, supporting multi-sensor input and multi-ISP image processing. It integrates dual-core A73 and dual-core A53, and its big.LITTLE architecture and dual operating system achieve a balance between power consumption and startup time. Its efficient and abundant computing resources support its widespread application in products. The HiSilicon Hi3559AV100 uses advanced 12nm low-power technology and miniaturized packaging, while supporting DDR4 / LPDDR4, enabling miniaturized product design. This is especially important for portable handheld combat weapons like observation and aiming systems, which have high requirements for long battery life and portability. In addition to its powerful image processing capabilities, the Hi3559AV100's low power consumption and miniaturization meet the demands for long battery life and portability.
[0034] On the other hand, this application provides a real-time ranging device for moving targets, the device comprising: The image acquisition module is used to acquire frame images from the video stream; The target tracking module is used to execute the KCF tracking algorithm to track targets; The target recognition module runs in parallel with the target tracking module, executing the target recognition algorithm to identify targets in the frame image. The target recognition module adopts a dual NNIE core parallel operation mechanism. The dual NNIE core parallel operation mechanism of the HiSilicon platform is used to improve computing power, reduce recognition processing time, and improve real-time performance. For small target detection, it is necessary to improve the small target detection capability by adding a small target detection layer, optimizing feature fusion, and data augmentation, so as to achieve accurate target recognition.
[0035] The display module is used to display the processing results of the frame image; The target tracking module and the target recognition module share a recognition cache pool. The target tracking module includes: The status determination unit is used to determine whether the current tracking state is normal or the re-identification state. The KCF tracking unit is used to perform tracking updates and track loss detection under normal tracking conditions. The initialization unit is used to retrieve data from the identification cache pool to initialize the KCF tracking unit in the case of loss or re-identification.
[0036] The desired effect of the device is as follows: Figure 1 As shown.
[0037] The principle is as follows: like Figure 5 The real-time ranging effect diagram of the moving target in this embodiment of the application is shown. The box represents the tracking box or recognition box of the moving target on the display screen at a certain moment. The tracking box is generated by the KCF tracking algorithm, and the recognition box is generated after inference by the YOLOV5 model. The corresponding circle represents the position of the ranging point generated after trajectory prediction. The circle is used to aim and send laser to the moving target to accurately measure the distance.
[0038] The analysis focuses on both system real-time performance and ranging accuracy. (1) To ensure the real-time performance of the system, the time to acquire the target box should be minimized. Compared with target recognition algorithms based on deep learning (R-CNN, OverFeat, Fast / Faster R-CNN, SSD, YOLO series, Pelee, etc.), the KCF tracking algorithm has a faster speed, stronger robustness and higher accuracy. Therefore, from the perspective of real-time performance, the KCF tracking algorithm is used to acquire the target box.
[0039] (2) To ensure accuracy of identification, the accuracy of the target bounding box must be guaranteed first. Although the KCF tracking algorithm guarantees the real-time performance of the system, it may have certain limitations in handling complex scenarios such as occlusion, scale changes, interference from similar targets, and rapid movement, and may not be able to guarantee the accuracy of the target bounding box. First, when the target is severely occluded, the algorithm will learn the occluder as part of the target when updating the filter, causing the filter to gradually deviate from the true target. Secondly, the performance of the algorithm may degrade when the target undergoes a large scale change, because the algorithm needs to determine the initial scale of the target during initialization. Once the target scale changes significantly, the filter needs to be readjusted to adapt to the new scale. Furthermore, when there are other objects in the scene that are similar to the target, the KCF tracking algorithm may mistrack because the algorithm mainly relies on the appearance features of the target during the tracking process. If other objects have similar appearance features to the target, the algorithm may mistake them for the target. Finally, updating the filter also takes time. If the target moves too fast, the algorithm may not be able to capture the target's new position in time.
[0040] While acquiring target bounding boxes through target recognition can overcome some drawbacks of the KCF tracking algorithm and adapt to complex backgrounds, the acquisition method based solely on target recognition not only takes longer to process than tracking, but also suffers from issues such as bounding box jitter and false detections. This can seriously affect the accuracy of predicting attack points and reduce the precision of the strike.
[0041] Therefore, a parallel operation mechanism of recognition and tracking is adopted, with tracking as the main thread and recognition as the auxiliary thread. If the tracking is lost, the recognition thread can correct the situation in time. This can overcome some limitations of KCF in complex scenarios and also overcome the problems of target recognition algorithm such as recognition box jitter and false detection. It ensures both the stability of the target box and the real-time performance of the system. Therefore, the design adopts a tracking-as-main-thread and recognition-as-auxiliary-correction scheme.
[0042] The entire device is mainly divided into two parts: target recognition and target tracking. These two parts operate in parallel. The target tracking part is the main process for acquiring the target bounding box, while the target recognition part is an auxiliary process used to correct the target if it is lost. Its workflow diagram is shown below. Figure 1 The flowchart for obtaining the target box in this embodiment of the application is shown below; Target tracking section, such as Figure 6 The target tracking flowchart shown in this application embodiment has the following logical steps: S701: Acquire the image to be processed via video stream input; S702: Determine whether the current state is normal tracking state or re-identification state; S703: Determine the status based on S702. If it is a re-recognition status, then the video frame and the recognition target box need to be obtained from the recognition buffer pool and displayed on the screen. S704: After S703 is displayed on the screen, enter S701 to acquire the next frame of image; S705: Determine the status based on S702. If it is a normal tracking status, then perform KCF update processing based on the image obtained in S701. S706: Determine whether the KCF has lost track of the target based on the KCF update of S705; S707: Determine the tracking status of KCF based on S706. If tracking is lost, retrieve video frames and target boxes from the recognition buffer pool to perform KCF initialization and start a new round of normal tracking. S708: After S707 completes KCF initialization, it enters S701 to acquire the next frame of image; S709: Determine the tracking status of KCF based on S706. If it has not been lost, save the tracking target box result. S710: Perform trajectory prediction based on the tracking target bounding box results obtained in S709; S711: Displays the range points predicted by the trajectory obtained by S710 on the screen together with the tracking frame and video frame; S712: After S711 is displayed on the screen, it enters S701 to acquire the next frame of image.
[0043] Target recognition part such as Figure 7 The target recognition flowchart shown in this application embodiment has the following logical steps: S81: Obtain the image to be processed by inputting a video stream (parse the video into each frame image); S82: Perform image recognition processing based on the image obtained in S81; S83: Determine whether a target has been detected based on the recognition processing result of S82. If no target is detected, proceed to step 1 to acquire the next frame image. S84: Determine whether a target has been detected based on the recognition and processing results of S82. If a target is detected, determine the current tracking status. S85: Based on the tracking status judgment of S84, if it is a re-identification state, the current video frame and recognition box will be displayed, and KCF initialization will be performed to start a new round of normal tracking. S86: After S85 completes KCF initialization, proceed to step 1 to acquire the next frame image; S87: Based on the tracking status judgment of S84, if it is a normal tracking status, the current video frame and recognition box are put into the recognition buffer pool for use in case KCF is lost. S88: After S87 puts the current video frame and recognition box into the recognition buffer pool, it enters S81 to acquire the next frame image.
[0044] In another aspect, this application provides a computer device, which includes a processor and a memory. The memory stores at least one instruction, at least one program, code set, or instruction set. The processor loads and executes the at least one instruction, at least one program, code set, or instruction set to implement a real-time ranging method for moving targets.
[0045] In another aspect, this application provides a computer-readable storage medium, characterized in that the readable storage medium stores at least one instruction, at least one program, code set or instruction set, wherein the at least one instruction, at least one program, code set or instruction set is loaded and executed by a processor to implement a real-time ranging method for moving targets.
[0046] It should be noted that the real-time moving target ranging device provided in this embodiment is only an example of the above-described division of functional modules / units. In practical applications, the above functions can be assigned to different functional modules / units as needed, that is, the internal structure of the real-time target ranging device can be divided into different functional modules / units to complete all or part of the functions described above. Furthermore, the implementation method of the real-time target ranging method provided in the above-described method embodiments and the implementation method of the real-time target ranging device provided in this embodiment belong to the same concept. The specific implementation process of the real-time target ranging device provided in this embodiment is detailed in the above-described method embodiments and will not be repeated here.
[0047] Figure 8 This illustration shows a structural block diagram of a computer device provided in an exemplary embodiment of this application. The computer device can be a desktop computer, a laptop computer, a handheld computer, or a cloud server, etc. The computer device may include, but is not limited to, a processor and memory. The processor and memory can be connected via a bus or other means. The processor can be a Central Processing Unit (CPU). The processor can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, graphics processing units (GPUs), embedded neural network processing units (NPUs) or other dedicated deep learning coprocessors, discrete gate or transistor logic devices, discrete hardware components, or combinations of the above types of chips.
[0048] The processor may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor may be implemented using at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor may also include a main processor and coprocessors. The main processor, also known as the CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, the processor may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0049] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods in the above embodiments of this application. The processor executes various functional applications and data processing by running the non-transitory software programs, instructions, and modules stored in the memory, thereby implementing the methods in the above embodiments. The memory may include a program storage area and a data storage area, wherein the program storage area may store the operating system and at least one application program required for a function; the data storage area may store data created by the processor, etc. Furthermore, the memory may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0050] In some embodiments, the computer device may also optionally include: a peripheral device interface and at least one peripheral device. The processor, memory, and peripheral device interface can be connected via a bus or signal lines. Each peripheral device can be connected to the peripheral device interface via a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit, a display screen, and a keyboard.
[0051] Peripheral device interfaces can be used to connect at least one I / O (Input / Output) related peripheral device to the processor and memory. In some embodiments, the processor, memory, and peripheral device interface are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor, memory, and peripheral device interface can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0052] The display screen is used to display the UI (User Interface). This UI can include graphics, text, icons, videos, and any combination thereof. When the display screen is a touch screen, it also has the ability to collect touch signals on or above the surface of the display. These touch signals can be input as control signals to a processor for processing. In this case, the display screen can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen, located on the front panel of the computer device; in other embodiments, there may be at least two display screens, respectively located on different surfaces of the computer device or in a folded design; in still other embodiments, the display screen may be a flexible display screen, located on a curved or folded surface of the computer device. Furthermore, the display screen can be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0053] A power supply is used to power the various components in a computer device. The power supply can be alternating current (AC), direct current (DC), a disposable battery, or a rechargeable battery. When the power supply includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is charged via a wired connection, while a wireless rechargeable battery is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0054] Those skilled in the art will understand that the structure shown in this embodiment does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0055] This application also discloses a computer-readable storage medium. Specifically, the computer-readable storage medium is used to store a computer program, which, when executed by a processor, implements the methods described in the above-described method embodiments. Those skilled in the art will understand that implementing all or part of the processes in the methods described above can be accomplished by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium can also include combinations of the above types of memory.
[0056] This specific embodiment is merely an explanation of the present invention and is not intended to limit the invention. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of the claims of the present invention.
Claims
1. A method for real-time ranging of a moving target, comprising: obtaining each frame of a video stream by an image acquisition module, and performing the following steps on the frame: obtaining the current frame; performing target recognition on the frame by an image recognition algorithm to detect whether a target exists in the frame; if no target is detected in the frame, returning to the step of obtaining the current frame to process the next frame; if a target is detected in the frame, determining a tracking state of the system, the tracking state being a normal tracking state or a re-identification state; if the current tracking state is the re-identification state, performing the following steps: displaying the current frame and a recognized target box; initializing a KCF tracker using the recognized target box as an initial tracking box; setting the current tracking state to the normal tracking state; and returning to the step of obtaining the current frame; if the current tracking state is the normal tracking state, performing the following steps: storing the frame and the target box recognized in the target recognition step in a recognition cache pool; updating the frame by a KCF tracking algorithm; determining whether the KCF tracking algorithm has lost the target; if the KCF tracking algorithm has lost the target, obtaining the frame and the recognized target box from the recognition cache pool, initializing the KCF tracking algorithm, setting the current tracking state to the normal tracking state, and returning to the step of obtaining the current frame; if the KCF tracking algorithm has not lost the target, saving a tracking target box result output by the KCF tracking algorithm; performing trajectory prediction on the tracking target box result; displaying a ranging point after trajectory prediction, the tracking target box, and the current frame on a screen; and returning to the step of obtaining the current frame. The frame and the recognized target box obtained from the recognition cache pool are the frame and the recognized target box stored in the cache pool after the target is successfully detected by the target recognition algorithm last time. The determination of whether the target is lost is based on a comparison between a response score output by the KCF tracking algorithm and a preset threshold of the KCF tracking algorithm. 4.The method of claim 1, wherein: the recognition cache pool adopts a queue structure of first-in-last-out, and a capacity of the recognition cache pool is set to store the frame and the recognized target box after N times of successful recognition, wherein N is a positive integer greater than or equal to 1, and the capacity N is dynamically adjusted according to a frame rate of the video stream and a highest expected speed of the target movement. 5.The method of claim 3, wherein: the determination of whether the target is lost is performed by calculating a peak-to-sidelobe ratio of a response map of the KCF tracking algorithm, and comparing the peak-to-sidelobe ratio with a preset first threshold; and the response peak-to-sidelobe ratio is the response score, and the response score further includes a size change rate of a tracking box. 2. The method of claim 1, wherein, 3. The method of claim 1, wherein, The determining whether the target is lost further includes: if the peak side lobe ratio is lower than the first threshold, further determining whether a size change rate of the tracking frame exceeds a preset second threshold, and if yes, comprehensively determining that the target is lost.
6. The method of claim 1, wherein: The method further includes: when the target is not detected in the continuous multiple frame images, automatically setting a tracking state to a re-identification state.
7. The method of claim 1, wherein: The initialization step of the KCF tracking algorithm includes extracting appearance features of the target and establishing a target frame model.
8. A real-time ranging device for moving targets, characterized in that The device includes: an image acquisition module configured to acquire frame images in a video stream; a target tracking module configured to perform a KCF tracking algorithm to track the target; a target identification module configured to run in parallel with the target tracking module and perform a target identification algorithm to identify the target in the frame images, the target identification module being configured to run in a dual-NNIE core parallel running mechanism; a display module configured to display a processing result of the frame images; wherein the target tracking module and the target identification module share an identification cache pool; the target tracking module includes: a state determining unit configured to determine whether a current state is a normal tracking state or a re-identification state; a KCF tracking unit configured to perform tracking update and loss determination in the normal tracking state; an initialization unit configured to acquire data from the identification cache pool to initialize the KCF tracking unit in the lost or re-identification state.
9. A computer device, comprising: The computer device includes a processor and a memory, the memory storing at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the real-time distance measurement method of the moving target according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The readable storage medium stores at least one instruction, at least one program, a code set or an instruction set, the at least one instruction, the at least one program, the code set or the instruction set being loaded and executed by the processor to implement the real-time distance measurement method of the moving target according to any one of claims 1 to 7.