-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Unable to get raw image in raspberry pi 5 #1010
Comments
Hi, please could you say what camera you are using. Please confirm that a clean install of the latest OS shows the problem. Could you also post the exact script (as short as possible, please!) that fails in the comments here so that I can copy and paste it - then I can try it for myself. Thanks! |
Hi, this is my version: I am running a 64 bit OS on the pi5 The code is this: import numpy as np cv2.startWindowThread() picam2.start() |
Thanks very much for the update. There's a fix here (actually just the second commit), and I'll merge that shortly for the next release. Note that a Pi 5 will give you an "R16" raw image - after configuring the camera, check
so your loop should look like this:
|
Thanks, I will pull and give it a try. Just wondering if it is possible to pull out the exact bit depth as the camera, like before? Like for the imx296, it would be 10 bit values? |
Yes, look at |
Thanks, I can get raw. I have looked at the manual and tried setting sensor={'bit_depth':10} when creating the configuration. If ran but still produced 16 bit data in the raw image |
Yes, it's 10 bit from the sensor, but you always get full 16-bit range values in the raw file (in this case the bottom 6 bits will always be zero). You can't get the "right shifted" version. There are some benefits:
|
Do you think there will be any work around to get the exact bit depth as before on the raspberry pi 4 (10/12 bit)? I am binning the images (8x8, on 10 bit data in 16 bit array) on the go so I can get a 16 bit image right afterwards. If I do the shifts as well, it will probably drop my frame rate abit. |
No. Pi 5 gives you 16-bit values for all raw formats. If you want to reduce the dynamic range you will have to shift the values. In your case, I'd compute the sums of the 8x8 pixels (or whatever it is that you're doing!), and right-shift by 6 (substitute the correct value if that one is wrong!) at the end. In the previous case you had to have different code for 10/12 bit sensors, now they're all the same. On a Pi 5, this will be way faster than what you were doing on a Pi 4. |
Just one last thing, about shiftting. I might be misunderstanding shifiting. Do you mean I have to compute each new pixel value of the 16 bit array to 10 bit by mutiplying with 1023/65536 to shift it? Or is there an easier way to convert the 16 bit value to 10 bit while keeping the 16 bit array numpy structure? |
I would do |
Perfect! thanks for speedy replies. I think the probelm is solved and I will give that a go |
I am trying to get raw images using a rqspberry pi 5 with a monchrome imx296.
Here is my code
I was using this code in raspberry pi 4 and it worked fine. It seemed liked the libcamera tuning files were changed from vc4 to pisps on the pi5s? Is this change causing the issue?
With libcamera-raw it gave me a MONO_PISP_COMP1 format on the pi5 vs R10 on the pi4.
The text was updated successfully, but these errors were encountered: