fdiba
Posts: 2
Joined: Mon Apr 14, 2014 9:11 pm

pi camera openCV and Python

Mon Apr 14, 2014 9:19 pm

Hello I try to edit the code below to use a pi camera with openCV (to be able to detect faces at the end)

I just want to put the image taken by the pi camera on my Display (myDisplay). Can you help me ?

Code: Select all

from SimpleCV import Camera, Display
from time import sleep

myCamera = Camera(prop_set={'width': 320, 'height': 240})
myDisplay = Display(resolution=(320, 240))
while not myDisplay.isDone():
      myCamera.getImage().save(myDisplay)
      sleep(.1)

TrevorAppleton
Posts: 74
Joined: Wed May 30, 2012 7:26 pm
Contact: Website

Re: pi camera openCV and Python

Tue Apr 15, 2014 10:21 am

Hello,

I have written a blog post in the past which helps getting started with Image detection in OpenCV. I think this may be a good starting point.

http://trevorappleton.blogspot.co.uk/20 ... pencv.html

If I was re-writing this now I would probably implement the python libraries for the camera, which were not available at the time I wrote the post. There are some details here.

http://www.raspberrypi.org/a-pure-pytho ... -picamera/

Hope this helps,

Trevor
Check out my blog post for Raspberry Pi and Python tutorials.

http://trevorappleton.blogspot.co.uk/

fdiba
Posts: 2
Joined: Mon Apr 14, 2014 9:11 pm

Re: pi camera openCV and Python

Tue Apr 15, 2014 4:27 pm

Thank you but it doesn't really help : I don't want to use camera.start_preview() to show the video.

I'd like to find the something like .getImage() if it exists to use with myDisplay and use the library PiCamera.

I'm going to try this : http://thinkrpi.wordpress.com/2013/05/2 ... board-csi/ if I get any other solution.

Return to “Python”