Five Passive Income Skills I Wish I Knew at 20

Late-nights at nightclubs. Stupid amounts of alcohol. Racing cars down suburban streets at over 100 mph. I asked my friends to call me Peter Pan. The one or two grey hairs I now have prove this claim…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Comprehensive Guide on How to Build Face Recognition Camera using Raspberry Pi and Pi Zero

This tutorial will teach how to create IoT device that can capture and analyze faces using Raspberry PI devices. In this article, I will discuss following:

In the end, you will have two devices that will communicate with each other using Socket Programming in order to capture and process the images.

Along with Raspberry PI’s V2 camera, you can also use cameras created by 3rd party companies.

Below I listed some of the cameras for Raspberry PI along with several statistics for comparison. These cameras are in range of $27 each, but they 1) are all wide angle 2) have built in IR-cut and 3) have night vision capabilities

If you are building camera that you want to use during night vision, I recommended you check out the list below; otherwise, you can just buy Raspberry V2 camera.

Note: if you decide to buy one of those above mentioned cameras, you will also need to buy cable.

The image below shows how to connect camera to Raspberry PI. In our case, note that we will be connecting camera to Raspberry PI Zero.

In the Section 4 - Software, I provided source code and explain how to check if camera was connected correctly.

2. Power Supply for Raspberry device

3. Additional sensors

Below is an infographic that shows high level of how each tool is connected to either Raspberry PI or PI Zero. Moving forward, Raspberry PI will be addressed as Processing Unit and Raspberry PI Zero as Camera Unit.

Schematics for Raspberry PI (Processing Unit) and Raspberry PI Zero (Camera Unit)

The following steps will outline how to install and prepare OS for Raspberry PI devices before installing face recognition software.

NOTE: In this section, you will have to connect microSD card to your computer and keep it connected until your are done enabling WiFi and SSH

Once you complete the steps above, your microSD card will be renamed boot

Cyberduck will allow you to view files in your Raspberry PI using simple GUI.

2. Select SFTP (SSH File Transfer Protocol)

Once you SSH into Raspberry PI for the first time, make sure you change passcode and enable camera. In the terminal of the PI, type in sudo raspi-config . You will see Raspberry menu.

In the menu section Interfacing Options enable camera.

In the menu section Advanced change GPU memory split from 64 to 16.

Then, reboot PI to enable changes: sudo reboot

As of now, you should have OS installed on your microSD card, powered and connected Raspberry PI Zero, and have it connected via WiFi and SSH.

In the following section we will ensure Raspberry PI Zero has camera set up correctly

3. Create new file with .py extension and paste the following code (change location to save the your files):

If code runs correctly, camera on Raspberry PI Zero is installed correctly.

2. Create and activate Python virtual environment.

So far we did software installations on ‘Camera Unit’ and Raspberry PI separately. But as of now, they do not communicate with each other. Next, we will focus on sockets to send information from one device to another.

Socket connection between Processing Unit (Left) and Camera Unit (Right)

As of now, you have installed face recognition on Raspberry PI, and camera is running on Raspberry PI Zero. Next, we need to send information from PI Zero to PI.

NOTE: For clarity, I will address Processing Unit as Server and Camera Unit as Client.

Outlined below code will do 2 things:

In the example above:

In the example above:

Socket Programming allows to send and receive data bi-directionally. In this case, Raspberry PI (Processing Unit) is server, which receives the information and Raspberry PI Zero (Camera Unit) is client, which emits (transfers) information.

Schematics of the process where images are emitted to Processing Unit and stored

In the following article, we discussed 3 primary points:

In the end, you should have 2 IoT devices that are capable of capturing, storing and transmitting captured images.

Add a comment

Related posts:

Honey

Make your money; honey, it drips from the golden globe, when the heart invests in the desire for more, folklore, be the twin, move into humanity not away, In pursuit of all being; spiritual sight…

Cerita Di Balik Nama Coban Rondo dan Sedudo

Rondo dan Sedudo. Mendengar namanya, mungkin kamu bakalan tersenyum sendiri. sebutan objek wisata Malang dan Nganjuk yang memiliki makna dan arti tersendiri. Meski banyak yang mengatakan hanya mitos…

Increment Your Customer base by Disseminating Astonishing Special Items

In the event that you’re hoping to find hot dark women, you must be cautious while investigating where you’re going. There are many spots where you’re bound to find one of these hot ladies. They’re…