poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Default still image size is not using the whole sensor

Fri May 17, 2013 11:15 am

The horizontal field of view of a default still image is narrower than the default video. I experimented a bit and found the following:

The default width is set to 2592 pixels which gives an image that is more square than the video which is shot in 16:9. The height of the default image is 1944 pixels, so
1944 * 16 / 9 = 3456 pixels. Indeed, if I give the command:

Code: Select all

 raspistill -hf -o image3456.jpg -w 3456
I get an image which is wider while retaining the same height. If I increase the number above 3456 the image becomes larger while retaining the horizontal field of view but it becomes more zoomed in vertically as you can see in the last image. Not sure why that happens.
imageDefault.jpg
Default image - width is 2592 pixels
imageDefault.jpg (44.92 KiB) Viewed 8481 times
image3456.jpg
width is 3456 pixels
image3456.jpg (49.63 KiB) Viewed 8481 times
image5000.jpg
width is 5000
image5000.jpg (50.79 KiB) Viewed 8481 times
Just so you know ;)

kaos
Posts: 108
Joined: Mon Mar 26, 2012 8:14 pm

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 1:15 pm

Sounds like the default output is 4:3, which is the old school non-widescreen TV/video standard, and also used by some still cameras (e.g. the four-thirds and micro-four-thirds systems used by Olympus and Panasonic). The sensor, however, seems to be 16:9 widescreen, so you can increase the aspect ratio to that point without loosing any vertical resolution. Go any further and the camera will start discarding information top and bottom to achieve the asked for aspect ratio, and as a result zooming in.
This means that to take full advantage of the sensor's resolution, you should use it's native aspect ratio, 16:9.

--
Kári

User avatar
psergiu
Posts: 223
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
Contact: Website

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 2:33 pm

You just found RPi's "uncrop" function. :lol:

http://www.youtube.com/watch?v=KUFkb0d1kbU

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

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 5:39 pm

kaos wrote:The sensor, however, seems to be 16:9 widescreen, so you can increase the aspect ratio to that point without loosing any vertical resolution. Go any further and the camera will start discarding information top and bottom to achieve the asked for aspect ratio, and as a result zooming in.
This means that to take full advantage of the sensor's resolution, you should use it's native aspect ratio, 16:9.
There is something wrong here, because the sensor aspect ratio is not native 16:9 (1.778:1 ) it is much more square than that. The imaging area is 3.67 x 2.74 mm and each of the 2592 x 1944 pixels is square (1.4 x 1.4 um). That gives a full sensor aspect ratio of 1.342:1 which is approximately a 4:3 aspect.

I have a suspicion that the provided software is always using the sensor in 1920x1080 video mode even when capturing stills, and then upscaling or rescaling, instead of using the full native sensor resolution for stills.

From OV5647 chip specs at http://www.ovt.com/download_document.ph ... ensorid=66
RPi camera sensor image area: 3.6736 x 2.7384 mm and diagonal: 4.582 mm
Number of effective pixels 2592 x 1944 (Total: 5038848 )
Pixel pitch in µm: 1.4 x 1.4

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 6:19 pm

jbeale wrote:
kaos wrote:The sensor, however, seems to be 16:9 widescreen, so you can increase the aspect ratio to that point without loosing any vertical resolution. Go any further and the camera will start discarding information top and bottom to achieve the asked for aspect ratio, and as a result zooming in.
This means that to take full advantage of the sensor's resolution, you should use it's native aspect ratio, 16:9.
There is something wrong here, because the sensor aspect ratio is not native 16:9 (1.778:1 ) it is much more square than that. The imaging area is 3.67 x 2.74 mm and each of the 2592 x 1944 pixels is square (1.4 x 1.4 um). That gives a full sensor aspect ratio of 1.342:1 which is approximately a 4:3 aspect.

I have a suspicion that the provided software is always using the sensor in 1920x1080 video mode even when capturing stills, and then upscaling or rescaling, instead of using the full native sensor resolution for stills.

From OV5647 chip specs at http://www.ovt.com/download_document.ph ... ensorid=66
RPi camera sensor image area: 3.6736 x 2.7384 mm and diagonal: 4.582 mm
Number of effective pixels 2592 x 1944 (Total: 5038848 )
Pixel pitch in µm: 1.4 x 1.4
Good find and thinking!

My camera is back to 'hospital' so I can't check. Besides the *cough* 'lens' *cough* is not really 'up to my standards', so to speak (although nicely cheap), so I think it's hard to find evidence of upscaling. But it's a very good point, when I get another camera I'll investigate.

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

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 6:23 pm

You are right, there are no tack-sharp full-resolution images from the R-Pi camera just due to the lens, but here is what started me wondering about upscaling: http://www.raspberrypi.org/phpBB3/viewt ... 50#p329599
what else would you suppose would cause that non-integer-pixel "jaggy" aliasing on the edge of the flourescent light bulb, which in reality I presume does not have stair-step edges?

