Python Forum
Get image from PI camera and analyze it - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Get image from PI camera and analyze it (/thread-37057.html)



Get image from PI camera and analyze it - korenron - Apr-28-2022

Hello,
I'm trying to write a code for detecting license plate number ,
until now I took a saved image and did all the testing on it
I want to check the code "Live" - taking image automatically from PI camera

how do I do this ?

I have found this simple example
from picamera import PiCamera
import time
camera = PiCamera()
camera.resolution = (1280, 720)
camera.vflip = True
camera.contrast = 10
camera.image_effect = "watercolor"
time.sleep(2)
camera.capture("/home/pi/Pictures/img.jpg")
print("Done.")
my question is how do I know I got something and need to analyze it ? and didn't take image of empty road ?
maybe to add a PIR sensor or something ? is this a good solution ?
do I run this part every 5 seconds ~ then what ?

Thanks ,