If you don’t want to miss my updates, remember to check the public account in the upper right corner and set it as a star, take down the stars and give them to me.


When it comes to computer vision and face recognition, the first reaction is definitely to use OpenCV. Now with the latest MATLAB library, it can also be easily accomplished:

(Source: hackster.io) To implement the above face recognition function, the required software and hardware are also very simple:
About MATLAB, many people may think that it is a course in college, but in fact, many data researchers and artificial intelligence scientists use MATLAB. Although it may take some time to get started, once you get into it, you will find that MATLAB can basically accomplish all tasks. With the built-in tool library and related software support of MATLAB, you will be immersed and unable to extricate yourself. MATLAB even supports generating runnable software code for Raspberry Pi, which is a major wish for Raspberry Pi enthusiasts.
1
Installation
Before starting, make sure that MATLAB software is installed on your computer. I won’t go into detail about the installation of MATLAB, please solve it yourself.
Then, we need to install the relevant tool packages in MATLAB, the installation steps are:
1) Open MATLAB and select Add-Ons->Get Add-Ons
2) Search for ‘MATLAB Raspberry Pi support package’ -> install
3) Accept the terms


2
Configure Raspberry Pi to work with MATLAB
The principle of collaboration between MATLAB and Raspberry Pi is that MATLAB sends commands to Raspberry Pi while Raspberry Pi acts as a server in the project, interpreting and executing the received commands.
Select ‘Setup hardware with Mathworks Raspbian image’

Download the deep learning image file
Find the downloaded image file and unzip it:
Verify the image file

3
Burn the image
Find a memory card, connect it to the computer with a card reader, and start burning the image file.(Note: The MAC version of MATLAB cannot burn images. Friends using MAC can use ‘BalenaEtcher’ to burn the image.)
01

02

03

04

Swipe to view steps
◇ If the connection is successful, ‘test hardware connection successful’ will appear.Otherwise, ensure that your Raspberry Pi and PC are in the same network environment.
4
Transmit commands and control Raspberry Pi
If the test connection passes, you can now control Raspberry Pi through MATLAB.

5
Run the face recognition program
Clear the test connection channel, enter in the MATLAB command window:
%% set up your raspberry pi hardwareperipherals accessmypi = raspi();myCam = cameraboard(mypi)%% Image acquisition & plottingmySnap = snapshot(myCam)imshow(mySnap)hold on%% Detect face and insert a rectangle around thefacefD = vision.CascadeObjectDetector(); %% fromcomputer vision toolboxbbox = step(fD, mySnap);imageOut = insertObjectAnnotation(mySnap,'rectangle', bbox, 'Face');imshow(imageOut);%% Repeat in a loop to make it look like facedetection in videoflag = 1;while flagclearvars -except mypi myCam flagmySnap = snapshot(myCam);imshow(mySnap);hold onfD = vision.CascadeObjectDetector();bbox = step(fD, mySnap);imageOut = insertObjectAnnotation(mySnap, 'rectangle',bbox, 'Face');imshow(imageOut);title('Detected Face');drawnow %% refreshes the image window afterevery loopend


More practical project recommendations:
STM32 IoT Smart Home Project
Raspberry Pi + Compute Stick 2 Real-time Face Recognition Project
Building a Cloud Computing Platform for Embedded Development Boards
STM32 Implementing the Simplest Air Mouse
Arduino Rubik’s Cube Robot
STM32 Version of “AI Soul Painter”
STM32 Electronic Photo Album Production
STM32 + DDS Homemade Signal Generator
Using Raspberry Pi and Web Interface to Remotely Control Appliances
STM32 “Cloud” Music Player
Raspberry Pi Remote Monitoring
Design of Glow Tube Clock Based on STM32
Homemade FPGA Minimum System Board (PCB can be directly made)
Raspberry Pi 4 Builds NAS, Making Hard Drives Easily Networked
ESP32 Car Software and Hardware Practical Sharing
Only 79 lines of code to complete creative gesture recognition
IoT + Electronic Ink Screen can create a custom display
Build a value of thousands of exploration robots for dozens of dollars
Glasses-free 3D holographic display, visual persistence POV project
DIY Gesture Recognition Module
Practical small designs that can be DIYed from scratch
Raspberry Pi creates a smart doorbell + smart door lock that can video
Strange! My development board can play games automatically
Homemade ventilator
ESP8266 + Zigbee Networking to Transform Wall Switches
Wireless Home Monitoring System
DIY Bionic Arm, a tool to free your hands
Handmade Air Purifier, all design materials open source
Tech Toy: Remotely Controlled Bluetooth Cannon
Create the LittleBee Monitoring System with ST Sensors, Let Bees “Speak”
Homemade Cat Petting Device
STM32 + Raspberry Pi Implementing 6s Rubik’s Cube Robot
Blind Modification of Drone Controller, DIY “Foam” Drone
Recommended Reading:

Like, watch, and share three times in a row