...actually, I suppose it could be complicated by the fact the fluorescent light is flickering due to AC power cycle, I don't know whether all pixels are exposed simultaneously, so to remove that doubt it would be better to have a test image with a non-flickering light source.

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

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 6:45 pm

Hmmm, that sounds possible. I'll take a look on Monday. It may well be choosing the wrong mode at some point That code is rather complex and buried in the firmware, so its not possible to work it out from the Arm side.

The tuning we (well, David) did didn't use the same configuration of hardware, so this may have been missed, or something changed to mean the wrong mode is selected.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 6:53 pm

Thanks for having a look James. If it does turn out to be currently locked in 1080p mode, that means we might be able to enjoy (slightly) better resolution in true stills mode!

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

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 7:03 pm

jbeale wrote:Thanks for having a look James. If it does turn out to be currently locked in 1080p mode, that means we might be able to enjoy (slightly) better resolution in true stills mode!
Actually should be quite noticeable better I would think. (1920x1080 vs 2592x1944)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

Re: Default still image size is not using the whole sensor

Fri May 17, 2013 7:17 pm

jamesh wrote:
jbeale wrote:Thanks for having a look James. If it does turn out to be currently locked in 1080p mode, that means we might be able to enjoy (slightly) better resolution in true stills mode!
Actually should be quite noticeable better I would think. (1920x1080 vs 2592x1944)
If the 'lens' permits, otherwise it's just wasting bandwidth ;) But it should be investigated!

gkreidl
Posts: 6054
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Default still image size is not using the whole sensor

Sat May 18, 2013 7:20 am

@james:

You should also check, if the cropped image may be the result of the lens correction algorithm. Basically a lens correction is a projection onto a curved surface. The resulting image may get larger this way; if the algorithm crops it instead of rescaling it to the original image size, that would explain the smaller image area. But quality of the image might be even better, if it is not rescaled but sent out with this "higher" resolution (make it into a feature).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

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

Re: Default still image size is not using the whole sensor

Sat May 18, 2013 9:12 am

It's almost certainly picking the wrong camera mode (annoying as there are only two currently in there...). We don't do lens correction (well, we do lens shading correction but that is something different).
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

kaos
Posts: 108
Joined: Mon Mar 26, 2012 8:14 pm

Re: Default still image size is not using the whole sensor

Sat May 18, 2013 11:11 am

jbeale wrote:
kaos wrote:
The sensor, however, seems to be 16:9 widescreen, so you can increase the aspect ratio to that point without loosing any vertical resolution. Go any further and the camera will start discarding information top and bottom to achieve the asked for aspect ratio, and as a result zooming in.
This means that to take full advantage of the sensor's resolution, you should use it's native aspect ratio, 16:9.
There is something wrong here, because the sensor aspect ratio is not native 16:9 (1.778:1 ) it is much more square than that. The imaging area is 3.67 x 2.74 mm and each of the 2592 x 1944 pixels is square (1.4 x 1.4 um). That gives a full sensor aspect ratio of 1.342:1 which is approximately a 4:3 aspect.

I have a suspicion that the provided software is always using the sensor in 1920x1080 video mode even when capturing stills, and then upscaling or rescaling, instead of using the full native sensor resolution for stills.

From OV5647 chip specs at http://www.ovt.com/download_document.ph ... ensorid=66
RPi camera sensor image area: 3.6736 x 2.7384 mm and diagonal: 4.582 mm
Number of effective pixels 2592 x 1944 (Total: 5038848 )
Pixel pitch in µm: 1.4 x 1.4
Ah, I was going entirely by the behaviour and didn't even think to check the actual sensor spec. :oops:
--
Kári

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Default still image size is not using the whole sensor

Sun May 19, 2013 11:36 am

psergiu wrote:You just found RPi's "uncrop" function. :lol:

http://www.youtube.com/watch?v=KUFkb0d1kbU

Great Find! :D

baz069
Posts: 1
Joined: Tue May 21, 2013 2:31 pm

Re: Default still image size is not using the whole sensor

Tue May 21, 2013 2:34 pm

Nice find poing, the difference is amazing!

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

Re: Default still image size is not using the whole sensor

Tue May 21, 2013 6:27 pm

In case you haven't heard the latest- JamesH has confirmed that both 1080p video mode and every resolution in stills-mode is taking a 1920x1080 center-crop of the full 2592x1944 sensor, and rescaling / upscaling as necessary. No one (here) has yet seen a true full-sensor image from the R-Pi camera. Work is in progress to fix this. http://www.raspberrypi.org/phpBB3/viewt ... 31#p353815

User avatar
wallarug
Posts: 460
Joined: Mon May 14, 2012 8:21 am
Location: Sydney, Australia

Re: Default still image size is not using the whole sensor

Wed May 29, 2013 12:38 pm

Jamesh informed here that it has been fixed as of last Friday:

http://www.raspberrypi.org/phpBB3/viewt ... 2&e=359042

Return to “Camera board”