Anti-tailgating method, device and computer-readable storage medium

By calculating the distance between faces and coefficients, it can accurately determine whether there is tailing behavior in the passing area, solving the problem of inaccurate judgment of tailing behavior in the existing technology, and improving safety and protection effects.

CN113989894BActive Publication Date: 2024-10-25CHONGQING ZHONGKE YUNCONG TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111296273.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-03
Publication Date
2024-10-25
Estimated Expiration
2041-11-03

AI Technical Summary

Technical Problem

The existing technology is difficult to accurately determine whether there is tailgating behavior in the face recognition system, especially when there are multiple people in the passing area, resulting in safety hazards and the risk of gate pinching.

Method used

By acquiring face images, calculate the distance between the faces of the current person and other persons, and combine the interpupillary distance, age coefficient and gender coefficient to determine whether there is tailgating behavior, and issue an alarm or allow passage when necessary.

Benefits of technology

It achieves accurate judgment and prevention of tailgating behavior, improves the safety of the passing area, and avoids gate pinch accidents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113989894B_ABST
    Figure CN113989894B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of face recognition technology, and specifically provides an anti-tailgating method, device and computer-readable storage medium, aiming to solve the problem of how to prevent tailgating through face images. To this end, the anti-tailgating method of the present invention includes: in response to a received face recognition instruction for the current person, obtaining face images of the current person and other persons in a preset face recognition area; the current person is the person who currently needs to enter the passage area; determining the face distance between the current person and other persons based on the face image; judging whether other persons are the tailing persons of the current person based on the face distance; if so, issuing an alarm; if not, allowing the current person to enter the passage area. Based on the above method, since the face distance can be determined through the face image, and since the face distance is small when there is a tailing behavior, an alarm can be issued after determining the tailing behavior through the face distance, effectively preventing the tailing behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of face recognition, and specifically provides an anti-tailgating method, device and computer-readable storage medium. Background Art

[0002] There are many gates in airports, stations and other places. Take the railway station as an example. After the passenger passes the face verification, the gate of the gate opens and the passenger passes normally. In this process, some passengers follow the previous passenger closely through the gate to avoid face verification. This behavior is not only illegal to evade tickets, but also has great safety hazards, because the gate will close normally after the previous passenger passes. If the next passenger follows through at this time, it is very likely that the gate will pinch the next passenger, so how to prevent tailing is a very important issue. In the existing technical solution, a camera can be installed on the gate to collect facial images, and whether there is a tailing behavior can be determined by judging whether there are multiple people near the passage area. When there are multiple people, it is determined that there is a tailing behavior, but in actual scenarios, there will be multiple people near the same area, so it is inaccurate to judge whether there is a tailing behavior only by whether there are multiple people in the passage area.

[0003] Accordingly, a new anti-tailgating solution is needed in the art to solve the above problems. Summary of the invention

[0004] The present invention aims to solve the above technical problem, that is, to solve or at least partially solve the problem of how to effectively prevent tailgating behavior through facial images.

[0005] In a first aspect, the present invention provides a method for preventing tailgating, the method comprising:

[0006] In response to a received face recognition instruction for a current person, acquiring face images of the current person and other persons in a preset face recognition area; the current person is a person who currently needs to enter the passage area;

[0007] Determine the face distance between the current person and the other persons according to the face image;

[0008] Determine whether the other person is a person following the current person according to the face distance;

[0009] If yes, an alarm is issued; if no, the current person is allowed to enter the passage area.

[0010] In a technical solution of the above anti-tailgating method, “determining the face distance between the current person and the other person according to the face image” specifically includes:

[0011] Determining the pupil distance of the current person and the pupil distance of the other persons respectively according to the facial image;

[0012] According to the pupil distance and the method shown in the following formula, the distance between the current person and the face image acquisition device and the distance between the other persons and the face image acquisition device are determined respectively:

[0013]

[0014] Wherein, L represents the distance between the current person and the face image acquisition device or the distance between the other person and the face image acquisition device, S represents the pupil distance of the current person or the pupil distance of the other person, a represents the age coefficient of the current person or the age coefficient of the other person, b represents the gender coefficient of the current person or the gender coefficient of the other person, and k represents a preset constant coefficient;

[0015] The face distance between the current person and the face image acquisition device is determined according to the distance between the current person and the face image acquisition device and the distance between the other person and the face image acquisition device.

[0016] In a technical solution of the above anti-tailgating method, the method further includes determining the age coefficient of the current person and the age coefficients of other persons by the following steps:

[0017] For each of the current person and the other persons, the age coefficient of each person is determined by the following steps:

[0018] Determining the age of a person corresponding to the facial image according to the facial image, so as to judge whether the person corresponding to the facial image is an adult or a child;

[0019] If the person is an adult, the age coefficient of the person corresponding to the face image is a=a1;

[0020] If the person is a child, the age coefficient of the person corresponding to the face image is set to a=a2;

[0021] Wherein, a1=1, The x is the average value of the real pupil distance of adult males, and the y is the average value of the real pupil distance of children, and x>y;

[0022] and / or,

[0023] The method further comprises determining the gender coefficient of the current person and the gender coefficients of other persons by the following steps:

[0024] For each of the current person and the other persons, the gender coefficient of each person is determined by the following steps:

[0025] Determining the gender of the person corresponding to the facial image according to the facial image;

[0026] If the gender is male, the gender coefficient b of the person corresponding to the face image is set to b1;

[0027] If the gender is female, the gender coefficient b of the person corresponding to the face image is set to b2;

[0028] Wherein, b1=1, The x is the average value of the real pupil distance of adult males, and the z is the average value of the real pupil distance of adult females, and x>z.

[0029] In a technical solution of the above anti-tailgating method, the method further includes:

