CN112614263A - Method and device for controlling gate, computer equipment and storage medium - Google Patents

Method and device for controlling gate, computer equipment and storage medium Download PDF

Info

Publication number
CN112614263A
CN112614263A CN202011600571.0A CN202011600571A CN112614263A CN 112614263 A CN112614263 A CN 112614263A CN 202011600571 A CN202011600571 A CN 202011600571A CN 112614263 A CN112614263 A CN 112614263A
Authority
CN
China
Prior art keywords
feature vector
image
similarity
detected
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011600571.0A
Other languages
Chinese (zh)
Inventor
潘军威
牟宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202011600571.0A priority Critical patent/CN112614263A/en
Publication of CN112614263A publication Critical patent/CN112614263A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07CTIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
    • G07C9/00Individual registration on entry or exit
    • G07C9/30Individual registration on entry or exit not involving the use of a pass
    • G07C9/32Individual registration on entry or exit not involving the use of a pass in combination with an identity check
    • G07C9/37Individual registration on entry or exit not involving the use of a pass in combination with an identity check using biometric data, e.g. fingerprints, iris scans or voice recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The application provides a method and a device for controlling a gate, computer equipment and a storage medium, which are used for solving the problem of low efficiency of controlling the gate. The method comprises the following steps: obtaining a characteristic vector of an image to be detected; the image to be detected comprises the face of a target user to pass through a gate at present; if the first reference characteristic vector with the similarity to the characteristic vector larger than a first preset similarity threshold does not exist in a preset first reference characteristic vector set, acquiring an attribute value of the image to be detected, and determining a second reference characteristic vector set associated with the attribute value according to the attribute value; and if it is determined that a second reference feature vector with the similarity to the feature vector larger than a second preset similarity threshold exists in the second reference feature vector set, controlling the gate to be opened.

Description

