Today we will build a project on compare two photos for similarity via the remote terminal developed by Sixfab,
ProcedureIn this project, we compare the two photos we took on the Raspberry Pi, with which we have a cellular connection, with the Python Imaging library(PIL), and show the differences between the two photos. We can do all these operations quickly and remotely.
Hardware SetupHere's a quick look at what we are going to build:
- Attach the Quectel EC25 Mini PCle 4G/LTE Module(or compatible modules) module to the HAT.
- Attach the antenna to the mini PCIe module.
- Attach 40 pin header to the Base HAT that comes with the HAT and insert the Sixfab SIM to Base HAT.
- Connect the camera module.
- Now attach the HAT to the Raspberry Pi.
- Connect the micro-USB cable to the HAT and Raspberry Pi.
- Finally, power up the Raspberry Pi.
- Create a suitable area for yourself as a photo comparison area.
- To compare photos properly you have to immobilize the camera.
1. Complete the Sixfab CORE installation.I will remote connect to this cellular-connected Raspberry Pi. For the remote session, we have Sixfab CORE installed. The installation of Sixfab CORE has been explained in this blog by Ensar.
2. Setting up the camera softwareNow you need to enable camera support using the raspi-config
program you will have used when you first set up your Raspberry Pi.
sudo raspi-config
Use the cursor keys to select and open Interfacing Options, and then select Camera and follow the prompt to enable the camera.
Remote Photo ComparisonLogin to Sixfab CORE and open 'remote terminal' after making sure your device's cellular connection.
if you have saved the code before:
python3 similarity.py
Else:
nano similarity.py
Copy code and paste then save file:
python3 similarity.py
If you have previously taken photos(you have to change photo location in code). You can choose 1-2-3 options. Else you should choose fourth option and take two new photos.
I chose the fourth option(the most important thing is that the two objects to be compared are at the same angle.).
Result:
And we did it. In the third window we can see the difference, the sim.
Comments
Please log in or sign up to comment.