C# video multi-face recognition

The content of the previous article was adjusted and submitted to git according to @ reincarnation, https://github.com/catzhou2002/ArcFaceDemo

 The basic idea is as follows:

First, identify the thread

1. Get the current picture

2. Identify the face position of the current picture and store the result in the list

3. Obtain and compare the eigenvalues ​​of the face respectively, and store the results in a list

4. If registration is required, the facial feature values ​​that need to be registered are stored in the list

Second, the display thread

Draw the content of the current list to the video control, focusing on the zooming of the picture.

The size of the video source picture is 1280*720

The size of the display control is: 640*480

The face rectangle in the video source picture is: Left: 100, Top: 100, Width: 200, Height: 200

The method of self-reliance is to multiply both the Left and Width of the rectangle by 640/1280, and the Top and Height by 480/720. It is frustrating every time. The solution is:

Graphics.ScaleTransform( 640F/1280,480F/720);

3. Mouse conversion

When the mouse is moved, if it is in the face position, the mouse will be transformed into Cursors.Hand

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325260449&siteId=291194637