Method and device for controlling gate, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for controlling a gate, a computer device, and a storage medium.
Background
Along with the continuous development of science and technology, access control systems become more and more intelligent. For example, an access control system in an office, a community, or a school, etc., can recognize the face of a user outside the access control system in a very short time, for example, 200 ms. The access control system can determine whether the user can pass through the gate according to the identification result, and the user does not need to wait outside the gate, so that the non-inductive passing is realized.
However, in the process of identifying the face of the user, it is usually required to ensure that the face of the user is not occluded, so that accurate identification can be performed. Then, when the user carries a mask or a hat, the access control system needs to continuously detect the face of the user, and when the user takes off the mask or the hat, the face of the user is identified, so that the gate can be controlled according to the identification result. It can be seen that the efficiency of the gate control system is low when the user has a mask or a cap, etc.
Disclosure of Invention
The embodiment of the application provides a method and a device for controlling a gate, computer equipment and a storage medium, which are used for solving the problem of low efficiency of controlling the gate.
In a first aspect, a method for controlling a gate is provided, including:
obtaining a characteristic vector of an image to be detected; the image to be detected comprises the face of a target user to pass through a gate at present;
if the first reference characteristic vector with the similarity to the characteristic vector larger than a first preset similarity threshold does not exist in a preset first reference characteristic vector set, acquiring an attribute value of the image to be detected, and determining a second reference characteristic vector set associated with the attribute value according to the attribute value; the attribute values are used for representing the types of the obstacles on the faces of the users, the preset first reference feature vector set comprises reference feature vectors of reference images which are associated with the users and do not contain the obstacles, and the second reference feature vector set comprises reference feature vectors of reference images which are associated with the users and contain the obstacles;
and if it is determined that a second reference feature vector with the similarity to the feature vector larger than a second preset similarity threshold exists in the second reference feature vector set, controlling the gate to be opened.
Optionally, the method further includes:
if the first reference characteristic vector exists in the preset first reference characteristic vector set, controlling the gate to be opened, and determining whether the first similarity between the first reference characteristic vector and the characteristic vector is greater than a first updating threshold value;
and if the first similarity is larger than the first updating threshold, updating the first reference feature vector into the feature vector.
Optionally, the method further includes:
and if the first similarity is larger than the first updating threshold, updating the first updating threshold to the first similarity.
Optionally, the method further includes:
determining whether a second similarity of the second reference feature vector to the feature vector is greater than a second update threshold;
and if the second similarity is larger than the second updating threshold, updating the second reference feature vector into the feature vector.
Optionally, the method further includes:
if the second similarity is greater than the second update threshold, updating the second update threshold to the second similarity.
Optionally, obtaining the attribute value of the image to be detected includes:
inputting the feature vector into a trained target classification model to obtain the probability that the shielding object contained in the image to be detected belongs to each preset shielding object type;
and sequencing the probability of the shielding object contained in the image to be detected belonging to each preset shielding object type from large to small, if the difference value between the probabilities arranged at the first two positions is determined to be larger than the preset probability difference, determining the preset shielding object type corresponding to the probability arranged at the first position as the shielding object type of the shielding object contained in the image to be detected, and obtaining the attribute value of the image to be detected.
In a second aspect, there is provided an apparatus for controlling a gate, comprising:
an acquisition module: the method comprises the steps of obtaining a feature vector of an image to be detected; the image to be detected comprises the face of a target user to pass through a gate at present;
a processing module: the method comprises the steps of obtaining an attribute value of an image to be detected if a first reference characteristic vector with the similarity to a characteristic vector larger than a first preset similarity threshold value does not exist in a preset first reference characteristic vector set, and determining a second reference characteristic vector set associated with the attribute value according to the attribute value; the attribute values are used for representing the types of the obstacles on the faces of the users, the preset first reference feature vector set comprises reference feature vectors of reference images which are associated with the users and do not contain the obstacles, and the second reference feature vector set comprises reference feature vectors of reference images which are associated with the users and contain the obstacles;
the processing module is further configured to: and if it is determined that a second reference feature vector with the similarity to the feature vector larger than a second preset similarity threshold exists in the second reference feature vector set, controlling the gate to be opened.
Optionally, the processing module is further configured to:
if the first reference characteristic vector exists in the preset first reference characteristic vector set, controlling the gate to be opened, and determining whether the first similarity between the first reference characteristic vector and the characteristic vector is greater than a first updating threshold value;
and if the first similarity is larger than the first updating threshold, updating the first reference feature vector into the feature vector.
Optionally, the processing module is further configured to:
and if the first similarity is larger than the first updating threshold, updating the first updating threshold to the first similarity.
Optionally, the processing module is further configured to:
determining whether a second similarity of the second reference feature vector to the feature vector is greater than a second update threshold;
and if the second similarity is larger than the second updating threshold, updating the second reference feature vector into the feature vector.
Optionally, the processing module is further configured to:
if the second similarity is greater than the second update threshold, updating the second update threshold to the second similarity.
Optionally, the processing module is specifically configured to:
inputting the feature vector into a trained target classification model to obtain the probability that the shielding object contained in the image to be detected belongs to each preset shielding object type;
and sequencing the probability of the shielding object contained in the image to be detected belonging to each preset shielding object type from large to small, if the difference value between the probabilities arranged at the first two positions is determined to be larger than the preset probability difference, determining the preset shielding object type corresponding to the probability arranged at the first position as the shielding object type of the shielding object contained in the image to be detected, and obtaining the attribute value of the image to be detected.
In a third aspect, a computer device comprises:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory and executing the method according to the first aspect according to the obtained program instructions.
In a fourth aspect, a storage medium stores computer-executable instructions for causing a computer to perform the method of the first aspect.
In the embodiment of the application, whether a reference image matched with the image to be detected exists in the reference image which is associated with each user and does not contain the shielding object is determined by comparing the feature vector of the image to be detected with each reference feature vector in the preset first reference feature vector set, so that whether a target user is one of the users can be determined according to the comparison result when the shielding object does not exist on the face of the user, and whether the gate is opened is controlled. If the reference image matched with the image to be detected does not exist, the attribute value of the image to be detected can be determined, and the type of the shielding object contained in the image to be detected is determined through the attribute value. By comparing the feature vectors of the image to be detected with the reference feature vectors in the second reference feature vector set associated with the attribute values, whether a reference image matched with the image to be detected exists in the reference image associated with each user and containing the shielding object is determined, and when the shielding object exists on the face of the user, whether the target user is one of the users can be determined according to the comparison result, so that whether the gate is opened or not is controlled. After the target user does not need to wait for the face shelter to be removed, whether the target user can pass through the gate or not is judged, and the gate control efficiency is improved. And whether the condition of containing the shielding object is distinguished, a first preset similarity threshold and a second preset similarity threshold are respectively set to compare the feature vector of the image to be detected with each reference feature vector in a preset first reference feature vector set, compare the feature vector of the image to be detected with each reference feature vector in a second reference feature vector set, improve the accuracy of determining the first reference feature vector and the second reference feature vector and further improve the accuracy of controlling the gate.
Drawings
Fig. 1 is a schematic view of an application scenario of a method for controlling a gate according to an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating a method for controlling gates according to an embodiment of the present disclosure;
FIG. 3 is a first schematic structural diagram of an apparatus for controlling gates according to an embodiment of the present disclosure;
fig. 4 is a second schematic structural diagram of a device for controlling gates according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application.
In addition, in the embodiments of the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items.
With the continuous development of science and technology, the control process of the gate becomes more and more intelligent. For example, an entrance guard system in an office, a community, or a school, etc. can perform facial recognition on a target user who is coming to the gate from the outside of the gate in a very short time, for example, 200 ms. The access control system can determine whether the target user can pass through the gate according to the identification result, if the target user can pass through the gate, the gate is controlled to be opened, so that the user can directly pass through the gate when walking to the gate, waiting outside the gate is not needed, and the non-inductive passing is realized.
However, in the process of identifying the face of the target user, it is usually required to ensure that the face of the target user is not blocked, so that accurate identification can be performed. Then, when the target user carries a mask or a hat, the access control system needs to continuously detect the face of the target user, and when the target user takes off the mask or the hat, the access control system identifies the face of the target user, so that the gate can be controlled according to the identification result. It can be seen that the access control system has a problem of low gate control efficiency when the target user has a mask or a cap, and has similar problems for other devices for controlling the gate.
In view of this, the present application provides a method for controlling a gate, which may be applied to a terminal device or a network device. The terminal equipment can be a mobile phone, a tablet computer, a personal computer or the like; the network device may be a local server, a third party server, a cloud server, or the like.
In the embodiment of the application, whether a reference image matched with the image to be detected exists in the reference image which is associated with each user and does not contain the shielding object is determined by comparing the feature vector of the image to be detected with each reference feature vector in the preset first reference feature vector set, so that whether a target user is one of the users can be determined according to the comparison result when the shielding object does not exist on the face of the user, and whether the gate is opened is controlled. If the reference image matched with the image to be detected does not exist, the attribute value of the image to be detected can be determined, and the type of the shielding object contained in the image to be detected is determined through the attribute value. By comparing the feature vectors of the image to be detected with the reference feature vectors in the second reference feature vector set associated with the attribute values, whether a reference image matched with the image to be detected exists in the reference image associated with each user and containing the shielding object is determined, and when the shielding object exists on the face of the user, whether the target user is one of the users can be determined according to the comparison result, so that whether the gate is opened or not is controlled. After the target user does not need to wait for the face shelter to be removed, whether the target user can pass through the gate or not is judged, and the gate control efficiency is improved.
Please refer to fig. 1, which is a schematic view of an application scenario of a method for controlling gates according to an embodiment of the present application. The application scenario includes a photographing apparatus 101, a processing apparatus 102, and a gate 103. Communication is possible between the photographing apparatus 101 and the processing apparatus 102; communication between the processing device 102 and the gate 103 is possible; communication is possible between the photographing apparatus 101 and the gate 103. The communication mode may be a wired communication mode, for example, communication is performed through a connection network line or a serial port line; the communication may also be in a wireless communication mode, for example, communication is performed through technologies such as bluetooth or wireless fidelity (WIFI), and the specific limitations are not limited.
As an embodiment, the photographing apparatus 101 and the processing apparatus 102 may be the same apparatus; alternatively, the processing device 102 and the gate 103 may be the same device; alternatively, the photographing apparatus 101 and the gate 103 may be the same apparatus; alternatively, the photographing apparatus 101, the processing apparatus 102, and the gate 103 may be the same apparatus. In the embodiment of the present application, the photographing apparatus 101, the processing apparatus 102, and the gate 103 are different apparatuses, respectively.
As an example, the device to be controlled is taken as the gate 103 in the embodiment of the present application, and other devices to be controlled based on the face recognition result, such as an automatic door, may also be controlled by using the method for controlling the gate described in the present application, which is not limited specifically. In the embodiment of the present application, the recognition result of the face of the user is taken as an example to be introduced to control the gate 103, and the recognition result of other targets, such as the behavior of the target user, the wearing speed, or the movement speed of the target object, may also be taken as a basis to control the gate 103, which is not limited specifically.
The following is a brief description of the interaction process between the devices based on the application scenario of fig. 1.
The shooting device 101 shoots a shooting scene, and when it is determined that a target user exists in the shooting scene, an image to be detected is obtained, wherein the image to be detected comprises the face of the target user currently to pass through the gate 103. The photographing apparatus 101 transmits an image to be detected to the processing apparatus 102, and the processing apparatus 102 receives the image to be detected from the photographing apparatus 101.
The processing device 102 performs feature extraction on the image to be detected to obtain a feature vector of the image to be detected. The processing device 102 determines whether a first reference feature vector with a similarity greater than a first preset similarity threshold with the feature vector of the image to be detected exists in a preset first reference feature vector set. If there is no first reference feature vector having a similarity to the feature vector of the image to be detected greater than a first preset similarity threshold, the processing device 102 determines an attribute value of the image to be detected. The processing device 102 determines a second reference feature vector set associated with the attribute value according to the attribute value of the image to be detected. The processing device 102 determines whether a second reference feature vector with a similarity greater than a second preset similarity threshold with the feature vector of the image to be detected exists in the second reference feature vector set.
If a second reference feature vector with the similarity degree with the feature vector of the image to be detected being greater than a second preset similarity degree threshold exists, the processing device 102 sends a control signal for controlling the gate 103 to be opened to the gate 103, and after the gate 103 receives the control signal sent from the processing device 102, the gate 103 is opened.
Please refer to fig. 2, which is a flowchart illustrating a method for controlling gates according to an embodiment of the present disclosure. The method of controlling the gate is described in detail below.
S201, obtaining an image to be detected.
The shooting equipment 101 can shoot a shooting scene in real time or at regular time, then carry out target detection on the shot image, and take the image of a target user to pass through the gate 103 as an image to be detected; or, the shot picture can be detected, when the target user exists in the shot picture, the shot scene is shot to obtain the image to be detected, and the specific shooting time is not limited.
For example, in an office area, the photographing apparatus 101 may perform object detection on whether or not a work certificate is included in the photographing screen, and determine whether or not a target user is present in the photographing screen. If it is determined that the photographed image includes the employee's card, the photographing parameters of the photographing apparatus 101 may be adjusted according to the relative distance between the employee's card and the face of the target user, and the ratio of the face of the target user in the photographed image may be enlarged, for example, the ratio of the pixel point occupied by the face of the target user to the total pixel point of the photographed image may be increased. And when the proportion of the face of the target user in the shooting picture reaches a preset proportion, shooting the shooting picture to obtain an image to be detected. Therefore, the shooting equipment 101 can not shoot the user without the employee's card, the proportion of the face of the target user in the shooting picture is improved, the proportion of the background in the image to be detected is reduced, and the accuracy of feature recognition of the subsequent image to be detected is improved.
For another example, in an airport, because there are many users, the photographing apparatus 101 may determine the relative distance between the photographing apparatus 101 and each user, and the relative angle between the plane of the face of the user and the plane of the photographing apparatus 101. The photographing apparatus 101 may determine a user whose relative distance is closest and whose relative angle is within a preset angle range as the target user. The photographing apparatus 101 may adjust the photographing parameters of the photographing apparatus 101 according to the relative distance and the relative angle, and enlarge the occupation ratio of the face of the target user in the photographing screen. And when the proportion of the face of the target user in the shooting picture reaches a preset proportion, shooting the shooting picture to obtain an image to be detected. The user closest to the shooting device 101 is shot, the situation that the user behind the team is determined as the target user when more people pass in line at the airport is reduced, and the accuracy of obtaining the image to be detected is improved.
The preset percentage may be a value set when the shooting device 101 leaves a factory, or may be a value set based on a use scene when the shooting device 101 is used, or may be a value determined by the shooting device 101 according to historical target detection data, which is not limited specifically.
The photographing apparatus 101 may transmit an image to be detected to the processing apparatus 102 after obtaining the image to be detected, and the processing apparatus 102 may obtain the image to be detected after receiving the image to be detected from the photographing apparatus.
S202, obtaining a feature vector of the image to be detected.
After obtaining the image to be detected, the processing device 102 may perform feature extraction on the image to be detected to obtain a feature vector of the image to be detected. The feature vectors may be used to characterize facial features of the target user. The feature extraction of the image to be detected may be implemented by a conventional image processing technique, or implemented by a machine learning technique, etc., which will not be described herein.
As an embodiment, the process of feature extraction on the image to be detected may be performed by the photographing apparatus 101. After obtaining the image to be detected, the shooting device 101 may perform feature extraction on the image to be detected to obtain a feature vector of the image to be detected. The photographing apparatus 101 transmits the feature vector of the image to be detected to the processing apparatus 102 after obtaining the feature vector of the image to be detected. After the processing device 102 receives the feature vector of the image to be detected from the photographing device 101, the feature vector of the image to be detected is obtained.
S203, determining whether a first reference feature vector with the similarity to the feature vector of the image to be detected larger than a first preset similarity threshold exists in a preset first reference feature vector set.
After obtaining the feature vector of the image to be detected, the processing device 102 may determine whether a first reference feature vector with a similarity greater than a first preset similarity threshold with the feature vector of the image to be detected exists in a preset first reference feature vector set. If there is a first reference feature vector in the preset first reference feature vector set, the processing device 102 performs S204. If there is no first reference feature vector in the preset first reference feature vector set, the processing device 102 performs S205.
The preset first reference feature vector set comprises reference feature vectors of reference images which are associated with users and do not contain the shielding objects. The reference feature vector may be obtained by performing feature extraction on a reference image associated with each user in advance, and may be stored in the processing device 102, or may be stored in another storage device, before the processing device 102 determines whether the first reference feature vector exists in the preset first reference feature vector set, the processing device 102 may obtain the preset first reference feature vector set and the like from the storage device, and feature extraction is not required to be performed on the reference image in real time when the reference feature vector is used, so that unnecessary resource occupation of the processing device 102 is reduced. Wherein each user associated with each reference feature vector in the first set of reference feature vectors is a user having the right to pass through the gate 103.
As an embodiment, the preset first reference feature vector set may further include reference images associated with respective users, and each reference image corresponds to each reference feature vector one to one; or, a preset first reference feature vector set may be associated with a preset first reference image set, and each reference image in the first reference image set corresponds to each reference feature vector in the first reference feature vector set one to one, and so on.
And S204, if a first reference characteristic vector with the similarity to the characteristic vector of the image to be detected larger than a first preset similarity threshold exists, controlling the gate machine 103 to be opened.
If the processing device 102 determines that the first reference feature vector exists in the preset first reference feature vector set, it indicates that the target user is a user having the authority to pass through the gate 103, and thus, the processing device 102 may generate a control signal for controlling the gate to open. The processing device 102 sends a control signal to the gate 103, and after the gate 103 receives the control signal sent by the processing device 102, the gate 103 is opened so that the target user can pass through. After the target user passes, the gate 103 is closed.
As an embodiment, each reference feature vector in a preset first reference feature vector set may be associated with each user authority in a user authority set, where the user authority set includes users having gate passing authorities and may carry the number of visitors. After the processing device 102 determines the first reference feature vector in the first reference feature vector set, the user permission associated with the first reference feature vector, that is, the number of visitors that the target user can carry, may be determined according to the user permission set. According to the number of visitors that the target user can carry, the processing device 102 may control the photographing device 101 to determine whether other users are included in the photographing screen in addition to the target user, and the total number of other users.
If the total number of other users is less than or equal to the number of visitors that the target user can carry, the processing device 102 controls the gate 103 to close the gate 103 after the target user and the other users pass. Therefore, users without the gate passing authority can also pass through the gate 103, and the gate 103 does not need to be closed when passing through one user, so that the efficiency of controlling the gate 103 is improved, and the element loss of the gate 103 in the working process is reduced.
If the total number of other users is greater than the number of visitors that the target user can carry, the processing device 102 may control the gate 103 to close the gate 103 after the target user and the number of visitors that the target user can carry pass; alternatively, the processing device 102 may close the gate 103 after the target user passes through, and the setting may be specifically performed according to the actual situation, which is not limited herein.
As an example, since the user's dress and the like may change over time, the reference images that do not include the obstruction and are associated with the respective users, which are stored in advance, may not be accurate enough. When the processing device 102 determines that the first reference feature vector exists in the preset first reference feature vector set, the processing device 102 may further determine whether a first similarity between the first reference feature vector and the feature vector of the image to be detected is greater than a first update threshold.
If the processing device 102 determines that the first similarity is greater than the first update threshold, it indicates that the image to be detected is very similar to the pre-stored reference image associated with the target user, and the image to be detected is a close shot of the target user relative to the pre-stored reference image associated with the target user, and therefore, the first reference feature vector may be updated to the image feature vector to be detected. If the first reference feature vector set further comprises reference images associated with the respective users, the reference images associated with the target user can be updated to be images to be detected.
Moreover, after the first reference feature vector set is updated, the processing device 102 may update the first update threshold to the first similarity, and then when the image to be detected associated with the target user is obtained next time, the first similarity is updated only when the similarity between the first reference feature vector and the feature vector of the image to be detected is greater than the first similarity, so that the situation that the first reference feature vector set is frequently updated due to the fact that the similarity between the first reference feature vector and the feature vector of the image to be detected is greater than the first update threshold more times because the first update threshold is updated less timely is reduced, the accuracy of the first reference feature vector set is improved, and the accuracy of the gate control unit 103 is further improved.
If the processing device 102 determines that the first similarity is less than or equal to the first update threshold, it indicates that the image to be detected does not have a very similar degree to the pre-stored reference image associated with the target user, and therefore, the first reference feature vector set may not be updated, the first update threshold may not be updated, and the like.
S205, if the first reference characteristic vector with the similarity of the characteristic vector of the image to be detected larger than the first preset similarity threshold does not exist, acquiring the attribute value of the image to be detected.
If the processing device 102 determines that the first reference feature vector does not exist in the preset first reference feature vector set, it indicates that the target user is not matched with each reference feature vector in the first reference feature vector set possibly due to the existence of an obstruction in the face of the target user, and therefore, the processing device 102 may further determine whether an obstruction exists in the image to be detected and the type of the obstruction.
The processing device 102 may input the feature vector of the image to be detected into the trained target classification model, and the target classification model determines the probability that the obstruction in the image to be detected belongs to each preset obstruction type. After obtaining the probability that the obstruction in the image to be detected belongs to each preset obstruction type, the processing device 102 uses the preset obstruction type with the highest probability as the obstruction type of the obstruction in the image to be detected. The trained target classification model is obtained by training a large number of sample feature vectors and sample obstruction type labels of the sample feature vectors. The large number of sample feature vectors and the sample obstruction type labels of the sample feature vectors may be obtained from network resources, or may be sent by other devices, or may be obtained by labeling the sample feature vectors of the mobile phone by using a labeling device, and the like.
Or after obtaining the probability that the obstruction belongs to each preset obstruction type in the image to be detected, the processing device 102 sorts the probabilities that the obstruction belongs to each preset obstruction type in the image to be detected according to the descending order. The processing device 102 determines whether a difference between the probabilities at the first two positions is greater than a preset probability difference, and if so, it indicates that the probability that the obstruction in the image to be detected belongs to a certain preset obstruction type is much greater than other preset obstruction types, so that the preset obstruction type corresponding to the probability at the first position can be determined as the obstruction type of the obstruction contained in the image to be detected. If the probability difference is smaller than or equal to the preset probability difference, the probability difference of the occlusion objects in the image to be detected belonging to each preset occlusion object type is not large, and therefore the image to be detected does not contain the occlusion objects.
The predetermined shade type may include one or more of a mask, a scarf, a hat, or a helmet.
After the processing device 102 obtains the type of the obstruction contained in the image to be detected, the attribute value of the image to be detected can be determined according to the corresponding relationship between the type of the obstruction and the attribute value.
And S206, determining a second reference feature vector set associated with the attribute value.
After the processing device 102 obtains the attribute values of the image to be detected, a second set of reference feature vectors associated with the attribute values may be determined. The second reference feature vector set comprises reference feature vectors of reference images containing the obstruction related to each user. The type of the occlusion object in each reference image in the second reference feature vector set corresponds to the attribute value of the image to be detected determined by the processing device 102.
The second reference feature vector set can also comprise reference images associated with the users, and each reference image corresponds to each reference feature vector one to one; alternatively, the second reference feature vector set may be associated with a second reference image set, each reference image in the second reference image set corresponds to each reference feature vector in the second reference feature vector set one to one, and the like.
The processing device 102 may store the reference feature vector set associated with each attribute value, or the reference feature vector set associated with each attribute value may be stored in other storage devices, and when the processing device 102 needs to determine the second reference feature vector set associated with the attribute value, the reference feature vector set associated with each attribute value may be obtained from the storage device, which is not limited specifically.
And S207, determining whether a second reference feature vector with the similarity to the feature vector of the image to be detected larger than a second preset similarity threshold exists in the second reference feature vector set.
After the processing device 102 obtains the second reference feature vector set, it may be further determined whether there is a second reference feature vector in the second reference feature vector set, where the similarity between the feature vector of the image to be detected and the second reference feature vector is greater than a second preset similarity threshold. If there is a second reference feature vector in the second set of reference feature vectors, the processing device 102 performs S208. If there is no second reference feature vector in the second set of reference feature vectors, the processing device 102 performs S209.
And S208, if a second reference characteristic vector with the similarity to the characteristic vector of the image to be detected larger than a second preset similarity threshold exists, controlling the gate machine 103 to be opened.
If there is a second reference feature vector in the second set of reference feature vectors, then the target user representing a face with an obstruction is the user with access to the gate, and thus the processing device 102 controls the gate 103 to open. The process of the processing device 102 controlling the gate 103 is the same as the process described in S204, and is not described again here.
As an example, since the user's dress, appearance of the long-phase and the obstruction, etc. may change over time, the reference image including the obstruction stored in advance in association with each user may not be accurate enough. When the processing device 102 determines that a second reference feature vector exists in the second set of reference feature vectors, the processing device 102 may further determine whether a second similarity of the second reference feature vector to the feature vector of the image to be detected is greater than a second update threshold.
If the processing device 102 determines that the second similarity is greater than the second update threshold, it indicates that the image to be detected is very similar to the pre-stored reference image associated with the target user, and the image to be detected is a close shot of the target user relative to the pre-stored reference image associated with the target user, so that the second reference feature vector can be updated to the image feature vector to be detected. If the second reference feature vector set further comprises reference images associated with the respective users, the reference images associated with the target user can be updated to be the images to be detected.
Moreover, after the second reference feature vector set is updated, the processing device 102 may update the second update threshold to the second similarity, and then when the image to be detected associated with the target user is obtained next time, the second similarity is updated only when the similarity between the second reference feature vector and the feature vector of the image to be detected is greater than the second similarity, so that the situation that the second reference feature vector set is frequently updated due to the fact that the similarity between the second reference feature vector and the feature vector of the image to be detected is greater than the second update threshold more times because the second update threshold is not updated timely is reduced, the accuracy of the second reference feature vector set is improved, and the accuracy of the gate control unit 103 is further improved.
If the processing device 102 determines that the second similarity is less than or equal to the second update threshold, it indicates that the image to be detected does not have a very similar degree to the pre-stored reference image associated with the target user, and therefore, the second reference feature vector set may not be updated, the second update threshold may not be updated, and the like.
S209, if the second reference characteristic vector with the similarity of the characteristic vector of the image to be detected larger than the second preset similarity threshold does not exist, outputting prompt information.
If the processing device 102 determines that the first reference feature vector does not exist in the preset second reference feature vector set, indicating that the target user is possibly a user without the gate-passing authority, the processing device 102 may output a prompt message for prompting that the user cannot pass through, or needs the assistance of a manager, or the like. The processing device 102 may output the prompting information in a variety of ways, including, for example, an audio output such as a prompting voice, music, or beep; video output such as text, animation or pictures; also including light output, such as light color change or flashing; and sending prompt information to the terminal equipment of the manager.
As an example, S201, S203 to S204, S207 and S209 are optional steps.
Based on the same inventive concept, the embodiment of the present application provides an apparatus for controlling a gate, which is equivalent to the processing device 102 discussed above and can implement the corresponding functions of the foregoing method for controlling a gate. Referring to fig. 3, the apparatus includes an obtaining module 301 and a processing module 302, wherein:
the acquisition module 301: the method comprises the steps of obtaining a feature vector of an image to be detected; the image to be detected comprises the face of a target user to pass through the gate at present;
the processing module 302: the attribute value of the image to be detected is obtained if the first reference characteristic vector with the similarity to the characteristic vector larger than a first preset similarity threshold value does not exist in the preset first reference characteristic vector set, and a second reference characteristic vector set associated with the attribute value is determined according to the attribute value; the attribute value is used for representing the type of an obstruction of a user face, a preset first reference feature vector set comprises reference feature vectors of reference images which are associated with each user and do not contain the obstruction, and a second reference feature vector set comprises reference feature vectors of reference images which are associated with each user and contain the obstruction;
the processing module 302 is further configured to: and if the second reference characteristic vector with the similarity greater than a second preset similarity threshold exists in the second reference characteristic vector set, controlling the gate to be opened.
In a possible embodiment, the processing module 302 is further configured to:
if the first reference characteristic vector exists in the preset first reference characteristic vector set, controlling a gate to be opened, and determining whether the first similarity between the first reference characteristic vector and the characteristic vector is greater than a first updating threshold value;
if the first similarity is greater than the first updating threshold, the first reference feature vector is updated to be the feature vector.
In a possible embodiment, the processing module 302 is further configured to:
if the first similarity is greater than the first updating threshold, the first updating threshold is updated to the first similarity.
In a possible embodiment, the processing module 302 is further configured to:
determining whether a second similarity of the second reference feature vector to the feature vector is greater than a second update threshold;
and if the second similarity is larger than a second updating threshold, updating the second reference feature vector into the feature vector.
In a possible embodiment, the processing module 302 is further configured to:
and if the second similarity is larger than the second updating threshold, updating the second updating threshold to be the second similarity.
In a possible embodiment, the processing module 302 is specifically configured to:
inputting the feature vector into a trained target classification model to obtain the probability that the shielding object contained in the image to be detected belongs to each preset shielding object type;
and sequencing the probability of the shielding object contained in the image to be detected belonging to each preset shielding object type from large to small, and if the difference value between the probabilities arranged at the first two positions is determined to be larger than the preset probability difference, determining the preset shielding object type corresponding to the probability arranged at the first position as the shielding object type of the shielding object contained in the image to be detected, so as to obtain the attribute value of the image to be detected.
Based on the same inventive concept, an embodiment of the present application provides a computer device, which can implement the functions of the aforementioned apparatus for controlling a gate, and the computer device may be equivalent to the aforementioned processing device 102, please refer to fig. 4, and the computer device includes:
at least one processor 401 and a memory 402 connected to the at least one processor 401, in this embodiment, a specific connection medium between the processor 401 and the memory 402 is not limited in this application, and fig. 4 illustrates an example in which the processor 401 and the memory 402 are connected by a bus 400. The bus 400 is shown in fig. 4 by a thick line, and the connection manner between other components is merely illustrative and not limited thereto. The bus 400 may be divided into an address bus, a data bus, a control bus, etc., and is shown with only one thick line in fig. 4 for ease of illustration, but does not represent only one bus or type of bus. Alternatively, the processor 401 may also be referred to as the controller 401, without limitation to name.
In the embodiment of the present application, the memory 402 stores instructions executable by the at least one processor 401, and the at least one processor 401 can execute the method for controlling the gate discussed above by executing the instructions stored in the memory 402. The processor 401 may implement the functions of the respective modules in the control apparatus shown in fig. 3.
The processor 401 is a control center of the control device, and may connect various portions of the entire control device through various interfaces and lines, and perform various functions and process data of the control device by executing or executing instructions stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring on the control device.
In one possible embodiment, processor 401 may include one or more processing units and processor 401 may integrate an application processor, which primarily handles operating systems, user interfaces, application programs, and the like, and a modem processor, which primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 401. In some embodiments, processor 401 and memory 402 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 401 may be a general-purpose processor, such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like, that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method for controlling a gate disclosed in the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
Memory 402, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 402 may include at least one type of storage medium, and may include, for example, a flash Memory, a hard disk, a multimedia card, a card-type Memory, a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), a charge Erasable Programmable Read Only Memory (EEPROM), a magnetic Memory, a magnetic disk, an optical disk, and so on. The memory 402 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 402 in the embodiments of the present application may also be circuitry or any other device capable of performing a storage function for storing program instructions and/or data.
The processor 401 is programmed to solidify the code corresponding to the method for controlling the gate described in the foregoing embodiment into the chip, so that the chip can execute the steps of the method for controlling the gate of the embodiment shown in fig. 2 when running. How to program the processor 401 is well known to those skilled in the art and will not be described in detail herein.
Based on the same inventive concept, the present application also provides a storage medium storing computer instructions, which when executed on a computer, cause the computer to execute the method for controlling a gate discussed above.
In some possible embodiments, the various aspects of the method for controlling a gate provided by the present application may also be implemented in the form of a program product comprising program code for causing a control apparatus to perform the steps of the method for controlling a gate according to various exemplary embodiments of the present application described above in this specification when the program product is run on a device.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method of controlling a gate, comprising:
obtaining a characteristic vector of an image to be detected; the image to be detected comprises the face of a target user to pass through a gate at present;
if the first reference characteristic vector with the similarity to the characteristic vector larger than a first preset similarity threshold does not exist in a preset first reference characteristic vector set, acquiring an attribute value of the image to be detected, and determining a second reference characteristic vector set associated with the attribute value according to the attribute value; the attribute values are used for representing the types of the obstacles on the faces of the users, the preset first reference feature vector set comprises reference feature vectors of reference images which are associated with the users and do not contain the obstacles, and the second reference feature vector set comprises reference feature vectors of reference images which are associated with the users and contain the obstacles;
and if it is determined that a second reference feature vector with the similarity to the feature vector larger than a second preset similarity threshold exists in the second reference feature vector set, controlling the gate to be opened.
2. The method of claim 1, further comprising:
if the first reference characteristic vector exists in the preset first reference characteristic vector set, controlling the gate to be opened, and determining whether the first similarity between the first reference characteristic vector and the characteristic vector is greater than a first updating threshold value;
and if the first similarity is larger than the first updating threshold, updating the first reference feature vector into the feature vector.
3. The method of claim 2, further comprising:
and if the first similarity is larger than the first updating threshold, updating the first updating threshold to the first similarity.
4. The method of claim 1, further comprising:
determining whether a second similarity of the second reference feature vector to the feature vector is greater than a second update threshold;
and if the second similarity is larger than the second updating threshold, updating the second reference feature vector into the feature vector.
5. The method of claim 4, further comprising:
if the second similarity is greater than the second update threshold, updating the second update threshold to the second similarity.
6. The method according to claim 1, wherein obtaining the property values of the image to be detected comprises:
inputting the feature vector into a trained target classification model to obtain the probability that the shielding object contained in the image to be detected belongs to each preset shielding object type;
and sequencing the probability of the shielding object contained in the image to be detected belonging to each preset shielding object type from large to small, if the difference value between the probabilities arranged at the first two positions is determined to be larger than the preset probability difference, determining the preset shielding object type corresponding to the probability arranged at the first position as the shielding object type of the shielding object contained in the image to be detected, and obtaining the attribute value of the image to be detected.
7. An apparatus for controlling a gate, comprising:
an acquisition module: the method comprises the steps of obtaining a feature vector of an image to be detected; the image to be detected comprises the face of a target user to pass through a gate at present;
a processing module: the method comprises the steps of obtaining an attribute value of an image to be detected if a first reference characteristic vector with the similarity to a characteristic vector larger than a first preset similarity threshold value does not exist in a preset first reference characteristic vector set, and determining a second reference characteristic vector set associated with the attribute value according to the attribute value; the attribute values are used for representing the types of the obstacles on the faces of the users, the preset first reference feature vector set comprises reference feature vectors of reference images which are associated with the users and do not contain the obstacles, and the second reference feature vector set comprises reference feature vectors of reference images which are associated with the users and contain the obstacles;
the processing module is further configured to: and if it is determined that a second reference feature vector with the similarity to the feature vector larger than a second preset similarity threshold exists in the second reference feature vector set, controlling the gate to be opened.
8. The apparatus of claim 7, wherein the processing module is further configured to: if the first reference characteristic vector exists in the preset first reference characteristic vector set, controlling the gate to be opened, and determining whether the first similarity between the first reference characteristic vector and the characteristic vector is greater than a first updating threshold value;
and if the first similarity is larger than the first updating threshold, updating the first reference feature vector into the feature vector.
9. A computer device, comprising:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory and executing the method according to any one of claims 1 to 6 according to the obtained program instructions.
10. A storage medium having stored thereon computer-executable instructions for causing a computer to perform the method of any one of claims 1 to 6.
CN202011600571.0A 2020-12-30 2020-12-30 Method and device for controlling gate, computer equipment and storage medium Pending CN112614263A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011600571.0A CN112614263A (en) 2020-12-30 2020-12-30 Method and device for controlling gate, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011600571.0A CN112614263A (en) 2020-12-30 2020-12-30 Method and device for controlling gate, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112614263A true CN112614263A (en) 2021-04-06

