George_P
Posts: 10
Joined: Sun Jun 16, 2013 12:11 am

PiCamera: Raw RGB data and short distance focusing

Thu Oct 08, 2015 11:00 pm

Hello,
We would very much appreciate if you could assist with two PiCamera problems we have.

A. We have been trying to get and further process the raw RGB data of captured images. To test this we run this script and see what values we get:

from picamera.array import PiRGBArray
from picamera import PiCamera
import time

camera = PiCamera()
camera.resolution = (640,480)
rc = PiRGBArray(camera)

time.sleep(0.5)

camera.capture(rc, format="RGB")

print rc.array.shape[0] # get one array dimension
print rc.array([0,0,0]) #??? value of the corner pixel RED component ???

raw_input("\n\n Press ENTER to exit")



Unfortunately there is no output as the program seems to become lost in the CAPTURE method.
There are no errors whatsoever when interpreting these lines, though we are not sure about the array syntax - is it the same as in NumPi arrays?
What are we doing wrong?
Are there any documents with more details about the classes, methods and attributes of the PiCamera modules?

B The Picamera does not focus on short distances. We need to focus to distances no more than 7-10cm. We have read in other sites about turning the lens holder counterclockwise, but none of the methods suggested (thin pliers, rubber block, etc) worked so far for us, and we are afraid to force it any more as the whole camera assembly seems quite flimsy...

We have been trying to use the Pi and the camera as part of a system that detects impurities in a natural product - it would be great if we can get the Pi to do this job!

Best regards[/size]

Return to “Automation, sensing and robotics”