towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: RPi Camera issues and status

Mon May 27, 2013 12:04 pm

jamesh wrote:(2x2 binned = throw away every other pixel)
I thought binned means average over 2x2 area hence increasing signal-to-noise?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Mon May 27, 2013 12:36 pm

towolf wrote:
jamesh wrote:(2x2 binned = throw away every other pixel)
I thought binned means average over 2x2 area hence increasing signal-to-noise?
Depends on the sensor I believe.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: RPi Camera issues and status

Mon May 27, 2013 12:41 pm

Can you find out? I guess we can’t. A pixel skip would be cool as well, but binning would yield clear image quality benefits.

User avatar
jbeale
Posts: 3570
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Camera issues and status

Mon May 27, 2013 8:06 pm

jamesh wrote:(2x2 binned = throw away every other pixel)
Like towolf, I also assumed 2x2 binned = "average together 4 adjacent pixels".

The brochure for this OV5647 device at http://www.ovt.com/download_document.ph ... ensorid=66 says
Additionally, the 720p/60 HD video is captured in full field of view (FOV) with 2x2 binning to double the sensitivity and improve SNR. The post binning re-sampling filter helps minimize spatial and aliasing artifacts to provide superior image quality.
so in that particular case, it points to averaging, because throwing away pixels doesn't improve sensitivity or SNR. Although as suggested by the second sentence, there is some complication to it due to the Bayer filter array.

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: RPi Camera issues and status

Mon May 27, 2013 8:26 pm

Thanks jbeale. I’m hopeful. So 720p is the best resolution for video if you go from 2592x1944 to 1296x972 via 2x2 binning and then crop 1280x720 out of that. That is, if you want 16:9. No futher interpolation necessary.
jamesh wrote:This does mean that 1080p will actually be a slightly smaller resolution scaled up (full frame binned 2x2 scaled up to 1080p). This is quite common in the field, and the scaling up is not noticeable once you gone through H264 encoding anyway. This should give 1080p the same horizontal FOV as capture.
It would be good if that were documented or made explicit. Not much use stuffing more data than necessary into the H264 encoder only to advertise "full HD". The player can scale up later just fine.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Mon May 27, 2013 8:52 pm

towolf wrote:Thanks jbeale. I’m hopeful. So 720p is the best resolution for video if you go from 2592x1944 to 1296x972 via 2x2 binning and then crop 1280x720 out of that. That is, if you want 16:9. No futher interpolation necessary.
jamesh wrote:This does mean that 1080p will actually be a slightly smaller resolution scaled up (full frame binned 2x2 scaled up to 1080p). This is quite common in the field, and the scaling up is not noticeable once you gone through H264 encoding anyway. This should give 1080p the same horizontal FOV as capture.
It would be good if that were documented or made explicit. Not much use stuffing more data than necessary into the H264 encoder only to advertise "full HD". The player can scale up later just fine.
I think you would be quite surprised how many devices claim 1080p30 encoding, yet do a certain amount of scaling up to reach that resolution. Although technically, they are 1080p30 encoding, it's just the source imagery isn't quite of that resolution. Although as I said early, once you H264 encode, the scaling is not particularly noticeable. And of course with video there is a certain amount of temporal help - few use cases watch videos frame by frame and need full pixel resolution.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: RPi Camera issues and status

Mon May 27, 2013 9:06 pm

Sure, if you want to check off feature lists.

But the bits that go into coding more interpolated pixels could be used to give more fidelity to the original pixels.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Mon May 27, 2013 9:15 pm

towolf wrote:Sure, if you want to check off feature lists.

But the bits that go into coding more interpolated pixels could be used to give more fidelity to the original pixels.
Not really. The encoder is an independent set of HW to the ISP, so the ISP can do the same amount of work whether encoding 1080p or 720p. (scaling also done in HW). One of the few limits is memory bandwidth, and the only time that's been a problem was with the 41MP Nokia 808 sensor...which is a slightly different kettle of fish!

EDIT: Actually, you would have more GPU CPU power to run a more sophisticated software stage in the ISP. But they don't generally get used for image quality - usually things like effects.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: RPi Camera issues and status

Mon May 27, 2013 9:20 pm

No, I mean, when you encode 720p in 10Mbps or 1080p (upscaled from 720p) in 10Mbps the former ought to be higher quality because less bits have been wasted to encode empty data.

How the architecture looks is orthogonal to that, isn’t it?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Mon May 27, 2013 9:51 pm

Well, 1080p won't be an upscaled 720p, it will be a upscaled 1296x972,so will be higher quality than 720p. Unless you zoom in to the level of the current encode at which point you will hit full resolution 1080p.

Once I've added zooming.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

User avatar
rew
Posts: 425
Joined: Fri Aug 26, 2011 3:25 pm

Re: RPi Camera issues and status

Fri Jun 28, 2013 2:46 pm

What towolf means is that if you encode an upscaled image, you're better off not upscaling and encoding the original.