Family

ID=75248911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011600571.0A Pending CN112614263A (en) 2020-12-30 2020-12-30 Method and device for controlling gate, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112614263A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1494037A (en) * 2002-11-01 2004-05-05 ��ʽ���綫֥ Apparatus and method for identifying personnel and passage controller
JP2008117221A (en) * 2006-11-06 2008-05-22 Sony Corp Image processing apparatus, image processing method, and program
CN104484644A (en) * 2014-11-06 2015-04-01 三星电子(中国)研发中心 Gesture identification method and device
CN106782560A (en) * 2017-03-06 2017-05-31 海信集团有限公司 Determine the method and device of target identification text
CN107016370A (en) * 2017-04-10 2017-08-04 电子科技大学 One kind is based on the enhanced partial occlusion face identification method of data
CN107577739A (en) * 2017-08-28 2018-01-12 深圳市空谷幽兰人工智能科技有限公司 A kind of semi-supervised domain term excavates the method and apparatus with classification
CN108875932A (en) * 2018-02-27 2018-11-23 北京旷视科技有限公司 Image-recognizing method, device and system and storage medium
CN111985360A (en) * 2020-08-05 2020-11-24 上海依图网络科技有限公司 Face recognition method, device, equipment and medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1494037A (en) * 2002-11-01 2004-05-05 ��ʽ���綫֥ Apparatus and method for identifying personnel and passage controller
JP2008117221A (en) * 2006-11-06 2008-05-22 Sony Corp Image processing apparatus, image processing method, and program
CN104484644A (en) * 2014-11-06 2015-04-01 三星电子(中国)研发中心 Gesture identification method and device
CN106782560A (en) * 2017-03-06 2017-05-31 海信集团有限公司 Determine the method and device of target identification text
CN107016370A (en) * 2017-04-10 2017-08-04 电子科技大学 One kind is based on the enhanced partial occlusion face identification method of data
CN107577739A (en) * 2017-08-28 2018-01-12 深圳市空谷幽兰人工智能科技有限公司 A kind of semi-supervised domain term excavates the method and apparatus with classification
CN108875932A (en) * 2018-02-27 2018-11-23 北京旷视科技有限公司 Image-recognizing method, device and system and storage medium
CN111985360A (en) * 2020-08-05 2020-11-24 上海依图网络科技有限公司 Face recognition method, device, equipment and medium

