2.8 Facial recognition1. Learning objectives2. preparation before class3. Programming Methods4. Blocks5. Code6. Download code7. Experimental phenomena
In this course, we will realize k210 vision module performs face recognition.
When different faces are recognized, the Micro:bit led dot matrix displays different face serial numbers and plays different music.
In this course, we are recognize 3 different faces.
Delete the main.py file.
Then, rename the 2.8_face_recog.py file as the main.py file.
Online programming: first copy this URL https://makecode.microbit. and enter the online programming interface.
Copy the package URL: https://github.com/YahboomTechnology/K210-Module.git to the input field, click confirm to add the package, after that you can use the blocks of K210 vision module package.
Connect the Micro:bit board to the computer via micro USB cable, the computer will pop up a USB stick.
Then, select the microbit-face_rec.hex file and right click to send it to the Micro:bit U disk.
Wait until sending is complete and unplug the Micro:bit USB cable. Plug the Micro:bit board into the car.
After starting the car, wait for the screen to display the camera image.
After the screen is displayed, the camera is pointed at the face, and if it is an unrecognized face, a white box will be displayed.
Press the K1 button in the upper right corner to record the face information, at this time the face serial number is 0, the white border changes to green border, and the recognized score is displayed.
Micro:bit led dot matrix displays the face serial number 0, and plays the music of serial number 0.
Continue to the unrecognized face, press the K1 button at the top right corner, at this time the face serial number is 1, the white border changes to a green border and the recognized score is displayed.
Micro:bit led dot matrix displays the face serial number 1 and plays the music of serial number 1.
Repeat the above operation for the recognized face.
Press the K1 button in the upper right corner, then the face serial number is 2, the white border changes to green border and the recognized score is displayed.
Micro:bit led dot matrix displays the face serial number 2 and plays the music of serial number 2.