[0030] When the current person enters the passage area and does not receive a face recognition instruction for the next person, an infrared detection method is used to detect whether other people have entered the passage area; if so, it is determined that the other person is a follower of the current person and an alarm is issued.

[0031] In a second aspect, the present invention provides an anti-tailgating device, the device comprising:

[0032] An image acquisition module, which is configured to acquire facial images of the current person and other persons in a preset facial recognition area in response to a received facial recognition instruction for the current person; the current person is a person who currently needs to enter the passage area;

[0033] a distance determination module, configured to determine the face distance between the current person and the other person according to the face image;

[0034] The tailgating warning module is configured to determine whether the other person is a tailgating person of the current person according to the face distance; if so, issue a warning; if not, allow the current person to enter the passage area.

[0035] In a technical solution of the above anti-tailgating device, the distance determination module is further configured to perform the following operations:

[0036] Determining the pupil distance of the current person and the pupil distance of the other persons respectively according to the facial image;

[0037] According to the pupil distance and the method shown in the following formula, the distance between the current person and the face image acquisition device and the distance between the other persons and the face image acquisition device are determined respectively:

[0038]

[0039] Wherein, L represents the distance between the current person and the face image acquisition device or the distance between the other person and the face image acquisition device, S represents the pupil distance of the current person or the pupil distance of the other person, a represents the age coefficient of the current person or the age coefficient of the other person, b represents the gender coefficient of the current person or the gender coefficient of the other person, and k represents a preset constant coefficient;

[0040] The face distance between the current person and the face image acquisition device is determined according to the distance between the current person and the face image acquisition device and the distance between the other person and the face image acquisition device.

[0041] In a technical solution of the above anti-tailgating device, the distance determination module further includes a coefficient determination submodule, and the coefficient determination submodule is configured to determine the age coefficient of the current person and the age coefficients of other persons through the following steps:

[0042] For each of the current person and the other persons, the age coefficient of each person is determined by the following steps:

[0043] Determining the age of a person corresponding to the facial image according to the facial image, so as to judge whether the person corresponding to the facial image is an adult or a child;

[0044] If the person is an adult, the age coefficient of the person corresponding to the face image is a=a1;

[0045] If the person is a child, the age coefficient of the person corresponding to the face image is set to a=a2;

[0046] Wherein, a1=1, The x is the average value of the real pupil distance of adult males, and the y is the average value of the real pupil distance of children, and x>y;

[0047] and / or,

[0048] The coefficient determination submodule is further configured to determine the gender coefficient of the current person and the gender coefficients of other persons through the following steps:

[0049] For each of the current person and the other persons, the gender coefficient of each person is determined by the following steps:

[0050] Determining the gender of the person corresponding to the facial image according to the facial image;

[0051] If the gender is male, the gender coefficient b of the person corresponding to the face image is set to b1;

[0052] If the gender is female, the gender coefficient b of the person corresponding to the face image is set to b2;

[0053] Wherein, b1=1, The x is the average value of the real pupil distance of adult males, and the z is the average value of the real pupil distance of adult females, and x>z.

[0054] In a technical solution of the above anti-tailgating device, the device further includes:

[0055] The infrared alarm module is configured to use an infrared detection method to detect whether other people have entered the passage area when the current person enters the passage area and no face recognition instruction for the next person is received; if so, it is determined that the other person is a follower of the current person and an alarm is issued.

[0056] In a third aspect, a control device is provided, which includes a processor and a storage device, wherein the storage device is suitable for storing multiple program codes, and the program codes are suitable for being loaded and run by the processor to execute the anti-tailgating method described in any one of the technical solutions of the above-mentioned anti-tailgating method.

[0057] In a fourth aspect, a computer-readable storage medium is provided, wherein a plurality of program codes are stored in the computer-readable storage medium, wherein the program codes are suitable for being loaded and run by a processor to execute the anti-tailgating method described in any one of the technical solutions of the above-mentioned anti-tailgating method.

[0058] In the case of adopting the above technical solution, the present invention can obtain the facial images of the current person and other persons in the preset facial recognition area after receiving the facial recognition instruction for the current person, wherein the current person is the person who currently needs to enter the passage area, and then determine the facial distance between the current person and other persons based on the facial image, and the facial distance represents the distance between the current person and other persons, and finally determine whether the other persons are the following persons of the current person based on the facial distance, if so, issue an alarm, if not, allow the current person to enter the traveling area. Based on the above method, since the facial distance between the current person and other persons can be determined through the facial image of the current person and the facial images of other persons, and the facial distance is the most direct manifestation of the existence of the following behavior, that is, if there is the following behavior, the facial distance must be small, and finally, after determining the existence of the following behavior based on the facial distance, an alarm is issued, so the present invention can effectively prevent the following behavior based on the facial image. BRIEF DESCRIPTION OF THE DRAWINGS

[0059] The disclosure of the present invention will become more easily understood with reference to the accompanying drawings. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the scope of protection of the present invention. In addition, similar numbers in the figures are used to represent similar components, among which:

[0060] Figure 1 is a schematic flow chart of main steps of an anti-tailgating method according to an embodiment of the present invention;

[0061] Figure 2 is a schematic diagram of an application scenario of an anti-tailgating method according to an embodiment of the present invention;

[0062] Figure 3 is a schematic diagram of a process for determining the distance between faces according to an anti-tailgating method according to an embodiment of the present invention;

[0063] Figure 4 is a schematic diagram of calculating the distance between the center points of both eyes according to an anti-tailing method of an embodiment of the present invention;

[0064] Figure 5 is a schematic diagram of calculating the distance between the inner corners of both eyes according to an anti-tailgating method of an embodiment of the present invention;

