Disclosure of Invention
The purpose of the invention is as follows: the utility model provides a monitoring and warning system of queue-in behavior based on human body detection, in order to solve the above-mentioned problem.
The technical scheme is as follows: a queue-insertion behavior monitoring and warning system based on human body detection comprises a queue detection unit, a queue-insertion behavior detection unit and a feature recognition unit, wherein data of the queue detection unit, the queue-insertion behavior detection unit and the feature recognition unit are stored, processed and transmitted by utilizing neural network training;
the queue detection unit is used for carrying out basic modeling on the scenes in the set range by using Gaussian filtering, accurately positioning the queue, regulating and controlling the measurement range in real time and updating the queue to be measured along with the change of the queue;
the queue-insertion behavior detection unit is used for carrying out blink recognition on eye frames of the human faces by using frame positioning, and positioning the detected human faces; when a non-sequential face is detected and a living body is confirmed, comparing the detected face with a stored face and confirming the detected face as a queue-insertion face, and positioning the queue-insertion face;
the characteristic identification unit is used for shooting a human face by means of a camera, identifying the characteristics of the shot human face and broadcasting the characteristic to finish the warning of the queue-insertion behavior;
the queue detection unit confirms a shooting area according to a camera installation angle, after the shooting area is input into a system, the shooting area is divided by a blue frame, a human face is positioned by using a computer vision field target detection technology, a blue solid frame is used for identifying the human face, a detected queue is confirmed by a black thin-line frame, the black thin-line frame is synchronously updated according to the change of the queuing queue range of the shooting area, and the method specifically comprises the following steps:
step 1, taking a first face identified by one side of a close-up camera head in a shooting area as a reference, taking the first face as an initial point position of a black thin line frame, and recording horizontal and vertical coordinates which are respectively 0;
step 2, taking the last face identified by one side of the telephoto image head in the shooting area as a reference, taking the last face as an end point of a black thin line frame, and recording a vertical coordinate;
step 3, performing image processing on the initial point position and the end point position by using a Gaussian filtering method, removing high-frequency information generated by a frame region due to large color change, and ensuring that all human faces in a shooting region are identified;
and 4, updating and detecting the queue of the shooting area at an interval of ten seconds, and repeating the step 1 to update the queue when an unidentified face appears at an initial point or an end point when the initial point or the end point is positioned according to a computer vision field target detection technology.
According to an aspect of the present invention, the queue detection unit reuses a gaussian filtering method to smooth the high frequency information of the edge region of the input image and remove noise, and the formula is:
G(x,y)=eE/2Πσ2;
Fs(x,y)=f(x,y)* G(x,y);
wherein E = - (x)2+y2)/2σ2F (x, y) is data of an input image, and Fs (x, y) is image data after gaussian convolution.
According to one aspect of the invention, the edge detection of the input image can cause the phenomenon of inaccurate alignment of the queuing area due to the influence of false edges, a double threshold method is used for removing errors caused by alignment of the false edges, 0.7/0.6 and 0.15 are respectively selected as a highest threshold and a lowest threshold, and points higher than the highest threshold are set as 1, and points lower than the lowest threshold are set as 0.
According to one aspect of the invention, the queue-jumping behavior detection unit is used for dynamically acquiring the queuing queue frame in real time, when queue-jumping behavior occurs, the width of the black thin-line frame is changed by exceeding a threshold value and is usually larger than the width of a head frame of a person, and the angle of the camera can be further adjusted or a shot image of the upper body of the queue-jumping person can be acquired by detecting the change and preliminarily locking the person trying to queue-jump.
According to one aspect of the invention, the characteristic identification unit sends the queue-inserting person half-body frame obtained by the queue-inserting behavior detection technology into a neural network, identifies the clothes color and the gender of the queue-inserting person, converts the clothes color and the gender into text information and voice information, and broadcasts and reminds the clothes color and the gender.
A queue-insertion behavior monitoring and warning method based on human body detection comprises the following steps:
step 1, taking a first face identified by one side of a close-up camera head in a shooting area as a reference, taking the first face as an initial point position of a black thin line frame, and recording horizontal and vertical coordinates which are respectively 0;
step 2, taking the last face identified by one side of the telephoto image head in the shooting area as a reference, taking the last face as an end point of a black thin line frame, and recording a vertical coordinate;
step 3, performing image processing on the initial point position and the end point position by using a Gaussian filtering method, removing high-frequency information generated by a frame region due to large color change, and ensuring that all human faces in a shooting region are identified;
and 4, updating and detecting the queue of the shooting area at an interval of ten seconds, and repeating the step 1 to update the queue when an unidentified face appears at an initial point or an end point when the initial point or the end point is positioned according to a computer vision field target detection technology.
The blink recognition face positioning method specifically comprises the following steps:
in order to avoid the influence of the queue width caused by the queue misalignment, the face recognition error removal is needed, that is, the face in the queue is recognized and recorded, and when the queue width exceeds the threshold value, the error caused by the queue misalignment is removed in advance, and the method specifically comprises the following steps:
step 1, positioning face characteristic points on a picture of a detection frame by framing the picture of a shot video so as to obtain eye key points;
step 2, constructing a human eye width-height ratio model, carrying out blink detection, locking a human face when the blink frame detection probability in thirty seconds reaches 1/10-1/3, eliminating the face influence of an inactive person, and recording face data;
and 3, when the queue width exceeds the threshold value, framing the currently shot queue picture, comparing the currently shot queue picture with the result of face recognition five times before the moment after face recognition is carried out, if the number and the result of the face recognition are not changed, determining that the width is changed due to the fact that the queue is not uniform, otherwise, carrying out face hole search without recognition, and positioning the faces of the queue inserts.
According to one aspect of the invention, the face recognition uses a 68-point feature point positioning algorithm based on a cascade regression tree, for a fixed frame picture to be detected, the algorithm generates an initial shape and initial position coordinates of 68 feature points, the sum of square errors between the initial shape and a true value is further reduced by using a gradient lifting algorithm, and the accuracy of face recognition and eye position positioning is ensured.
According to one aspect of the present invention, the face recognition record value is set for a special condition, and for a queue change caused by incomplete queuing due to direct departure of people from the queue, the face recognition record value needs to be set as a normal condition, and status exclusion is performed, specifically including the steps of:
step 1, carrying out face recognition of a queuing queue by using face recognition, and marking faces after positioning eyes;
step 2, after face loss occurs, team face exclusion recognition is carried out, team face updating is carried out synchronously, inter-team early warning is not started, when the fact that the face loss cannot be recognized in the team is confirmed, the phenomenon that people leave uncompleted queuing tasks in the queuing queue is considered to occur, and face relocation and recognition are carried out on the queuing queue;
and 3, confirming that the queue width changes and restores to normal along with the disappearance of the missing face, and restoring normal face recognition and blink recognition.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
step 1, taking a first face identified by one side of a close-up camera head in a shooting area as a reference, taking the first face as an initial point position of a black thin line frame, and recording horizontal and vertical coordinates which are respectively 0;
step 2, taking the last face identified by one side of the telephoto image head in the shooting area as a reference, taking the last face as an end point of a black thin line frame, and recording a vertical coordinate;
step 3, performing image processing on the initial point position and the end point position by using a Gaussian filtering method, removing high-frequency information generated by a frame region due to large color change, and ensuring that all human faces in a shooting region are identified;
and 4, updating and detecting the queue of the shooting area at an interval of ten seconds, and repeating the step 1 to update the queue when an unidentified face appears at an initial point or an end point when the initial point or the end point is positioned according to a computer vision field target detection technology.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of:
step 1, taking a first face identified by one side of a close-up camera head in a shooting area as a reference, taking the first face as an initial point position of a black thin line frame, and recording horizontal and vertical coordinates which are respectively 0;
step 2, taking the last face identified by one side of the telephoto image head in the shooting area as a reference, taking the last face as an end point of a black thin line frame, and recording a vertical coordinate;
step 3, performing image processing on the initial point position and the end point position by using a Gaussian filtering method, removing high-frequency information generated by a frame region due to large color change, and ensuring that all human faces in a shooting region are identified;
and 4, updating and detecting the queue of the shooting area at an interval of ten seconds, and repeating the step 1 to update the queue when an unidentified face appears at an initial point or an end point when the initial point or the end point is positioned according to a computer vision field target detection technology.
Has the advantages that: the invention can realize the automatic face recognition and human body positioning of the queue insertion behavior, and determines the range of the queue through a Gaussian filtering method and a false edge removing method; further determining queuing human faces in the queue by using a human face recognition and blink detection method; through special circumstances setting, get rid of because of lining up irregularly, the task of lining up incomplete directly leave behind the width error that team caused, can accurately carry out the face identification of inserting a team and fix a position, further carry out the face of inserting a team and shoot, make things convenient for the camera to shoot and further characteristic information draws, carry out voice warning to the people of inserting a team.
Detailed Description
As shown in fig. 1, in this embodiment, a queue behavior monitoring and warning system based on human body detection includes a queue detection unit, a queue behavior detection unit, and a feature recognition unit, and stores, processes, and transmits data of the three units by using neural network training;
the queue detection unit is used for carrying out basic modeling on the scenes in the set range by using Gaussian filtering, accurately positioning the queue, regulating and controlling the measurement range in real time and updating the queue to be measured along with the change of the queue;
the queue-insertion behavior detection unit is used for carrying out blink recognition on eye frames of the human faces by using frame positioning, and positioning the detected human faces; when a non-sequential face is detected and a living body is confirmed, comparing the detected face with a stored face and confirming the detected face as a queue-insertion face, and positioning the queue-insertion face;
the characteristic identification unit is used for shooting a human face by means of a camera, identifying the characteristics of the shot human face and broadcasting the characteristic to finish the warning of the queue-insertion behavior;
the queue detection unit confirms a shooting area according to a camera installation angle as shown in figure two, after the shooting area is input into a system, a blue frame is used for dividing a queuing area, a computer vision field target detection technology is used for positioning a human face, a blue solid frame is used for identifying the human face, a black thin wire frame is used for confirming a detected queue, the black thin wire frame is synchronously updated according to the change of the queuing queue range of the shooting area, and the method comprises the following specific steps:
step 1, taking a first face identified by one side of a close-up camera head in a shooting area as a reference, taking the first face as an initial point position of a black thin line frame, and recording horizontal and vertical coordinates which are respectively 0;
step 2, taking the last face identified by one side of the telephoto image head in the shooting area as a reference, taking the last face as an end point of a black thin line frame, and recording a vertical coordinate;
step 3, performing image processing on the initial point position and the end point position by using a Gaussian filtering method, removing high-frequency information generated by a frame region due to large color change, and ensuring that all human faces in a shooting region are identified;
and 4, updating and detecting the queue of the shooting area at an interval of ten seconds, and repeating the step 1 to update the queue when an unidentified face appears at an initial point or an end point when the initial point or the end point is positioned according to a computer vision field target detection technology.
In a further embodiment, the queue detection unit reuses a gaussian filtering method to smooth the high-frequency information of the edge region of the input image and remove noise, and the formula is as follows:
G(x,y)=eE/2Πσ2;
Fs(x,y)=f(x,y)* G(x,y);
wherein E = - (x)2+y2)/2σ2F (x, y) is data of an input image, and Fs (x, y) is image data after gaussian convolution.
In a further embodiment, the edge detection of the input image may cause inaccurate alignment of the queue area due to false edge, a dual threshold method is used to remove errors caused by alignment of false edges, 0.7/0.6 and 0.15 are selected as the highest threshold and the lowest threshold, respectively, and a point higher than the highest threshold is set to be 1, and a point lower than the lowest threshold is set to be 0.
In a further embodiment, as shown in fig. three, the queue-jumping behavior detection unit dynamically acquires the queuing queue frame in real time, when the queue-jumping behavior occurs, the width of the black thin-line frame may change beyond a threshold value, and is usually greater than the width of a human head frame, and the camera angle may be further adjusted or the camera pan may be further acquired by detecting the change to preliminarily lock the person trying to queue-jump.
In a further embodiment, the characteristic identification unit sends the queue-inserting person half-length frame obtained by the queue-inserting behavior detection technology to a neural network, identifies the clothes color and the gender of the queue-inserting person, converts the clothes color and the gender into text information and voice information, and broadcasts and reminds the clothes color and the gender.
The blink recognition face positioning method comprises the following contents that in order to avoid the influence of the misalignment on the queue width, face recognition is needed to remove errors, namely, faces in a queue are recognized and recorded, and when the queue width exceeds a threshold value, the error condition caused by the misalignment of a standing queue is eliminated in advance, and the method specifically comprises the following steps:
step 1, positioning face characteristic points on a picture of a detection frame by framing the picture of a shot video so as to obtain eye key points;
step 2, constructing a human eye width-height ratio model, carrying out blink detection, locking a human face when the blink frame detection probability in thirty seconds reaches 1/10-1/3, eliminating the face influence of an inactive person, and recording face data;
and 3, when the queue width exceeds the threshold value, framing the currently shot queue picture, comparing the currently shot queue picture with the result of face recognition five times before the moment after face recognition is carried out, if the number and the result of the face recognition are not changed, determining that the width is changed due to the fact that the queue is not uniform, otherwise, carrying out face hole search without recognition, and positioning the faces of the queue inserts.
In a further embodiment, the face recognition uses a 68-point feature point positioning algorithm based on a cascade regression tree, for a fixed frame picture to be detected, the algorithm generates an initial shape and initial position coordinates of 68 feature points, the sum of square errors between the initial shape and a real value is further reduced by using a gradient lifting algorithm, and the accuracy of the face recognition and the eye position positioning is ensured.
In a further embodiment, after face alignment is performed in the face recognition, different face data can be stored and can be transmitted to a neural network for training, blink judgment is performed after the eye region is further positioned, when blink judgment is unqualified, face multi-department alignment recognition is performed again, and influence of non-living person recognition is eliminated.
In a further embodiment, the face recognition record value is set in a special condition, and for a queue change caused by incomplete queuing due to direct departure of people from the queue, the face recognition record value needs to be set in a normal condition, and status exclusion is performed, specifically including the steps of:
step 1, carrying out face recognition of a queuing queue by using face recognition, and marking faces after positioning eyes;
step 2, after face loss occurs, team face exclusion recognition is carried out, team face updating is carried out synchronously, inter-team early warning is not started, when the fact that the face loss cannot be recognized in the team is confirmed, the phenomenon that people leave uncompleted queuing tasks in the queuing queue is considered to occur, and face relocation and recognition are carried out on the queuing queue;
and 3, confirming that the queue width changes and restores to normal along with the disappearance of the missing face, and restoring normal face recognition and blink recognition.
In summary, the present invention has the following advantages: after the initial position and the end position of a queuing queue are preliminarily confirmed by positioning a face by using a computer vision field target detection technology, reconfirming the queuing queue by using a Gaussian filtering and false edge removing method to remove the influence of redundant edges; after the queue-inserting behavior detection unit monitors the queuing queue frame in real time and the width exceeds a threshold value, positioning the queue-inserting person and identifying the face by using a blink detection method after the conditions that the queue is uneven and the queuing task is not completed and leaves halfway are eliminated; and finally, shooting and identifying specific clothing and gender information of the person inserting the team through the camera and broadcasting the information, automatically storing and processing data and transmitting the data through neural network training, thereby realizing the function of high-precision automatic detection of the non-civilized behavior of the inserting team, greatly saving the labor cost and being beneficial to promoting harmonious queuing.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. The invention is not described in detail in order to avoid unnecessary repetition.