mostafae
Posts: 11
Joined: Thu Jun 01, 2017 6:00 pm
Contact: Website

Capture an image error "PiCameraResolutionRounded" in Python

Sun Jun 04, 2017 8:38 pm

I am trying to capture an image from PiCamera in Pi Zero using OpenCV 3.1. When i run my code to capture an image, i get the following error:

PiCameraResolutionRounded: frame size rounded up from 1440x900 to 1440x912
width, height, fwidth, fheight)))

Here is my code:
# import the necessary packages
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import cv2

# initialize the camera and grab a reference to the raw camera capture
camera = PiCamera()
rawCapture = PiRGBArray(camera)

# allow the camera to warmup
time.sleep(0.1)

# grab an image from the camera
camera.capture(rawCapture, format="bgr")
image = rawCapture.array

# display the image on screen and wait for a keypress
cv2.imshow("Image", image)
cv2.waitKey(0)

How can i fix this issue?

DirkS
Posts: 8436
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Capture an image error "PiCameraResolutionRounded" in Py

Sun Jun 04, 2017 8:48 pm

It's a warning, not an error.
IIRC values have to be multiple of 16.

mostafae
Posts: 11
Joined: Thu Jun 01, 2017 6:00 pm
Contact: Website

Re: Capture an image error "PiCameraResolutionRounded" in Py

Sun Jun 04, 2017 9:08 pm

Still the image has not been taken! so what would be the problem?

DirkS
Posts: 8436
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Capture an image error "PiCameraResolutionRounded" in Py

Sun Jun 04, 2017 9:26 pm

mostafae wrote:Still the image has not been taken! so what would be the problem?
No idea, but I can't see how it's related to the warning msg.

fishbulb
Posts: 4
Joined: Thu Jul 12, 2018 8:00 pm

Re: Capture an image error "PiCameraResolutionRounded" in Python

Thu Jul 12, 2018 8:03 pm

HI Mustafae,

I'm having the exact same issue running running Python 2.7.9 and trying to display a frame from the Pi Camera module. II am running virtually the same code as you that I found https://www.pyimagesearch.com/2015/03/3 ... nd-python/ . I get the PiCameraResolutionRounded warning and a blank gray image frame. Interestingly, there is no value I can set the camera resolution to to avoid the PiCameraResolutionRounded warning.

Did you ever figure this out?
FB

Return to “Camera board”

Who is online

Users browsing this forum: SamX33 and 11 guests