[0065] Figure 6 is a schematic diagram of a method for calculating face distance in an anti-tailgating method according to an embodiment of the present invention;

[0066] Figure 7 is a schematic diagram of a flow chart of determining an age coefficient of an anti-tailgating method according to an embodiment of the present invention;

[0067] Figure 8 is a schematic diagram of a flow chart of determining a gender coefficient according to an anti-tailgating method according to an embodiment of the present invention;

[0068] Fig. 9 It is a schematic diagram of the main structure block diagram of an anti-tailgating device according to an embodiment of the present invention.

[0069] Reference numerals list :

[0070] 91: image acquisition module; 92: distance determination module; 93: tailgating warning module. DETAILED DESCRIPTION

[0071] Some embodiments of the present invention are described below with reference to the accompanying drawings. It should be understood by those skilled in the art that these embodiments are only used to explain the technical principles of the present invention and are not intended to limit the protection scope of the present invention.

[0072] In the description of the present invention, "module" and "processor" may include hardware, software or a combination of the two. A module may include hardware circuits, various suitable sensors, communication ports, and memories, and may also include software parts, such as program codes, or a combination of software and hardware. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, hardware, or a combination of the two. Non-temporary computer-readable storage media include any suitable media that can store program codes, such as magnetic disks, hard disks, optical disks, flash memory, read-only memory, random access memory, and the like.

[0073] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of the anti-tailgating method according to an embodiment of the present invention. Figure 1 As shown, the anti-tailgating method in the embodiment of the present invention mainly includes the following steps S101 to S105.

[0074] Step S101: In response to a received face recognition instruction for a current person, facial images of the current person and other persons in a preset face recognition area are acquired; the current person is a person who currently needs to enter the passage area.

[0075] The current person refers to the person who is currently undergoing identity authentication through face recognition in the preset face recognition area, hoping to enter the access area after successful identity authentication; while other persons refer to the persons who are currently not undergoing identity authentication through face recognition in the preset face recognition area. These other persons may be persons waiting for identity authentication behind the current person, or they may be trailing persons who do not want to undergo identity authentication and hope to follow the current person into the access area after successful identity authentication of the current person.

[0076] The face recognition instruction refers to an instruction used to control the face recognition device to perform face recognition, and the face recognition device refers to a device used to perform face recognition (i.e., identity verification) on a person to confirm that the person is the person who currently needs to enter the pass area.

[0077] The face recognition area refers to the area where the face recognition device performs face recognition and / or the face image acquisition device acquires face images. Specifically, the recognition area of ​​the face recognition device and / or the face image acquisition device is limited, and this limited recognition area can be the face recognition area. The face image acquisition device refers to a device used to acquire face images.

[0078] The passage area refers to the area that the current person hopes to enter after face recognition.

