mirotomi
Posts: 4
Joined: Wed Aug 10, 2016 9:05 am

Picamera_Visualization

Thu Aug 11, 2016 11:01 am

Hello,

I was testing some recipes in the documentation but I could not succeed at viewing the picture captured to the file '. data', like in this recipe:

Code: Select all

import time, picamera

with picamera.PiCamera() as camera:
    camera.resolution = (100, 100)
    camera.start_preview()
    time.sleep(2)
    camera.capture('image.data', 'yuv')
I am not familiar with this format - I tried with Gimp but ... (If I didn't see the preview, I would think that it's something wrong with my RPi's camera module.) Can someone suggest what method could I use? Thank you.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Picamera_Visualization

Thu Aug 11, 2016 5:26 pm

Have you tried a simple JPEG: http://picamera.readthedocs.io/en/relea ... -to-a-file

The unencoded yuv format is documented here:http://picamera.readthedocs.io/en/relea ... yuv-format

mirotomi
Posts: 4
Joined: Wed Aug 10, 2016 9:05 am

Re: Picamera_Visualization

Thu Aug 11, 2016 8:27 pm

Thank you for reply. Yes, I tried that.
Sorry, I meant to say that I am not familiar with .data format, not yuv. When I capture an image to numpy array I can visualize it with matplotlib but when I capture it to, let's say, 'image.data' file I can't visualize it with it or Gimp. So I would like to know how to do that.

Return to “Python”