Similar Documents

Publication Publication Date Title
CN109697416B (en) Video data processing method and related device
WO2021077984A1 (en) Object recognition method and apparatus, electronic device, and readable storage medium
CN110602527B (en) Video processing method, device and storage medium
CN108038176B (en) Method and device for establishing passerby library, electronic equipment and medium
US10275672B2 (en) Method and apparatus for authenticating liveness face, and computer program product thereof
WO2019184471A1 (en) Image tag determination method and device, and terminal
CN106548145A (en) Image-recognizing method and device
US20170053156A1 (en) Human face recognition method, apparatus and terminal
CN106295515B (en) Determine the method and device of the human face region in image
CN106295511B (en) Face tracking method and device
WO2021136528A1 (en) Instance segmentation method and apparatus
TW202026948A (en) Methods and devices for biological testing and storage medium thereof
CN103617432A (en) Method and device for recognizing scenes
CN112419170A (en) Method for training occlusion detection model and method for beautifying face image
CN110458218B (en) Image classification method and device and classification network training method and device
CN108174152A (en) A kind of target monitoring method and target monitor system
CN109299658B (en) Face detection method, face image rendering device and storage medium
CN106971164A (en) Shape of face matching process and device
CN106557755B (en) Fingerprint template acquisition method and device
CN109670458A (en) A kind of licence plate recognition method and device
CN111242188A (en) Intrusion detection method, device and storage medium
CN108206941A (en) Method for tracking target, system, terminal device and storage medium
CN113409342A (en) Training method and device for image style migration model and electronic equipment
CN113677409A (en) Treasure hunting game guiding technology
CN109800675A (en) A kind of method and device of the identification image of determining face object

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20210406

RJ01 Rejection of invention patent application after publication