Integrating ESP32 Camera with Android for Enhanced Object Detection
Good morning,I have a project in which I am using Android application for object detection
Currently my phone camera opens when I open the application and it starts detecting the objects
But I want to integrate the esp32 cam with android so that esp32 video stream come to android and should be shown at phone's screen
Basically it uses phone camera for object detection now it should use esp32 cam
Can anyone help?
Solution:Jump to solution
You can run a Webserver on a ESP32 CAM Module. And access it from Android App which can be made by using simple MIT App Inventor. So that the Mobile App will access a video stream over HTTP as a client. Also, you can add additional capabilities like the object detection algorithm running on ESP32 to acces camera stream connected to it.
12 Replies
Solution
You can run a Webserver on a ESP32 CAM Module. And access it from Android App which can be made by using simple MIT App Inventor. So that the Mobile App will access a video stream over HTTP as a client. Also, you can add additional capabilities like the object detection algorithm running on ESP32 to acces camera stream connected to it.
Wich app you are using, it mabe has a sitting to change cam source and his choosing phone cam us default
I haven't worked with Android applications before, but I tried connecting the ESP32-CAM. I used the example called 'CameraWebServer,' which gave me an address. I put this address into my Python script, and it worked. I'm not sure if I answered your question correctly.
@wafa_athmani Have you tried calibrating the ESP32-CAM? I ask because I need its parameters for my project. I've already tried, but the results aren't accurate.
Actually i tried your solution by using flask library and then used kodular WebViewer، i completely changed the app but works very nicely and smoothly thank you for the idea
The ESP32-CAM can only capture frames, it does not support functionalities such as opencv
To use
OpenCV
and runing inference (ML)
. I suggest using RPi with HQ Camera moduleimport time
import esp32_camera # Replace with your ESP32-CAM library
camera = esp32_camera.Camera()
camera.set_resolution((320, 240)) # Adjust as needed
camera.capture_frame()
img_data = camera.frame
format (assuming RGB format)
img = Image.frombytes('RGB', camera.frame.shape[:2], img_data)
img.save('f3.png', 'PNG')
camera.deinit()
print("Image captured and saved as f3.png!")
This is the code i used to take a pic , i hope it would help you
RPi is too expensive compared to the ESP32CAM. Can I still use it for capturing frames? I plan to process the data on my laptop and then send it to the ESP32 via WiFi
And my system doesn't necessarily need to be real-time strict
I've already tried to calibrate the camera. I need the parameters you obtained to compare them with mine.
Yes, most of my experience is with RPi and its camera modules. But I'm not sure about ESP32 CAM and its limitations at this moment especially, with capturing frames.