One provenance taste shares the recognition of face and long-distance intelligent remote control method in kitchen
Technical field
The present invention relates to the communications between raspberry pie and Cloud Server, mobile phone terminal.The present invention is a kind of shared based on source taste
The recognition of face and long-distance intelligent remote control method added on cooking apparatus.
Background technique
Source taste kitchen Project-developing final goal is to realize that user places an order (deletion server give an order part)-by APP
Central kitchen allocation semi-finish cooked food and it is sent to-intelligent terminal refrigeration and switching culinary art in due course.
The terminal mechanical equipment of kitchen system is made of host and distribution box two parts, and wherein there are four independent controls for host
Working bin, four distribution boxes of arranging in pairs or groups, it is possible to provide 1 meal, 3 dish totally 16 sets of canteens.Distribution box is made of incubator and liner case, is protected
Incubator is used to guarantee preservation temperature of the vegetable in dispatching, and liner case is for placement tray and meal bowl.Liner case can be layered placement
Four pallets have multiple units on each pallet, can place the meal bowl of different model.Meal bowl is made of bowl and bowl cover, by right
The case where design of its structure can prevent taint of odour, drip.Since control robot has permission, and the people having permission is absent from the scene
When fail to open equipment take out food.
Summary of the invention
Intelligent program in order to overcome the shortcomings of existing kitchen system is lower, reliability is poor, and the present invention provides one
Kind intelligence degree is higher, the recognition of face and long-distance intelligent remote control method in the shared kitchen of the good source taste of reliability, realizes people
Face identification and long-distance intelligent control.
The technical solution adopted by the present invention to solve the technical problems is:
One provenance taste shares the recognition of face and long-distance intelligent remote control method in kitchen, comprising the following steps:
Step 1: the respbian jessie system of burning raspberry pie opens the service of raspberry pie SSH, VNC into SD card,
Purchase can connect the usb camera of raspberry pie, open raspberry pie camera service;Using raspberry pie GPIO low and high level control after
Electric switch has the function that controlling equipment;
Step 2: installation translation and compiling environment (python, c++);
Step 3: carrying out recognition of face, to guarantee that camera photographed complete face, show that camera is clapped using led display screen
The picture arrived, is convenient for knowing others and carries out face's alignment;
Step 4: configuration lnmp environment, server end are placed the end Web that html+css+js+php writes, are used on mobile phone clear
Device of looking at opens webpage and carries out relevant device switch operation;
Step 5: carrying out the perfect of Web end control system function;
Step 6: setting script booting self-starting.
Further, in the step 3, recognition of face process is described as follows:
Step 3.1: the position of face in picture is determined using HOG --- 16x16 is divided the image into after picture gray processing
The square of pixel calculates how many gradient of principal direction in each small cube, is replaced using the strongest gradient of directive property
Original image is finally converted into a very simple HOG expression-form by small cube originally, captures facial basic structure;
Step 3.2: in order to eliminate face towards error caused by different directions, we use the calculation of facial facial feature estimation
Method finds 68 points (landmark) such as table 1 generally existing on face:
Table 1
The position at each position of face is known according to this 68 points, picture pivots about operation with nose, so that
Face location is substantially aligned, then carries out next step operation;
Step 3.3: face encodings are given, for distinguishing different faces, concrete operations are one depth convolutional network of training,
128 measured values are generated for face, network can obtain almost the same value when the photo of two same persons is as input.Tool
Body is video under typing state using frame as unit screenshot by configuring openface program, training dataset in raspberry pie,
It carrying out recognition of face and the picture of Video segmentation is then inputted into training pattern, output test value is similar with the picture recognition of script, depending on
Frequency identification is exactly a large amount of picture recognition in fact, and the frame screenshot of video is stored under same file folder by the present invention, when identification is tied
Picture is deleted after beam, also screenshot is left out after same recognition of face detection, prevents picture from excessively causing raspberry pie can not
128 measured values of different people's training results are stored in cloud database by storage to identify;
Step 3.4: distinguishing different people 128 by personage in 128 measured values of measurement of comparison result and database
The Euclidean distance of measured value is compared, it is contemplated that volume will not be arranged in equipment rights management personnel, so this process
Performance raspberry pie can bear completely, one threshold value of default then thinks the non-same person more than threshold value, and authentication authorization and accounting loses
It loses, Euclidean distance is defined as follows d (x, y)
Wherein, xiRepresent the ith measurement value that instrument detects face, yiRepresent comparison people's image data in database
Ith measurement value.
In the present invention, using the raspberry pie operation associated depth learning program training facial image of connection camera, pass through
The video taken, which is cut into frame and identify, reaches face identification functions, while being communicated by socket and Cloud Server,
Cloud Server is communicated by http agreement with mobile phone mobile terminal.
Beneficial effects of the present invention are mainly manifested in: carrying out the deep learning of intelligent terminal by raspberry pie and items are counted
It calculates, control, since required calculating power is little, it is possible to complete to operate by raspberry pie, realize recognition of face and long-range intelligence
It can control.
Detailed description of the invention
Fig. 1 is that source taste shares the recognition of face in kitchen and the raspberry pie data communication process figure of long-distance intelligent remote control method.
Specific embodiment
The invention will be further described below in conjunction with the accompanying drawings.
Referring to Fig.1, a provenance taste shares the recognition of face and long-distance intelligent remote control method in kitchen, comprising the following steps:
Step 1: into SD card, (some raspberry pies are bought to be passed through the respbian jessie system of burning raspberry pie
Businessman's burning, the step for can saving), the service of raspberry pie SSH, VNC is opened, purchase can connect the usb camera of raspberry pie,
Open raspberry pie camera service.Originally small kitchen terminal mechanical equipment is using relay control switch, and the present invention is intended that with tree
The certain kind of berries sends GPIO low and high level to control relay switch, has the function that controlling equipment;
Step 2: installation translation and compiling environment (python, c++);
Step 3: installation opencv, the method for handling video is to be split video according to frame, logical when typing information
It crosses web terminal manipulation raspberry pie to start to record face information, starts to detect by starting to record by the switch on instrument, pass through threaded tree
The certain kind of berries group infrared module detecting instrument before whether someone, when detection complete or it is infrared can not detect people station 5 seconds before instrument
After close detection function.Opencv determines the position of face in picture using HOG --- it is divided the image into after picture gray processing
The square of 16x16 pixel calculates how many gradient of principal direction in each small cube, is come using the strongest gradient of directive property
Instead of original small cube, original image is finally converted into a very simple HOG expression-form, captures the basic knot of face
Structure;
Step 4: in order to eliminate face towards error caused by different directions, we use the algorithm of facial facial feature estimation
(Vahid Kazemi and Josephine Sullivan were invented in 2014), finds 68 points generally existing on face
(landmark) such as table 1:
Characteristic point |
Chin |
Left eyebrow |
Right eyebrow |
The bridge of the nose |
Nose |
Left eye |
Right eye |
Outer lip |
Interior lip |
Number |
0-16 |
17-21 |
22-26 |
27-30 |
31-35 |
36-41 |
42-47 |
48-59 |
60-67 |
Table 1
The position at each position of face can be substantially known according to this 68 points, picture pivots about behaviour with nose
Make, so that face location is substantially aligned, by treated, image saves the original image of covering, then carries out next step operation;
Step 5: giving face encodings, for distinguishing different faces, concrete operations are one depth convolutional network of training, are
Face generates 128 measured values, and when the photo of two same persons is as input, network can obtain almost the same value.Specifically
By configuring openface program in raspberry pie, training dataset is video under typing state using frame as unit screenshot, into
The picture of Video segmentation is then inputted training pattern by row recognition of face, and output test value is similar with the picture recognition of script, video
Identification is exactly a large amount of picture recognition in fact, and the frame screenshot of video is stored under same file folder by the present invention, works as end of identification
Picture is deleted afterwards, is also left out screenshot after same recognition of face detection, preventing picture excessively causes raspberry pie that can not deposit
128 measured values of different people's training results are stored in cloud database by storage to identify;
Step 6: distinguishing different people and pass through 128 surveys of personage in 128 measured values of measurement of comparison result and database
The Euclidean distance of magnitude is compared, it is contemplated that and volume will not be arranged in equipment rights management personnel, so this process
Performance raspberry pie can be born completely, one threshold value of default, and the non-same person is then thought more than threshold value, and authentication authorization and accounting fails,
Euclidean distance is defined as follows d (x, y)
Wherein, xiRepresent the ith measurement value that instrument detects face, yiRepresent comparison people's image data in database
Ith measurement value;
Step 7: purchase Ali's Cloud Server configures lnmp environment, and server end places what html+css+js+php write
The end Web, using browser opening webpage on mobile phone and carrying out relevant device switch operation (has unlatching to eat in script terminal mechanical equipment
Object heating cabinet and the button for starting culinary art, stopping culinary art are all relay switch operations, and operation here also includes these), the phase
Between connection relationship such as Fig. 1;
Step 8: carrying out perfect (such as user's logins, rights management etc., the progress phase of Web end control system correlation function
Close security setting).
Step 9: setting script booting self-starting;
The present invention carries out the deep learning of intelligent terminal by raspberry pie and every calculating, control centre act on, due to this
Calculating power needed for invention is little, so can complete to operate by raspberry pie substantially.
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, above embodiments implement the present invention
Technical solution in example is clearly and completely described, it is clear that and described embodiments are some of the embodiments of the present invention, and
The embodiment being not all of, based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work
Under the premise of every other embodiment obtained, shall fall within the protection scope of the present invention.