Object Recognition Method, Apparatus and Electronic Device
By obtaining and analyzing the trajectory data of the object to be identified and automatically determining its stay and contact information, the problem of low object recognition efficiency in the prior art is solved, and efficient abnormal object recognition is achieved.
Patent Information
- Application Number
- CN202111363924.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-11-17
AI Technical Summary
In the prior art, object recognition efficiency is low, and feature images of abnormal objects need to be manually calibrated, resulting in low recognition efficiency.
By obtaining the trajectory data of the object to be identified in the target scene, determining its stay information and contact information, and automatically determining whether it is an abnormal object based on preset conditions, including the number of stays, duration, and contact times.
Automatic recognition of abnormal objects is realized, the efficiency of object recognition is improved, and the need for manual calibration is reduced.
Smart Images

Figure CN114092809B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and particularly to an object recognition method, apparatus, and electronic device. Background Art
[0002] In related technologies of object recognition, it is often necessary to manually calibrate abnormal objects in advance and store the feature images of the abnormal objects in a feature image library to be warned. Then, by comparing the feature image of the on-site object with the feature images in the feature image library, it is determined whether the on-site object is an abnormal object.
[0003] Since it is necessary to manually calibrate abnormal objects, the object recognition efficiency in related technologies is low. Summary of the Invention
[0004] The purpose of the embodiments of the present invention is to provide an object recognition method, apparatus, and electronic device to improve the efficiency of object recognition. The specific technical solutions are as follows:
[0005] In a first aspect, the embodiments of the present invention provide an object recognition method, and the method includes:
[0006] Obtain the trajectory data of the object to be recognized in the target scenario;
[0007] Based on the obtained trajectory data, determine the stay information of the object to be recognized in the target scenario, and determine the contact information between the object to be recognized and the specified object in the target scenario;
[0008] If the stay information meets the preset stay abnormality condition, and / or the contact information meets the preset contact abnormality condition, then determine that the object to be recognized is an abnormal object.
[0009] Optionally, the stay information includes: the number of stays and / or the stay duration;
[0010] The determining, based on the obtained trajectory data, the stay information of the object to be recognized in the target scenario includes:
[0011] Based on the obtained trajectory data, determine the number of trajectories of the object to be recognized in the target scenario as the number of stays of the object to be recognized; and / or;
[0012] Based on the obtained trajectory data, determine the trajectory duration of each trajectory of the object to be recognized in the target scenario, and calculate the sum of the trajectory durations of each determined trajectory to obtain the stay duration of the object to be recognized in the target scenario.
[0013] Optionally, the stay information meeting the preset stay abnormality condition includes:
[0014] The number of stays is greater than or equal to the stay number threshold;
[0015] and / or
[0016] The stay duration is greater than or equal to the stay duration threshold.
[0017] Optionally, the contact information includes the number of contacts;
[0018] The above method for determining the contact information between the object to be recognized and the specified object in the target scenario based on the acquired trajectory data includes:
[0019] Based on the acquired trajectory data, determine each trajectory of the object to be recognized in the target scenario;
[0020] For each trajectory of the object to be recognized, based on this trajectory and each specified trajectory of the specified object, determine the number of contacts between the object to be recognized and the specified object during the formation of this trajectory, as the number of contacts corresponding to this trajectory; wherein, each specified trajectory is the trajectory of the specified object in the target scenario;
[0021] Calculate the sum of the number of contacts corresponding to each trajectory of the object to be recognized to obtain the number of contacts between the object to be recognized and the specified object.
[0022] Optionally, before determining the number of contacts between the object to be recognized and the specified object during the formation of this trajectory, based on this trajectory and each specified trajectory of the specified object, as the number of contacts corresponding to this trajectory, the method further includes:
[0023] Perform a specified behavior detection on the object to be recognized to obtain the behavior time when the object to be recognized performs the specified behavior;
[0024] The step of determining the number of contacts between the object to be recognized and the specified object during the formation of this trajectory, based on this trajectory and each specified trajectory of the specified object, as the number of contacts corresponding to this trajectory, includes:
[0025] Determine the intersection time when this trajectory intersects with each specified trajectory of the specified object;
[0026] Determine the number of matches between the behavior time and the intersection time as the number of contacts corresponding to this trajectory.
[0027] Optionally, the contact information satisfying the preset contact anomaly condition includes:
[0028] The number of contacts is greater than or equal to the contact number threshold.
[0029] Optionally, obtaining the trajectory data of the object to be recognized in the target scenario includes:
[0030] Reading the trajectory data of the object to be recognized in the target scenario from the object file of the object to be recognized.
[0031] Optionally, generating the trajectory data in the object file adopts the following steps, including:
[0032] Obtaining the image data collected for the target scenario;
[0033] Identifying the objects included in the image data as the objects to be processed;
[0034] For each object to be processed, based on the image data, performing trajectory recognition on the object to be processed to obtain the trajectory of the object to be processed;
[0035] Determining the object file to which the object to be processed belongs, and writing the generated trajectory into the determined object file to obtain the trajectory data in the object file.
[0036] Optionally, each object file further includes the face attributes of the object to which the object file belongs;
[0037] The determining the object file to which the object to be processed belongs includes:
[0038] Based on the image data, obtaining the face attributes of the object to be processed;
[0039] Judging whether there is an object file in the existing object files whose included face attributes match the obtained face attributes;
[0040] If there is, determining the object file whose included face attributes match the obtained face attributes as the object file to which the object to be processed belongs.
[0041] Optionally, each object file further includes the collection identifier of the object to which the object file belongs; the collection identifier of each object is the identifier generated when collecting the image data of the object;
[0042] The method further includes:
[0043] If there is no object file whose included face attributes match the obtained face attributes, determining the collection identifier of the object to be processed;
[0044] Judging whether there is an object file in the existing object files whose included collection identifier is the same as the determined collection identifier;
[0045] If there is, determining the object file whose included collection identifier is the same as the determined collection identifier as the object file to which the object to be processed belongs.
[0046] Optionally, each object file further includes the human body attributes of the object to which the object file belongs;
[0047] The method further includes:
[0048] If there is no object file whose included collection identifier is the same as the determined collection identifier, determine the human body attributes of the object to be processed;
[0049] Determine whether there is an object file in the existing object files whose included human body attributes match the determined human body attributes;
[0050] If there is, determine the object file whose included human body attributes match the determined human body attributes as the object file to which the object to be processed belongs.
[0051] Optionally, the method further includes:
[0052] If there is no object file whose included human body attributes match the determined human body attributes, generate an object file for the object to be processed based on at least one of the face attributes, collection identifier, and human body attributes of the object to be processed.
[0053] Optionally, before obtaining the trajectory data of the object to be recognized in the target scene, the method further includes:
[0054] Identify the objects belonging to the specified category in the target scene as the objects to be recognized, and identify the objects that do not belong to the specified category as the specified objects.
[0055] Optionally, the identifying the objects belonging to the specified category in the target scene as the objects to be recognized includes:
[0056] For each object in the target scene, perform clothing detection and / or behavior detection on the object. If the object wears the specified type of service and / or performs the specified behavior, then regard the object as the object to be recognized.
[0057] In a second aspect, an embodiment of the present invention provides an object recognition device, and the device includes:
[0058] A trajectory data acquisition module, configured to acquire trajectory data of an object to be recognized in a target scene;
[0059] An information determination module, configured to determine the stay information of the object to be recognized in the target scene based on the acquired trajectory data, and determine the contact information between the object to be recognized and the specified object in the target scene;
[0060] A determination module, configured to determine that the object to be recognized is an abnormal object if the stay information meets a preset stay abnormal condition and / or the contact information meets a preset contact abnormal condition.
[0061] Optionally, the stay information includes: the number of stays and / or the stay duration;
[0062] The information determination module is specifically configured to, based on the acquired trajectory data, determine the number of trajectories of the object to be recognized in the target scenario as the number of stays of the object to be recognized; and / or; based on the acquired trajectory data, determine the trajectory duration of each trajectory of the object to be recognized in the target scenario, and calculate the sum of the trajectory durations of each determined trajectory to obtain the stay duration of the object to be recognized in the target scenario.
[0063] Optionally, the stay information meeting the preset stay abnormal condition includes: the number of stays is greater than or equal to the stay number threshold; and / or, the stay duration is greater than or equal to the stay duration threshold.
[0064] Optionally, the contact information includes the number of contacts;
[0065] The information determination module is specifically configured to, based on the acquired trajectory data, determine each trajectory of the object to be recognized in the target scenario; for each trajectory of the object to be recognized, based on this trajectory and each specified trajectory of the specified object, determine the number of contacts between the object to be recognized and the specified object during the formation of this trajectory as the number of contacts corresponding to this trajectory; wherein, each specified trajectory is the trajectory of the specified object in the target scenario.
[0066] Optionally, the information determination module is further configured to, before determining the number of contacts between the object to be recognized and the specified object during the formation of this trajectory as the number of contacts corresponding to this trajectory based on this trajectory and each specified trajectory of the specified object, perform a specified behavior detection on the object to be recognized to obtain the behavior time of the object to be recognized performing the specified behavior;
[0067] The information determination module is specifically configured to determine the intersection time of this trajectory and each specified trajectory of the specified object; determine the number of matches between the behavior time and the intersection time as the number of contacts corresponding to this trajectory.
[0068] Optionally, the contact information meeting the preset contact abnormal condition includes: the number of contacts is greater than or equal to the contact number threshold.
[0069] Optionally, the trajectory data acquisition module is specifically configured to read the trajectory data of the object to be recognized in the target scenario from the object file of the object to be recognized.
[0070] Optionally, the device further includes:
[0071] An image data acquisition module, configured to acquire image data collected for the target scenario;
[0072] An object recognition module, configured to recognize the object included in the image data as an object to be processed;
[0073] A trajectory recognition module, configured to perform trajectory recognition on each object to be processed based on the image data to obtain the trajectory of the object to be processed;
[0074] A data storage module, configured to determine the object file to which the object to be processed belongs, and write the generated trajectory into the determined object file to obtain the trajectory data in the object file.
[0075] Optionally, each object file further includes the face attributes of the object to which the object file belongs;
[0076] The data storage module is specifically configured to obtain the face attributes of the object to be processed based on the image data; determine whether there is an object file in the existing object files whose included face attributes match the obtained face attributes; if so, determine the object file whose included face attributes match the obtained face attributes as the object file to which the object to be processed belongs.
[0077] Optionally, each object file further includes the acquisition identifier of the object to which the object file belongs; the acquisition identifier of each object is the identifier generated when the image data of the object is acquired;
[0078] The data storage module is further configured to, if there is no object file whose included face attributes match the obtained face attributes, determine the acquisition identifier of the object to be processed; determine whether there is an object file in the existing object files whose included acquisition identifier is the same as the determined acquisition identifier; if so, determine the object file whose included acquisition identifier is the same as the determined acquisition identifier as the object file to which the object to be processed belongs.
[0079] Optionally, each object file further includes the human body attributes of the object to which the object file belongs;
[0080] The data storage module is further configured to determine the human attributes of the object to be processed if there is no object file whose included collection identifier is the same as the determined collection identifier; determine whether there is an object file in the existing object files whose included human attributes match the determined human attributes; if so, determine the object file whose included human attributes match the determined human attributes as the object file to which the object to be processed belongs.
[0081] Optionally, the data storage module is further configured to generate an object file of the object to be processed based on at least one of the face attributes, collection identifier, and human attributes of the object to be processed if there is no object file whose included human attributes match the determined human attributes.
[0082] Optionally, the image data acquisition module is further configured to identify, before acquiring the trajectory data of the object to be recognized in the target scene, the objects belonging to the specified category in the target scene as the objects to be recognized, and the objects not belonging to the specified category as the specified objects.
[0083] Optionally, the image data acquisition module is specifically configured to perform clothing detection and / or behavior detection on each object in the target scene, and if the object wears the specified type of service and / or performs the specified behavior, use the object as the object to be recognized.
[0084] In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus. Among them, the processor, the communication interface, and the memory complete communication with each other through the communication bus;
[0085] The memory is used to store a computer program;
[0086] The processor is configured to implement the method steps described in the first aspect when executing the program stored on the memory.
[0087] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the method steps described in the first aspect are implemented.
[0088] Advantages of the embodiments of the present invention:
[0089] In the object recognition method provided by the embodiments of the present invention, trajectory data of an object to be recognized in a target scenario can be obtained. Then, based on the obtained trajectory data, the stay information of the object to be recognized in the target scenario can be determined, and the contact information between the object to be recognized and a specified object in the target scenario can be determined. If the stay information meets a preset stay anomaly condition and / or the contact information meets a preset contact anomaly condition, it is determined that the object to be recognized is an abnormal object. Since it is possible to determine whether the object to be recognized is an abnormal object based on the stay information and contact information of the object to be recognized, automatic recognition of abnormal objects can be achieved, thereby improving the efficiency of object recognition.
[0090] Of course, it is not necessary for any product or method implementing the present invention to achieve all the above-mentioned advantages simultaneously. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other embodiments can be obtained based on these drawings without creative efforts.
[0092] Figure 1 It is a flowchart of the object recognition method provided by the embodiments of the present invention;
[0093] Figure 2 It is another flowchart of the object recognition method provided by the embodiments of the present invention;
[0094] Figure 3 It is a schematic structural diagram of the object recognition device provided by the embodiments of the present invention;
[0095] Figure 4 It is a schematic structural diagram of the electronic device provided by the embodiments of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0096] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts belong to the scope of protection of the present invention.
[0097] In order to improve the efficiency of object recognition, embodiments of the present invention provide an object recognition method, device, and electronic device.
[0098] The following first introduces an object recognition method provided by the embodiments of the present invention.
[0099] It should be noted that the embodiments of the present invention can be applied to various electronic devices, such as personal computers, servers, mobile phones, and other devices with data processing capabilities. Moreover, the object recognition method provided by the embodiments of the present invention can be implemented in a software, hardware, or a combination of software and hardware manner.
[0100] The object recognition method provided by the embodiments of the present invention may include the following steps:
[0101] Obtain the trajectory data of the object to be recognized in the target scenario;
[0102] Based on the obtained trajectory data, determine the stay information of the object to be recognized in the target scenario, and determine the contact information between the object to be recognized and the specified object in the target scenario;
[0103] If the stay information meets the preset stay anomaly condition, and / or the contact information meets the preset contact anomaly condition, then determine that the object to be recognized is an abnormal object.
[0104] With the above solution of the embodiments of the present invention, since it is possible to determine whether the object to be recognized is an abnormal object based on the stay information and contact information of the object to be recognized, and realize the automatic recognition of abnormal objects, the efficiency of object recognition can be improved.
[0105] Next, in conjunction with the accompanying drawings of the specification, the object recognition method provided by the embodiments of the present invention will be described in detail.
[0106] As Figure 1 shown, an object recognition method provided by the embodiments of the present invention may include the following steps:
[0107] S101, obtain the trajectory data of the object to be recognized in the target scenario;
[0108] Among them, the target scenario can be any specified scenario, such as business handling scenarios like banks and insurance companies, or any scenario where object recognition is required. The embodiments of the present invention do not make specific limitations in this regard. It should be noted that the object referred to in the embodiments of the present invention can be any object in the target scenario. For example, for a business handling scenario, the object referred to in the embodiments of the present invention can be a person, and for other possible scenarios, the object referred to in the embodiments of the present invention can also be things such as animals and machines, which are all acceptable.
[0109] The object to be recognized is an object for which abnormal recognition is required. This abnormal recognition can be used to identify whether the object is an abnormal object, such as identifying personnel engaged in product promotion, peddling, or even fraud. In one implementation, the object to be recognized in the target scenario can be determined first. Optionally, in the target scenario, the objects belonging to the specified category are recognized as the objects to be recognized.
[0110] The object of the specified type can be a person whose clothing matches that of normal staff in the current scene. At this time, for each object in the target scene, clothing detection can be performed on the object, and based on the detection result, it can be determined whether the object is wearing clothing of the specified type. If so, the object is regarded as an object to be recognized. Herein, the clothing of the specified type is the clothing of normal staff in the target scene, or clothing similar to that of normal staff in the target scene.
[0111] Optionally, behavior detection can also be performed on the object. If the object performs a specified behavior, the object is regarded as an object to be recognized. Herein, the specified behavior includes at least one of the behaviors of carrying a bag and passing an item.
[0112] Optionally, for abnormal personnel engaged in product promotion, peddling, or even fraud, they need to interact with normal business handling personnel in the target scene. Therefore, in order to analyze abnormal personnel more accurately, objects in the target scene that do not belong to the specified category can also be identified as specified objects.
[0113] For different application scenarios, the method of obtaining the trajectory data of the object to be recognized can be different. For example, in one implementation, for a real-time scene, the object to be recognized can be tracked in real time to generate the trajectory data of the object to be recognized. Or, for an offline scene or a scene with low real-time requirements, at a specific time point, the trajectory data of the object to be recognized in the target scene within a specified time period can be obtained. For example, at 21:00 every day, the trajectory data of the object to be recognized in the target scene on the same day is obtained. At this time, the trajectory data can include each trajectory of the target object in the target scene within the specified time period.
[0114] In one implementation, optionally, the trajectory data of the object to be recognized in the target scene can be read from the object file of the object to be recognized. The object file is a data set recording the information of the object to be recognized. In addition to the trajectory data of the object to be recognized in the target scene, the above object file can also include at least one of the acquisition identifier of the object, face attributes, body attributes, abnormal behavior record information, etc. The above face attributes can include face images and / or face features extracted based on face images. The above body attributes can include body images and / or body features extracted based on body images. The above abnormal behavior record information can be the abnormal behavior record of the object in the target scene, such as the behavior of carrying a bag, passing an item, etc., which can be used to assist in the recognition of the object.
[0115] The data included in the object file of each object can be generated based on the tracking of the object within a historical event segment. This will be described in the following embodiments of the present invention and will not be elaborated here.
[0116] S102. Based on the acquired trajectory data, determine the stay information of the object to be recognized in the target scenario, and determine the contact information between the object to be recognized and the specified object in the target scenario;
[0117] Among them, the stay information is the information indicating the stay situation of the object to be recognized in the target scenario, and may include the number of stays and / or the stay duration of the object to be recognized in the target scenario.
[0118] Since a trajectory will be generated each time the object to be recognized stays in the target scenario, when the stay information includes the number of stays, based on the acquired trajectory data, the number of trajectories of the object to be recognized in the target scenario can be determined first, and then the determined number of trajectories can be used as the number of stays of the object to be recognized.
[0119] If the stay information includes the stay duration, based on the acquired trajectory data, the trajectory duration of each trajectory of the object to be recognized in the target scenario can be determined first, and then the sum of the trajectory durations of each determined trajectory can be calculated to obtain the stay duration of the object to be recognized in the target scenario. Among them, the trajectory duration of each trajectory can be the time difference between the end time and the start time of the trajectory.
[0120] The above contact information may include the number of contacts between the object to be recognized and the specified object in the target scenario. In one implementation, based on the acquired trajectory data, each trajectory of the object to be recognized in the target scenario can be determined. Then, for each trajectory of the object to be recognized, based on this trajectory and each specified trajectory of the specified object, the number of contacts between the object to be recognized and the specified object during the formation of this trajectory can be determined as the contact number corresponding to this trajectory. Finally, the sum of the contact numbers corresponding to each trajectory of the object to be recognized can be calculated to obtain the contact number between the object to be recognized and the specified object.
[0121] In one implementation, before determining the number of contacts between the object to be recognized and the specified object during the formation of this trajectory as the contact number corresponding to this trajectory based on this trajectory and each specified trajectory of the specified object, a specified behavior detection can be performed on the object to be recognized to obtain the behavior time of the object to be recognized performing the specified behavior. Then, the intersection time of this trajectory and each specified trajectory of the specified object can be determined, and the number of matches between the behavior time and the intersection time can be determined as the contact number corresponding to this trajectory.
[0122] The above-mentioned trajectory intersection means that at the same moment, the distance between two trajectories is less than a set threshold, which is regarded as one intersection. Exemplarily, if the object to be recognized is a person dressed in the same category as normal staff in the target scene, and the designated object is a person dressed in a different category from normal staff in the target scene, then based on the trajectories of the people dressed in the same category and the trajectories of the people dressed in different categories, it is determined that the landing distances of the people dressed in the same category and the people dressed in different categories at the same moment are both less than the set threshold, then it is considered that there is 1 contact between the people dressed in the same category and the people dressed in different categories.
[0123] Optionally, it can also be analyzed in combination with whether the object to be recognized has the behavior of carrying a bag, that is, the sum of the contact times corresponding to each trajectory of the object to be recognized with the behavior of carrying a bag is used as the contact times between the object to be recognized and the designated object.
[0124] S103, if the stay information meets the preset stay abnormal condition, and / or the contact information meets the preset contact abnormal condition, then it is determined that the object to be recognized is an abnormal object;
[0125] The above-mentioned preset stay abnormal condition and / or the preset contact abnormal condition can be determined based on requirements and experience.
[0126] If the stay information includes the number of stays, then the above-mentioned preset stay abnormal condition can include that the number of stays is greater than or equal to the stay number threshold, such as 5 times; if the stay information includes the stay duration, then the above-mentioned preset stay abnormal condition can include that the stay duration is greater than or equal to the stay duration threshold, such as 90 minutes; when the stay information includes the number of stays and the stay duration, the above-mentioned preset stay abnormal condition can be that the number of stays is greater than or equal to the stay number threshold or the stay duration is greater than or equal to the stay duration threshold.
[0127] If the contact information includes the number of contacts, then the contact information meets the preset contact abnormal condition can be that the number of contacts is greater than or equal to the contact number threshold, such as 20 times.
[0128] In the above solution of the embodiment of the present invention, since it is possible to determine whether the object to be recognized is an abnormal object based on the stay information and contact information of the object to be recognized, and realize the automatic recognition of abnormal objects, the efficiency of object recognition can be improved.
[0129] As Figure 2 shown, another object recognition method provided by the embodiment of the present invention, in addition to Figure 1 the steps shown, may further include the following steps:
[0130] S201: Obtain the image data collected for the target scene;
[0131] Among them, the above image data can be at least one scene image of the target scene, or a scene video of the target scene. The image data can be collected by a monitoring camera deployed in the target scene. A single monitoring camera or multiple monitoring cameras can be deployed in the target scene, which is acceptable. When multiple monitoring cameras are included in the target scene, objects in the image data collected by the multiple monitoring cameras can be associated according to the topological structure and spatio-temporal relationship between the multiple monitoring cameras.
[0132] S202: Identify the objects included in the image data as the objects to be processed;
[0133] Optionally, object detection can be performed on the image data through an object detection algorithm to identify the objects included in the image data. Alternatively, object detection can also be performed on the image data based on a pre-trained neural network model to identify the objects included in the image data, which is acceptable. It should be noted that the objects to be processed can be objects to be recognized or specified objects, which is acceptable.
[0134] When identifying the objects to be processed, the position information of the objects to be processed in the image data can also be recorded simultaneously. If the image data is multiple images or video segments, the position information of the objects to be processed in each image or in each frame of the video segment can be recorded.
[0135] S203: For each object to be processed, based on the image data, perform trajectory recognition on the object to be processed to obtain the trajectory of the object to be processed;
[0136] Optionally, for each object to be processed, since the position information of the object to be processed in at least one image included in the image data has been identified, the trajectory of the object to be processed can be determined based on the position information of the object to be processed, and the trajectory of the object to be processed can be obtained.
[0137] S204: Determine the object file to which the object to be processed belongs, and write the generated trajectory into the determined object file to obtain the trajectory data in the object file.
[0138] Among them, before writing the trajectory data into the object file, it is necessary to first determine the object file to which the object to be processed belongs.
[0139] For each object to be processed, the object file to which it belongs may already exist in advance, then it is necessary to determine the object file to which the object to be processed belongs from each object file; if the object file to which the object to be processed belongs does not exist in advance, a new object file needs to be created as the object file to which the object to be processed belongs.
[0140] Therefore, it is necessary to first determine whether there is an object file to which the object to be processed belongs in each object file.
[0141] In the embodiments of the present invention, various strategies can be adopted to determine whether there is an object file to which the object to be processed belongs in each object file.
[0142] In one implementation, the object file of the object to be processed can be determined in combination with the acquisition identifier of each object. The acquisition identifier of each object is an identifier generated when acquiring the image data of the object. When the camera continuously acquires the images of the same object, the acquisition identifier of the object is the same. For a single camera, it is judged whether its acquisition identifier is the same as the existing object file; for multiple cameras, it can be judged whether multiple objects to be processed across cameras are associated according to the topological structure and spatio-temporal relationship between the cameras. If there is an association, the corresponding object to be processed is marked with the sampling identifier of the associated object to be processed. The above sampling identifier can be a tracking ID (Identity Document) or an object ID.
[0143] Optionally, when the object is a person, the object file to which the object to be processed belongs can be determined based on at least one of the face attributes and the human body attributes. Among them, the above face attributes can be the face features after feature extraction of the face image. For example, after extracting the face image using a feature extraction model, the obtained feature vector, or the above face attributes can include the description information of the face, such as the face shape, eye type, etc. Optionally, the face attributes include, but are not limited to, features such as the corners of the mouth, nose, eyes, eyebrows, forehead, and hair.
[0144] The above human body features can be the human body features after feature extraction of the human body image. For example, after extracting the human body image using a feature extraction model, the obtained feature vector, or the above human body attributes can include the description information of the human body, such as height, body type, etc.
[0145] In one implementation, the object file to which the object to be processed belongs can be determined in combination with the face attributes, acquisition identifier, and human body attributes.
[0146] If each object file also contains the face attributes of the object to which the object file belongs, the face attributes of the object to be processed can be obtained based on the image data, and then it can be judged whether there is an object file in the existing object files whose included face attributes match the obtained face attributes. If there is, the object file whose included face attributes match the obtained face attributes is determined as the object file to which the object to be processed belongs.
[0147] Among them, judging whether there is an object file in the existing object files whose included face attributes match the obtained face attributes can include:
[0148] For each object file, it is possible to first determine whether there is a cover face attribute, which is a face attribute in the object file with a recorded duration less than a specified duration threshold among all face attributes. Compared with face attributes with a relatively long recorded duration, the cover face attribute has the smallest difference from the current object's face. Optionally, the cover face attribute can be the most recently recorded face attribute with a recorded duration less than the specified duration threshold.
[0149] If there is a cover face attribute, calculate the similarity between the obtained face attribute and the cover face attribute. If the similarity is greater than the first similarity threshold, determine that this object file belongs to the object file of the to-be-processed object. Conversely, if the similarity is not greater than the first similarity threshold, determine whether there are other face attributes in this object file. If there are, calculate the similarity between the other face attributes and the obtained face attribute. If the similarity is greater than the first similarity threshold, determine that this object file belongs to the object file of the to-be-processed object. Conversely, if the similarity is not greater than the first similarity threshold, determine that this object file does not belong to the object file of the to-be-processed object.
[0150] Optionally, if there is no object file whose included face attribute matches the obtained face attribute, determine the collection identifier of the to-be-processed object, and then determine whether there is an object file in the existing object files whose included collection identifier is the same as the determined collection identifier. If there is, determine the object file with the same included collection identifier and the determined collection identifier as the object file to which the to-be-processed object belongs.
[0151] Among them, if there is no object file whose included collection identifier is the same as the determined collection identifier, determine the human attribute of the to-be-processed object, and then determine whether there is an object file in the existing object files whose included human attribute matches the determined human attribute. If there is, determine the object file with the included human attribute matching the determined human attribute as the object file to which the to-be-processed object belongs.
[0152] Among them, determining whether there is an object file in the existing object files whose included human attribute matches the determined human attribute may include:
[0153] For each object file, it is possible to first determine whether there is a cover human attribute, which is a human attribute in the object file with a recorded duration less than a specified duration threshold among all human attributes. Compared with human attributes with a relatively long recorded duration, the cover human attribute has the smallest difference from the current object's human body. Optionally, the cover human attribute can be the most recently recorded human attribute with a recorded duration less than the specified duration threshold.
[0154] If there is a human attribute on the cover, calculate the similarity between the obtained human attribute and the human attribute on the cover. If the similarity is greater than the second similarity threshold, determine that the object file is the object file to which the object to be processed belongs. On the contrary, if the similarity is not greater than the second similarity threshold, determine whether there is any other human attribute in the object file. If there is, calculate the similarity between the other human attribute and the obtained human attribute. If the similarity is greater than the second similarity threshold, determine that the object file is the object file to which the object to be processed belongs. On the contrary, if the similarity is not greater than the second similarity threshold, determine that the object file does not belong to the object to be processed.
[0155] In a method for generating a cover image, if there is a human attribute, store the captured human image (human image) as the human cover; if there is no human attribute, store the captured face image (face image) as the face cover, so as to improve the recall rate and accuracy of single-human clustering. Considering that the clothing of the same object may be different every day, for the cover image, it can be deleted and regenerated regularly every day. At the same time, different similarity thresholds can also be adopted according to different face attributes or human attributes to achieve the effect of improving personnel clustering.
[0156] Furthermore, if there is an object file in which the included human attribute matches the determined human attribute, generate the object file of the object to be processed based on at least one of the face attribute, the collection identifier, and the human attribute of the object to be processed.
[0157] Further, if it is necessary to store the face attribute, use the face attribute as the cover face attribute of the object file of the object to be processed. If it is necessary to store the human attribute, use the human attribute as the cover human attribute of the object file of the object to be processed.
[0158] In the above solution of the embodiment of the present invention, the efficiency of object recognition can be improved. Further, by generating the trajectory data in each object file, a basis for realizing the improvement of the efficiency of object recognition is provided.
[0159] Corresponding to the object recognition method provided in the above embodiment, as Figure 3 shown, the embodiment of the present invention further provides an object recognition device, and the device includes:
[0160] A trajectory data acquisition module 301, configured to acquire trajectory data of an object to be recognized in a target scenario;
[0161] An information determination module 302, configured to determine the stay information of the object to be recognized in the target scenario based on the acquired trajectory data, and determine the contact information between the object to be recognized and a specified object in the target scenario;
[0162] The determination module 303 is configured to determine that the object to be recognized is an abnormal object if the stay information meets the preset stay abnormal condition and / or the contact information meets the preset contact abnormal condition.
[0163] Optionally, the stay information includes: the number of stays and / or the stay duration;
[0164] The information determination module is specifically configured to, based on the acquired trajectory data, determine the number of trajectories of the object to be recognized in the target scenario as the number of stays of the object to be recognized; and / or; based on the acquired trajectory data, determine the trajectory duration of each trajectory of the object to be recognized in the target scenario, and calculate the sum of the trajectory durations of each determined trajectory to obtain the stay duration of the object to be recognized in the target scenario.
[0165] Optionally, the stay information meeting the preset stay abnormal condition includes: the number of stays is greater than or equal to the stay number threshold; and / or, the stay duration is greater than or equal to the stay duration threshold.
[0166] Optionally, the contact information includes the number of contacts;
[0167] The information determination module is specifically configured to, based on the acquired trajectory data, determine each trajectory of the object to be recognized in the target scenario; for each trajectory of the object to be recognized, based on the trajectory and each specified trajectory of the specified object, determine the number of contacts between the object to be recognized and the specified object during the formation of the trajectory as the number of contacts corresponding to the trajectory; where each specified trajectory is the trajectory of the specified object in the target scenario; calculate the sum of the number of contacts corresponding to each trajectory of the object to be recognized to obtain the number of contacts between the object to be recognized and the specified object.
[0168] Optionally, the information determination module is further configured to, before determining the number of contacts between the object to be recognized and the specified object during the formation of the trajectory as the number of contacts corresponding to the trajectory based on the trajectory and each specified trajectory of the specified object, perform a specified behavior detection on the object to be recognized to obtain the behavior time of the object to be recognized performing the specified behavior;
[0169] The information determination module is specifically configured to determine the intersection time of the trajectory and each specified trajectory of the specified object; determine the number of matches between the behavior time and the intersection time as the number of contacts corresponding to the trajectory.
[0170] Optionally, the contact information meeting the preset contact abnormal condition includes: the number of contacts is greater than or equal to the contact number threshold.
[0171] Optionally, the trajectory data acquisition module is specifically configured to read the trajectory data of the object to be recognized in the target scenario from the object file of the object to be recognized.
[0172] Optionally, the device further includes:
[0173] An image data acquisition module, configured to acquire image data collected for a target scene;
[0174] An object recognition module, configured to recognize an object included in the image data as an object to be processed;
[0175] A trajectory recognition module, configured to perform trajectory recognition on each object to be processed based on the image data to obtain the trajectory of the object to be processed;
[0176] A data storage module, configured to determine an object file to which the object to be processed belongs, and write the generated trajectory into the determined object file to obtain trajectory data in the object file.
[0177] Optionally, each object file further includes the face attributes of the object to which the object file belongs;
[0178] The data storage module is specifically configured to obtain the face attributes of the object to be processed based on the image data; determine whether there is an object file in the existing object files whose included face attributes match the obtained face attributes; if so, determine the object file whose included face attributes match the obtained face attributes as the object file to which the object to be processed belongs.
[0179] Optionally, each object file further includes a collection identifier of the object to which the object file belongs; the collection identifier of each object is an identifier generated when the image data of the object is collected;
[0180] The data storage module is further configured to, if there is no object file whose included face attributes match the obtained face attributes, determine the collection identifier of the object to be processed; determine whether there is an object file in the existing object files whose included collection identifier is the same as the determined collection identifier; if so, determine the object file whose included collection identifier is the same as the determined collection identifier as the object file to which the object to be processed belongs.
[0181] Optionally, each object file further includes the human body attributes of the object to which the object file belongs;
[0182] The data storage module is further configured to, if there is no object file whose included collection identifier is the same as the determined collection identifier, determine the human body attributes of the object to be processed; determine whether there is an object file in the existing object files whose included human body attributes match the determined human body attributes; if so, determine the object file whose included human body attributes match the determined human body attributes as the object file to which the object to be processed belongs.
[0183] Optionally, the data storage module is further configured to generate an object profile of the object to be processed based on at least one of the face attributes, the collection identifier, and the human body attributes of the object to be processed if there is no object profile whose included human body attributes match the determined human body attributes.
[0184] Optionally, the image data acquisition module is further configured to identify, before acquiring the trajectory data of the object to be recognized in the target scenario, the objects belonging to the specified category in the target scenario as the objects to be recognized, and the objects not belonging to the specified category as the specified objects.
[0185] Optionally, the image data acquisition module is specifically configured to perform clothing detection and / or behavior detection on each object in the target scenario, and if the object wears the specified type of service and / or performs the specified behavior, then use the object as the object to be recognized.
[0186] The above solution provided by the embodiments of the present invention can acquire the trajectory data of the object to be recognized in the target scenario, and then, based on the acquired trajectory data, determine the stay information of the object to be recognized in the target scenario, and determine the contact information between the object to be recognized and the specified object in the target scenario, and if the stay information meets the preset stay anomaly condition, and / or the contact information meets the preset contact anomaly condition, then determine that the object to be recognized is an abnormal object. Since it is possible to determine whether the object to be recognized is an abnormal object based on the stay information and contact information of the object to be recognized, the automatic recognition of abnormal objects is realized, thereby improving the efficiency of object recognition.
[0187] The embodiments of the present invention also provide an electronic device, as Figure 4 shown, including a processor 401, a communication interface 402, a memory 403, and a communication bus 404. Among them, the processor 401, the communication interface 402, and the memory 403 communicate with each other through the communication bus 404.
[0188] The memory 403 is used to store a computer program;
[0189] The processor 401 is configured to implement the steps of the object recognition method provided by the embodiments of the present invention when executing the program stored in the memory 403.
[0190] The communication bus mentioned in the above electronic device may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, only a thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0191] The communication interface is used for communication between the above-mentioned electronic device and other devices.
[0192] The memory may include a Random Access Memory (RAM), or may also include a Non-Volatile Memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0193] The above-mentioned processor may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0194] In another embodiment provided by the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed by a processor, the steps of any of the above object recognition methods are implemented.
[0195] In another embodiment provided by the present invention, there is also provided a computer program product containing instructions, which when running on a computer, causes the computer to execute any of the object recognition methods in the above embodiments.
[0196] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more integrated available media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid-state disk (SSD)).
[0197] It should be noted that in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including", or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or device that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the presence of additional identical elements in the process, method, article, or device that includes the element.
[0198] Each embodiment in this specification is described in a related manner. The same or similar parts among the embodiments can be referred to each other, and the differences between each embodiment and other embodiments are emphasized. In particular, for devices, electronic devices, computer-readable storage media, and computer program products, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0199] The above are only the preferred embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are all included within the protection scope of the present invention.
Claims
1. An object recognition method, characterized in that, The method includes: Obtaining trajectory data of an object to be recognized in a target scenario; Based on the obtained trajectory data, determining the stay information of the object to be recognized in the target scenario, and determining the contact information between the object to be recognized and a specified object in the target scenario; each time the object to be recognized stays in the target scenario, a trajectory is generated; the stay information includes: the number of stays and / or the stay duration; the number of stays is: the number of trajectories of the object to be recognized in the target scenario; the stay duration is: the sum of the trajectory durations of each trajectory of the object to be recognized in the target scenario; If the stay information meets a preset stay anomaly condition and / or the contact information meets a preset contact anomaly condition, then determine that the object to be recognized is an abnormal object; The contact information includes the number of contacts; the determining, based on the obtained trajectory data, of the contact information between the object to be recognized and the specified object in the target scenario includes: Based on the obtained trajectory data, determining each trajectory of the object to be recognized in the target scenario; For each trajectory of the object to be recognized, based on this trajectory and each specified trajectory of the specified object, determining the number of contacts between the object to be recognized and the specified object during the formation of this trajectory as the number of contacts corresponding to this trajectory; where each of the specified trajectories is a trajectory of the specified object in the target scenario; Calculating the sum of the number of contacts corresponding to each trajectory of the object to be recognized to obtain the number of contacts between the object to be recognized and the specified object.
2. The method according to claim 1, characterized in that The determining, based on the obtained trajectory data, of the stay information of the object to be recognized in the target scenario includes: Based on the obtained trajectory data, determining the number of trajectories of the object to be recognized in the target scenario as the number of stays of the object to be recognized; and / or; Based on the obtained trajectory data, determining the trajectory duration of each trajectory of the object to be recognized in the target scenario, and calculating the sum of the determined trajectory durations of each trajectory to obtain the stay duration of the object to be recognized in the target scenario.
3. The method according to claim 1, characterized in that, Before determining, based on this trajectory and each specified trajectory of the specified object, the number of contacts between the object to be recognized and the specified object during the formation of this trajectory as the number of contacts corresponding to this trajectory, the method further includes: Performing a specified behavior detection on the object to be recognized to obtain the behavior time when the object to be recognized performs the specified behavior; The determining, based on this trajectory and each specified trajectory of the specified object, of the number of contacts between the object to be recognized and the specified object during the formation of this trajectory as the number of contacts corresponding to this trajectory includes: Determining the intersection time when this trajectory intersects with each specified trajectory of the specified object; Determining the number of matches between the behavior time and the intersection time as the number of contacts corresponding to this trajectory.
4. The method according to claim 1, wherein The obtaining of the trajectory data of the object to be recognized in the target scenario includes: Read the trajectory data of the object to be recognized in the target scenario from the object file of the object to be recognized.
5. The method according to claim 4, wherein Generate the trajectory data in the object file by the following steps, including: Obtain the image data collected for the target scenario; Identify the objects included in the image data as the objects to be processed; For each object to be processed, based on the image data, perform trajectory recognition on the object to be processed to obtain the trajectory of the object to be processed; Determine the object file to which the object to be processed belongs, and write the generated trajectory into the determined object file to obtain the trajectory data in the object file.
6. The method according to claim 5, characterized in that, Each object file also includes the face attributes of the object to which the object file belongs; The determination of the object file to which the object to be processed belongs includes: Based on the image data, obtain the face attributes of the object to be processed; Judge whether there is an object file in the existing object files whose included face attributes match the obtained face attributes; If there is, determine the object file whose included face attributes match the obtained face attributes as the object file to which the object to be processed belongs.
7. The method according to claim 6, wherein Each object file also includes the collection identifier of the object to which the object file belongs; the collection identifier of each object is the identifier generated when collecting the image data of the object; The method further includes: If there is no object file whose included face attributes match the obtained face attributes, determine the collection identifier of the object to be processed; Judge whether there is an object file in the existing object files whose included collection identifier is the same as the determined collection identifier; If there is, determine the object file whose included collection identifier is the same as the determined collection identifier as the object file to which the object to be processed belongs.
8. The method according to claim 7, characterized in that Each object file also includes the human body attributes of the object to which the object file belongs; The method further includes: If there is no object file whose included collection identifier is the same as the determined collection identifier, determine the human body attributes of the object to be processed; Judge whether there is an object file in the existing object files whose included human body attributes match the determined human body attributes; If there is, determine the object file whose included human body attributes match the determined human body attributes as the object file to which the object to be processed belongs.
9. The method according to claim 1, characterized in that Before obtaining the trajectory data of the object to be recognized in the target scenario, the method further includes: Identify the objects belonging to the specified category in the target scenario as the objects to be recognized, and identify the objects that do not belong to the specified category as the specified objects.
10. An object recognition device, characterized in that, The device includes: A trajectory data acquisition module, configured to acquire the trajectory data of the object to be recognized in the target scenario; An information determination module, configured to determine the stay information of the object to be recognized in the target scenario based on the acquired trajectory data, and determine the contact information between the object to be recognized and a specified object in the target scenario; each time the object to be recognized stays in the target scenario, a trajectory is generated; the stay information includes: the number of stays and / or the stay duration; the number of stays is: the number of trajectories of the object to be recognized in the target scenario; the stay duration is: the sum value of the trajectory durations of each trajectory of the object to be recognized in the target scenario. A determination module, configured to determine that the object to be recognized is an abnormal object if the stay information meets a preset stay abnormal condition and / or the contact information meets a preset contact abnormal condition. The contact information includes the number of contacts; the information determination module is specifically configured to determine each trajectory of the object to be recognized in the target scenario based on the acquired trajectory data; for each trajectory of the object to be recognized, based on this trajectory and each specified trajectory of the specified object, determine the number of contacts between the object to be recognized and the specified object during the formation of this trajectory, as the number of contacts corresponding to this trajectory; wherein, each specified trajectory is the trajectory of the specified object in the target scenario; calculate the sum of the number of contacts corresponding to each trajectory of the object to be recognized to obtain the number of contacts between the object to be recognized and the specified object.
11. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory complete communication with each other through the communication bus. The memory is used to store a computer program. The processor is configured to implement the method steps described in any one of claims 1-9 when executing the program stored on the memory.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the method steps described in any one of claims 1-9 are implemented.
Citation Information
Patent Citations
Object monitoring method and device, equipment and storage medium
CN110062210A
Interest point determination method and device, computer equipment and storage medium
CN111380541A
Personnel management method and related device
CN111489276A