Most of the time, we are utilizing our device's webcam for any machine learning projects such as image classification or object detection.
I believe there's a case where we need a portable camera source such as putting it on an autonomous vehicle or robotic arm.
In this article, I will show you two ways to have portable camera sources for your machine learning projects with using:
- Mobile smartphone (Android or iOS)
- ESP32 CAM
- IP Camera Adapter (Windows PC software)
This is applicable for both Android and iOS users. The instructions are different.
Android Users
1. DownloadIP Webcam app on Play Store.
2. Open the IP Webcam app, scroll down and click on the "Start Server". This will turn your mobile phone as an IP Camera and begin serving video stream. Take note on the IP address generated. (192.168.1.106:8080 for my case)
iOS Users
For iPhone users, unfortunately that the IP Webcam app is not available. Alternatively, I found out that DroidCam works well!
1. Download DroidCam on Apple Store.
2. Launch the DroidCam app on your iPhone. You should see the WiFi IP Address with port number. For example: 192.168.1.74:4747
Do take that the port numbers are different for Android and iOS users.
How to Use Your ESP32 CAM as Camera Source for Machine Learning Projects?Generally, the idea is that, we need to make the ESP32 CAM as an IP Camera. The goal is to obtain the IP Address. The general flow as below:
1. Making the ESP32-CAM Video Streaming Web Server. Checkout the great tutorial by Random Nerd Tutorials: ESP32-CAM Video Streaming Web Server (works with Home Assistant) | Random Nerd Tutorials
2. Obtain the video stream endpoint URL address. It may be something like <ip address of the streaming>/video or something else. Use the "Inspect element" on the browser to get the video source URL.
3. Bind the ESP32 CAM video stream web server to laptop. For Windows desktop, download the IP Camera Adapter (ip-webcam.appspot.com) and follow thru the documentation to bind your IP camera to your laptop.
Project Idea: Autonomous VehicleWith the knowledge from my previous project article, you could write a Python code to do the image classification and send the classification result command to the Arduino side to control the actuators for the autonomous vehicle.
There are some software in the market that help you achieve the AI Robotics easily using drag and drop blocks coding.
Here's one of my previous project that made with uCode inbuilt AI combined with robotics: Autonomous Vehicle Workshop for Teachers! | LinkedIn
SummaryIn this project, we have discussed about two ways to have portable camera sources for your machine learning projects.
We had made an autonomous vehicle that's utilizing smartphone as the camera source and send the video stream to laptop for machine learning inferencing.
Thank you!
CreditThis post is done in collaboration with PCBWay. PCBWay is providing services for one-stop PCB, and PCBA services. Furthermore, if you have some good ideas for the hardware, they can help to manufacture and sell them within their PCBWay shop! Read more from this link. PCBWay also provide the platform for makers to share their open-sourced projects as well. Check out the different projects on their "Share & Discover" website.
Thank you.
Comments
Please log in or sign up to comment.