A method for detecting a resident target, an electronic device, a medium and a program product
Patent Information
- Application Number
- CN202510552443.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2026-10-30
AI Technical Summary
但是,部分场所受保密协议要求,内外网数据不流通,保存常驻目标特定部位的数据信息的内网与收集目标抓拍图片的外网之间无法进行数据交互
[0019]本申请实施例的技术方案,通过在对场景中的目标持续进行图像采集的过程中,对图像帧进行积累,根据积累的各图像帧中同一目标出现的位置,确定目标在每一次移动过程中的移动距离,得到目标的移动距离序列,通过移动距离序列体现出目标的移动规律,结合预先确定的常驻目标的移动距离序列特征,确定该目标的移动距离序列特征是否满足常驻目标的移动距离序列特征,从而确定该目标是否为常驻目标,在无需提前存储常驻目标的特征信息的情况下,直接对场景中目标进行检测的过程中即可以准确地确定常驻目标,避免了因环境光照角度等因素影响导致目标的特征与预存常驻目标的特征信息匹配准确度低得到的问题,并且不受内网外网信息不互通无法获取常驻目标的特征信息的限制。
Smart Images

Figure CN123016315A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resident target detection technology, and in particular to a resident target detection method, electronic device, medium and program product. Background Technology
[0002] In modern commerce, service industries, and transportation, efficient queue management is crucial for improving customer experience and operational efficiency. In various public settings such as shopping malls, train stations, banks, airports, supermarkets, and tourist attractions, accurate queue length estimation helps manage queue length, enabling dynamic allocation of service windows and rational scheduling of queuing personnel. This ensures the rational allocation of resources, reduces customer waiting time, and improves service satisfaction. However, in practical applications, there are permanent targets, such as security personnel and service guides. These individuals are constantly present in the scene, meaning that moving targets do not accurately represent the queueing target. This significantly impacts the estimation of the actual queueing target and queue length. Eliminating the interference of permanent targets is becoming a major direction for optimizing queue management in real-world scenarios.
[0003] The current solution involves creating a database of resident targets and recording data on their specific body parts. In real-world scenarios, images of targets are matched against the corresponding information in the database, marking the target as a resident target. This resident target is then skipped when the queuing progress is estimated based on the queue of other targets. However, due to confidentiality agreements, data cannot flow between internal and external networks in some locations. The internal network storing data on specific body parts of resident targets cannot interact with the external network collecting captured images. Furthermore, factors such as lighting and angle can cause mismatches between the data on specific body parts recorded in the database and captured images of resident targets in real-world scenarios. Summary of the Invention
[0004] This application provides a resident target detection method, electronic device, medium, and program product that can accurately locate resident targets in real-time detection without prior knowledge.
[0005] According to one aspect of this application, a method for detecting resident targets is provided, the method comprising:
[0006] The image acquisition device continuously acquires images of targets within the scene, resulting in accumulated image frames;
[0007] For the same target, each image frame is traversed to detect the movement distance of the target's position in the current image frame relative to its position in the previous image frame, and the movement distance sequence corresponding to the target is determined.
[0008] Based on the movement distance sequence of each target and the movement distance sequence characteristics of resident targets, the resident targets in the scenario are determined.
[0009] According to one aspect of this application, a resident target detection device is provided, the device comprising:
[0010] The image frame acquisition module is used to continuously acquire images of targets within the scene through an image acquisition device, thereby obtaining accumulated image frames;
[0011] The movement distance sequence determination module is used to detect the movement distance of the target in the current image frame relative to the position in the previous image frame, and determine the movement distance sequence corresponding to the target, for the same target;
[0012] The resident target determination module is used to determine the resident targets in the scene based on the movement distance sequence of each target and the movement distance sequence characteristics of the resident targets.
[0013] According to another aspect of this application, an electronic device is provided, the electronic device comprising:
[0014] At least one processor; and
[0015] A memory that is communicatively connected to at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by at least one processor, such that the at least one processor is able to perform the resident target detection method of any embodiment of this application.
[0017] According to another aspect of this application, a computer-readable storage medium is provided, which stores computer instructions for causing a processor to execute and implement the resident target detection method of any embodiment of this application.
[0018] According to another aspect of this application, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the resident target detection method of any embodiment of this application.
[0019] The technical solution of this application embodiment accumulates image frames during the continuous image acquisition of targets in the scene. Based on the position of the same target in each accumulated image frame, the moving distance of the target in each movement process is determined, resulting in a target moving distance sequence. The moving distance sequence reflects the movement pattern of the target. Combined with the pre-determined moving distance sequence characteristics of permanent targets, it is determined whether the moving distance sequence characteristics of the target satisfy the moving distance sequence characteristics of permanent targets, thereby determining whether the target is a permanent target. Without the need to store the feature information of permanent targets in advance, permanent targets can be accurately identified directly during the detection of targets in the scene. This avoids the problem of low matching accuracy between the target features and the pre-stored feature information of permanent targets due to factors such as ambient lighting angle. Furthermore, it is not limited by the inability to obtain the feature information of permanent targets due to the lack of communication between internal and external networks.
[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 A flowchart of a resident target detection method provided in an embodiment of this application;
[0023] Figure 2 A flowchart of a resident target detection method is provided in another embodiment of this application;
[0024] Figure 3 A schematic diagram illustrating the frequency distribution characteristics of the movement distance provided in another embodiment of this application;
[0025] Figure 4 A flowchart of a resident target detection method is provided in another embodiment of this application;
[0026] Figure 5 A flowchart of a specific implementation method provided in another embodiment of this application;
[0027] Figure 6 This is a schematic diagram of the structure of a resident target detection device provided in an embodiment of this application;
[0028] Figure 7This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0029] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0030] It should be noted that the terms "first," "second," "third," "fourth," "actual," "preset," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0031] Figure 1 This is a flowchart illustrating a persistent target detection method provided in an embodiment of this application. This embodiment is applicable to determining persistent targets in queuing process monitoring scenarios. The method can be executed by a persistent target detection device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 As shown, the method includes:
[0032] S110. The image acquisition device continuously acquires images of targets within the scene to obtain accumulated image frames.
[0033] Among them, the image acquisition device can be a monitoring device set up in the scene, used to acquire images of targets in the scene.
[0034] In this embodiment, since the queuing scenario is constantly changing, it is necessary to monitor the real-time changes in the queuing. Therefore, an image acquisition device is required to continuously acquire images of targets within the scene, accumulating multiple image frames. This allows the movement of targets over time to be reflected based on changes in target positions across multiple image frames. In practical applications, multiple targets may exist in the scene, and multiple targets may be present in each image frame. For each image frame, targets can be identified and distinguished, and the same target can be detected. This allows for tracking of the same target's position across different image frames, thus determining the target's movement.
[0035] Specifically, in the process of detecting and tracking the same target, starting from the first image frame, the system traverses two adjacent image frames, performs target detection on each frame to determine the target's region, extracts the target's image features from the target region, matches the image features in the two image frames, and identifies the successfully matched targets as the same target. The movement of the target is then determined based on the position of the same target in adjacent image frames. Targets whose image features did not match successfully in the next image frame are treated as incremental targets, and matching and tracking continue in subsequent image frames. Targets whose image features did not match successfully in the previous image frame are treated as disappeared targets. For example, when the image acquisition device acquires the first image frame, it detects each target in the first image frame, determines each target region, extracts features from each target region, and determines the image features of each target. Then, for the second image frame, it detects each target, determines each target region, extracts feature values from each target region, and determines the image features of each target. The image features of the targets in the second image frame are matched with the image features of the targets in the first image frame, and the successfully matched targets are treated as the same target. The movement of the target is then determined based on its position in the first and second image frames. The targets corresponding to unmatched image features in the second image frame are used as incremental targets. If the incremental target appears in subsequent image frames, its motion is tracked. Targets corresponding to unmatched image features in the first image frame are identified as disappeared targets. The same process is applied to subsequent image frames, matching image features with previous frames to track the motion of the same target. The advantage of this scheme is that it can identify the same target in different image frames based on image feature matching, solving the problem that the current scheme is only applicable to face matching and not to body matching.
[0036] S120. For the same target, traverse each image frame to detect the movement distance of the target's position in the currently traversed image frame relative to its position in the previous image frame, and determine the movement distance sequence corresponding to the target.
[0037] In this process, a certain number of image frames need to be accumulated, meaning the image acquisition duration needs to reach a certain time, in order to demonstrate the target's motion within the accumulated image frames. If the number of image frames is insufficient, the target may not exhibit motion. In such cases, the steps of this embodiment can be executed once a certain number of image frames have been accumulated. Alternatively, the steps of this embodiment can be executed after each acquired image frame.
[0038] In the accumulated image frames, the same target in each image frame is identified. For the same target, its position in each image frame containing it, and its movement distance in each adjacent image frame, are recorded. In a group of image frames where the same target is continuously present, the position of the target in adjacent image frames determines the movement distance of the target. Multiple image frames can determine multiple movement distances, which can be arranged into a movement distance sequence based on the time dimension. For at least two non-contiguous image frame groups containing the same target, at least two movement distance sequences can be detected. The movement distance sequences corresponding to each target can be aligned in the time dimension to analyze the distribution characteristics of the movement distance sequences in the time dimension, or they can be unaligned and analyzed based on the magnitude and frequency of the specific movement distance values, which can be adaptively determined.
[0039] S130. Based on the movement distance sequence of each target and the movement distance sequence characteristics of the resident targets, determine the resident targets in the scenario.
[0040] For example, the movement distance sequence characteristics of resident targets and queued targets are different. In the time dimension, resident targets are mostly located in the same position with little movement. At certain times, when targets in other locations have service needs, resident targets will move to that location and return to their original position after a certain period. Queued targets, on the other hand, generally move with the queue, exhibiting intermittent movement patterns of moving-stopping-moving-stopping. Therefore, the movement distance sequences of resident targets and queued targets show different characteristics. Based on this, resident targets in a scene can be identified according to their movement distance sequences and the movement distance sequence characteristics of resident targets.
[0041] Specifically, statistical calculations and other processing can be performed on the target's movement distance sequence to determine its movement distance sequence characteristics. These characteristics are then compared with those of resident targets to determine if the target's movement distance characteristics match those of resident targets, thus identifying whether the target is a resident target. This scheme objectively and accurately identifies the distinguishing features between resident and queued targets based on the differences in their movement distance sequences. In actual detection, the characteristics of the target's movement distance sequence, along with the features of resident targets that differ from those of queued targets, determine whether a target is a resident target. This eliminates the need for pre-stored image features of each resident target, avoiding the problem of low matching accuracy due to different acquisition environments. It also avoids limitations imposed by the lack of information exchange between internal and external networks, improving the accuracy of resident target detection and its versatility across different scenarios.
[0042] The technical solution of this application embodiment accumulates image frames during the continuous image acquisition of targets in the scene. Based on the position of the same target in each accumulated image frame, the moving distance of the target in each movement process is determined, resulting in a target moving distance sequence. The moving distance sequence reflects the movement pattern of the target. Combined with the pre-determined moving distance sequence characteristics of permanent targets, it is determined whether the moving distance sequence characteristics of the target satisfy the moving distance sequence characteristics of permanent targets, thereby determining whether the target is a permanent target. Without the need to store the feature information of permanent targets in advance, permanent targets can be accurately identified directly during the detection of targets in the scene. This avoids the problem of low matching accuracy between the target features and the pre-stored feature information of permanent targets due to factors such as ambient lighting angle. Furthermore, it is not limited by the inability to obtain the feature information of permanent targets due to the lack of communication between internal and external networks.
[0043] Figure 2 This is a flowchart illustrating a persistent target detection method according to another embodiment of this application. This embodiment is an optimization based on the above embodiment; schemes not described in detail in this embodiment are described in the above embodiment. Figure 2 As shown, the method in this embodiment of the application specifically includes the following steps:
[0044] S210. The image acquisition device continuously acquires images of targets within the scene to obtain accumulated image frames.
[0045] S220. For the same target, traverse each image frame to detect the movement distance of the target's position in the currently traversed image frame relative to its position in the previous image frame, and determine the movement distance sequence corresponding to the target.
[0046] S230. For the same target, determine the movement distance sequence characteristics of the target based on the mathematical and statistical calculation results of the movement distance sequence of the target.
[0047] For example, for the same target, mathematical statistical calculations are performed on the target's movement distance sequence to summarize the statistical patterns of the movement distance sequence. Based on the results of the mathematical statistical calculations, the characteristics of the target's movement distance sequence are determined. The above operation is performed for each target to determine whether each target is a resident target.
[0048] Specifically, the process of mathematical statistical calculation can include statistical calculations of specific movement distance values in the movement distance sequence, such as summation, averaging, standard deviation, and variance. It can also be the calculation results of statistical patterns in the movement distance values over time or in terms of frequency of occurrence. In the mathematical statistical calculation methods described above, the results for resident targets differ from those for queued targets.
[0049] In this embodiment of the application, the characteristics of the target's movement distance sequence are determined based on the mathematical and statistical calculation results of the target's movement distance sequence, including:
[0050] At least one of the following is determined as the target's average moving distance, the target's moving distance distribution characteristics over time, and the target's moving distance frequency distribution characteristics, as the target's moving distance sequence characteristics; wherein, the target's average moving distance includes the sum of all moving distances detected for the same target during the traversal process, and the ratio of any one of the following: number of moves, number of image frames, and duration of image acquisition.
[0051] For example, for a sequence of movement distances of the same target, the average of all movement distances can be calculated to obtain the target's average movement distance, which serves as a feature of the movement distance sequence. The target's average movement distance can be the ratio of the sum of all movement distances of the same target to the number of movements. In the accumulated image frames, if the target's position changes in adjacent image frames, it is counted as one movement; if the target's position does not change in adjacent image frames, it is not counted as a movement. During the process of traversing each image frame to determine whether the target's position has changed in adjacent image frames, the number of movements is accumulated to obtain the target's movement count. The target's average movement distance can also be the ratio of the sum of all movement distances of the target to the number of image frames, reflecting the average movement distance in the dimension of the number of image acquisitions during the image acquisition process. The target's average movement distance can also be the ratio of the sum of all movement distances of the target to the image acquisition duration, reflecting the target's average movement distance in the time dimension.
[0052] For example, for a sequence of movement distances to the same target, the distribution of all movement distances over time can be calculated to obtain a movement distance distribution feature, which serves as a movement distance sequence feature. Specifically, the distribution of movement distances over time can be the continuous duration of a certain movement distance value. For example, the duration when the movement distance is 0 and the duration when the movement distance is non-zero. The distribution position of the duration corresponding to the movement distance of 0 and the duration when the movement distance is non-zero across the entire time axis corresponding to the accumulated image frames is used as the movement distance distribution feature of the target over time, which serves as a movement distance sequence feature.
[0053] For example, for a sequence of movement distances to the same target, the frequency distribution characteristic of all movement distances can be calculated as a feature of the movement distance sequence. Specifically, for the same movement distance value in the movement distance sequence, the number of times that value appears is counted, and the frequency distribution characteristic of each different movement distance value is determined. For example, if the movement distance sequence contains 10 movement distances, the movement distance 0 appears 7 times, the movement distance 4 meters appears 2 times, and the movement distance 6 meters appears 1 time.
[0054] S240. Based on the movement distance sequence characteristics of the target and the movement distance sequence characteristics of the resident target, determine the resident target in the scene.
[0055] For example, the movement distance sequence characteristics of resident targets and queued targets are generally different. Based on the difference in movement distance sequence characteristics, resident targets within the scene can be identified. The movement distance sequence characteristics of resident targets can be predetermined. The movement distance sequence characteristics of the target can be compared with those of resident targets to determine whether the target's movement distance sequence characteristics match those of resident targets. If they match, the target in the scene is determined to be a resident target; otherwise, it is determined not to be a resident target. Specifically, determining whether the movement distance sequence characteristics of the target match those of resident targets can be done by comparing whether at least one of the target's movement distance sequence characteristics completely matches the movement distance sequence characteristics of the corresponding resident target, or by comparing whether the difference between at least one parameter value in the target's movement distance sequence characteristics and at least one parameter value in the resident target's movement distance sequence characteristics is less than a preset difference.
[0056] In this embodiment of the application, if the movement distance sequence characteristics of the target satisfy at least one of the following, then the movement distance sequence characteristics of the target are determined to conform to the movement distance sequence characteristics of a resident target, and the target is determined to be a resident target:
[0057] The average movement distance of the target is less than a preset average movement distance; wherein, the preset average movement distance is less than or equal to the average of the average movement distances of all targets.
[0058] The distribution characteristics of the target's movement distance over time are as follows: movement distances less than a lower threshold have temporal continuity, and movement distances greater than or equal to the lower threshold have temporal continuity; wherein, the difference between the lower threshold and zero is less than a preset threshold.
[0059] The frequency distribution characteristic of the target's movement distance is that the frequency of movement distances less than the lower threshold is higher than the first preset frequency threshold.
[0060] The number of times the movement distance exceeds the upper limit threshold is higher than the second preset frequency threshold; wherein, the upper limit threshold is greater than or equal to the preset average movement distance.
[0061] For example, during the image acquisition period, resident targets typically remain in a fixed position for extended periods, with a movement distance of 0. When targets in other locations require service, resident targets will move to those locations, involving some movement distance, but the overall movement distance of 0 exceeds a preset proportion. Queuing personnel, on the other hand, generally move with the queue, alternating between moving and stopping, and do not remain in a fixed position for extended periods; therefore, their movement distance is more often not 0. Based on these characteristics of resident and queuing targets, it can be determined that the average movement distance of resident targets is generally less than a preset average movement distance. The preset average movement distance can be less than or equal to the average of the average movement distances of all targets, reflecting that the average movement distance of resident targets is less than the average movement distance of all targets, including both resident and queuing targets.
[0062] For example, during the image acquisition period, a resident target typically remains stationed at a fixed location. When other targets in different locations require service, the resident target will move to those locations to provide service, and then return to its fixed location after a certain period. When the target remains stationary at the fixed location, a movement distance less than a lower threshold is considered to have temporal continuity. Similarly, a movement distance close to zero (where the difference between the lower threshold and zero is less than a preset threshold) is also considered to have temporal continuity. Conversely, a movement distance greater than or equal to the lower threshold after a resident target moves to another location to provide service for a certain period and then returns to its fixed location is also considered to have temporal continuity. Temporal continuity can be determined by either maintaining a movement distance less than the lower threshold for a specified duration or maintaining a movement distance greater than or equal to the lower threshold for a specified duration.
[0063] For example, during the image acquisition period, resident targets generally remain in fixed positions. When targets in other locations have service needs, resident targets will move to other locations to provide services, and then return to their fixed positions after a certain period. Therefore, it can be determined that the frequency of movement distances less than the lower threshold is the highest, exceeding the first preset frequency threshold. When the difference between the lower threshold and zero is less than the preset threshold, that is, the frequency of movement distances close to zero is higher than the first preset frequency threshold. When targets in other locations have service needs, resident targets generally move quickly to other locations to provide services, while queued targets generally move slowly forward. The movement distance of resident targets each time is relatively large compared to the movement distance of queued targets. Therefore, it is necessary to detect whether the frequency of movement distances greater than the upper threshold is higher than the second preset frequency threshold. When the upper threshold is greater than or equal to the preset average movement distance, that is, to detect whether most of the target's movement distances are large. The first preset frequency threshold can be the total number of movement distances in the movement distance sequence multiplied by a first preset ratio, and the second preset frequency threshold can be the total number of movement distances in the movement distance sequence multiplied by a second preset ratio. The first and second preset ratios are generally set to values greater than 50%. A specific case of the frequency distribution of movement distances of resident targets and queued targets is as follows: Figure 3 As shown, in Figure 3 In the analysis, the movement distance of 0 for resident targets occurred most frequently, with three peaks appearing at larger movement distance values. Since the time difference between adjacent image frames is constant, movement distance and movement speed are positively correlated, reflecting that resident targets sometimes move to other locations at a relatively fast speed to provide services. The movement distance of 0 for queuing targets occurred a certain number of times, but less frequently than for resident targets. A moderate range of movement distances occurred more often, with most movement distances falling within this range, indicating that queuing targets are in a process of intermittent movement.
[0064] In this embodiment, if the target's movement distance sequence characteristics satisfy at least one of the above conditions, then the target's movement distance sequence characteristics are determined to conform to the movement distance sequence characteristics of a resident target, and the target is determined to be a resident target. In one specific implementation, it can be first determined whether the target's average movement distance is less than a preset average movement distance. If so, it can be determined whether the frequency distribution characteristics of the target's movement distance are such that the frequency of movement distances less than a lower threshold is higher than a first preset frequency threshold, and the total number of movement distances greater than an upper threshold is higher than a second preset frequency threshold. If so, the target is determined to be a resident target. For example, the lower threshold is 0, the upper threshold is the average of the average movement distances of all targets, and the first and second preset frequency thresholds are 80%. It can also be determined whether the target's average movement distance is less than a preset average movement distance. If so, it can be determined whether the number of times the target's movement distance of 0 occurs exceeds 80%, and whether the number of times the non-zero movement distance greater than the upper threshold occurs exceeds 80%. If so, the target is determined to be a resident target.
[0065] This application provides a method for detecting resident targets. An image acquisition device continuously captures images of targets within a scene, accumulating image frames. For the same target, each image frame is traversed to detect the movement distance of the target's position in the current frame relative to its position in the previous image frame, determining the movement distance sequence corresponding to the target. For the same target, the movement distance sequence features of the target are determined based on mathematical statistical calculations of the movement distance sequences. Based on the movement distance sequence features of the target and the movement distance sequence features of resident targets, resident targets within the scene are identified. Since the movement distance sequence features of resident targets and queuing targets may differ, the movement distance sequence features are determined based on the mathematical statistical calculations of the movement distance sequences of the same target in the image frames. This allows for accurate determination of whether a target is a resident target based on its movement distance sequence features, achieving objective and accurate detection of resident targets in the field based on the actual detected movement distances.
[0066] Figure 4 This is a flowchart illustrating a persistent target detection method according to another embodiment of this application. This embodiment is an optimization based on the above embodiments; schemes not described in detail in this embodiment are described in the above embodiments. Figure 4 As shown, the method in this embodiment of the application specifically includes the following steps:
[0067] S310. The image acquisition device continuously acquires images of targets within the scene, resulting in accumulated image frames.
[0068] S320. For the same target, traverse each image frame to detect the movement distance of the target's position in the currently traversed image frame relative to its position in the previous image frame, and determine the movement distance sequence corresponding to the target.
[0069] S330. Based on the movement distance sequence of each target and the movement distance sequence characteristics of the resident targets, determine the resident targets in the scenario.
[0070] S340. Cluster the positions of the resident target in each image frame to determine the resident position of the resident target.
[0071] In this embodiment, after identifying the resident targets in the scene, the resident targets can be further verified to confirm whether they are truly resident targets. Specifically, for the same resident target, the positions where the resident target appears in each image frame can be clustered to determine the resident position of the resident target. The resident position can be the position in the cluster with the most occurrences after clustering. The clustering algorithm can be selected according to the actual situation, such as the DBSCAN algorithm.
[0072] S350. Traverse each image frame and detect the motion of the resident target relative to the resident position during the image acquisition duration.
[0073] For example, a resident target typically resides at a fixed location, leaving when there is a service demand for targets in other locations, and returning to the resident location when there is no service demand for targets in other locations. Each image frame can be traversed to detect the movement of the resident target relative to its resident location within the duration of image acquisition, thereby further verifying whether the resident target conforms to the pattern of its movement relative to its resident location.
[0074] S360. Based on the described movement, determine the final permanent target.
[0075] For example, the credibility of a resident target can be verified based on its movement to determine whether it is the final resident target. For instance, a resident target is typically located at its usual position. If it leaves its usual position but returns within a certain time, then it can be determined that the resident target is the final resident target. If the resident target initially resides at its usual position but leaves and does not return within a certain time, then it is determined that the resident target is not actually a resident target and is adjusted to a non-resident target.
[0076] In this embodiment of the application, determining the final permanent target based on the motion situation includes:
[0077] If the duration of the permanent target's stay at the permanent location exceeds a first preset duration, then the confidence value of the permanent target is increased.
[0078] If the resident target returns to the resident location within a second preset time period after leaving the resident location, then the confidence value of the resident target is increased;
[0079] If the confidence value of the permanent target accumulates to a preset confidence value, then the permanent target is determined to be the final permanent target;
[0080] If the resident target does not return to the resident location within a second preset time period after leaving the resident location, the resident target will be adjusted to a non-resident target.
[0081] For example, if a resident target remains in its designated location for a duration exceeding a first preset time, it indicates that the target has been in that location for a longer period, unlike queuing targets which are constantly moving with the queue. This increases the confidence value of the resident target. Furthermore, if a resident target leaves its designated location and returns within a second preset time, it indicates that the target has primarily remained in its designated location, further increasing its confidence value. When the movement of the resident target meets the above conditions, the confidence value of the resident target is accumulated. If the accumulated confidence value reaches a preset confidence value, the resident target can be determined as the actual final resident target. For example, if the first preset time is 60 minutes and the second preset time is 30 minutes, if the resident target remains in its designated location for more than 60 minutes, the confidence value increases by 1. If the resident target leaves its designated location and returns within 30 minutes, the confidence value increases by 1. The confidence scores are accumulated. If the confidence scores accumulate to a preset confidence score, such as 10, then the permanent target is determined to be the actual final permanent target.
[0082] In this embodiment of the application, clustering the positions of the resident target in each image frame to determine the resident position of the resident target includes:
[0083] If the number of elements in the largest cluster after clustering the locations of the permanent target in each image frame exceeds a preset number, then the location in the largest cluster is taken as the permanent location; wherein, the preset number is the product of the total number of locations where the permanent target has appeared and a preset proportion;
[0084] The method further includes:
[0085] If the number of elements in the largest cluster after clustering the positions of the resident target in each image frame does not exceed a preset number, then the resident target is adjusted to a non-resident target.
[0086] For example, if the number of position elements in each cluster after clustering the locations of a resident target in each image frame does not differ by more than a threshold, it indicates that the resident target's locations are relatively dispersed and do not frequently reside in the same position. Therefore, there is no truly resident location, and the resident target is not considered a permanent target. In this case, the resident target is reclassified as a non-resident target. If the number of position elements in the largest cluster after clustering the locations of a resident target in each image frame exceeds a preset number, it indicates that the resident target resides in that location most of the time, and this location is designated as a resident location. The preset number can be the total number of locations of the resident target in each image frame multiplied by a preset ratio, such as 80%. For instance, if the ratio of the largest cluster location to all locations exceeds 80% after clustering, meaning the number of positions in the largest cluster exceeds the preset number, then that location is determined as the resident location of the resident target.
[0087] The scheme in this application embodiment, after determining the permanent target, can determine whether the permanent position of the permanent target can be determined based on the position of the permanent target in each image frame. If the permanent position can be determined, the permanent target is accurately matched further based on the movement of the permanent target relative to the permanent position to determine the authenticity of the permanent target and determine the final permanent target.
[0088] Figure 5 This is a flowchart illustrating a specific implementation method in one embodiment of this application, such as... Figure 5 As shown, images can be captured by monitoring equipment to photograph people in a scene. For each image frame, it is matched with people in previously captured image frames to determine if they are the same person. If they are, the person's position in the image frame is updated; otherwise, it is saved as a new person. Based on the determined movement distance of the person in adjacent image frames, a person behavior pattern is calculated, that is, the movement distance sequence features are determined based on the movement distance distribution sequence, thereby identifying potential resident personnel. The above process can be defined as the person behavior pattern generation stage. In this embodiment, the potential resident personnel identified in the person behavior pattern generation stage can be confirmed as resident personnel, or the potential resident personnel can be further confirmed as actual resident personnel in the subsequent person behavior pattern verification stage. In the person behavior pattern verification stage, the resident position of the potential resident personnel is calculated, and it is detected whether the potential resident personnel leave the resident position within a first preset time period. If they do not leave, the confidence value is increased by 1; if they leave but return to the resident position within a second preset time period, the confidence value is increased by 1. If the confidence level reaches a preset value, the potential resident is identified as a permanent staff member; otherwise, the personnel behavior pattern verification phase continues. If the potential resident leaves and does not return to their permanent location within a second preset time period, they are determined not to be a permanent staff member.
[0089] Figure 6 This is a schematic diagram of a resident target detection device provided in an embodiment of this application. This device can execute the resident target detection method provided in any embodiment of this application, and possesses the corresponding functional modules and beneficial effects for executing the method. Figure 6 As shown, the device includes:
[0090] The image frame acquisition module 410 is used to continuously acquire images of targets in the scene through an image acquisition device to obtain accumulated image frames;
[0091] The movement distance sequence determination module 420 is used to detect the movement distance of the target in the current image frame relative to the position in the previous image frame, and determine the movement distance sequence corresponding to the target, for the same target;
[0092] The resident target determination module 430 is used to determine the resident targets in the scene based on the movement distance sequence of each target and the movement distance sequence characteristics of the resident targets.
[0093] In this embodiment of the application, the resident target determination module 430 determines the resident targets in the scene based on the movement distance sequence of each target and the movement distance sequence characteristics of the resident targets, including:
[0094] For the same target, the characteristics of the target's movement distance sequence are determined based on the mathematical and statistical calculation results of the target's movement distance sequence;
[0095] Based on the movement distance sequence characteristics of the target and the movement distance sequence characteristics of the resident target, the resident target in the scene is determined.
[0096] In this embodiment of the application, the resident target determination module 430 determines the movement distance sequence characteristics of the target based on the mathematical statistical calculation results of the target's movement distance sequence, including:
[0097] At least one of the following is determined as the target's average moving distance, the target's moving distance distribution characteristics over time, and the target's moving distance frequency distribution characteristics, as the target's moving distance sequence characteristics; wherein, the target's average moving distance includes the sum of all moving distances detected for the same target during the traversal process, and the ratio of any one of the following: number of moves, number of image frames, and duration of image acquisition.
[0098] In this embodiment of the application, the resident target determination module 430 determines the resident targets in the scene based on the movement distance sequence characteristics of the target and the movement distance sequence characteristics of the resident targets, including:
[0099] If the target's movement distance sequence characteristics satisfy at least one of the following, then the target's movement distance sequence characteristics are determined to match the movement distance sequence characteristics of a resident target, and the target is determined to be a resident target:
[0100] The average movement distance of the target is less than a preset average movement distance; wherein, the preset average movement distance is less than or equal to the average of the average movement distances of all targets.
[0101] The distribution characteristics of the target's movement distance over time are as follows: movement distances less than a lower threshold have temporal continuity, and movement distances greater than or equal to the lower threshold have temporal continuity; wherein, the difference between the lower threshold and zero is less than a preset threshold.
[0102] The frequency distribution characteristic of the target's movement distance is that the frequency of movement distances less than the lower threshold is higher than the first preset frequency threshold.
[0103] The number of times the movement distance exceeds the upper limit threshold is higher than the second preset frequency threshold; wherein, the upper limit threshold is greater than or equal to the preset average movement distance.
[0104] In this embodiment of the application, the device further includes:
[0105] The permanent location determination module is used to cluster the locations where the permanent target appears in each image frame to determine the permanent location of the permanent target;
[0106] The motion determination module is used to traverse each image frame and detect the motion of the resident target relative to the resident position during the image acquisition duration.
[0107] The final permanent target determination module is used to determine the final permanent target based on the motion situation.
[0108] In this embodiment of the application, the final resident target determination module determines the final resident target based on the motion situation, including:
[0109] If the duration of the permanent target's stay at the permanent location exceeds a first preset duration, then the confidence value of the permanent target is increased.
[0110] If the resident target returns to the resident location within a second preset time period after leaving the resident location, then the confidence value of the resident target is increased;
[0111] If the confidence value of the permanent target accumulates to a preset confidence value, then the permanent target is determined to be the final permanent target;
[0112] If the resident target does not return to the resident location within a second preset time period after leaving the resident location, the resident target will be adjusted to a non-resident target.
[0113] In this embodiment of the application, the persistent location determination module clusters the locations where the persistent target appears in each image frame to determine the persistent location of the persistent target, including:
[0114] If the number of elements in the largest cluster after clustering the locations of the permanent target in each image frame exceeds a preset number, then the location in the largest cluster is taken as the permanent location; wherein, the preset number is the product of the total number of locations where the permanent target has appeared and a preset proportion;
[0115] The method further includes:
[0116] If the number of elements in the largest cluster after clustering the positions of the resident target in each image frame does not exceed a preset number, then the resident target is adjusted to a non-resident target.
[0117] The resident target detection device provided in this application embodiment can execute a resident target detection method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of executing the method.
[0118] Figure 7 A schematic diagram of an electronic device 10, which can be used to implement embodiments of this application, is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0119] like Figure 7As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0120] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless resident target detection transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0121] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as resident object detection methods.
[0122] In some embodiments, the resident target detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the resident target detection method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the resident target detection method by any other suitable means (e.g., by means of firmware).
[0123] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable resident target detection device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0125] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0127] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0128] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0129] This invention also provides a computer program product, including a computer program that, when executed by a processor, implements the resident target detection method as provided in any embodiment of this application.
[0130] In implementing the computer program product, computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof. Programming languages include object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0131] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired information of the technical solution of this application can be achieved, and this is not limited herein.
[0132] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for detecting resident targets, characterized in that, The method includes: The image acquisition device continuously acquires images of targets within the scene, resulting in accumulated image frames; For the same target, each image frame is traversed to detect the movement distance of the target's position in the current image frame relative to its position in the previous image frame, and the movement distance sequence corresponding to the target is determined. Based on the movement distance sequence of each target and the movement distance sequence characteristics of resident targets, the resident targets in the scenario are determined.
2. The method according to claim 1, characterized in that, Based on the movement distance sequence of each target and the movement distance sequence characteristics of resident targets, the resident targets in the scene are determined, including: For the same target, the characteristics of the target's movement distance sequence are determined based on the mathematical and statistical calculation results of the target's movement distance sequence; Based on the movement distance sequence characteristics of the target and the movement distance sequence characteristics of the resident target, the resident target in the scene is determined.
3. The method according to claim 2, characterized in that, Based on the mathematical and statistical calculation results of the target's movement distance sequence, the characteristics of the target's movement distance sequence are determined, including: At least one of the following is determined as the target's average moving distance, the target's moving distance distribution characteristics over time, and the target's moving distance frequency distribution characteristics, as the target's moving distance sequence characteristics; wherein, the target's average moving distance includes the sum of all moving distances detected for the same target during the traversal process, and the ratio of any one of the following: number of moves, number of image frames, and duration of image acquisition.
4. The method according to claim 2, characterized in that, Based on the movement distance sequence characteristics of the target and the movement distance sequence characteristics of resident targets, resident targets within the scene are determined, including: If the target's movement distance sequence characteristics satisfy at least one of the following, then the target's movement distance sequence characteristics are determined to match the movement distance sequence characteristics of a resident target, and the target is determined to be a resident target: The average movement distance of the target is less than a preset average movement distance; wherein, the preset average movement distance is less than or equal to the average of the average movement distances of all targets. The distribution characteristics of the target's movement distance over time are as follows: movement distances less than a lower threshold have temporal continuity, and movement distances greater than or equal to the lower threshold have temporal continuity; wherein, the difference between the lower threshold and zero is less than a preset threshold. The frequency distribution characteristic of the target's movement distance is that the frequency of movement distances less than the lower threshold is higher than the first preset frequency threshold. The number of times the movement distance exceeds the upper limit threshold is higher than the second preset frequency threshold; wherein, the upper limit threshold is greater than or equal to the preset average movement distance.
5. The method according to claim 1, characterized in that, The method further includes: Cluster the locations where the resident target appears in each image frame to determine the resident location of the resident target; Traverse each image frame and detect the motion of the resident target relative to the resident position during the image acquisition duration; Based on the described movement, the final permanent target is determined.
6. The method according to claim 5, characterized in that, Based on the described movement patterns, the final permanent target is determined, including: If the duration of the permanent target's stay at the permanent location exceeds a first preset duration, then the confidence value of the permanent target is increased. If the resident target returns to the resident location within a second preset time period after leaving the resident location, then the confidence value of the resident target is increased; If the confidence value of the permanent target accumulates to a preset confidence value, then the permanent target is determined to be the final permanent target; If the resident target does not return to the resident location within a second preset time period after leaving the resident location, the resident target will be adjusted to a non-resident target.
7. The method according to claim 5, characterized in that, Clustering the locations of the resident targets in each image frame to determine their resident locations includes: If the number of elements in the largest cluster after clustering the locations of the permanent target in each image frame exceeds a preset number, then the location in the largest cluster is taken as the permanent location; wherein, the preset number is the product of the total number of locations where the permanent target has appeared and a preset proportion; The method further includes: If the number of elements in the largest cluster after clustering the positions of the resident target in each image frame does not exceed a preset number, then the resident target is adjusted to a non-resident target.
8. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the resident target detection method according to any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the resident target detection method according to any one of claims 1-7.
10. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the resident target detection method as described in any one of claims 1-7.
