A gimbal rotation rear target identity maintaining and event gating method
By predicting the target's position and area after the PTZ rotates, and using correlation thresholds and scores to determine the validity of candidates, the problem of maintaining target identity and event gating after PTZ rotation is solved, achieving accurate updating of target data and continuity of video sessions.
Patent Information
- Application Number
- CN202611636641.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-22
- Publication Date
- 2026-11-20
AI Technical Summary
After the pan-tilt unit rotates, the changes in the camera's field of view and image coordinates cause the original target person to be incorrectly associated with other candidates, leading to pan-tilt unit tracking errors, target data update errors, and inconsistencies in the target person in the video session.
By recording PTZ control commands and target snapshots before rotation, the system predicts the position and area after rotation. It uses association thresholds and association scores to determine the validity of candidate personnel, ensuring that the target identity is maintained. When the association is invalid, it restricts candidate personnel from taking over PTZ correction and updating target data, thus maintaining the continuity of the video session.
It effectively narrowed the search range for target re-association, reduced the possibility of mis-associating people with similar appearances and under short-term occlusion, maintained the continuous association between target people and events, and avoided the transmission of erroneous data and inconsistencies in video sessions.
Smart Images

Figure CN123142178A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent video surveillance and image processing technology, and in particular to a method for maintaining target identity and gating events after pan-tilt-zoom rotation. Background Technology
[0002] With the development of image recognition, target tracking, and PTZ control technologies, camera equipment with automatic tracking capabilities has been widely used in scenarios such as personnel management, security monitoring, and remote surveillance. These devices typically identify target personnel through video frames and control the PTZ rotation based on the target person's position in the frame, keeping the target person within the camera's effective shooting area. When the target person is obstructed or temporarily leaves the shooting field of view, the system can also search based on the target person's historical movement and re-identify the target person using physical or identity features.
[0003] For example, Chinese invention patent application CN112119627A discloses a gimbal-based target tracking method, device, gimbal, and computer storage medium. This solution tracks the target object based on its feature model; when the target object is lost, its possible future trajectory is predicted based on the motion trajectory formed during the tracking process, and the gimbal is adjusted according to this possible trajectory. During the gimbal adjustment, the target is re-identified based on the feature model. When the target object is re-identified, tracking continues. This solution provides an implementation method for motion prediction, gimbal search, and target retrieval after target loss.
[0004] In security monitoring scenarios, the results of target re-identification are not only used to restore target tracking, but also typically serve as the basis for subsequent pan-tilt-zoom (PTZ) correction, target feature updates, evidence image acquisition, and event notification. Because the camera rotates with the PTZ, the field of view and image coordinates change before and after rotation. Simultaneously, when there are people with similar appearances, overlapping persons, or brief obstructions within the shooting area, multiple candidate persons resembling the original target may appear in the rotated image. If, in this case, a candidate person who cannot yet be uniquely identified is directly used as the original target person for PTZ control, the camera may gradually deviate from the original target person. Furthermore, if target features or event evidence are updated based on this candidate person, subsequent re-identification may continue to be affected by erroneous data.
[0005] Furthermore, even after an event notification or video session has been established, target association errors can cause discrepancies between the current video feed, evidence images, and the target person who initially triggered the event. Existing processing methods primarily focus on re-searching and recovering the target after it has been lost. They lack a comprehensive control mechanism to address how to utilize target association results to coordinate PTZ correction, target data updates, and the correspondence between target personnel and event identifiers throughout the target search, re-locking, and video session processes. Therefore, it is necessary to provide a method for maintaining target identity and gating events after PTZ rotation. This would reduce the possibility of uncertainty in candidate personnel association being transmitted to PTZ control and event processing stages, and maintain a continuous association between target personnel and corresponding events. Summary of the Invention
[0006] The purpose of this invention is to provide a target identity retention and event gating method after gimbal rotation, in order to solve the problem that when the gimbal rotation causes changes in the shooting field of view and image coordinate relationship, the original target person is easily mistakenly associated with other candidate persons, which further leads to gimbal tracking errors, incorrect updates of target data, and inconsistencies between the target person bound to the event and the target person continuously tracked in the video session.
[0007] To address the aforementioned technical problems, this invention provides a method for maintaining target identity and gating events after gimbal rotation, comprising:
[0008] Identify unregistered target personnel in the video frame, establish target and event identifiers, save the identity characteristics, location, motion status, and acquisition time of the unregistered target personnel, and form a target snapshot before rotation;
[0009] Based on the positional deviation of the target personnel, a gimbal control command is generated, and the command identifier, rotation direction, speed, expected rotation amount and expected execution time are recorded. Combined with the target snapshot before rotation, the predicted position and predicted area of the gimbal after rotation are determined.
[0010] Candidates are obtained from the predicted region of the rotated video frame. The association score is determined based on the consistency of identity features between the candidate and the target snapshot before rotation, the consistency of position between the candidate position and the predicted position, motion continuity, and temporal continuity. When there is only one candidate, the association is deemed valid when its association score reaches the association threshold. When there are multiple candidates, the association is deemed valid when the highest association score reaches the association threshold and the difference between it and the second highest association score reaches the ambiguity threshold. In other cases, the association is deemed invalid.
[0011] When the association is invalid, retain the target identifier and event identifier, do not associate candidate personnel with the target identifier, prohibit the generation of gimbal correction instructions based on candidate personnel, and prohibit the use of candidate personnel to update the target snapshot and event evidence images, and expand the search range based on the target snapshot before rotation;
[0012] When the association is valid, the candidate with the highest association score is associated with the target identifier. The gimbal is controlled according to the residual position deviation until the association is valid for multiple consecutive frames, the residual position deviation is within the preset range, and the gimbal is stable. Then, the connection is locked.
[0013] Once locked, the target image, video source, and PTZ command record are bound to the event identifier and an event notification is sent. If the association fails during the video session, the target identifier and event identifier are maintained, and the association is re-established under the original event. Before the association is re-established, the candidate is not identified as the target person corresponding to the original event.
[0014] Preferably, confirming unregistered target personnel in video frames includes: matching detected facial features with registered personnel templates; and confirming unregistered target personnel when no registered personnel are matched in multiple consecutive video frames and the same personnel trajectory is detected. The target snapshot before rotation includes facial features, human appearance features, face bounding box position, human bounding box position, direction of movement, speed of movement, and acquisition time.
[0015] Preferably, the PTZ control command is determined based on the deviation between the center position of the target person and the effective area of the image. Before sending the PTZ control command, a command identifier is configured for the PTZ control command, and the rotation direction, speed level, expected rotation amount, sending time, expected stopping time, and camera zoom status are recorded to form a PTZ command record.
[0016] Preferably, the predicted position is determined based on the target person's position before rotation, the target motion displacement corresponding to the movement speed, and the screen displacement corresponding to the gimbal control command. The predicted area is centered on the predicted position, and the range of the predicted area is determined based on the gimbal rotation calibration error, the uncertainty of the target's motion state, and the time interval after the gimbal rotation.
[0017] Preferably, the association score is determined by weighting facial feature similarity, human appearance feature similarity, distance between candidate and predicted positions, deviation between candidate movement direction and movement direction before rotation, and deviation between the time when the candidate trajectory enters the predicted area and the time when the target is expected to arrive in the predicted area. The weights for each factor are adjusted based on facial image quality, occlusion duration, and the expected rotation amount of the gimbal.
[0018] Preferably, when the association is invalid, the target person is set to a temporarily lost state while maintaining the target snapshot before rotation, and the search range is gradually expanded centered on the predicted location. If the target person is not found within the current shooting field of view, the gimbal is controlled to scan adjacent shooting fields of view based on the movement direction in the target snapshot before rotation and the gimbal command record. The gimbal control commands during the search are not determined based on the position of any candidate person.
[0019] Preferably, the determination of locking also requires that: the candidate associated with the target identifier remains the same person in multiple consecutive video frames, the clarity and size of the target image reach the corresponding threshold, and the gimbal stops rotating and remains stable for a preset duration.
[0020] Preferably, when the correlation is valid but the residual position deviation exceeds the preset position range, a new gimbal correction command is generated based on the residual position deviation, and a corresponding gimbal command record is formed. After the gimbal executes the gimbal correction command, the prediction area and correlation score are re-determined based on the newly formed gimbal command record, and a decision is made on whether to allow the next gimbal correction based on the re-determined correlation validity.
[0021] Preferably, when it is confirmed that no target personnel have been registered, an event identifier is created, and the event status corresponding to the event identifier is set to the pending lock state. After locking is determined, the event status is updated to the pending notification state, and the initial image of the unregistered target personnel, the target image after locking, the target identifier, the PTZ command sequence, the PTZ locking posture information, and the video source identifier are bound to the event identifier, and then an event notification is sent to the monitoring terminal.
[0022] Preferably, during a video session established based on a video source, the validity of the association is reassessed at preset time intervals. When the association fails, the event status corresponding to the event identifier is updated to a relocked state, the original target identifier, event identifier, and bound content are retained, and before the association is reassessed, PTZ correction and event content updates based on the position and image of any candidate are prohibited; after successful relocking, the video session continues, and after the relocking timeout, automatic PTZ correction is stopped and target confirmation information is output.
[0023] Compared with the prior art, the present invention has at least the following beneficial effects:
[0024] (1) By recording the gimbal control command and combining it with the target snapshot before rotation, the predicted position and predicted area after rotation are determined. The changes in the image caused by the rotation of the camera equipment itself are distinguished from the changes in the position caused by the movement of the target personnel, thus narrowing the search range for re-association of the target after rotation.
[0025] (2) By setting an association threshold for candidates and further using the difference between the highest association score and the second highest association score to eliminate ambiguity when there are multiple candidates, the association efficiency in a single candidate scenario and the identity differentiation ability in a multi-candidate scenario are taken into account, reducing the possibility of mis-association of identities in cases of similar appearance, personnel overlap and short-term occlusion.
[0026] (3) When the association is invalid, the candidate is restricted from taking over the target identifier, driving the gimbal to correct the deviation, and updating the target snapshot and event evidence image, so as to avoid the continuous transmission of a single incorrect association along the gimbal control and target data update process.
[0027] (4) Event binding and notification are performed only after the target personnel meet the conditions of continuous association and location locking, and the original target identifier and event identifier are maintained during the video session, which helps to maintain the consistency between the initial target personnel, event evidence and video objects. Attached Figure Description
[0028] Figure 1 This is an overall flowchart of a target identity retention and event gating method after gimbal rotation according to the present invention;
[0029] Figure 2 This is a flowchart illustrating the process of determining the prediction area and associating candidate personnel based on the target snapshot before rotation and the gimbal command record in this invention.
[0030] Figure 3 This invention provides a state transition diagram for gating PTZ control, target data update, event binding, and video session relocking using association validity. Detailed Implementation
[0031] The technical solution of the present invention will be further described below with reference to the accompanying drawings. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Equivalent substitutions made by those skilled in the art to relevant parameters, device models, or specific algorithms without departing from the concept of the present invention are all possible implementations of the technical solution of the present invention.
[0032] Example 1
[0033] This embodiment provides a method for maintaining target identity and gating events after pan-tilt-zoom (PTZ) rotation, applied to security monitoring scenarios. The device executing this method includes an edge processing terminal, a camera, a PTZ, and a monitoring terminal. The camera is fixedly mounted relative to the PTZ's mounting surface and changes its field of view along at least one rotation direction with the PTZ. The edge processing terminal is communicatively connected to the camera, PTZ, and monitoring terminal, respectively, and is used to receive video frames, perform personnel detection and identity association, generate PTZ control commands, and send event notifications.
[0034] This embodiment uses a camera that rotates with the gimbal to complete target detection, target association, evidence image acquisition, and video conferencing. After the camera leaves its original field of view, for personnel who are not currently in the field of view, the edge processing terminal retains their trajectory before the gimbal rotates, and associates them only after the camera re-scans or the personnel re-enters the current field of view.
[0035] Combination Figure 1 This embodiment is implemented according to the following process.
[0036] I. Video frame processing and confirmation of unregistered target personnel
[0037] The edge processing terminal receives video frames captured by the camera at a preset frame rate. Let the width of the original video frame be... The height is To adapt to the personnel detection model, the original video frames were scaled proportionally and padded to fit the target area. The model input image, in this embodiment .
[0038] Scaling for:
[0039]
[0040] The horizontal and vertical fill amounts are as follows:
[0041]
[0042]
[0043] The model coordinates output by the personnel detection model are At that time, the corresponding original video frame coordinates for:
[0044]
[0045]
[0046] This eliminates the impact of image scaling and edge padding on target location calculation. The person detection model can employ a convolutional neural network or a visual transformation network with human detection capabilities; this invention does not limit the specific network structure.
[0047] For each detected person, the edge processing terminal extracts facial features and body appearance features respectively. The facial region is then scaled up after key point alignment. The pixels are then used to generate a fixed-length facial feature vector by a facial feature extraction model. Human appearance features are extracted from the image region corresponding to the human body detection box, representing at least one of the following: clothing color, clothing texture, human body contour, and body proportion.
[0048] The edge processing terminal matches facial features with locally registered personnel templates. If the facial similarity is lower than the registration matching threshold, the current person is temporarily recorded as an unregistered candidate. To avoid directly creating events due to single-frame detection errors, events are only created in consecutive frames. A non-registered target person is confirmed only when no registered person is matched within each video frame, and the detection results in each video frame belong to the same person's trajectory. In this embodiment, A value of 3 to 5 is acceptable.
[0049] After confirming that the target personnel are not registered, the edge processing terminal creates a target identifier and an event identifier. The target identifier uniquely corresponds to the target personnel during this tracking process; the event identifier is used to associate the target confirmation, PTZ control, evidence collection, event notification, and video session processes.
[0050] Simultaneously save a snapshot of the target before rotation. The snapshot of the target before rotation should include at least:
[0051] Facial features;
[0052] Human physical appearance characteristics;
[0053] Face frame position and body frame position;
[0054] Target center location;
[0055] Direction and speed of movement;
[0056] Image clarity;
[0057] Data collection time;
[0058] Target identifier and event identifier.
[0059] The target's speed can be determined based on continuous The change in the target center position within each video frame is determined. Let the first... The target center location in each video frame is The corresponding collection time is The target velocity can then be calculated as the average of the differences between adjacent positions:
[0060]
[0061] In other implementations, a Kalman filter or other motion estimation methods can be used to obtain the target velocity and direction of motion.
[0062] II. Generation and recording of PTZ control commands
[0063] Based on the central location of the target personnel The reference position of the effective area of the image is The normalized positional deviation of the target personnel relative to the reference position is:
[0064]
[0065]
[0066] The effective area of the screen can be a rectangular area centered on the screen's center, or an offset area set according to monitoring requirements. The preset dead zone refers to the allowable positional deviation range set based on the reference position of the effective area of the screen. It is used to prevent frequent reciprocating rotation of the pan-tilt unit (PTZ) when the target person moves slightly near the reference position. The preset dead zone is determined by the positional deviation threshold in the corresponding rotation direction. For PTZ units that only support horizontal rotation, the preset dead zone is limited by the horizontal positional deviation threshold; for PTZ units that support both horizontal and vertical rotation, the preset dead zone is limited by the horizontal and vertical positional deviation thresholds, respectively. When the absolute value of the normalized positional deviation in any controllable direction exceeds the corresponding positional deviation threshold, it is determined that the positional deviation exceeds the preset dead zone. The edge processing terminal generates PTZ control commands based on the deviation direction and magnitude.
[0067] In the embodiment where only horizontal rotation is performed, according to Determine whether to turn left, right, or stop; in embodiments that support horizontal and pitch rotation, according to and Determine the control values for the horizontal and pitch directions respectively.
[0068] The gimbal speed can be controlled in segments. For example, the first speed level can be used when the absolute value of the deviation is within the first deviation range, the second speed level when it is within the second deviation range, and the third speed level when it exceeds the second deviation range. The command duration can be determined based on the absolute value of the deviation and limited to the minimum and maximum duration allowed by the gimbal.
[0069] Before sending each PTZ control command, configure a unique command identifier for the command and record the following command information:
[0070] Instruction identifier;
[0071] Rotation direction;
[0072] Speed rating or speed code;
[0073] Command sending time;
[0074] Expected execution time;
[0075] Expected stopping time;
[0076] Expected rotation amount;
[0077] Camera zoom mode;
[0078] The target center position before the command is sent;
[0079] The target's motion state before the command is sent.
[0080] The above information constitutes the PTZ command record. When multiple PTZ control commands are sent consecutively, the PTZ command records are arranged in the order of transmission to form a PTZ command sequence.
[0081] Before deployment, the relationship between gimbal control commands and image displacement was calibrated. Specifically, under different rotation directions, speed levels, command durations, and zoom levels, the gimbal was controlled to capture images of a fixed calibration target. The changes in the image coordinates of the calibration target before and after rotation were recorded, establishing the correspondence between gimbal command parameters and image displacement.
[0082] During the calibration process of gimbal control commands and image displacement, a set of parameter combinations—rotation direction, speed level, command duration, and zoom state—along with the corresponding measured image displacement, is used as a calibration sampling point. Multiple calibration sampling points constitute the calibration data between gimbal command parameters and image displacement. For gimbal command parameters whose parameter combinations are not completely consistent with existing calibration sampling points, adjacent calibration sampling points can be selected from the calibration data with the same rotation direction and zoom state, and the corresponding image displacement can be determined through interpolation. The same gimbal command is repeatedly executed, and the gimbal rotation calibration error is determined based on the dispersion between multiple image displacements.
[0083] III. Determination of Predicted Position and Predicted Area after Rotation
[0084] like Figure 2 As shown, the target position after the gimbal rotates is affected by both the movement of the target person and the change in the camera's shooting direction. Therefore, this embodiment does not directly use the image coordinates before rotation, but predicts the target person's position in the video frame after rotation based on the target snapshot before rotation and the gimbal command sequence.
[0085] Let the position of the target center before rotation be... The target's speed is The time interval from the target snapshot capture time to the current video frame capture time is , No. The calibration screen displacement corresponding to each PTZ control command is The predicted position after rotation is:
[0086]
[0087] in, This represents the number of gimbal control commands executed during this round of gimbal rotation. The direction symbol is determined by the calibration results and is used to characterize the change in the position of the target image caused by the rotation of the camera.
[0088] To accommodate gimbal stopping errors, target velocity estimation errors, and video frame acquisition delays, this embodiment establishes a prediction region centered on the predicted location. The uncertainty matrix of the predicted location is:
[0089]
[0090] in, The detection error matrix for the target position before rotation; Estimate the error matrix for the target velocity; For the first The calibration error matrix corresponding to each gimbal control command.
[0091] The prediction region can be an elliptical region, satisfying the following:
[0092]
[0093] in, For any location within the prediction area; These are the control parameters for the area range. The greater the gimbal rotation, the longer the target loss time, or the greater the calibration error, the larger the prediction area will be.
[0094] In implementations that do not employ matrix calculations, the horizontal and vertical search radii can be calculated based on the calibration error, target velocity error, and time interval, and a rectangular prediction area can be established with the predicted position as the center.
[0095] IV. Candidate Acquisition and Related Score Calculation
[0096] After the gimbal rotates, the edge processing terminal acquires one or more candidate figures from the prediction region of the current video frame. For each candidate figure, facial features, body appearance features, candidate position, movement speed, and acquisition time are extracted and compared with the target snapshot before rotation.
[0097] No. The correlation score of each candidate Determined according to the following formula:
[0098]
[0099] in, Consistency of facial features; For the consistency of human appearance characteristics; To ensure positional consistency between candidate and predicted positions; For the continuity of motion; For time continuity; These are the weights of the corresponding components, and each weight is greater than or equal to 0, and satisfies the following:
[0100]
[0101] The consistency of facial features and the consistency of human appearance features can be determined based on the cosine similarity between feature vectors and normalized to the range of 0 to 1.
[0102] Positional consistency can be determined by the following formula:
[0103]
[0104] in For the first The central position of each candidate.
[0105] The continuity of motion can be determined by the following formula:
[0106]
[0107] in, The candidate's movement speed; These are the parameters for controlling motion speed deviation.
[0108] Temporal continuity is determined based on the deviation between the time when the candidate's trajectory enters the predicted area and the time when the target is expected to arrive in the predicted area:
[0109]
[0110] in, For the first The moment when the trajectory of each candidate first enters the prediction area; The estimated time when the target will arrive at the predicted area is determined based on the target's motion state before rotation and the gimbal command records. This is the time decay parameter.
[0111] The weights can be dynamically adjusted based on the current image conditions. When the candidate's face is clear and unobstructed, the weight of facial feature consistency is increased; when the face is invisible or its clarity is below the threshold, the weight of facial feature consistency is set to 0, and the remaining weights are renormalized; when the duration of occlusion increases, the weights of positional consistency and motion continuity are decreased, while the weight of human appearance feature consistency is increased; when the expected rotation of the gimbal increases, the weight of positional consistency is appropriately decreased to reduce the impact of gimbal calibration error on the correlation results.
[0112] As an example of feasible parameters, under normal image conditions, the following settings can be used:
[0113]
[0114] The parameters mentioned above are for implementation purposes only. In actual use, they can be calibrated according to the camera resolution, installation location, target distance, and on-site personnel density.
[0115] V. Determination of the validity of association
[0116] The edge processing terminal sorts the candidates from highest to lowest according to their association scores.
[0117] If no candidate is obtained, the association is deemed invalid.
[0118] When only one candidate is obtained, if the candidate's association score reaches the association threshold, the association is considered valid; otherwise, the association is considered invalid.
[0119] When obtaining multiple candidates, the highest correlation score is recorded as . The second-highest correlation score is denoted as The association is considered valid only if the following conditions are met simultaneously:
[0120]
[0121]
[0122] in, This is the correlation threshold, used to limit the absolute degree of match between the candidate and the original target person; This is the ambiguity threshold, used to limit the degree of distinction between the highest and second-highest association scores.
[0123] In this embodiment, It can be taken as 0.72 to 0.85. The threshold can be between 0.08 and 0.15. The specific threshold can be adjusted based on the cost of mismatches and the time required for re-searching.
[0124] VI. Identity Preservation and Extended Search When Association is Invalid
[0125] like Figure 3 As shown, when the association is invalid, the edge processing terminal sets the target person to a temporarily lost state and performs the following controls:
[0126] Keep the original target identifier and event identifier unchanged, and do not assign the original target identifier to any candidate.
[0127] Keep the target snapshot unchanged before rotation, and do not update the target snapshot using the facial features, human appearance features, or motion state of any candidate;
[0128] Keep the event evidence images unchanged and do not replace the initial evidence images with images of any candidate personnel;
[0129] It is prohibited to generate gimbal correction commands based on the position of any candidate personnel, to prevent ambiguous candidates from taking over gimbal control.
[0130] If the association fails, the search range is expanded incrementally from the original predicted location. For example, the search range is expanded sequentially by 1.5 times, 2 times, and 3 times the initial predicted area. Each time the search range is expanded, personnel detection and association score calculation are re-executed.
[0131] If no relevant and valid candidate personnel are obtained within the current shooting field of view, the gimbal is controlled to scan adjacent shooting fields of view based on the movement direction in the target snapshot before rotation and the executed gimbal command sequence. This scanning command is determined by the movement state of the original target personnel and the gimbal command record, and is not determined based on the position of any ambiguous candidate personnel.
[0132] During the extended search process, the original target identifier, event identifier, and target snapshot before rotation are still used. If the original target personnel are not re-associated after the preset search time, the event status corresponding to the event identifier is updated to the target pending confirmation status, and automatic PTZ correction based on candidate personnel is stopped.
[0133] VII. Closed-loop correction and locking after effective association
[0134] When the association is valid, the candidate with the highest association score is associated with the original target identifier. The residual positional deviation between the center position of this candidate and the reference position of the valid area of the image is calculated.
[0135] When the residual position deviation exceeds the preset position range, a new gimbal correction command is generated based on the residual position deviation, and a new command identifier is configured for the new gimbal correction command. After the gimbal executes the correction command, the predicted position and predicted area are determined again based on the new gimbal command record and the current target motion state, and the candidate personnel association is re-executed.
[0136] This forms the following closed loop:
[0137] The target association is valid;
[0138] Generate gimbal correction instructions based on the confirmed candidate's location;
[0139] Record the gimbal correction commands;
[0140] The target position is re-predicted after the gimbal rotates.
[0141] Recalculate the candidate's correlation score;
[0142] Whether to allow the next gimbal correction will be determined based on the new correlation validity.
[0143] If any re-association fails, immediately exit the candidate-based correction process, enter a temporary lost state, and stop using the position of the previous candidate to drive the gimbal.
[0144] This embodiment uses the following conditions being met simultaneously as the locking condition:
[0145] Candidates associated with the target identifier in continuous The same person is maintained within each video frame;
[0146] continuous The association of each video frame is effective;
[0147] The residual position deviation is within the preset position range;
[0148] The target image sharpness reaches the sharpness threshold;
[0149] The size of the target in the image reaches the target size threshold;
[0150] The target is not severely obscured;
[0151] The gimbal stops rotating and remains stable for a preset duration.
[0152] In this embodiment, The values can be 3 to 8, and the gimbal stabilization time can be 200 to 500 milliseconds. Image sharpness can be determined using the Laplacian operator response variance, and target size can be determined using the ratio of the human body bounding box area to the video frame area.
[0153] The stability of the PTZ can be determined through PTZ status feedback. If the PTZ does not provide status feedback, the background displacement between consecutive video frames can be calculated after the expected stopping time. When the background displacement is lower than the stability threshold and continues for a preset duration, the PTZ is determined to be in a stable state.
[0154] The gimbal lock attitude information is obtained from the gimbal status feedback when the gimbal provides attitude feedback; when the gimbal does not provide attitude feedback, it is estimated based on the gimbal's initial attitude and the gimbal command sequence before locking.
[0155] Once a target is identified as locked, the target snapshot can be updated using the high-quality target features identified after locking. Before the locking condition is met, event evidence images will not be replaced with candidate images that are not yet stable.
[0156] VIII. Event Binding and Notification
[0157] When it is confirmed that no target personnel have registered, the event status corresponding to the event identifier is set to "pending lock". Once locked, the event status corresponding to the event identifier is updated to "awaiting notification", and the following information is bound to the event identifier:
[0158] Original target identifier;
[0159] Initial image of an unregistered target person;
[0160] The target image after being locked;
[0161] Snapshot of the target before rotation;
[0162] This round of gimbal command sequence;
[0163] Attitude information when the gimbal is locked;
[0164] Video source identifier;
[0165] Event creation time and locking time.
[0166] After binding is complete, the edge processing terminal sends an event notification to the monitoring terminal. The event notification may include an event identifier, a target identifier, an initial image, a target image after locking, the event occurrence time, video source access information, and the target's pending processing status.
[0167] On-duty personnel can establish video sessions based on video source access information. Before sending event notifications, the edge processing terminal will not send candidate images that are in a temporarily lost state or have ambiguous associations as target images after locking.
[0168] IX. Target review and re-locking during video sessions
[0169] After a video session is established, the edge processing terminal recalculates the association validity of the current target person at preset time intervals. The preset time interval can be from 200 milliseconds to 1000 milliseconds, or it can be triggered for verification according to a preset number of video frames.
[0170] While the association remains valid during a video session, the binding relationship between the target identifier, event identifier, and video source is maintained, and PTZ correction is allowed based on the current location of the target person.
[0171] If the association fails during a video session, update the event status corresponding to the event identifier to the relocked state and perform the following processing:
[0172] Keep the original target identifier and event identifier unchanged;
[0173] Preserve the initial image, the target image after locking, and the gimbal command sequence that the event has already been bound to;
[0174] Suspend the use of candidate personnel to update event-bound content;
[0175] Generating gimbal correction instructions based on any candidate who fails the association validity check is prohibited.
[0176] The prediction area is redefined based on the original target snapshot, the most recent valid association result, and the gimbal command record, and the target association is re-executed under the original event.
[0177] After successful relocking, the original target personnel will be reassigned to the original target identifier, and the PTZ correction during the video session will be restored. No new event identifiers will be created during the relocking process.
[0178] If no effective association is obtained after the relock timeout period, the automatic PTZ correction will stop, the target confirmation information will be output to the duty terminal, and the original event identifier and the already bound event content will be retained for manual confirmation by the duty personnel.
[0179] Through the above processing, whether a candidate can drive the PTZ, update target data, and serve as the target object for event notifications and video sessions is all subject to the constraint of association validity. This prevents candidates with uncertain associations from taking over the PTZ closed loop and prevents the image and video content of incorrect candidates from overwriting the target information corresponding to the original event.
[0180] In other alternative implementations, the camera can rotate horizontally with the gimbal, or it can rotate in both horizontal and pitch directions; the gimbal control interface can use a serial communication protocol, a network control protocol, or a control interface provided by the equipment manufacturer. The aforementioned changes in hardware and communication methods do not affect the target identity preservation and event gating process.
[0181] Example 2
[0182] This embodiment provides a target identity retention and event gating method applicable to gimbals without attitude feedback. It employs an edge processing terminal running an Android operating system, a camera, a horizontally rotating gimbal, and a remote monitoring terminal. The camera is fixedly mounted on the gimbal's support surface and changes its horizontal shooting direction with the gimbal. The edge processing terminal sends control commands to the gimbal via a serial interface; the gimbal does not return the actual rotation angle or stop status.
[0183] The camera captures video frames at a resolution of 1920×1080. The edge processing terminal scales the video frames proportionally and fills them with a 600×600 model input image. After restoring the image coordinates, it obtains the person detection box, the face detection box, and the target center position. When a face is detected, the face region is aligned to 112×112 pixels and facial features are extracted; simultaneously, human appearance features are extracted based on the person detection box.
[0184] The edge processing terminal matches facial features with locally registered personnel templates. If a person's trajectory fails to match a registered person within three consecutive video frames, the person is identified as an unregistered target, a target identifier and an event identifier are created for them, and the event status corresponding to the event identifier is set to a pending lock state.
[0185] The edge processing terminal saves a snapshot of the target before rotation. This snapshot includes facial features, human appearance features, a person detection bounding box, the target's center position, horizontal movement direction, horizontal movement speed, and acquisition time. Event evidence images use the highest-resolution video frames used when confirming the absence of registered target personnel.
[0186] The horizontal center of the video frame is used as a reference position. When the horizontal deviation between the target center position and the reference position exceeds 10% of the video frame width, a horizontal pan-tilt control command is generated. A positive horizontal deviation sends a right turn command, and a negative horizontal deviation sends a left turn command. The rotation speed is divided into three levels: low speed, medium speed, and high speed, based on the absolute value of the horizontal deviation.
[0187] Each PTZ control command is configured with a unique command identifier and records the rotation direction, speed level, transmission time, expected duration, and expected stopping time. The edge processing terminal pre-establishes a calibration table between speed level, duration, and target image displacement using a fixed calibration target. For example, low-speed rotation of 200 milliseconds, medium-speed rotation of 200 milliseconds, and high-speed rotation of 200 milliseconds correspond to different average image displacements and displacement error ranges.
[0188] Since the gimbal does not return the actual posture, the edge processing terminal determines the expected screen displacement corresponding to the gimbal control command according to the calibration table, and adds the expected screen displacement, the expected movement displacement of the target person during the execution of the command, and the target position before rotation to obtain the predicted position after rotation.
[0189] A rectangular prediction area is established centered on the predicted location. The horizontal radius of the rectangular prediction area is determined based on the image displacement error, target horizontal velocity error, and gimbal command execution time from the calibration table; the vertical radius is determined based on the target detection error and the target's vertical movement range. The larger the expected image displacement error or the longer the target loss time, the larger the prediction area will be.
[0190] Upon reaching the expected stopping time, the edge processing terminal calculates the displacement of background feature points between consecutive video frames. When the average displacement of the background feature points remains below a stable threshold for 300 consecutive milliseconds, the gimbal is stopped, and candidate subjects are obtained from the prediction region of the current video frame.
[0191] For each candidate, calculate the similarity of facial features, similarity of human appearance features, positional consistency, motion continuity, and temporal continuity, and determine the association score according to the following formula:
[0192]
[0193] in, For the first The correlation score of each candidate For facial feature similarity, For similarity in human appearance features, To ensure positional consistency between candidate and predicted positions, For the continuity of motion, For time continuity.
[0194] When a candidate's face is not visible or its clarity is below the face quality threshold, the weight corresponding to the face feature similarity is set to 0, and the remaining weights are normalized according to the original ratio.
[0195] In this embodiment, the association threshold is set to 0.75, and the ambiguity threshold is set to 0.10. When only one candidate is obtained, the association is considered valid if the candidate's association score reaches 0.75. When multiple candidates are obtained, the association is considered valid only if the highest association score reaches 0.75, and the difference between the highest and second-highest association scores reaches 0.10.
[0196] To illustrate the process of determining the validity of association, assume that there are two candidates, A and B, within the prediction region, with association scores of 0.82 and 0.78, respectively. Although candidate A's association score reaches the association threshold, the difference between the two candidates' scores is 0.04, which does not reach the ambiguity threshold.
[0197] After the association is invalidated, the edge processing terminal retains the original target identifier and event identifier, does not associate candidate A or candidate B with the original target identifier, does not generate gimbal correction instructions based on the positions of the two, and does not use the features and images of the two to update the target snapshot and event evidence image.
[0198] Subsequently, the search range is expanded sequentially by 1.5 times, 2 times, and 3 times the original predicted area, centered on the predicted location. If no effective correlation is obtained within the current field of view, the gimbal is controlled to scan adjacent fields of view based on the horizontal movement direction of the target personnel before rotation. The scanning command is generated only based on the original target movement state and the executed gimbal command records, and not based on the position of candidate A or candidate B.
[0199] In another video frame, assuming that the association scores of candidate A and candidate B are 0.86 and 0.68 respectively, the highest association score reaches the association threshold, and the difference between the two scores is 0.18, which reaches the ambiguity threshold. Therefore, it is determined that candidate A is effectively associated with the original target person, and candidate A is associated with the original target identifier.
[0200] The edge processing terminal generates a new PTZ correction command based on the candidate A's residual positional deviation relative to the center of the image, and configures a new command identifier for the new PTZ correction command. After the PTZ executes the correction command, it re-determines the predicted position, predicted area, and correlation score. Only when the re-correlation is still effective is it allowed to continue controlling the PTZ based on the new residual positional deviation.
[0201] When candidate A is associated with 5 consecutive video frames, remains the same person in each video frame, the residual position deviation does not exceed 5% of the video frame width, the target image clarity reaches the clarity threshold, and the PTZ remains stable for 300 milliseconds, the target person is determined to be locked.
[0202] After locking, the event status corresponding to the event identifier is updated to pending notification, and the initial event evidence image, the locked target image, the target identifier, the PTZ command sequence, the PTZ locking attitude information determined according to the PTZ command sequence, and the video source identifier are bound to the event identifier. After binding is completed, an event notification containing the target image, the event occurrence time, and video source access information is sent to the monitoring terminal.
[0203] The monitoring terminal establishes a video session based on the video source access information. During the video session, the edge processing terminal re-determines the association validity every 500 milliseconds. When the association fails, the event status corresponding to the event identifier is updated to the relocked state, while retaining the original target identifier, event identifier, and already bound image and PTZ command records. The terminal does not continue to control the PTZ or update event content based on candidates who have failed the association validity determination.
[0204] After a successful re-lock, the re-identified target personnel will be reassigned to the original target identifier, and the video session will be resumed. If re-locking fails after more than 5 seconds, automatic PTZ correction will be stopped, a target confirmation message will be output to the monitoring terminal, and the original event identifier and the already bound event content will be retained.
[0205] This embodiment does not rely on the gimbal returning the actual posture. It determines the target prediction area and stable state after the gimbal rotates by jointly using the gimbal command calibration results, the expected stopping time and the background displacement of the video frame. It can implement the complete target identity preservation and event gating process on gimbal devices that only support command sending.
[0206] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit the scope of protection of the present invention. Equivalent substitutions or modifications made by those skilled in the art to specific parameters, processing order, or implementation forms based on the disclosure of the present invention, as long as they do not depart from the technical concept of the present invention, should fall within the scope of protection of the present invention.
Claims
1. A method for maintaining target identity and gating events after gimbal rotation, characterized in that, include: Identify unregistered target personnel in the video frame, establish target and event identifiers, save their identity characteristics, location, motion state, and acquisition time, and form a target snapshot before rotation; Based on the positional deviation of the target personnel, a PTZ control command is generated, and the command identifier, rotation direction, speed, expected rotation amount and expected execution time are recorded. Combined with the target snapshot before rotation, the predicted position and predicted area after rotation are determined. Candidates are obtained from the predicted region of the rotated video frame. The association score is determined based on the consistency of identity features between the candidate and the target snapshot before rotation, the consistency of position between the candidate position and the predicted position, motion continuity, and temporal continuity. When there is only one candidate, the association is deemed valid when its association score reaches the association threshold. When there are multiple candidates, the association is deemed valid when the highest association score reaches the association threshold and the difference between it and the second highest association score reaches the ambiguity threshold. In other cases, the association is deemed invalid. When the association is invalid, retain the target identifier and event identifier, do not associate candidate personnel with the target identifier, prohibit the generation of gimbal correction instructions based on candidate personnel, and prohibit the use of candidate personnel to update the target snapshot and event evidence images, and expand the search range based on the target snapshot before rotation; When the association is valid, the candidate with the highest association score is associated with the target identifier. The gimbal is controlled according to the residual position deviation until the association is valid for multiple consecutive frames, the residual position deviation is within the preset range, and the gimbal is stable. Then, the connection is locked. Once locked, the target image, video source, and PTZ command record are bound to the event identifier and an event notification is sent. If the association fails during the video session, the target identifier and event identifier are maintained, and the association is re-established under the original event. Before the association is re-established, the candidate is not identified as the target person corresponding to the original event.
2. The method according to claim 1, characterized in that, The process of confirming unregistered target personnel in video frames includes: matching detected facial features with a registered personnel template; and confirming the unregistered target personnel when no registered personnel are matched in multiple consecutive video frames and the same personnel trajectory is detected. The target snapshot before rotation includes facial features, human appearance features, facial bounding box position, human bounding box position, direction of movement, speed of movement, and acquisition time.
3. The method according to claim 1, characterized in that, The gimbal control command is determined based on the deviation between the center position of the target person and the effective area of the screen. Before the gimbal control command is sent, a command identifier is configured for it, and the rotation direction, speed level, expected rotation amount, sending time, expected stopping time and camera zoom status are recorded to form the gimbal command record.
4. The method according to claim 3, characterized in that, The predicted position is determined based on the position of the target person before rotation, the target motion displacement corresponding to the movement speed, and the screen displacement corresponding to the gimbal control command; the predicted area is centered on the predicted position, and its range is determined based on the gimbal rotation calibration error, the uncertainty of the target motion state, and the time interval after the gimbal rotation.
5. The method according to claim 4, characterized in that, The correlation score is determined by weighting facial feature similarity, human appearance feature similarity, distance between candidate position and predicted position, deviation between candidate movement direction and movement direction before rotation, and deviation between the time when the candidate trajectory enters the predicted area and the time when the target is expected to arrive at the predicted area; each weight is adjusted according to facial image quality, occlusion duration and gimbal rotation amount.
6. The method according to claim 5, characterized in that, When the association is invalid, the target person is set to a temporarily lost state and the target snapshot before rotation remains unchanged. The search range is gradually expanded with the predicted position as the center. If the target person is not found in the current shooting field of view, the gimbal is controlled to scan the adjacent shooting field of view based on the movement direction in the target snapshot before rotation and the gimbal command record. The gimbal control command during the search is not determined based on the position of any candidate person.
7. The method according to claim 1, characterized in that, The determination and locking also require that: the candidate associated with the target identifier remains the same person in multiple consecutive video frames, the clarity and size of the target image reach the corresponding threshold, and the gimbal stops rotating and remains stable for a preset duration.
8. The method according to claim 3, characterized in that, When the association is valid but the residual position deviation exceeds the preset position range, a new gimbal correction command is generated based on the residual position deviation, and a corresponding gimbal command record is formed. After the gimbal executes the gimbal correction command, the prediction area and association score are re-determined based on the newly formed gimbal command record, and a decision is made on whether to allow the next gimbal correction based on the re-determined association validity.
9. The method according to claim 1, characterized in that, When it is confirmed that no target personnel have been registered, an event identifier is created and the event status corresponding to the event identifier is set to the pending lock status. After the lock is determined, the event status is updated to the pending notification status, and the initial image of the unregistered target personnel, the target image after locking, the target identifier, the PTZ command sequence, the PTZ lock posture information and the video source identifier are bound to the event identifier. Then, an event notification is sent to the duty terminal.
10. The method according to claim 9, characterized in that, During a video session established based on the video source, the association validity is re-determined at preset time intervals. When the association fails, the event status corresponding to the event identifier is updated to the relocked state, the original target identifier, event identifier and bound content are retained, and before the association is re-determined to be valid, the PTZ correction and event content update are prohibited based on the position and image of any candidate. After the relock is successfully completed, the video session continues. After the relock timeout, the automatic PTZ correction stops and the target confirmation information is output.
Citation Information
Patent Citations
Holder-based target following method and device, holder and computer storage medium
CN112119627A
