Comments (4)
That's weird - raw capture over the video port is included in the test suite, and passes (more or less) happily (there's some issue with 100x100 captures that I don't understand yet). Unfortunately, my camera's currently busy chewing through yet another test for #40 (which is unsurprisingly taking some time to debug and fix - given the random nature of it showing up). Could you possibly test your code without the resizer? Something like the following:
from __future__ import division
import picamera
import cv2
import numpy as np
import io
import time
class PiCam:
def __init__(self):
self.cam = picamera.PiCamera()
self.cam.resolution = (320, 240)
def read(self):
stream = open('image.data', 'wb')
self.cam.capture(stream, 'bgra', use_video_port=True)
stream.seek(0)
image = np.fromfile(stream, dtype = np.uint8)
return image
cam = PiCam()
cv2.namedWindow("Camera Image", cv2.WINDOW_AUTOSIZE)
while True:
cv2.imshow("Camera Image", cam.read())
cv2.waitKey(1)
return
In theory it shouldn't make any difference as the raw encoder was changed in 1.0 to use the resizer to handle the conversion from YUV to RGBA/BGRA/etc. (so that we don't have to manipulate the camera's own ports and break video recording, and because the video-splitter doesn't seem to like doing the conversion itself). In other words, all raw captures invoke the resizer but if no resize resolution is given, the resizer is set to the same resolution as the camera itself.
Still, the test suite doesn't actually include a test for raw captures over the video port including a resizer with a different resolution to the camera, so I'm wondering if that's the cause.
from picamera.
That seems to work. The size of the output stream is correct, according to your RGB recipe math (320 * 240 * 4=307200.) Getting OpenCV to read it is another story. Thanks.
from picamera.
Glad you got something working in the end - I'll try and find some time to look into this, but I doubt it'll be in time to make the release I'm planning for later today
from picamera.
Doh! Found the cause of this issue - a stupid error on my part. It's a trivial fix so it'll make it into tonight's release after all. Amended the title as the bug would actually cause any raw capture with a resize parameter (set to something other than the parent's resolution) to fail.
from picamera.
Related Issues (20)
- Easy way to tap off frames pre-encoding
- python3-picamera package depends on python3-numpy
- What is the default intra-frame period? HOT 2
- Limited running time HOT 1
- Not supported in bullseye Raspberry Pi OS version HOT 3
- Jumping exposure time on Raspberry Pi HQ camera HOT 1
- [Docmentation] How to find out the Bayer pattern from the CFA layout HOT 2
- Can one access both frames from the OPQV-dual stream and output the difference in real time? HOT 2
- libmmal.so: cannot open shared object file: No such file or directory HOT 6
- Frame freezes whilst try display/save high resolution frame HOT 1
- shutter_speed TypeError HOT 12
- Cannot install on development machine
- No such file or directory HOT 1
- PiCamera start_preview blocks indefinitely
- Realtime Motion Detection Latency
- Camera eposure time doubled from shutter speed?
- Is the `PiBayerArray.flush` method unpacking data correctly?
- 4.16. Raw Bayer data captures - Example Code - Assertion Error
- mjk
- stereo mode: how to switch camera sides HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from picamera.