Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5526

Camera board • Re: Raspberry Pi High Quality Camera DNG Format and Raspberry Pi 4 Model B

$
0
0
Yeah so with the GitHub, I have been using those examples and its still the same result. And then with the other link that you sent about the processing raw images, I already tried that and it works. The only reason why it works is because its via the OS terminal which I stated before.
As I said, I don't have a PI camera but from what you've described, and the lack of other responses, I'd recommended using the command line solution by calling it from a Python subprocess call. You could construct s BASH shell to run both the RPICAMERA-STILL and PYDNG to get the DNG file.

If you didn't have the requirement for uncompressed format, I'd say recommend just using JPG and desaturate the colour to B&W and/or convert the JPG to TIFF grey scale.
So with you saying that it will have an embedded JPG, do you think that the white and black box image is correct and then when I convert it to Tiff and then grayscale and calculate the albedo it can do that?
I don't know if the PICAMERA2 creates and embedded JPG but it is a common practice for having a preview image. You'd have to exam the metadata of the file to see if Previews are embedded. However, in your case, you are Your goal is to get the DNG since you need uncompressed.

I don't know how you are processing your colored DNG to a TIFF file.

I don't know how you are calculating albedo but it sounds like the software you are using requires gray scale.

I only mention the above since you goal is to get the albedo and working backwards there can likely be multiple solutions.

Well I did everything with JPG and converted that to grayscale and then calculated the albedo which was correct in terms of what I was doing. Only thing is that is compressed and I would need uncompressed. But I haven't tried doing a Python subprocess call, not even sure what that looks like to be honest since thats the first time i've heard of that but I can research it more and try that!

So with the Picamera2, it does both the JPG and DNG with the code after this message, but what this means is that it will capture a DNG and a JPEG made from the same raw data. It shows how you can configure a still capture for a full resolution main stream and also obtain the raw image buffer. And then the DNG file stores the raw numbers received from the image sensor before the hardware on Raspberry Pi ‘develops’ it into a viewable (JPEG or PNG) image. DNG files are saved alongside the ‘developed’ JPEG or PNG version of the same image. With the JPG the raspistill application, which captures JPEG images from the attached camera. raspistill includes the -r option, which appends all the raw image data to the end of the JPEG file. And I actually used exiftool to look at the metadata attached for both the DNG and JPG and was able to see a number of different things! So I think I am on the right track... hopefully

Code:

import timefrom picamera2 import Picamera2, Previewpicam2 = Picamera2()picam2.start_preview(Preview.QTGL)preview_config = picam2.create_preview_configuration()capture_config = picam2.create_still_configuration(raw={}, display=None)picam2.configure(preview_config)picam2.start()time.sleep(2)r = picam2.switch_mode_capture_request_and_stop(capture_config)r.save("main", "full.jpg")r.save_dng("full.dng")

Statistics: Posted by Ayanhb10 — Sat Apr 06, 2024 6:55 pm



Viewing all articles
Browse latest Browse all 5526

Trending Articles