Access numpy array in openCV [closed]

asked 2015-08-04 10:41:45 -0500

Using the documentation here, in section 4.4 the code is:

> import time import picamera import
> picamera.array import cv2
> with picamera.PiCamera() as camera:
>     camera.start_preview()
>     time.sleep(2)
>     with picamera.array.PiRGBArray(camera) as
> stream:
>         camera.capture(stream, format='bgr')
>         # At this point the image is available as stream.array
>         image = stream.array

As i understand it, this returns a numpy array to be read in openCV correct? My question is, how do I then open/access it to perform image processing on it in openCV?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by sturkmen
close date 2020-10-11 09:33:45.437432


AFAIK, OpenCV python wrapper actually works with NumPy arrays. For example: So, probably, no conversion is needed.

mshabunin gravatar imagemshabunin ( 2015-08-06 09:38:57 -0500 )edit