A kind of face information collection method based on video camera recognition of face
Technical field
The present invention relates to a kind of collection method of face information, and in particular to a kind of face based on video camera recognition of face
Formation gathering method.
Background technology
Today's society, for the consideration of secure context, video monitoring equipment is applied to safe city monitoring more and more,
And in the monitoring of the various places such as cell, factory.Monitoring process is the identification for people in most cases, and as face is known
The maturation of other technology so that be possibly realized by artificial intelligence to digest the face in monitor video data automatically.As monitoring is set
It is standby increasingly to popularize, and requirement of the recognition of face to video quality is higher, and corresponding monitoring data is also increasing.
At present, use recognition of face in monitoring system, by the way of be video camera video in the case of the overwhelming majority
Data issue background server, and background server relies on its powerful hardware again, complicated software does intellectual analysis.So monitoring
The data throughout of network is surprising;Under conditions of video camera is more and more, the storage capacity and operational capability of background server
Also test is enjoyed so that cost significant increase;In addition monitors environment complexity is various, and the parameter setting of video camera does not ensure that reality
When it is intact, the situation that can lead to not identification and collector's picture occurs, and judges image matter using far-end server analysis diagram picture
Measure and return to camera parameters modification and require that video camera adjusts take pictures again, great pressure can be caused to hardware spending, on the time
Also have little time.
The video camera identification face that is promoted to of the improvement of algorithm in recent years and hardware performance provides possibility, traditionally uses
The general processor of the common mobile terminal frameworks such as cortex or atom based on X86 is not particularly suited for carrying out Video processing and hardware
The extensive simple operation needed for artificial intelligence is carried out while management again.
The content of the invention
In order to overcome prior art monitoring system network overhead big, the serious uneven situation of hardware spending distribution, the present invention
Purpose aim to provide a kind of face information collection method based on video camera recognition of face.
Method provided by the invention is as follows:
A kind of face information collection method based on video camera recognition of face, its method are:Camera acquisition video data
During, at the same to every one-frame video data carry out face information identification obtain present frame in all persons facial image and
The mass parameter of corresponding facial image, finally determine the face information and matter of facial image in all persons in the present frame
Amount parameter reaches the personage of preset standard, and captures human face photo to the personage.
It is described to every one-frame video data carry out face information identification obtain present frame in all persons facial image and
The mass parameter of corresponding facial image, it is specially:The video camera is according to the Luminance Distribution in the wherein frame of video data
Pick up face information, the brightness of the facial image in face information afterwards, definition and positive face human face characteristic matching journey
Degree determines the mass parameter of facial image.
The video camera also includes after picking up face information according to the Luminance Distribution in the wherein frame of video data:Institute
State video camera and judge that current face's image is with picking up face information contrast situation in neighbouring some frames according to current face's information
No is new person, if it is determined that be new person, for current face's image distribute face ID, conversely, by current face's image with it is existing
Face ID establishes corresponding relation.
It is described to determine that the face information of facial image and mass parameter reach pre- bidding in all persons in the present frame
Accurate personage, and human face photo is captured to the personage, it is specially:When the mass parameter for being defined as new person and facial image is more than
Or during equal to predetermined threshold value, the video capture human face photo simultaneously stores.
The facial image and correspondingly that face information identification obtains all persons in present frame is carried out to every one-frame video data
Facial image mass parameter after, this method also includes:When the mass parameter for being defined as new person but facial image is less than in advance
If during threshold value, the video camera adjusts camera parameters according to face information, while abandons facial image and continue to judge subsequently
The mass parameter of facial image caused by video data is until the mass parameter of facial image is more than or equal to predetermined threshold value.
Determine that the face information of facial image and mass parameter reach preset standard in all persons in the present frame
Personage, and human face photo is captured to the personage, it is specially:When the mass parameter for being defined as original face and facial image is more than
Or during equal to predetermined threshold value, the video camera judges that the mass parameter of facial image or the positive face degree of face are shone more than original face
Piece, finally capture human face photo and replace original human face photo.
The facial image and correspondingly that face information identification obtains all persons in present frame is carried out to every one-frame video data
Facial image mass parameter after, this method also includes:When the mass parameter for being defined as original face but facial image is small
When predetermined threshold value, the video camera adjusts camera parameters according to face information, while abandons facial image and continue to judge
The mass parameter of facial image caused by subsequent video data is until the mass parameter of facial image is more than or equal to predetermined threshold value.
After when the mass parameter of facial image is more than or equal to predetermined threshold value, this method also includes:The camera record
The mass parameter of facial image is more than or equal to exposure parameter during threshold value, judges that video camera does not detect in preset time afterwards
To face information, then the exposure parameter adjustment recorded when being more than or equal to predetermined threshold value according to the last facial image parameter is taken the photograph
Camera.
Determine that the face information of facial image and mass parameter reach preset standard in all persons in the present frame
Personage, and human face photo is captured simultaneously to the personage, this method also includes:Video camera detects that memory capacity is less than early warning
Value, part human face photo is deleted afterwards, be specially:The video camera access status of human face photo, upload according to corresponding to face ID
State and tracking mode determine face ID priority and do real-time adjustment, while delete face ID according to priority ranking and correspond to
Human face photo and nullify face ID, finally detect memory capacity higher than predetermined threshold value stop delete work.
Pre-set level candid photograph human face photo is reached according to the mass parameter of face information and facial image and uploaded, specifically
For video camera selects the candid photograph mode of human face photo according to far-end server demand.
A kind of face information collection method based on video camera recognition of face according to claim 1, its feature exist
In:Pre-set level candid photograph human face photo is reached according to the mass parameter of face information and facial image and uploaded, specifically, shooting
Machine selects the upload strategy of human face photo according to far-end server demand.
Compared with prior art, the present invention undertakes simple but substantial amounts of recognition of face work by adding image operation chip
Work, and acquisition and upload using general processor according to the result of recognition of face progress human face photo, substitute on originally direct
Bandwidth waste caused by original video code stream carries out recognition of face for server, and the hardware resource waste of server are passed, is fitted
More face lifting monitoring effects are monitored and tracked during contract.
Brief description of the drawings
Fig. 1 is a kind of flow chart of the face information collection method based on video camera recognition of face.
A kind of a kind of flow of embodiment of the face information collection method based on video camera recognition of face in Fig. 2 positions
Figure.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and
It is not used in the restriction present invention.
The embodiment of the present invention provides a kind of face identification method based on video camera, and step includes:Camera acquisition video
Data, face information identification is carried out to every one-frame video data while gathered data to obtain the face of face facial image
The mass parameter of information and facial image, determine that facial image reaches pre-set level, the face that pre-set level is reached to face enters
Row is taken pictures.
Include to implement this method, inside the video camera for control camera operation, image coding and decoding and
The master controller of the work such as communication, and corresponding main storage, in addition to for carrying out face figure using face recognition algorithms
As external parts such as the image operation chip of identification and its corresponding memories, video camera can also add external memory, for storing
The photo of gained is captured, reduces the storage pressure of main storage.The specific steps of this method include on basis herein:
Step 100:The video data of master controller collection sensor is simultaneously cached to main storage.
Step 200:Master controller transmits segmented video data to image operation chip.
Step 300:Face in image operation chip analysis segmented video data, identify face and return to face information
To master controller.
Step 301:Image operation chip according in the segmented video data received among a certain frame facial image brightness
Distribution, pick up face information.
Step 302:Image operation chip is according to the face information of current detection with forward being detected in some frames
The face information of facial image is compared, and judges the two similarity, and according to the current quilt of similarity and the threshold decision of setting
Whether the face of detection is new person, according to judged result by the face information of the facial image occurred and corresponding face ID
It is corresponding, or new face ID is set for new person.
Step 303;Image operation chip according to the brightness of current face's image, definition and with positive face human face feature
Matching degree provide the mass parameter of current face's image.
Step 304:Facial image and quality parameter information are transmitted to master controller.
Step 400:Master controller is overseas set according to face information adjustment ring.
Step 401:Master controller judges whether to need to adjust according to the mass parameter of facial image and the brightness of current face
The adjusting step of whole exposure parameter and needs.
Step 402:When the mass parameter of facial image reaches given threshold, the exposure in master controller record a period of time
Parameter.
Step 403:When can't detect face, the exposure parameter of master controller usage record sets video camera.
Step 500:Master controller is captured face and is stored in main storage or external memory.
Step 501:According to face ID, when the mass parameter for receiving new person's facial image is higher than predetermined threshold value, main control
Device control video camera, which is grabbed, to be afraid of human face photo and stores.
Specifically, master controller is according to setting, control video capture face figure, human figure or artwork, or three from
By combining.
Step 502:According to face ID, when receiving the human face image information for having preserved human face photo, master controller judges
When current face's image and anon-normal face, current face's image is bigger compared with the positive face product of the human face photo of saved mistake,
And the mass parameter of current face's image is higher than threshold value, or current face's image mass parameter higher than having preserved human face photo
Then grab and be afraid of human face photo and store to replace original human face photo and record the mass parameter of human face photo.
Step 503:According to face ID, when receiving the human face image information for having preserved human face photo, master controller judges
When it is positive face to have preserved human face photo, the mass parameter of current face's image, which is more than, have been preserved face and then captures human face photo simultaneously
Storage replaces original human face photo and records the mass parameter of human face photo.
Step 600:Upload and clear up human face photo.
Step 601:When human face photo quality exceedes setting value, master controller uploads human face photo.
Specifically, the preferential upload pictures mass parameter of master controller reaches the photo of upload standard and between current time
Every the higher human face photo of mass parameter in shorter human face photo, and all human face photos.
Specifically, master controller, according to setting, control video camera uploaded after upload, people leave in real time and interval uploads
Three kinds of upload modes, wherein it is to upload human face photo at once after human face photo produces variation to upload in real time, people uploads after leaving
It is that optimal photo is uploaded after people leaves detection zone, interval upload is that face ID corresponds to facial image and gone out in the detection area
Now, optimal photo is periodically uploaded.
Step 602:When main storage or when reaching setting value using capacity of external memory, master controller is corresponding according to face ID
Human face photo currently accesses situation, currently uploads situation, current to track situation and last tracking time as each face ID settings
Priority.
Specifically, the current human face photo accessed has highest priority, the human face photo currently not yet uploaded
Higher priority is obtained, the human face photo currently tracked obtains higher priority, finally tracks between time and current time
Lower priority is obtained every longer human face photo.
Step 603:It is preferential to delete and cover the lower human face photo of priority according to face ID priority, and nullify
Face ID corresponding to capped human face photo.
Embodiment one:
Video camera is recorded a video to place detection zone, and is stored in internal memory, and arm processor leads to segmented video data
BT1120 normal video data interfaces are crossed to transmit to the FPGA computings chip.
Segmented video data is buffered in the internal memory of FPGA computing chips and to segment data frame by frame by FPGA computings chip
Analyze, the Luminance Distribution of human face region in captured image, capture facial image and simultaneously record face information.FPGA computing chips make
Contrasted with the face information of current record and the face information of nearest some frame recordings, judge the face whether with formerly recording
Face is consistent, if the face is judged be new person's face if distribute new face ID, if it is original that the face, which is judged,
Face, then the face information of current record face ID corresponding with original face is associated.
FPGA computings chip is according to the matching degree of the brightness of current face's information, definition and positive face human face feature
Provide the mass parameter of current face's image and transmit mass parameter and face information to arm processor.
Arm processor judges whether to need to adjust exposure parameter according to the face brightness of current face's information and mass parameter
And other camera parameters, and confirming the step-length of adjustment, control video camera completes the modification of acquisition parameters, while monitors FPGA fortune
The face information in the follow-up facial image of chip transmission is calculated, until brightness is enough, mass parameter reaches standard.
On the premise of quality of human face image parameter reaches predetermined threshold value, arm processor is captured human face photo and is stored in
In internal memory.
Specifically, arm processor extracts the facial image in caching as human face photo, while add to this document
Descriptive information, records photographing time and face ID.
The human face photo stored in internal memory is uploaded to far-end server by arm processor.
The advantage of the program is:The acquisition situation of facial image is judged using face ID, is easy to be accurately controlled and remembers
The collection situation of face information is recorded, and without obtaining and uploading substantial amounts of picture, greatly saves the expense of hardware.
Photograph taking situation is obtained according to the face information of human face photo and mass parameter, adjusts camera parameters in real time,
Be advantageous to take the higher photo of quality.
Embodiment two:
On the basis of embodiment one, when FPGA computing chips can't detect any face, arm processor backtracking is nearest
Take that to reach the human face photo of standard be the exposure parameter of adjustment, for setting video camera.
The program is easy to be arranged on the exposure status of video camera when not having face under detecting detection zone most rational
Under state, it is easy to more efficiently be adjusted to suitable exposure position after detecting face again.
Embodiment three:
On the basis of embodiment one, ARM controller judges face ID after receiving human face image information, as the face people
Face ID has been captured and has been stored photo, then corresponds to the mass parameter and positive face product and current face's image of the human face photo of storage
The mass parameter and face area included in information, if mass parameter is higher or positive face product is bigger, face is captured again and is shone
Piece simultaneously replaces original human face photo.
The mass parameter of the human face photo and the matter of current face's image are only contrasted if being positive face if the human face photo of storage
Measure parameter.If the mass parameter of current face's image is higher than the mass parameter for having stored human face photo, captures and store new
Human face photo, replace old human face photo.
Positive face accumulates larger photo on average, and the mass parameter of facial image is also corresponding higher, so the program is fitted
Close the image and photo for filtering out and more picking out personnel.The program is easy to efficiently contrast and obtain the higher face photograph of quality
Piece, it is easy to preserve the more excellent human face photo of quality.
Example IV:
On the basis of embodiment three, arm processor also receives the instruction for coming from far-end server, is taken according to distal end
Fearness rule is grabbed in the demand adjustment of business device.
Specifically, including but not limited to following picture pattern:
Current scene artwork, the affiliated human figure of track human faces or the face figure of track human faces or any combination of three;
Also include but is not limited to following candid photograph strategy:
After the mass parameter of facial image reaches threshold value, capture and upload at once;
After the affiliated personnel of face leave detection zone, optimal human face photo corresponding to the face is uploaded;
As the affiliated personnel of face after detection zone occurs the optimal face picture of periodic transmission.
The program causes video camera more to adapt to daily monitor task, is protected in the case where no video data is as achieving
Stay more reasonably data.
Embodiment five:
On the basis of embodiment one, add TF card or ROM memory and be connected as external storage with arm processor,
Human face photo is stored in TF card or ROM memory by arm processor.
The program optimizes the storage environment of human face photo, prevents from uploading not in time, and causes photo not upload and lost
Abandon or, situation that the photo newly captured can not store.
Embodiment six:
On the basis of embodiment one or five, when arm processor monitors that the memory space of internal memory or external memory is less than in advance
If threshold value, priority ranking is carried out to the human face photo of storage.
Specifically, according to face ID, judge whether human face photo corresponding to face ID is accessing, for the people accessed
Face photo sets high priority, judges that face ID corresponds to the upload situation of human face photo, and the human face photo to have uploaded is set
Low priority, judge corresponding to face ID that facial image tracks situation, the face ID corresponding to the facial image that is tracking is set
High priority is put, according to the last tracking time from closely to the priority being far sequentially arranged from high to low.
Arm processor deletes the face ID that priority is relatively low in internal memory or external memory according to the precedence information of real-time change
Corresponding human face photo, and nullify face ID.When the memory space of internal memory or external memory is higher than a predetermined threshold value, stopping is deleted
Work.
The program ensure that the human face photo of high value more effectively preserves together in the case where network condition is exceedingly odious
When be normally carried out without prejudice to monitoring work.
The foregoing is only a preferred embodiment of the present invention, but protection scope of the present invention be not limited thereto,
Any one skilled in the art the invention discloses technical scope in, the change or replacement that can readily occur in,
It should all be included within the scope of the present invention.Therefore, protection scope of the present invention should be with scope of the claims
It is defined.