Summary of the invention:
The object of the present invention is to provide a kind of embedded human face automatic detection equipment and method based on DSP.
Along with the development of society, each side is urgent day by day to the requirement of auto authentication fast and effectively.Because biological characteristic is people's a inherent attribute, has very strong self stability and individual difference, be the most desirable foundation of authentication therefore.This wherein, utilizing face characteristic to carry out authentication is again the most direct means, compares it with other biological characteristic of human body and has directly, friendly, characteristics easily, is easy to be accepted by the user.Face identification system (FacialRecognition System) comprises two major technology link (see figure 1)s: at first be that people's face detects (having comprised people's face location), promptly from input picture, detect people's face and the residing position of people's face, and people's face split from background, be only then normalized facial image is carried out feature extraction and identification.
Embedded system is application-centered, based on computer technology, but and the software and hardware cutting, be applicable to that application system has the dedicated computer system of strict demand to function, reliability, cost, volume, power consumption.It generally is made up of part such as four of embedded microprocessor, peripheral hardware equipment, embedded OS and application program of user etc., is used to realize the functions such as control, supervision or management to other equipment.
See Fig. 4, embedded human face automatic detection equipment based on DSP, it is characterized in that, comprise: people's face trace routine can be solidified outside high-speed procedure storer (5) within it, video camera (1) or A/D converter (9), DSP digital signal processor (2), image sampling logic module (3), a plurality of outside high speed static data storeies (4), high speed serialization input/output module (6), control/decoding module (7), power module (8); Wherein video camera (1) or A/D converter (9) are connected by control line with image sampling logic module (3), image sampling logic module (3), control/decoding module (7), DSP digital signal processor (2), high speed serialization input/output module (6), a plurality of outside high speed static data storeies (4) and outside high-speed procedure storer (5) interconnect by control bus, data bus, address bus, and power supply (8) is connected with each several part.
Detection method based on the embedded human face automatic detection equipment of DSP is characterized in that people's face trace routine is:
A) video data obtains;
B) image pre-service;
C) colourful attitude center of gravity template people face detects---Rough Inspection;
D) illumination compensation is handled;
E) false face is removed---examining;
F) face organ location;
G) image normalization is handled;
H) data communication;
C wherein), e) two steps can be provided with according to the user and combine, d) can be provided with not deal with according to the user, d) also can with b) merge and handle, f), g) can be provided with according to the user and not process and handle by control computer.
Principle of work: see 2, Fig. 4, embedded human face automatic detection equipment based on DSP, under the control of people's face trace routine of human face automatic detection equipment in being solidificated in outside high-speed procedure storer (5), can carry out the analog video collection to various scenes by video camera (1), finish sampling and analog to digital conversion by image sampling logic module (3) again; The image pretreatment module of people's face trace routine is at first carried out the image pre-service to the digital picture that enters DSP digital signal processor (2), mainly is to carry out processing such as gray processing, noise reduction, enhancing, translation, rotation; People's face detection module by people's face trace routine carries out people's face Preliminary detection according to specific people's face detection algorithm again; For avoiding the generation of system's omission, flase drop phenomenon, people's face trace routine has been carried out processing such as illumination compensation, false face removal by certain flow process; And people's face position, scope are accurately located by methods such as gray feature inspection, rim detection; On pinpoint basis, more detected human face is positioned; Then people's face trace routine with two iris center position as reference point, concern by a certain percentage the normalized image of detected people's face image normalization for unified physical dimension, by asynchronous communication mouth RS-232 or RS-485 (6) normalized image is outputed to control computer at last, also can export raw video image on request;
Input: analog video stream, support multiple standard, as PAL, NTSC;
Output: people's face normalized image, digitized image;
Advantage of the present invention: the present invention has carried out organic the combination with people's face Automatic Measurement Technique with embedded system.Can from the scene of complexity, detect standardized people's face automatically and be used to carry out various identity validations, identifying operation, gate inhibition's control in for example gateway of building/residential quarter control, the building or the like; To need only also to can be applicable to people's face is detected and do not need the application scenario confirming, discern, as various TV monitoring and controlling warning systems.Human face automatic detection equipment involved in the present invention has that people's face detection speed is fast, accuracy of detection is high, good stability, failure rate are low, be easy to remarkable advantages such as maintenance, and the production use cost also is starkly lower than existing procucts.Can with the supporting use of portable computer POCKET PC, reduce the gate control system cost.
People's face trace routine functional module is divided referring to appendix one, and the communication interface of human face automatic detection equipment and control computer defines referring to appendix two.
Embodiment 1: see Fig. 4, go into face automatic detection equipment based on DSP embedded, it is characterized in that, comprising: people's face trace routine can be solidified within it outside high-speed procedure storer (5), video camera (1), DSP digital signal processor (2), image sampling logic module (3), a plurality of outside high speed static data storeies (4), high speed serialization input/output module (6), control/decoding module (7), power module (8); Wherein video camera (1) is connected by control line with image sampling logic module (3), image sampling logic module (3), control/decoding module (7), DSP digital signal processor (2), high speed serialization input/output module (6), a plurality of outside high speed static data storeies (4) and outside high-speed procedure storer (5) interconnect by control bus, data bus, address bus, and power module (8) is connected with each several part.
DSP digital signal processor (2): in order to realize man face image acquiring/identification real-time, adopting the digital signal processor of the TMS320UVC5409 series of American TI Company high-speed high-performance is core devices, it has very high arithmetic speed, is a kind of microprocessor that is particularly suitable for carrying out the digital signal processing computing.
Image sampling logic module (3): gathering video data stream real-time is the important ring of native system, has adopted programmable logic device (PLD) FPGA, selects 1,000,000 for use.Not only make system design more convenient flexibly, also improved the integrated level of circuit greatly.
Outside high speed static data storer (4):, disposed three 256K * 16 high speed static data storeies for the required high-speed high capacity data space of the image calculation that satisfies the automatic detection of complex of people's face;
Outside high-speed procedure storer (5): a slice 64K * 16 high-speed procedure storeies, a slice 64K * 16FLASH program storage.The program in the FLASH of will being stored in when system powers on is loaded in the high-speed procedure storer to be carried out, to satisfy system's full speed running.
High speed serialization output/load module (6): adopt RS232 or RS485 converter.
Control/decoding module (7): adopted the high-speed programmable logic device (CPLD), selected 100 macroelements for use, finished the I/O of DSP, the address decoding of external memory storage, function such as skip.
Embodiment 2: see Fig. 5, substantially the same manner as Example 1, different is, without gamma camera (1), uses A/D converter (9) instead, by the vision signal input, is converted into digital signal, is transferred to the sampling logical circuit; High speed serialization output/load module (6): expanded the high-speed serial communication that asynchronous communication chip TL16C550B realizes system; It is core devices that digital signal processor (DSP) (2) adopts the digital signal processor of the TMS3206203 series of American TI Company high-speed high-performance.
Embodiment 3: based on the embedded human face automatic detection equipment of DSP, it is characterized in that, people's face trace routine is removed ram in slice, the ROM that has used DSP digital signal processor (2) chip, also used the outside high speed static data storer (4) of polylith according to actual needs, externally people's face trace routine is provided with global variable memory block, common data exchange area and interim local variable memory block--heap, stack in the high speed static data storer (4).
High speed serialization output/load module (7) adopts RS-232 or two kinds of hardware interfaces of RS-485, for the communication interface of control computer.All the other are identical with embodiment 1.
The user can detect dedicated imbedded system to people's face by control computer carry out state-detection, function setting and the request of sender's face image data acquiring, and people's face detects dedicated imbedded system and can receive various Frames that control computer sends over, command frame and require loopback facial image data and correlation parameter, carry out feedback of status according to control computer.People's face detects dedicated imbedded system and control computer can be formed various people's faces/detection identification application system, as digital TV monitoring and controlling warning system, face recognition door control system etc.People's face detects dedicated imbedded system and control computer can realize many-to-one system configuration by the RS-485 bus, and promptly a control computer can be with many cover people faces to detect dedicated imbedded system.Control computer can be PC, minicomputer, graphics workstation, also can be Pocket PC.
See Fig. 2, the embedded human face automatic testing method based on DSP is characterized in that, catches people's face head portrait by camera, is stored in after head portrait is handled in the FLASH RAM memory as original image, comprises following sequential steps:
(1), video data obtains:
Processing response control computer request of data is obtained the original-gray image of single frames after control computer request of data, original video stream are handled, picture specification is 320 * 240, and pixel is 8, the output original-gray image;
(2), image pre-service:
Original-gray image pre-service with input may further comprise the steps: rotation, translation, flexible, clipping image, and the Mosaicization image extracts the Mosaic horizontal edge, calculates focus point, output center of gravity image;
(3), colourful attitude center of gravity template people face detects--Rough Inspection:
With the center of gravity image of input, utilization various human face center of gravity template is carried out matching operation to the center of gravity image that the image pretreatment stage obtains, and to obtain preliminary people's face information, exports preliminary people's face information content, position, size parameter;
(4), illumination compensation is handled:
With the end of input through the Flame Image Process of illumination compensation, mainly be that utilization Grey conversion, Log conversion, Exp conversion, histogram equalization, LogAbout conversion series methods or method combination are carried out the illumination compensation processing to image, to eliminate bad illumination condition as far as possible, as influence high and low, sidelight, the image that the output illumination compensation finishes;
(5), false face is removed examining:
With preliminary people's face information processing that the Rough Inspection of importing obtains, utilize the structural information and the proportionate relationship of face characteristic, the utilization gray feature detects, the edge feature detection method is got rid of false face, exports accurate people's face information;
(6), face organ location--location eye center point coordinate:
To import the information processing of accurate people's face, and utilize the structural information and the proportionate relationship of human face, utilization Gray Projection method draws the organic region position, again and then determine its center position, output eye position parameter;
(7), image normalization is handled:
Original image, people's appearance related parameter with input, picture specification requires to handle, the utilization digital image processing techniques, utilize the correlation parameter of people's face, after original image carried out corresponding conversion process, controlled computing machine requires specification size, the unified image of gray scale, output normalized image, eye position parameter;
(8), data communication:
The data of input are sent, receive interrupt request handle, with data transmission and the feedback of status of interrupt mode realization with control computer, output corresponding data frame.
Embodiment 4: see Fig. 6, the present invention is based on the application synoptic diagram of embedded human face automatic detection equipment in gate control system of DSP.Embedded human face automatic detection equipment (14) based on DSP connects PORT COM controller (12), portable computer POCKET PC (11) connects PORT COM controller (12) by the RS232 interface, and door lock controller (13) is connected with PORT COM controller (2) respectively with backstage backup management PC (15).After handling by portable computer POCKET PC (11) based on embedded human face automatic detection equipment (14) the output people face information of DSP, send the signal that opens the door to door lock controller 13, detect automatically and gate inhibition's function thereby finish people's face.
Appendix one:
Functional module definition based on the embedded human face automatic detection equipment of DSP
1, video data obtains;
Handle: respond the host computer request of data, obtain the original-gray image of single frames.
Input: host computer request of data, original video stream;
Output: original-gray image;
2, image pre-service;
Pre-service may further comprise the steps: rotation, translation, flexible, clipping image, the Mosaicization image extracts the Mosaic horizontal edge, calculates focus point.
Input: original-gray image;
Output: center of gravity image.
3, colourful attitude center of gravity template people face detects (Rough Inspection);
Handle: utilization various human face center of gravity template is carried out matching operation to the center of gravity image that the image pretreatment stage obtains, to obtain preliminary people's face information.
Input: center of gravity image;
Output: preliminary people's face information (quantity, position, size parameter).
4, illumination compensation is handled;
Handle: mainly be that series methods such as utilization Grey conversion, Log conversion, Exp conversion, histogram equalization, LogAbout conversion or method combination are carried out illumination compensation to image and handled, to eliminate the influence of bad illumination condition (high and low, sidelight) as far as possible.
Input: without the image of illumination compensation;
Output: the image that illumination compensation finishes.
5, false face is removed (examining);
Handle: utilize some priori of face characteristic, the utilization gray feature detects, the edge feature detection method is got rid of false face.
Input: preliminary people's face information that Rough Inspection obtains;
Output: accurate people's face information.
6, face organ location;
Handle: utilize some priori of human face, utilization Gray Projection method draws the organic region position, again and then determine its center position.
Input: accurate people's face information;
Output: face organ's location parameter.
7, image normalization is handled
Handle: use digital image processing techniques, utilize the correlation parameter of people's face, original image is carried out obtaining specification that host computer the requires image of (size, gray scale are unified) after the corresponding conversion process.
Input: original image, people's appearance related parameter, picture specification requirement;
Output: normalized image, organ site parameter.
8, data communication
Handle: with data transmission and the feedback of status of interrupt mode realization with host computer.
Input: data send, receive interrupt request;
Output: corresponding data frame (two " based on embedded human face automatic detection equipment communication interface and the communication regulations definition of DSP " that for details, see the appendix).
Appendix two:
Embedded human face automatic detection equipment communication interface and communication regulations definition based on DSP
One, interface type and relative parameters setting
Interface type: RS-232C (RS-485);
Interface rate: 115200baud rate (RS-232C is tentative system initial value)
Data bit: 8
Parity checking: (even parity check) arranged
Position of rest: 1
Performance evaluation: ideally 1s can transmit 11520 bytes.
Two, host computer (Pocket PC) with based on the embedded human face automatic detection equipment (DSP front end) of DSP
Specify:
The Communications failure that causes host computer and DSP front end owing to the reason that has following several respects:
1) the RS-232C communication line is unusual, and data can't transmit;
2) the DSP front end does not power up;
3) the DSP front end system breaks down, can't operate as normal, can not respond to the host computer request;
Therefore send request of data (or time-delay order is set after) at host computer and promptly carry out timing, system temporarily fixes in the 2000ms approximately if host computer does not receive the response of DSP front end, host computer promptly reports an error, and the unknown of prompting user DSP front end state need detect DSP front end, communication link.
1, system communication link self check (handshake): data frame format: address code (1 byte)+data frame type (1 byte)+test data (10 byte) illustrates: 1) the address code span is 0 ~ 225 (corresponding a plurality of DSP front ends), defaults to 00;
2) use this Frame during the system power-up self check
3) span of data frame type is 1,2,3,4,5,6,7, and wherein 7 is Retention Type;
4) the data frame type value is 1;
5) test data is the random data of 10 bytes, can be decided to be 5,4,3,2,1,0,9,8,7,6;
6) be subjected to the interference of various factors easily in the RS-232C communication link, therefore when realizing in system for avoiding data transmission to go wrong, following implementation strategy is taked in preparation: host computer sends to the DSP front end with this Frame, and host computer was given in i.e. passback after the DSP front end received.If it is errorless that host computer is confirmed, then sending to DSP front end status information value by host computer is 3 feedback of status frame; Otherwise 300ms is (under the normal prerequisite of communication link in time-delay, transmission data required time is worth far below this) more than, communication two party simultaneously communication speed is reduced a grade (by 115200-〉57600-〉38400-19200-14400-9600-7200-4800-2400 order successively decreases) repeat above-mentioned transmission, passback, proof procedure again, minimumly still can't correctly transmit this Frame if repeat repeatedly to have reduced to, then stop the transport process of this Frame, and by host computer prompting communication link data transmission exception.
Data flow: the DSP front end<---host computer
2, the overtime setting of DSP front end image acquisition and processing:
Data frame format: address code (1 byte)+data frame type (1 byte)+processing time-delay (1 byte)
Illustrate: 1) the address code span is 0 ~ 225 (corresponding a plurality of DSP front ends), defaults to 00;
2) DSP processing time-delay is a unit of account with ms, and span is 50 ~ 1000ms, defaults to 300ms;
3) the data frame type value is 2.
4) use this Frame after System self-test finishes.
Data flow: host computer---〉the DSP front end
3, host computer man face image acquiring request:
Data frame format: address code (1 byte)+data frame type (1 byte)+operational code (1 byte)+compression identity code (1 byte)
Illustrate: 1) the address code span is 0 ~ 225 (corresponding a plurality of DSP front ends), defaults to 00;
2) the operational code value is 0,1,2,3.Wherein 0 expression requires the DSP front end to carry out return state information after the self check but does not require the output normalized image, it is 80 * 100 pixel grey scale images that 1 expression requires the normalized image of DSP front end output, it is 100 * 125 pixel grey scale images that 2 expressions require the normalized image of DSP front end output, and 3 keep as system's extended interface;
3) be 3 according to the frame type value;
4) the identity code value is 0,1.Unpacked data is got in 0 expression, the 1 expression pressure data that contract.The system default value is 0.
Data flow: host computer---〉the DSP front end
4, feedback of status:
Data frame format: address code (1 byte)+data frame type (1 byte)+status information (1 byte)
Illustrate: 1) the address code span is 0 ~ 225 (corresponding a plurality of DSP front ends), defaults to 00;
2) the status information value is 0,1,2,3.Wherein 0 expression DSP front end system self check unusual (normally images acquired), 1 expression DSP front end system self check is normal; 2 expression DSP front end image acquisition and processing processes are overtime, 3 expression states normal (can send to the DSP front end by host computer, also can send to host computer by the DSP front end);
3) the data frame type value is 4;
4) host computer also can be 3 feedback of status frame to DSP front end send state information value.
Data flow: the DSP front end<---host computer
5, DSP front end image key parameter:
Data frame format: address code (1 byte)+data frame type (1 byte)+Normalized Grey Level image width (1 byte)+Normalized Grey Level image height (1 byte)+left eye x coordinate (1 byte)+left eye y coordinate (1 byte)+right eye x coordinate (1 byte)+right eye y coordinate (1 byte)
Illustrate: 1) address code meaning, value are with 1;
2) width, height and eye position parameter all are base unit with the pixel.
3) the data frame type value is 4.
Data flow: the DSP front end<---host computer
Suggestion: because these parameters are the key characterising parameter of Normalized Grey Level image, therefore when realizing in system for avoiding data transmission to go wrong, following implementation strategy is taked in preparation: the DSP front end sends to host computer with this Frame, and the DSP front end was given in i.e. passback after host computer received.If it is errorless that the DSP front end is confirmed, then sending to host computer status information value by the DSP front end is 3 DSP front end feedback of status frame; Otherwise repeat above-mentioned transmission, passback, proof procedure, still can't correctly transmit this Frame, then stop the transport process of this Frame, and by host computer reminder-data transmission abnormality if repeat 2 times.
6, DSP front end Normalized Grey Level view data:
Data frame format: address code (1 byte)+data frame type (1 byte)+flag byte 1 (1 byte)+flag byte 2+ follow-up data length (1 byte)+gray level image data (n byte)
Illustrate: 1) address code meaning, value are with 1;
2) totalframes of the width of cloth normalized image fractionation of flag byte 1 expression correspondence;
3) flag byte 2 expression notebook data frames are which frames of a width of cloth normalized image of correspondence;
4) value of follow-up data length represents that follow-up what bytes from this byte are effective gray level image data;
5) suggestion of gray level image data length is no more than 256 bytes (data length is unsuitable long);
6) the data frame type value is 6.
Data flow: DSP front end---〉host computer