[0079] like Figure 2 As shown, taking a gate at a high-speed railway station as an example, a passenger can stand in front of the gate and swipe his ID card (or ticket, etc.). After swiping the ID card, the industrial computer can receive a face recognition instruction for the person in the ID card, and then control the face recognition device (i.e. Figure 2 The face recognition panel machine shown in the figure performs face recognition on the passenger in the face recognition area according to the face recognition instruction to ensure that the identity of the ID card (or ticket) used by the passenger is consistent with the passenger's real identity. After confirming that the identities are consistent, the gate of the gate opens and the passenger can pass through the gate. In the above scenario, after the gate of the gate is opened, the path of the passenger passing through the gate can be the pass area, the passenger who swipes the ID card can be the above-mentioned current person, and the passenger who does not swipe the ID card can be the above-mentioned other person.

[0080] While controlling the face recognition device to perform face recognition on passengers, the face image acquisition device (i.e. Figure 2 The high-position camera in the face recognition area) obtains the facial images of the current person and other persons in the face recognition area.

[0081] Step S102: determining the face distance between the current person and other persons according to the face image.

[0082] Face distance refers to the distance between the faces of different people. For example, if person 1 stands at position A and person 2 stands at position B, the distance between the faces of person 1 and person 2 is the face distance. Face distance also represents the distance between people.

[0083] Continuing to refer to the example in the above step S101, after the facial images of the current person and other persons are acquired by the facial image acquisition device, the facial distance between the current person and other persons can be determined.

[0084] In one implementation of this embodiment, the Figure 3 Steps S301 to S303 shown determine the face distance between the current person and other persons:

[0085] Step S301: Determine the pupil distance of the current person and the pupil distances of other persons respectively according to the face image.

[0086] Step S302: Determine the distance between the current person and the face image acquisition device and the distance between other persons and the face image acquisition device according to the pupil distance and the method shown in the following formula (1):

[0087]

[0088] Among them, L represents the distance between the current person and the face image acquisition device or the distance between other persons and the face image acquisition device, S represents the pupil distance of the current person or the pupil distance of other persons, a represents the age coefficient of the current person or the age coefficient of other persons, b represents the gender coefficient of the current person or the gender coefficient of other persons, and k represents a preset constant coefficient.

[0089] Step S303: Determine the face distance between the current person and the other persons according to the distance between the current person and the face image acquisition device and the distance between the other persons and the face image acquisition device.

[0090] The pupil distance generally refers to the real distance between two eyes of a human body, and in this embodiment, the pupil distance refers to the distance between two eyes of a human body in a face image, for example, it can be the pixel distance between the two eyes, etc.

[0091] The age coefficient refers to a coefficient set to correct the effect of a person's age on the pupil distance of the human body.

[0092] The gender coefficient refers to a coefficient set to correct the influence of a person's gender on the pupil distance of the human body.

[0093] After research, the inventor found that the size of the face image collected by the face image collection device will decrease as the distance between the person and the face image collection device increases. Correspondingly, the interpupillary distance of the person will also decrease as the distance between the person and the face image collection device increases. After multiple tests, the inventor concluded that "the size of the interpupillary distance in the face image" and "the distance between the person and the face image collection device" are inversely proportional. In addition, different genders and different ages will affect the real interpupillary distance of the person, that is, the interpupillary distance in the face image.

[0094] To determine the pupil distance, the eyes in the face image can be obtained through the face image, and then the center points of the eyes can be determined, such as Figure 4 As shown, after the center points of both eyes are determined, the pupil distance can be calculated. It should be noted that different pupil distance determination methods have an impact on the determination of the k value in the above formula (1). For example, assuming that the above k=5000 is determined by calculating the distance between the center points of both eyes, and if the distance between the inner corners of the eyes of the person is calculated (such as Figure 5 As shown), it is possible to determine the above k=4800. Those skilled in the art can freely choose how to define (or define) the calculation method of the pupil distance according to different situations. At the same time, although the k values ​​in the calculation methods of different pupil distances are given in the above examples, it should be understood that the above k values ​​are only examples. Those skilled in the art can determine the k values ​​according to the actual scenario. Regardless of the method used to determine the k value in the above formula (1), it should fall within the protection scope of the present invention.

[0095] Continuing to refer to the example in step S101 above, assuming that k=5000, a=1, b=1, and the pupil distance S=100 of the current person is determined based on the face image, the distance between the current person and the face image acquisition device can be calculated based on the above formula (1): (Assuming the unit is centimeters).

[0096] The method for determining the face distance between the current person and other persons may be determined by the following method:

[0097] According to the distance L1 between the current person and the face image acquisition device and the distance L2 between other persons and the face image acquisition device, the face distance between the current person and other persons is determined to be |L1-L2|, that is, the absolute value of the difference between "the distance between the current person and the face image acquisition device" and "the distance between other persons and the face image acquisition device". For example, the distance L1 between the current person and the face image acquisition device = 50 (assuming the unit is centimeters), and the distance L2 between other persons and the face image acquisition device = 30 (assuming the unit is centimeters), then it can be determined that the face distance between the current person and other persons is |L1-L2| = |50-30| = 20 (assuming the unit is centimeters).

[0098] It should be noted that in the above method for determining the face distance between the current person and other persons, the calculation is performed when the face image acquisition device is set at a certain (or some) specific position, and when the face image acquisition device is set at the above "certain (or some) specific position", the face image acquisition device, the current person and other persons are in the same direction or approximately in the same direction. However, in actual situations, those skilled in the art may set the face image acquisition device at other positions (i.e., set the face image acquisition device at any position excluding the above "certain (or some) specific position") according to actual needs, at which time the face image acquisition device, the current person and other persons are no longer in the same direction or approximately in the same direction. When the face image is set at the above other positions, there is a certain impact on the specific method of "determining the face distance between the current person and other persons based on the distance between the current person and the face image acquisition device and the distance between other persons and the face image acquisition device". Therefore, in another embodiment of the present invention, an exemplary method for determining the face distance between the current person and other persons when the face image acquisition device is set at other positions is given.

[0099] like Figure 6 As shown, it is assumed that the distance between the face image acquisition device and the center line of the traffic area is 30 cm, and the current person (i.e. Figure 6①) is standing on the center line of the traffic area, and then assume that the current person (i.e. Figure 6 The distance between ①) and the face image acquisition device is 50 cm. If the midline of the passage area is taken as the coordinate axis X-axis, and the line perpendicular to the midline of the passage area and connecting the face image acquisition device and the midline of the passage area is taken as the coordinate axis Y-axis, then the intersection of the line connecting the face image acquisition device and the midline of the passage area is the coordinate origin. Figure 6 It can be clearly seen that the current personnel (i.e. Figure 6 The line connecting ①) and the face image acquisition device, the line connecting the face image acquisition device and the midline of the passage area, and the midline of the passage area form a right triangle. On this basis, the distance between the current person and the coordinate origin can be calculated according to the Pythagorean theorem: (assuming the unit is centimeters), the coordinates of the current person can be set to (-40,0). Similarly, assuming that other people (i.e. Figure 6 The coordinates of ②) in is (-50,0), then we can determine the current person ( Figure 6 ①) and other personnel ( Figure 6 The face distance in ②) is 10 cm.

[0100] It should be noted that although the above example provides a method for determining the facial distance between the current person and other persons when the facial image acquisition device is set at other positions, those skilled in the art should understand that when the facial image acquisition device is set at different positions, there may be slight differences in the method for determining the facial distance. However, no matter where the facial image acquisition device is set, the slight differences in the specific method of "determining the facial distance between the current person and other persons based on the distance between the current person and the facial image acquisition device and the distance between other persons and the facial image acquisition device" should fall within the scope of protection of the present invention.

[0101] Through the above steps S301 to S303, the face distance between the current person and other persons can be accurately calculated according to the pupil distance in the face image.

[0102] In one implementation of this embodiment, it is also possible to Figure 7 Steps S701 to S703 shown determine the age coefficient of the current person and the age coefficients of other persons:

[0103] For each of the current person and other persons, determine the age coefficient of each person by the following steps:

[0104] Step S701: Determine the age of the person corresponding to the facial image based on the facial image to judge whether the person corresponding to the facial image is an adult or a child. If the person is an adult, execute step S702; if the person is a child, execute step S703.

[0105] Step S702: Set the age coefficient of the person corresponding to the face image to a=a1.

[0106] Step S703: Set the age coefficient of the person corresponding to the face image to a=a2.

[0107] Among them, a1=1, The x is the average value of the real pupil distance of adult males, and y is the average value of the real pupil distance of children, and x>y.

[0108] In one implementation of this embodiment, it is also possible to Figure 8 Steps S801 to S803 shown determine the gender coefficient of the current person and the gender coefficients of other persons:

[0109] For each of the current person and other persons, determine the gender coefficient of each person through the following steps:

[0110] Step S801: Determine the gender of the person corresponding to the facial image based on the facial image. If the gender is male, execute step S802; if the gender is female, execute step S803.

[0111] Step S802: Set the gender coefficient b of the person corresponding to the face image to b1.

[0112] Step S803: Set the gender coefficient b of the person corresponding to the face image to b2.

[0113] Where b1=1, x is the average true pupil distance of adult males, z is the average true pupil distance of adult females, x>z.

[0114] After research, the inventor found that different ages and different genders will affect the pupil distance of people. After statistics, the inventor found that the average value of the real pupil distance of adult males is about 70 mm, the average value of the real pupil distance of adult females is about 65 mm, and the average value of the real pupil distance of children is generally about 60 mm (in this embodiment, it is assumed that 18 years old and above are adults, and under 18 years old are children), that is, the average value of the real pupil distance of adult males is greater than the average value of the real pupil distance of adult females, and the average value of the real pupil distance of adult females is greater than the average value of the real pupil distance of children. On this basis, different genders and different ages will inevitably affect the final determined face distance.

[0115] For example, assume that the current person 1 is an adult male, and the other person 2 is also an adult male. The true interpupillary distances of the two persons are basically the same. So, it can be a = 1, b = 1, that is By calculating the distance between the current person 1 and / or the other person 2 and the face image acquisition device, and then determining the face distance between the current person 1 and the other person 2, the result is also relatively accurate.

[0116] If there is another person 3, and the other person 3 is an adult female. Assume that the other person 3 stands at the same position as the above-mentioned other person 2. The face image acquisition device acquires the interpupillary distance of the other person 2 as S2, and the interpupillary distance of the other person 3 as S3. Still assume a = 1, b = 1. Then, according to the following formulas (2) and (3), the distances between the other person 2 and the face image acquisition device, and between the other person 3 and the face image acquisition device can be calculated respectively as:

[0117]

[0118]

[0119] Among them, L2 represents the distance between the other person 2 and the face image acquisition device, and L3 represents the distance between the other person 3 and the face image acquisition device.

[0120] According to the above description, the average value of the true interpupillary distances of adult males is generally greater than that of adult females. So, when the other person 2 and the other person 3 stand at the same position, the interpupillary distance of the other person 2 acquired by the face image acquisition device is greater than that of the other person 3, that is S2 > S3. Therefore, according to the above formulas (2)-(3), it can be seen that on the premise of a = 1, b = 1, and a fixed k value, even if the other person 2 and the other person 3 stand at the same position, the finally calculated result is still L2 < L3, that is, the finally calculated "distance between the other person 2 and the face image acquisition device" is less than the "distance between the other person 3 and the face image acquisition device". The result is the same for persons of different ages.

[0121] Therefore, different ages and genders need to be considered in the method for determining the distance between a person and the face image acquisition device. In this embodiment, taking adult males as the benchmark, when the current person and / or the other person is an adult male, a = a1 = 1, b = b1 = 1, while when the current person and / or the other person is a child, the interpupillary distance of the child is "corrected" by the ratio of the average value of the true interpupillary distances of adult males to the average value of the true interpupillary distances of children, that is For example, make x = 70, y = 60, when making After that, the pupil distance in the child's face image is "enlarged" to the same as that of an adult male, so the calculated face distance is relatively accurate. Similarly, when the current person and / or other persons are female, the female pupil distance is "corrected" by the ratio of the average value of the real pupil distance of adult males to the average value of the real pupil distance of adult females, even if For example, if x=70, z=60, then Afterwards, the pupil distance in the female face image is "enlarged" to the same as that of an adult male, so the calculated face distance is relatively accurate.

[0122] Continuing to refer to the example in the above steps S301 to S303, assuming k = 7000, the pupil distance S = 100 of the current person is determined based on the face image. If the current person is an adult male, then a = 1 and b = 1 can be determined, and then the distance between the current person and the face image acquisition device can be calculated according to the above formula (1). (Assuming the unit is centimeters). If the current person is an adult female, then it can be determined that a=a1=1, Then, the distance between the current person and the face image acquisition device can be calculated according to the above formula (1): (Assuming the unit is centimeters).

[0123] Through the above steps S701 to S703 and S801 to S803, the pupil distance of the facial images of the current person and / or other persons of different ages and genders is "corrected" by the age coefficient and the gender coefficient, so that the calculated facial distance is more accurate, thereby achieving a more accurate judgment on whether there is a stalking behavior, thereby achieving a more accurate and effective prevention of stalking behavior.

[0124] In the above embodiment of the present invention, the real pupil distance of children under the age of 18 is set to a fixed value. However, in actual situations, before a certain age, the human skeleton can continue to grow, and the pupil distance also continues to increase. Only after reaching a certain age will it approach stability and no longer change. Therefore, in another embodiment of the present invention, the pupil distance of children in the above embodiment can be further refined, and the age coefficients corresponding to children of different ages are also different. For example, the real pupil distance of children aged 12 or more and less than 18 can be based on 60mm, the real pupil distance of children aged 6 or more and less than 12 can be based on 55mm, the real pupil distance of children under 6 years old can be based on 50mm, and so on. On this basis, the above steps S701 to S703 can also be implemented in the following manner:

[0125] For each of the current person and other persons, determine the age coefficient of each person by the following steps:

[0126] The age of a person corresponding to the facial image is determined according to the facial image.

[0127] If the age is greater than or equal to 18 years old, the age coefficient of the person corresponding to the face image is a=a1.

[0128] If the age is less than 18 years old and greater than or equal to 12 years old, the age coefficient of the person corresponding to the facial image is a=a3.

[0129] If the age is less than 12 years old and greater than or equal to 6 years old, the age coefficient of the person corresponding to the facial image is a=a4.

[0130] If the age is less than 6 years old, the age coefficient of the person corresponding to the facial image is a=a5.

[0131] Among them, a1=1, x is the average true pupil distance of adult males, w is the average true pupil distance of children aged 18 or less and over 12, v is the average true pupil distance of children aged 12 or less and over 6, u is the average true pupil distance of children under 6, x>w>v>u.

[0132] Continuing to refer to the examples in the above steps S701 to S703 and S801 to S803, assuming that the face image of the current person is recognized as a 9-year-old girl and the pupil distance of the current person is S=100, it can be determined that Assuming k = 7000, the distance between the current person and the face image acquisition device can be determined (Assuming the unit is centimeters).

[0133] Step S103: Determine whether the other person is following the current person according to the face distance, if so, execute step S104, if not, execute step S105.

[0134] Step S104: Issue an alarm.

[0135] Step S105: Allow the current person to enter the passage area.

[0136] Continuing to refer to the example in the above steps S301 to S303, the current person (ie Figure 6 ①) and other personnel (i.e. Figure 6 The face distance of ② in the figure is 10 cm. Assuming the distance threshold is 30 cm, that is, if the face distance is less than or equal to 30 cm, it is judged that there is a tailing behavior. Then, other people (i.e. Figure 6 ②) in the above is the current person (i.e. Figure 6 The following personnel of ①), other personnel (i.e. Figure 6 In ②), if there is a tailing behavior, an alarm can be issued, such as reminding the current person that there is a tailing person behind him. Assuming that the face distance between the current person and other people is 50 cm, and the distance threshold is 30 cm, it can be determined based on the distance threshold that other people are not the tailing people of the current person, and the current person can be allowed to enter the passage area.

[0137] Further consider that when the child is under a certain age, it is very likely that he or she is led by the parents (for example, holding the child's hand to pass through the gate together), or the parent may directly hold the child through the gate. In this case, if the facial distance between the child who is too young and the current person is still calculated, although it can effectively prevent the following behavior, there may be inhumane problems. Therefore, in another embodiment of the present invention, if it is determined that the facial distance between other persons and the current person is too small, and the age of the facial image of the other person obtained by the facial image acquisition device is less than a certain threshold (for example, less than 6 years old), the "other person" can be directly ignored, and no alarm is issued for the "other person" whose age is less than the certain threshold.

[0138] In one implementation of this embodiment, an alarm may be issued after the tailgating behavior is determined through the following steps:

[0139] When the current person enters the passage area and does not receive a face recognition instruction for the next person, an infrared detection method is used to detect whether other people have entered the passage area.

[0140] If so, it is determined that the other person is following the current person and an alarm is issued.

[0141] If not, no alarm is issued.

[0142] Continuing to refer to the example in step S101 above, when the current person enters the passage area and does not receive the face recognition instruction for the next person, the infrared detection device (i.e. Figure 2 The infrared detector in the system detects whether other people have entered the traveling area. For example, when a passenger 1 passes through the gate after swiping his ID card, there is another passenger 2 who was originally standing far away from passenger 1. The method in steps S101 to S105 above also determines that there is no tailing behavior. However, when passenger 1 passes through the gate, he quickly catches up and prepares to tail. At this time, the infrared detection device can detect that other people have passed through the gate and issue an alarm. In addition, the infrared device can also close the gate immediately after detecting that passenger 1 has passed through the gate, so that it can achieve the goal of both issuing an alarm and preventing other passengers from forcing their way through the gate. The above method further prevents tailing behavior.

[0143] It should be noted that in all the above examples, one "other person" is involved for illustration only. For the sake of brevity, this embodiment no longer provides more detailed examples for the scenario of multiple "other persons". However, it should be understood that this embodiment can also determine the face distance between the "current person" and each "other person" in the scenario where there are multiple "other persons", and then determine whether each "other person" is a follower of the "current person". In addition, all the examples mentioned above, such as the k value, the average value of the real pupil distance of adult males, and the numbers, units and spacing thresholds involved in calculating the distance between the current person and / or other persons and the face image acquisition device, and calculating the face spacing, are only for illustrative purposes and / or the results of statistics and / or measurements by the inventor. It should be understood that those skilled in the art can change, for example, the average value of the real pupil distance of adult males, the k value and the spacing threshold according to actual scenarios and / or actual statistical results and / or actual measurement results and / or actual needs. For example, the average value of the real pupil distance of adult males calculated is different from the average value of the real pupil distance of adult males in this embodiment, the calculated k value is different from the k value in this embodiment, and the set spacing threshold is different, etc. However, no matter how the changes are made, they should fall within the scope of protection of the present invention.

[0144] Based on the above steps S101-S105, the present invention can obtain the facial images of the current person and other persons in the preset facial recognition area after receiving the facial recognition instruction for the current person, wherein the current person is the person who currently needs to enter the passage area, and then determine the facial distance between the current person and other persons based on the facial image, and the facial distance represents the distance between the current person and other persons, and finally determine whether the other persons are the following persons of the current person based on the facial distance, and if so, issue an alarm, and if not, allow the current person to enter the traveling area. Based on the above method, since the facial distance between the current person and other persons can be determined through the facial image of the current person and the facial images of other persons, and the facial distance is the most direct manifestation of the existence of the following behavior, that is, if there is the following behavior, the facial distance must be small, and finally, after determining the existence of the following behavior based on the facial distance, an alarm is issued, so the present invention can effectively prevent the following behavior based on the facial image.

[0145] It should be pointed out that although the various steps in the above embodiments are described in a specific order, those skilled in the art can understand that in order to achieve the effects of the present invention, different steps do not have to be performed in such an order. They can be performed simultaneously (in parallel) or in other orders. These changes are within the scope of protection of the present invention.

[0146] Furthermore, the present invention also provides an anti-tailgating device.

[0147] See attached Fig. 9 , Fig. 9 FIG. 1 is a main structural block diagram of an anti-tailgating device according to an embodiment of the present invention. Fig. 9 As shown, the anti-tailgating device in the embodiment of the present invention mainly includes an image acquisition module 91, a distance determination module 92 and a tailgating alarm module 93. In some embodiments, one or more of the image acquisition module 91, the distance determination module 92 and the tailgating alarm module 93 can be combined into one module. In some embodiments, the image acquisition module 91 can be configured to respond to the received face recognition instruction for the current person, and obtain the face images of the current person and other persons in the preset face recognition area; the current person is the person who currently needs to enter the passage area. The distance determination module 92 can be configured to determine the face distance between the current person and other persons according to the face image. The tailgating alarm module 93 can be configured to determine whether other persons are the tailgating persons of the current person according to the face distance; if so, an alarm is issued; if not, the current person is allowed to enter the passage area. In one embodiment, the description of the specific implementation function can be referred to the description of steps S101 to S105.

[0148] In one embodiment, the distance determination module 92 may be further configured to perform the following operations:

[0149] Determine the pupil distance of the current person and the pupil distance of other persons respectively according to the face image;

[0150] According to the pupil distance and the method shown in formula (1) in the aforementioned method embodiment, the distance between the current person and the face image acquisition device and the distance between other persons and the face image acquisition device are determined respectively.

[0151] The face distance between the current person and the other persons is determined according to the distance between the current person and the face image acquisition device and the distance between the other persons and the face image acquisition device.

[0152] In one implementation, the description of the specific implementation functions may refer to steps S301 to S303.

[0153] In one embodiment, the distance determination module 92 may further include a coefficient determination submodule, which may be configured to determine the age coefficient of the current person and the age coefficients of other persons through the following steps:

[0154] For each of the current person and other persons, determine the age coefficient of each person by the following steps:

[0155] Determine the age of the person corresponding to the facial image based on the facial image to judge whether the person corresponding to the facial image is an adult or a child;

[0156] If the person is an adult, the age coefficient of the person corresponding to the face image is a=a1;

[0157] If the person is a child, the age coefficient of the person corresponding to the face image is a=a2;

[0158] Among them, a1=1, x is the average true pupil distance of adult males, y is the average true pupil distance of children, x>y.

[0159] In one implementation, the description of the specific implementation functions may refer to steps S701 to S703.

[0160] In one embodiment, the coefficient determination submodule may also be configured to determine the gender coefficient of the current person and the gender coefficients of other persons through the following steps:

[0161] For each of the current person and other persons, determine the gender coefficient of each person through the following steps:

[0162] Determine the gender of the person corresponding to the facial image according to the facial image;

[0163] If the gender is male, the gender coefficient of the person corresponding to the face image is b=b1;

[0164] If the gender is female, the gender coefficient of the person corresponding to the face image is b=b2;

[0165] Where b1=1, x is the average true pupil distance of adult males, z is the average true pupil distance of adult females, x>z.

[0166] In one implementation, the description of the specific implementation functions may refer to steps S801 to S803.

[0167] In one embodiment, the anti-tailgating device may further include:

[0168] The infrared alarm module is configured to use an infrared detection method to detect whether other people have entered the passage area when the current person enters the passage area and has not received a face recognition instruction for the next person; if so, it is determined that the other person is a follower of the current person and an alarm is issued.

[0169] The anti-tailgating device is used to perform Figure 1The anti-tailgating method embodiment shown in the figure has similar technical principles, technical problems solved and technical effects produced. Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working process and related instructions of the anti-tailgating device can refer to the contents described in the embodiment of the anti-tailgating method, which will not be repeated here.

[0170] It is understood by those skilled in the art that the present invention implements all or part of the processes in the method of the above embodiment, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device, medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory, random access memory, electric carrier signal, telecommunication signal and software distribution medium that can carry the computer program code. It should be noted that the content contained in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable storage media do not include electric carrier signals and telecommunication signals.

[0171] Furthermore, the present invention also provides a control device. In an embodiment of a control device according to the present invention, the control device includes a processor and a storage device, the storage device can be configured to store a program for executing the anti-tailgating method of the above method embodiment, and the processor can be configured to execute the program in the storage device, which includes but is not limited to the program for executing the anti-tailgating method of the above method embodiment. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The control device can be a control device device formed by various electronic devices.

[0172] Furthermore, the present invention also provides a computer-readable storage medium. In a computer-readable storage medium embodiment according to the present invention, the computer-readable storage medium can be configured to store a program for executing the anti-tailgating method of the above-mentioned method embodiment, and the program can be loaded and run by the processor to implement the above-mentioned anti-tailgating method. For ease of explanation, only the parts related to the embodiment of the present invention are shown. For specific technical details not disclosed, please refer to the method part of the embodiment of the present invention. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiment of the present invention is a non-temporary computer-readable storage medium.

[0173] Further, it should be understood that since the setting of each module is only for illustrating the functional units of the device of the present invention, the physical devices corresponding to these modules may be the processor itself, or a part of the software in the processor, a part of the hardware, or a part of the combination of software and hardware. Therefore, the number of each module in the figure is only schematic.

[0174] Those skilled in the art will appreciate that the modules in the device can be adaptively split or merged. Such splitting or merging of specific modules will not cause the technical solution to deviate from the principle of the present invention, and therefore, the technical solutions after splitting or merging will fall within the protection scope of the present invention.

[0175] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A method for preventing tailgating, characterized in that: The method comprises: In response to a received face recognition instruction for a current person, acquiring facial images of the current person and other persons within a preset face recognition area; the current person is a person who currently needs to enter the passage area; determining the face distance between the current person and the other persons based on the face image; The determining of the face distance between the current person and the other persons according to the face image includes: Determining the pupil distance of the current person and the pupil distance of the other persons respectively according to the facial image; The distance between the current person and the face image acquisition device and the distance between the other persons and the face image acquisition device are determined according to the pupil distance and the method shown in the following formula: Wherein, L represents the distance between the current person and the facial image acquisition device or the distance between the other person and the facial image acquisition device, S represents the pupil distance of the current person or the pupil distance of the other person, a represents the age coefficient of the current person or the age coefficient of the other person, b represents the gender coefficient of the current person or the gender coefficient of the other person, and k represents a preset constant coefficient; Determining the face distance between the current person and the other person based on the distance between the current person and the face image acquisition device and the distance between the other person and the face image acquisition device; Determine whether the other person is a person following the current person based on the face distance; If so, an alarm is issued; if not, the current person is allowed to enter the passage area.

2. The anti-tailgating method according to claim 1, characterized in that: The method further comprises determining the age coefficient of the current person and the age coefficients of other persons by the following steps: For each of the current person and the other persons, the age coefficient of each person is determined by the following steps: Determining the age of a person corresponding to the facial image based on the facial image to determine whether the person corresponding to the facial image is an adult or a child; If the person is an adult, the age coefficient of the person corresponding to the face image is a=a1; If the person is a child, the age coefficient of the person corresponding to the face image is a=a2; Wherein, a1=1, x is the average value of the actual pupil distance of adult males, y is the average value of the actual pupil distance of children, and x>y; and / or, The method further comprises determining the gender coefficient of the current person and the gender coefficients of other persons by the following steps: For each of the current person and the other persons, determine the gender coefficient of each person through the following steps: Determining the gender of the person corresponding to the facial image based on the facial image; If the gender is male, the gender coefficient b of the person corresponding to the face image is set to b1; If the gender is female, the gender coefficient b of the person corresponding to the face image is set to b2; Wherein, b1=1, The x is the average value of the real pupil distance of adult males, and the z is the average value of the real pupil distance of adult females, and x>z.

3. The anti-tailgating method according to claim 1, characterized in that: The method further comprises: When the current person enters the passage area and does not receive the face recognition instruction for the next person, an infrared detection method is used to detect whether other people enter the passage area; if so, it is determined that the other person is a follower of the current person and an alarm is issued.

4. An anti-tailgating device, characterized in that: The device comprises: An image acquisition module configured to acquire facial images of the current person and other persons within a preset facial recognition area in response to a received facial recognition instruction for the current person; the current person is a person who currently needs to enter the passage area; A distance determination module is configured to determine the face distance between the current person and the other person based on the facial image; wherein determining the face distance between the current person and the other person based on the facial image comprises: Determining the pupil distance of the current person and the pupil distance of the other persons respectively according to the facial image; The distance between the current person and the face image acquisition device and the distance between the other persons and the face image acquisition device are determined according to the pupil distance and the method shown in the following formula: Wherein, L represents the distance between the current person and the facial image acquisition device or the distance between the other person and the facial image acquisition device, S represents the pupil distance of the current person or the pupil distance of the other person, a represents the age coefficient of the current person or the age coefficient of the other person, b represents the gender coefficient of the current person or the gender coefficient of the other person, and k represents a preset constant coefficient; Determining the face distance between the current person and the other person based on the distance between the current person and the face image acquisition device and the distance between the other person and the face image acquisition device; The tailgating alarm module is configured to determine whether the other person is a tailgating person of the current person based on the face distance; if so, an alarm is issued; if not, the current person is allowed to enter the passage area.

5. The anti-tailgating device according to claim 4, characterized in that: The distance determination module further includes a coefficient determination submodule, which is configured to determine the age coefficient of the current person and the age coefficients of other persons through the following steps: For each of the current person and the other persons, the age coefficient of each person is determined by the following steps: Determining the age of a person corresponding to the facial image based on the facial image to determine whether the person corresponding to the facial image is an adult or a child; If the person is an adult, the age coefficient of the person corresponding to the face image is a=a1; If the person is a child, the age coefficient of the person corresponding to the face image is a=a2; Wherein, a1=1, x is the average value of the actual pupil distance of adult males, y is the average value of the actual pupil distance of children, and x>y; and / or, The coefficient determination submodule is further configured to determine the gender coefficient of the current person and the gender coefficients of other persons through the following steps: For each of the current person and the other persons, determine the gender coefficient of each person through the following steps: Determining the gender of the person corresponding to the facial image based on the facial image; If the gender is male, the gender coefficient b of the person corresponding to the face image is set to b1; If the gender is female, the gender coefficient b of the person corresponding to the face image is set to b2; Wherein, b1=1, The x is the average value of the real pupil distance of adult males, and the z is the average value of the real pupil distance of adult females, and x>z.

6. The anti-tailgating device according to claim 4, characterized in that: The device further comprises: The infrared alarm module is configured to use an infrared detection method to detect whether other people have entered the passage area when the current person enters the passage area and no face recognition instruction for the next person is received; if so, it is determined that the other person is a follower of the current person and an alarm is issued.

7. A control device comprising a processor and a storage device, wherein the storage device is suitable for storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by the processor to execute the anti-tailgating method according to any one of claims 1 to 3.

8. A computer-readable storage medium storing a plurality of program codes, characterized in that: The program code is suitable for being loaded and run by a processor to execute the anti-tailgating method according to any one of claims 1 to 3.