User avatar
schoolpost
Posts: 32
Joined: Sun Feb 19, 2017 10:47 am
Location: Canada
Contact: Website

Uncompressed Output?

Thu Feb 23, 2017 6:20 pm

Hello,

I've been experimenting over the past few months with the Bayer output of the V2 camera. Highlight reconstruction is
great from the raw data, however the Lens shading and overall image correction done by the ISP outweighs the
usefulness of the bayer data.

I'm trying to get an uncompressed 8-bit image, how can I achieve this with a tool such as raspistill? I'm just looking for an intermediate between the RAW and JPEG output of this camera. I intend to to some post processing on the images, I just find the JPEG compression even at its best is lacking to say the least. ( to be expected )

any advice?

Thanks,

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8673
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Uncompressed Output?

Thu Feb 23, 2017 6:45 pm

Raspistillyuv is pretty much the same as raspistill but writing out yuv or rgb data.
There's also raspividyuv which does the same but in video mode (don't expect an sd card to keep up writing the uncompressed files at anything above a pretty low resolution!).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

ethanol100
Posts: 637
Joined: Wed Oct 02, 2013 12:28 pm

Re: Uncompressed Output?

Thu Feb 23, 2017 6:56 pm

You have several possibilities:
1.) The ISP uses internally YUV:

Code: Select all

raspiyuv -o test.yuv
-> creates a yuv image, containing w*h Y values, (w/2*h/2) U and (w/2*h/2) V values
see -> https://en.wikipedia.org/wiki/YUV
2.) If you want to have RGB:

Code: Select all

raspiyuv -rgb -o test.rgb
-> creates a rgb image, containing w*h (R,G,B)-triplets.
You can create ppm images(most programs can open) adding a header to the rgb data:

Code: Select all

echo -e "P6\n3280 2464\n255" > test.ppm
cat rest.rgb >> test.ppm
3.) If you want to have lossless compressed images

Code: Select all

raspistill -e png -o test.png[\code]
-> you can open it in i.e. gimp and save in any format you like?

6by9 was faster...

User avatar
schoolpost
Posts: 32
Joined: Sun Feb 19, 2017 10:47 am
Location: Canada
Contact: Website

Re: Uncompressed Output?

Thu Feb 23, 2017 7:30 pm

Thanks for the responses.

I've been trying to use raspistillyuv for the longest time, only to finally have it pointed out that you invoke it with
"raspiyuv" no "raspistillyuv" :lol: oh no, silly me.

Doing a quick test, my standpoint on the JPEG compression thing is much altered. In terms of any visual characteristics, I'm finding the JPEG and the PNG are near identical after some image manipulations. Contrary to what I had expected.

I'm mainly intending to some saturation/contrast adjustments to the image to make it look a little nicer.

Are the raspistill "saturation",'contrast", etc... adjustments a post process after image processing? or do they directly influence the image during processing?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 8673
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Uncompressed Output?

Thu Feb 23, 2017 10:17 pm

schoolpost wrote:I'm mainly intending to some saturation/contrast adjustments to the image to make it look a little nicer.

Are the raspistill "saturation",'contrast", etc... adjustments a post process after image processing? or do they directly influence the image during processing?
Saturation, contrast, and brightness all alter the image during processing.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”