Target Tracking Method, Device, Equipment, Medium and Product
The method improves target tracking success in varying lighting conditions by reducing brightness differences and using feature extraction models to stabilize target identification, enhancing robustness in dynamic environments.
Patent Information
- Application Number
- CN202510423392.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-07
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2045-04-07
AI Technical Summary
In the prior art, the problem of severe changes in the environment brightness leads to failure in target tracking.
By reducing the brightness difference when extracting the target features of candidate targets in the image to be processed, the target features are acquired using the trained feature extraction model, combining background segmentation and brightness adjustment, the impact of brightness on feature extraction is reduced, and the robustness of matching features is improved through weighted averaging processing.
Improve the success rate of target tracking in scenarios of dramatic light changes, ensuring the stability and accuracy of target tracking.
Smart Images

Figure CN119941797B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to a target tracking method, apparatus, device, medium and product. Background Art
[0002] Target tracking technology is an important research direction in the fields of computer vision and pattern recognition. Its main task is to continuously track and locate one or more target objects in a video sequence. Target tracking technology has a wide range of applications in fields such as video surveillance, autonomous driving, human-computer interaction, and virtual reality. In target tracking technology, it is necessary to extract the feature information of the target and implement tracking based on the feature information. However, in actual application scenarios, the environmental brightness often changes sharply. At this time, the color, texture, etc. of the target in the image change violently, resulting in tracking failure. Summary of the Invention
[0003] The present invention provides a target tracking method, apparatus, device, medium and product to solve the defect that target tracking fails due to drastic changes in environmental brightness in the prior art, and to improve the success rate of target tracking.
[0004] The present invention provides a target tracking method, including:
[0005] Obtain an image to be processed, perform target detection on the image to be processed, and obtain at least one candidate target. The image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene;
[0006] Extract the target features of each candidate target in the image to be processed respectively, and determine the to-be-matched features corresponding to the tracking target based on the target features of the tracking target in the scene image before the image to be processed. The target features of the target in the image include the features of the target after reducing the difference between the brightness of the target in the image and a preset brightness value;
[0007] Based on the target features of each candidate target in the image to be processed and the to-be-matched features corresponding to the tracking target, determine the tracking target among the candidate targets.
[0008] According to a target tracking method provided by the present invention, the target features include first features; the step of respectively extracting the target features of each candidate target in the image to be processed includes:
[0009] Perform background segmentation on the image to be processed based on the candidate target, remove the background part of the candidate target in the image to be processed, and obtain a segmented region image;
[0010] Adjust the brightness of the segmented region image based on the preset brightness value to obtain an adjusted image;
[0011] Input the adjusted image into the trained feature extraction model to obtain the first feature of the candidate target in the image to be processed output by the feature extraction model.
[0012] According to a target tracking method provided by the present invention, the brightness adjustment of the segmented region image based on the preset brightness value to obtain an adjusted image includes:
[0013] Obtain the brightness average value of the segmented region image;
[0014] Determine an adjustment coefficient based on the preset brightness value and the brightness average value;
[0015] Perform weighted processing on the pixel values of the segmented region image based on the adjustment coefficient to obtain the adjusted image.
[0016] According to a target tracking method provided by the present invention, the target feature further includes a second feature. The extraction of the target features of each candidate target in the image to be processed respectively includes:
[0017] Crop the image to be processed based on the candidate target to obtain an image of the region to be processed, and the image of the region to be processed includes the candidate target;
[0018] Input the image of the region to be processed into the trained feature extraction model to obtain the second feature of the candidate target in the image to be processed output by the feature extraction model.
[0019] According to a target tracking method provided by the present invention, the features to be matched include a first feature to be matched and a second feature to be matched. The first feature to be matched is determined based on the first feature of the tracking target in the scene image before the image to be processed, and the second feature to be matched is determined based on the second feature of the tracking target in the scene image before the image to be processed;
[0020] Determining the tracking target among the candidate targets based on the target features of each candidate target in the image to be processed and the features to be matched corresponding to the tracking target includes:
[0021] Match the second feature to be matched corresponding to the tracking target with the second features corresponding to each candidate target respectively;
[0022] When the matching result meets the preset condition, obtain the candidate target with the highest matching degree as the tracking target, where the preset condition is that the matching degree between the second feature corresponding to the candidate target and the second feature to be matched corresponding to the tracking target is higher than the preset matching degree threshold;
[0023] When the matching result does not meet the preset condition, match the first feature to be matched corresponding to the tracking target with the first features corresponding to each candidate target respectively to determine the tracking target.
[0024] According to a target tracking method provided by the present invention, determining the feature to be matched corresponding to the tracking target based on the target feature of the tracking target in the scene image before the image to be processed includes:
[0025] Perform weighted average processing on the target features of the tracking target in N scene images before the image to be processed to obtain the feature to be matched corresponding to the tracking target, where N is a positive integer greater than 1.
[0026] The present invention also provides a target tracking device, including:
[0027] An image acquisition module, configured to acquire an image to be processed, perform target detection on the image to be processed, and obtain at least one candidate target, where the image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene;
[0028] A feature extraction module, configured to extract the target features of each candidate target in the image to be processed respectively, and determine the feature to be matched corresponding to the tracking target based on the target feature of the tracking target in the scene image before the image to be processed, where the target feature of the target in the image includes the feature of the target after reducing the difference between the brightness of the target in the image and a preset brightness value;
[0029] A feature matching module, configured to determine the tracking target among the candidate targets based on the target features of each candidate target in the image to be processed and the feature to be matched corresponding to the tracking target.
[0030] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored on the memory and running on the processor, where when the processor executes the computer program, the target tracking method described in any one of the above is implemented.
[0031] The present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the target tracking method described in any one of the above is implemented.
[0032] The present invention also provides a computer program product, including a computer program which, when executed by a processor, implements the target tracking method as described in any one of the above.
[0033] For the target tracking method, device, equipment, medium and product provided by the present invention, when extracting features of a target in a to-be-processed image, a target feature is obtained by reducing the difference between the brightness of a candidate target in the to-be-processed image and a preset brightness value, a to-be-matched feature of a tracking target is obtained by using the target feature of the tracking target in the scene image before the to-be-processed image, a tracking target is determined among all candidate targets based on the target feature of the candidate target and the to-be-matched feature of the tracking target, and then the tracking target is tracked. In the process of feature extraction, the present invention reduces the influence of brightness on feature extraction, thereby improving the success rate of target tracking in a scene with rapid light changes. Description of the Drawings
[0034] To more clearly illustrate the technical solutions in the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0035] Figure 1 is a flowchart of the target tracking method provided by the present invention.
[0036] Figure 2 is a logic block diagram of the target tracking method provided by the present invention.
[0037] Figure 3 is a structural schematic diagram of the target tracking device provided by the present invention.
[0038] Figure 4 is a structural schematic diagram of the electronic device provided by the present invention. Detailed Embodiments
[0039] To make the objectives, technical solutions and advantages of the present invention clearer, the following will clearly and completely describe the technical solutions in the present invention with reference to the drawings in the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments in the present invention belong to the scope of protection of the present invention.
[0040] The following will describe the target tracking method provided by the present invention in combination with Figure 1 - Figure 2 As shown in Figure 1 , the target tracking method includes the following steps:
[0041] S110. Obtain the image to be processed, perform object detection on the image to be processed to obtain at least one candidate object. The image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene.
[0042] S120. Extract the object features of each candidate object in the image to be processed respectively, and determine the to-be-matched features corresponding to the tracking object based on the object features of the tracking object in the scene image before the image to be processed. The object features of an object in an image include the features of the object after reducing the difference between the brightness of the object in the image and a preset brightness value.
[0043] S130. Determine the tracking object among the candidate objects based on the object features of each candidate object in the image to be processed and the to-be-matched features corresponding to the tracking object.
[0044] In the method provided by the present invention, when extracting features of an object in the image to be processed, the difference between the brightness of the candidate object in the image to be processed and a preset brightness value is reduced to obtain the object features, the to-be-matched features of the tracking object are obtained through the object features of the tracking object in the scene image before the image to be processed, and the tracking object is determined among each candidate object based on the object features of the candidate object and the to-be-matched features of the tracking object, so as to track the tracking object. In the process of feature extraction, the present invention reduces the influence of brightness on feature extraction, thereby improving the success rate of object tracking in a scene with drastic light changes.
[0045] The image to be processed can be a frame image in a video obtained by shooting a tracking scene. By processing the image frames in the video stream as the image to be processed, determining the tracking object and tracking it, continuous and smooth tracking of the tracking object can be achieved.
[0046] In a possible implementation manner, an RGB-D camera (RGB-depth camera) can be used to image the tracking scene to obtain an RGB image and a depth image. For example, an RGB-D camera is set on a tracking robot to shoot the tracking scene to obtain an RGB image and a depth image, and the RGB image among them is used as the image to be processed for processing. The depth image can provide information such as the distance between the object in the image and the camera, thereby providing position information for object tracking. Therefore, an RGB image and a depth image can be obtained by an RGB camera and a depth camera respectively, and the RGB image and the depth image are aligned. The aligned RGB image and depth image can be published through a ROS (Robot Operating System) node. Subscribe to the RGB image and the depth image from this node, extract features using the RGB image as the image to be processed to determine the tracking object, and track the tracking object based on the depth image.
[0047] After obtaining the image to be processed, first perform object detection on the image to be processed to obtain at least one candidate object. Performing object detection on the image to be processed can be achieved based on an existing object detection model, such as the YOLOv8 model. After performing object detection on the image to be processed, as Figure 2 shown, determine whether there is an object of the target type to be tracked according to the detection result. For example, if the tracking target is a human body, then determine whether there is a human body in the image to be processed. If the tracking target is an animal, then determine whether there is an animal in the image to be processed. The following will take the tracking target as a human body for specific illustration. For other types of tracking targets, the same process can be used for processing.
[0048] As Figure 2 shown, if there is no human body target in the image to be processed, then determine whether the set end process time limit is exceeded, or whether the stop condition is met (such as the user manually stops, or the upper-layer application sends a stop instruction, etc.). If the end condition is met or the set end process time limit is exceeded, return the no-human-body-target information to the upper-layer caller and end the following function process. If the end condition is not met, obtain a new frame of the image to be processed again.
[0049] If there is a human body target in the image to be processed, then use these human body targets as candidate targets, and check whether the tracking target in this tracking process has been determined and stored. The tracking target is the specific target to be tracked. In the method provided by the present invention, the basis for tracking the tracking target is the target feature of the tracking target. If the human body target to be tracked in this time has not been determined and stored, then a candidate target can be selected as the tracking target. For example, the candidate target closest to the center in the image to be processed is used as the tracking target, and its corresponding target feature is extracted as the feature to be matched and stored. When tracking the tracking target subsequently, the target feature extracted this time is used as the basis for tracking.
[0050] In practical applications, there may be a situation where the light in the scene changes violently, such as from indoors to outdoors, from a shady place to sunlight, etc. When the light in the scene changes violently, the brightness of the tracking target in adjacent images to be processed will change violently. At this time, even for the same target, the features extracted by performing feature extraction on different images to be processed may change greatly, resulting in inability to perform matching and thus tracking failure. In the method provided by the present invention, when performing feature extraction on a candidate target based on an image including the candidate target, the extracted target feature includes the feature of the candidate target in the image after reducing the difference between the brightness of the candidate target in the image and the preset brightness. That is to say, the target feature of the candidate target extracted based on the image to be processed includes the feature of the candidate target in the image to be processed after reducing the difference between the brightness of the candidate target in the image to be processed and the preset brightness.
[0051] Specifically, the target feature includes a first feature. Extracting the target features of each of the candidate targets in the to-be-processed image respectively includes:
[0052] Performing background segmentation on the to-be-processed image based on the candidate target, removing the background part of the candidate target in the to-be-processed image, and obtaining a segmented region image;
[0053] Performing brightness adjustment on the segmented region image based on a preset brightness value to obtain an adjusted image;
[0054] Inputting the adjusted image into a trained feature extraction model, and obtaining the first feature corresponding to the candidate target output by the feature extraction model.
[0055] The feature extraction model can be an existing feature extraction model. For example, the ReID model is a model based on ReID (Re-Identification) technology. ReID technology identifies and tracks individual identities through a given image or video sequence. The main task is to extract the ReID features of human images through a deep neural network model in images or video sequences captured from multiple perspectives or at multiple times, and compare and match the features to identify the same pedestrian. The method provided by the present invention uses the feature extraction model to extract the target features of the candidate target for matching to achieve the identification of the tracking target.
[0056] In order to reduce the influence of drastic light changes on feature extraction, in the method provided by the present invention, after reducing the difference between the brightness value of the candidate target in the to-be-processed image and the preset brightness value, it is input into the feature extraction model to extract features. This can reduce the influence of brightness on the features used for matching, thereby reducing the influence of drastic light changes on target tracking and improving the target tracking success rate. First, perform background segmentation on the to-be-processed image based on the candidate target, remove the background part in the to-be-processed image, and obtain a segmented region image to avoid interference of the background on brightness calculation. Background segmentation can be implemented using an existing segmentation model such as the SAM segmentation model (Segment Anything Model). After performing background segmentation on the to-be-processed image, only the part of the candidate target is retained to obtain a segmented region image. After performing brightness adjustment on this image, it is input into the feature extraction model to perform feature extraction to obtain the first feature.
[0057] Specifically, performing brightness adjustment on the segmented region image based on a preset brightness value to obtain an adjusted image includes:
[0058] Obtaining the brightness mean value of the segmented region image;
[0059] Determining an adjustment coefficient based on the preset brightness value and the brightness mean value;
[0060] The pixel values of the segmented region image are weighted based on an adjustment coefficient to obtain an adjusted image.
[0061] The average brightness of the segmented region image can be calculated by the following formula:
[0062] ;
[0063] Where, is the average brightness, are the width and height of the segmented region image, and R, G, and B are the pixel values of the three channels of the pixel point respectively.
[0064] According to the image properties of the RGB image, the value range of the average brightness should be .
[0065] The adjustment coefficient is the ratio of the preset brightness value to the average brightness, and can be calculated by the formula where, is the preset brightness value.
[0066] The preset brightness value is a brightness value that is preset to be beneficial for retaining information for target recognition, such as 180. That is to say, the image under the preset brightness value will not be too dark or too bright, resulting in the loss of color, details of the target, and texture information of the image. Of course, it can be understood that different preset brightness values can be set according to different target recognition scenarios and target categories, and the setting basis can be artificial experience or experimental data.
[0067] After obtaining the adjustment coefficient , the pixel values of the image in the segmented region are weighted based on this adjustment coefficient to obtain an adjusted image. This process can be expressed by the formula: , where, represents the pixel value matrix of the adjusted image, is the pixel value matrix of the segmented region image.
[0068] As can be seen from the above description, the process of extracting the first feature requires background segmentation, brightness adjustment, and feature extraction processes, which consume certain resources and the real-time performance will be poor. In the method provided by the present invention, in order to further ensure the success rate of target tracking, the target features of the candidate targets also include a second feature. The target features of each candidate target in the image to be processed are extracted respectively, and further include:
[0069] The image to be processed is cropped based on the candidate target to obtain an image of the region to be processed, and the image of the region to be processed includes the candidate target;
[0070] Input the image of the area to be processed into the trained feature extraction model to obtain the second feature of the candidate target output by the feature extraction model in the image to be processed.
[0071] When extracting the second feature, the brightness is not adjusted, and the feature extraction is directly performed on the image of the area to be processed including the candidate target to obtain the second feature. Since the processing steps of the second feature are relatively simple, it can have better real-time performance. Combining the second feature and the first feature can ensure the success rate of target tracking.
[0072] After obtaining the target features of each candidate target in the image to be processed, match the target features of each candidate target with the features to be matched of the tracking target respectively, and determine the tracking target among each candidate target.
[0073] The features to be matched of the tracking target are obtained based on the scene image before the image to be processed. The scene image before the image to be processed refers to the scene image whose acquisition time is earlier than that of the image to be processed. When the image to be processed is the first frame in the video stream, that is, there is no scene image before the image to be processed, as described above, the central target in the image to be processed can be specified or automatically used as the tracking target, and the target features are extracted as the features to be matched. For the case where there is a scene image before the image to be processed, in one possible implementation, the target features of the tracking target in the previous frame scene image of the image to be processed can be used as the features to be matched of the tracking target. However, the robustness of this method is relatively low. To improve the robustness of the matching and further improve the success rate of tracking, in another possible implementation, determining the features to be matched corresponding to the tracking target based on the target features of the tracking target in the scene image before the image to be processed includes:
[0074] Perform weighted average processing on the target features of the tracking target in N scene images before the image to be processed to obtain the features to be matched corresponding to the tracking target, where N is a positive integer greater than 1.
[0075] Through weighted average processing, the target features of the tracking target in N scene images before the image to be processed can be fused to obtain more robust and accurate features of the tracking target, improving the success rate of tracking.
[0076] The features to be matched of the tracking target include the first features to be matched and the second features to be matched. The first features to be matched are determined based on the first features of the tracking target in the scene image before the image to be processed, and the second features to be matched are determined based on the second features of the tracking target in the scene image before the image to be processed. Determining the tracking target among the candidate targets based on the target features of each candidate target in the image to be processed and the features to be matched corresponding to the tracking target includes:
[0077] Match the second feature to be matched corresponding to the tracking target with the second features corresponding to each candidate target respectively;
[0078] When the matching result meets the preset condition, obtain the candidate target with the highest matching degree as the tracking target. The preset condition is that there exists a second feature corresponding to a candidate target whose matching degree with the second feature to be matched corresponding to the tracking target is higher than the preset matching degree threshold;
[0079] When the matching result does not meet the preset condition, match the first feature to be matched corresponding to the tracking target with the first features corresponding to each candidate target that meets the preset condition to determine the tracking target.
[0080] First, match the second feature to be matched with the second features corresponding to each candidate target respectively. In the case of no drastic change in brightness, the tracking target can be directly determined among the candidate targets through the matching of the second feature to be matched and the second feature. Feature matching can be determined by calculating vector similarity. Specifically, the second feature to be matched is a vector of dimension M, and the second features of K candidate targets form K vectors of dimension M. Calculate the similarity of the two vectors to obtain a similarity vector S with a dimension of 1×K. Each element in the similarity vector S represents the similarity value between the tracking target and the k-th candidate target. When there is a candidate target with a value greater than the preset matching degree threshold (i.e., the similarity value is greater than the preset similarity threshold), it indicates that there is no drastic change in the current scene light. Obtain the candidate target with the highest matching degree as the tracking target. When there is no candidate target with a value greater than the preset matching degree threshold, it indicates that there is a drastic change in the current scene light. Then, further match the first feature to be matched corresponding to the tracking target with the first features corresponding to each candidate target. When there is a candidate target with a value greater than the preset matching degree threshold (i.e., the similarity value is greater than the preset similarity threshold), take the candidate target with the largest matching degree as the tracking target. If there is still no candidate target with a matching degree greater than the preset matching degree threshold after the second matching, it is determined that the tracking target is lost. M, and the second features of K candidate targets form K vectors of dimension M M. Calculate the similarity of the two vectors to obtain a similarity vector S with a dimension of 1×K After determining the tracking target among each candidate target, the position of the tracking target in the image to be processed can be published. Based on this position, the position of the tracking target in the depth image aligned with the image to be processed can be obtained. Based on the depth value corresponding to this position, the actual distance from the tracking target to the camera can be converted. Thus, the coordinates of the tracking target in the tracking robot coordinate system can be calculated according to the camera calibration parameters, and the control signal can be output according to the predetermined tracking strategy, and the motion interface of the tracking robot body can be called to control the movement of the robot, so as to track the tracking target.
[0081] After determining the tracking target among each candidate target, the position of the tracking target in the image to be processed can be published. Based on this position, the position of the tracking target in the depth image aligned with the image to be processed can be obtained. Based on the depth value corresponding to this position, the actual distance from the tracking target to the camera can be converted. Thus, the coordinates of the tracking target in the tracking robot coordinate system can be calculated according to the camera calibration parameters, and the control signal can be output according to the predetermined tracking strategy, and the motion interface of the tracking robot body can be called to control the movement of the robot, so as to track the tracking target.
[0082] The target tracking device provided by the present invention will be described below. The target tracking device described below can be referred to in correspondence with the target tracking method described above. As Figure 3 shown, the target tracking device provided by the present invention includes:
[0083] An image acquisition module 310, configured to acquire an image to be processed, perform target detection on the image to be processed, and obtain at least one candidate target. The image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene;
[0084] A feature extraction module 320, configured to extract the target features of each candidate target in the image to be processed respectively, and determine the to-be-matched features corresponding to the tracking target based on the target features of the tracking target in the scene image before the image to be processed. The target features of the target in the image include the features of the target after reducing the difference between the brightness of the target in the image and a preset brightness value;
[0085] A feature matching module 330, configured to determine the tracking target among the candidate targets based on the target features of each candidate target in the image to be processed and the to-be-matched features corresponding to the tracking target.
[0086] Figure 4 The schematic physical structure diagram of an electronic device is illustrated. As Figure 4 shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430, and a communication bus 440. Among them, the processor 410, the communication interface 420, and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call the logical instructions in the memory 430 to execute the target tracking method, and the method includes: acquiring an image to be processed, performing target detection on the image to be processed, and obtaining at least one candidate target. The image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene; extracting the target features of each candidate target in the image to be processed respectively, and determining the to-be-matched features corresponding to the tracking target based on the target features of the tracking target in the scene image before the image to be processed. The target features of the target in the image include the features of the target after reducing the difference between the brightness of the target in the image and a preset brightness value; determining the tracking target among the candidate targets based on the target features of each candidate target in the image to be processed and the to-be-matched features corresponding to the tracking target.
[0087] In addition, when the logical instructions in the above-mentioned memory 430 can be implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks, or optical discs that can store program codes.
[0088] On the other hand, the present invention also provides a computer program product. The computer program product includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the target tracking method provided by the above-mentioned various methods. The method includes: obtaining an image to be processed, performing target detection on the image to be processed to obtain at least one candidate target, where the image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene; respectively extracting the target features of each candidate target in the image to be processed, determining the matching features corresponding to the tracking target based on the target features of the tracking target in the scene image before the image to be processed, where the target features of the target in the image include the features of the target after reducing the difference between the brightness of the target in the image and a preset brightness value; and determining the tracking target among the candidate targets based on the target features of each candidate target in the image to be processed and the matching features corresponding to the tracking target.
[0089] On another aspect, the present invention also provides a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the target tracking method provided by the above-mentioned various methods. The method includes: obtaining an image to be processed, performing target detection on the image to be processed to obtain at least one candidate target, where the image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene; respectively extracting the target features of each candidate target in the image to be processed, determining the matching features corresponding to the tracking target based on the target features of the tracking target in the scene image before the image to be processed, where the target features of the target in the image include the features of the target after reducing the difference between the brightness of the target in the image and a preset brightness value; and determining the tracking target among the candidate targets based on the target features of each candidate target in the image to be processed and the matching features corresponding to the tracking target.
[0090] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. A person of ordinary skill in the art can understand and implement it without creative labor.
[0091] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments or equivalently replace some of the technical features. These modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A target tracking method, characterized in that, Including: Obtain an image to be processed, perform object detection on the image to be processed to obtain at least one candidate object, where the image to be processed is a scene image, and the scene image is an image obtained by imaging a tracking scene; Extract the object features of each candidate object in the image to be processed respectively, and determine the to-be-matched features corresponding to the tracking object based on the object features of the tracking object in the scene image before the image to be processed. The object features of the object in the image include the features of the object after reducing the difference between the brightness of the object in the image and a preset brightness value; Based on the object features of each candidate object in the image to be processed and the to-be-matched features corresponding to the tracking object, determine the tracking object among the candidate objects; The object features include a first feature and a second feature; The step of respectively extracting the object features of each candidate object in the image to be processed includes: Perform background segmentation on the image to be processed based on the candidate object, remove the background part of the candidate object in the image to be processed, and obtain a segmented region image; Adjust the brightness of the segmented region image based on the preset brightness value to obtain an adjusted image; Input the adjusted image into a trained feature extraction model to obtain the first feature of the candidate object in the image to be processed output by the feature extraction model; Crop the image to be processed based on the candidate object to obtain an image of a region to be processed, where the image of the region to be processed includes the candidate object; Input the image of the region to be processed into a trained feature extraction model to obtain the second feature of the candidate object in the image to be processed output by the feature extraction model; The to-be-matched features include a first to-be-matched feature and a second to-be-matched feature. The first to-be-matched feature is determined based on the first feature of the tracking object in the scene image before the image to be processed, and the second to-be-matched feature is determined based on the second feature of the tracking object in the scene image before the image to be processed; The step of determining the tracking object among the candidate objects based on the object features of each candidate object in the image to be processed and the to-be-matched features corresponding to the tracking object includes: Match the second to-be-matched feature corresponding to the tracking object with the second features corresponding to each candidate object respectively; When the matching result meets a preset condition, obtain the candidate object with the highest matching degree as the tracking object. The preset condition is that there is a candidate object whose second feature corresponding to it has a matching degree higher than a preset matching degree threshold with the second to-be-matched feature corresponding to the tracking object; When the matching result does not meet the preset condition, match the first to-be-matched feature corresponding to the tracking object with the first features corresponding to each candidate object respectively to determine the tracking object.
2. The target tracking method according to claim 1, characterized in that The step of adjusting the brightness of the segmented region image based on the preset brightness value to obtain an adjusted image includes: Obtain the brightness average value of the segmented region image; Determine an adjustment coefficient based on the preset brightness value and the brightness average value; Perform weighted processing on the pixel values of the segmented region image based on the adjustment coefficient to obtain the adjusted image.
3. The target tracking method according to claim 1, wherein, The determining the to-be-matched feature corresponding to the tracking target based on the target feature of the tracking target in the scene image before the to-be-processed image includes: Perform weighted average processing on the target features of the tracking target in N scene images before the to-be-processed image to obtain the to-be-matched feature corresponding to the tracking target, where N is a positive integer greater than 1.
4. A target tracking device, characterized in that, Including: An image acquisition module, configured to acquire a to-be-processed image, perform target detection on the to-be-processed image to obtain at least one candidate target, the to-be-processed image being a scene image, and the scene image being an image obtained by imaging a tracking scene; A feature extraction module, configured to extract the target features of each candidate target in the to-be-processed image respectively, and determine the to-be-matched feature corresponding to the tracking target based on the target feature of the tracking target in the scene image before the to-be-processed image, where the target feature of the target in the image includes the feature of the target after reducing the difference between the brightness of the target in the image and the preset brightness value; A feature matching module, configured to determine the tracking target among the candidate targets based on the target features of each candidate target in the to-be-processed image and the to-be-matched feature corresponding to the tracking target; The target feature includes a first feature and a second feature; The separately extracting the target features of each candidate target in the to-be-processed image includes: Perform background segmentation on the to-be-processed image based on the candidate target, remove the background part of the candidate target in the to-be-processed image to obtain a segmented region image; Perform brightness adjustment on the segmented region image based on the preset brightness value to obtain an adjusted image; Input the adjusted image into a trained feature extraction model to obtain the first feature of the candidate target in the to-be-processed image output by the feature extraction model; Perform cropping on the to-be-processed image based on the candidate target to obtain a to-be-processed region image, and the to-be-processed region image includes the candidate target; Input the to-be-processed region image into a trained feature extraction model to obtain the second feature of the candidate target in the to-be-processed image output by the feature extraction model; The to-be-matched feature includes a first to-be-matched feature and a second to-be-matched feature, the first to-be-matched feature is determined based on the first feature of the tracking target in the scene image before the to-be-processed image, and the second to-be-matched feature is determined based on the second feature of the tracking target in the scene image before the to-be-processed image; The determining the tracking target among the candidate targets based on the target features of each candidate target in the to-be-processed image and the to-be-matched feature corresponding to the tracking target includes: Match the second to-be-matched feature corresponding to the tracking target with the second features corresponding to each candidate target respectively; When the matching result meets the preset condition, the candidate target with the highest matching degree is obtained as the tracking target, where the preset condition is that the matching degree between the second feature corresponding to the candidate target and the second to-be-matched feature corresponding to the tracking target is higher than the preset matching degree threshold; When the matching result does not meet the preset condition, the first to-be-matched feature corresponding to the tracking target is respectively matched with the first features corresponding to each candidate target to determine the tracking target.
5. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the target tracking method according to any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the target tracking method according to any one of claims 1 to 3.
7. A computer program product comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the target tracking method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Target tracking method and device, equipment and storage medium
CN114708533A
Image strong light inhibition method and system
CN119136064A