According to Dong Zi's blog, to the Microsoft Oxford Project website to apply for the test face recognition key, according to the official document, the WPF project was built, follow the step by step process to complete the function in example. But this is only a example, the picture can not be too big, otherwise there will be overflow error. Previously concerned about the Oxford project, later did not know that the Chinese version of the official website also came out, only the Chinese document translation is too unsightly, but this also maintained the consistent style of Microsoft.
My environment is:win7 64bit+vs2015+.net4.5+c#
PS: Best to put drawingcontext.close ();
Move to the back of the RenderTargetBitmap object instantiation, and in Facewithrectbitmap.render (visual), add Try-catch. The following code snippet is modified:
1RenderTargetBitmap Facewithrectbitmap =NewRenderTargetBitmap (2(int) (Bitmapsource.pixelwidth *resizefactor),3(int) (Bitmapsource.pixelheight *resizefactor),4 the, the, PIXELFORMATS.PBGRA32); 5 drawingcontext.close ();6 Try7 {8 Facewithrectbitmap.render (visual);9 }Ten Catch(Exception ex) One { A MessageBox.Show (ex. ToString ()); -}
Here are the test results:
Tut, had to sigh before the painters of the poster master AH:
The side face is still not recognized in place (or I have not found the use of side face recognition?). ):
Here's a two x (actually I like his movie):
The current comparison of the Fire Parade Women Team (the most beautiful sister may be because only half of the face in the photo, so not identified):
Project Source code: microsoftfaceapi_src.7z
microsoffaceapi_debug.7z
A probe into Microsoft Oxford Project human face recognition API