You apparently have the 1296x972 resolution available as direct-knowledge, while towolf just called it (too quickly) 720p.

I certainly, e.g. for archive purposes, would prefer to have the 1296x972 resolution available as a mode. I'd then be able to get by with slightly less bits than when storing the 1080p stream. If I understand things correctly I'd get that if I explicitly ask for 1296x972. Good. :-)

IMHO the word "binning" does not agree with "throwing every other pixel away". If you support binning, you put (at least) two pixels in one "bin".

Of course, it could be that you've seen the technical docs and that what they do is not really binning, but something else. Of course some chinese might have used a wrong translation somewhere. Can you guess what "temperature activated" means on a GPS spec sheet? Can you guess what it means if you see the spec: "1s"?
The answer is: hot start (select and paste somewhere with a normal font. or zoom in with your browser.)
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Fri Jun 28, 2013 4:02 pm

For those who are interested, I just fixed the EXIF problem and asked for Dom to pull it in to userland. This should mean dates and user entered exif should now work. It used to to work, but I broke it when I added timelapse mode and didn't notice. Soz. I've also made a change to the firmware to add the focal length, f number and true aperture values that the community determined, not sure how long that will take to appear though, but when they do they also should appear in the exif data

I've also pushed a fix to RaspiStillYUV to add a timelapse mode to match that in RaspiStill.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

User avatar
jbeale
Posts: 3570
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Camera issues and status

Fri Jun 28, 2013 4:59 pm

Good improvements, thanks for the update!

User avatar
rkinch
Posts: 72
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
Contact: Website

Re: RPi Camera issues and status

Sat Jun 29, 2013 5:23 am

jbeale wrote:The lens thread size may be 6 mm x 0.5.
My measurement is M6x0.35.

User avatar
rew
Posts: 425
Joined: Fri Aug 26, 2011 3:25 pm

Re: RPi Camera issues and status

Sat Jun 29, 2013 5:46 pm

rew wrote:IMHO the word "binning" does not agree with "throwing every other pixel away". If you support binning, you put (at least) two pixels in one "bin".
Confirmed! Figure 3-2 of the (preliminary) datasheet shows four pixels going into an output pixel in binning mode. You can chose to have 2 or 4 pixels contribute to the output.

To use this binning mode, you ALSO have to change the mode to skip every other line.
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Sun Jun 30, 2013 9:48 am

Sorry, my use of the binning word was sloppy, you are correct in that it does 'average' the pixels together rather than throwing data away.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Fri Jul 05, 2013 1:24 pm

Latest status: Just fixed the EXIF problem (EXIF data not being passed to the JPEG), and the RAW captures in timelapse mode problem (only first frame had RAW metadata). RAW should make it to userland very soon, I think the EXIF fix is already there.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Fri Jul 05, 2013 3:24 pm

I've also just asked for pull for a fix to the ISO setting. Previously I had commented out the line in RaspiCamControl.c that enabled the ISP setting (cant remember why), but I have reintroduced it, and according to the EXIF data, the captures were taken with the ISO asked for. So not sure why I flagged it as not working before.

So if you want to try it you just need to uncomment the line 768 in RaspiCamControl.c. Would appreciate some feedback on that one - although the EXIF says it used 800, I've not had time to really test it out, although the OMX camera code does appear to be using the specified value.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

User avatar
jbeale
Posts: 3570
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Camera issues and status

Sun Jul 07, 2013 6:07 am

Very interesting, thank you for this fix. What is the valid ISO range, is it 100 through 800 ?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24556
Joined: Sat Jul 30, 2011 7:41 pm

Re: RPi Camera issues and status

Sun Jul 07, 2013 9:10 am

jbeale wrote:Very interesting, thank you for this fix. What is the valid ISO range, is it 100 through 800 ?
I think it's 100 to 800 according to my brief tests. There may be a way to increase the range (maybe lower, not sure about higher), which I will think about next week - likely to need a firmware change.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

feras
Posts: 1
Joined: Sun Mar 06, 2016 2:24 pm

Re: RPi Camera issues and status

Sun Mar 06, 2016 2:30 pm

I have a problem with my PI camera the captured image here http://joxi.ru/p27WGeKc05NBX2 with bad resolution i have set resolution different but without any help :cry:
any help ?

User avatar
DougieLawson
Posts: 36813
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi Camera issues and status

Sun Mar 06, 2016 3:07 pm

Is the lens in place? Is the lens screwed in correctly?
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
jbeale
Posts: 3570
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: RPi Camera issues and status

Mon Mar 07, 2016 5:24 pm

I've never seen an image like that from the standard Raspberry Pi camera, which has a fixed-focus lens set at infinity (unless you are trying to take a close-up image, closer than 1 meter or so). Your image looks like the lens is way out of focus.

Are you using the official RPi camera, or an aftermarket camera?
What software are you using to get the image (raspistill or ?)
(it is possible for some software to downsample and then upsample to give the impression of bad focus)

Return to “Camera board”