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

New 8MP Camera - Q&A thread

Mon Apr 25, 2016 10:33 am

(Updated 18/5/2016)

I thought I'd better open a semi-official Q&A thread on the new Sony IMX219 8MP camera.

Can I remind people at the outset that whilst it is an official Pi product and has support from Pi Towers, people such as myself supporting it do so on a voluntary basis and have full time jobs elsewhere. If something is hideously broken we will fix it as soon as possible, but making unreasonable demands because feature X isn't exposed is unlikely to be well received.

There are some features still in progress, but the basics are:
- Sony IMX219 8MPix sensor.
- Fixed lens.
- Various readout modes defined off the sensor. I haven't been directly involved in these, but reading out from the driver source, these are in order:
edit: As of rpi-update from 13/5/16, and raspbian update of 16/5/16, the mode list has been altered to more closely match the ordering on OV5647, and also to improve FOV for some modes.
- 1 - 1080P30 cropped (680 pixels off left/right, 692 pixels off top/bottom), up to 30fps
- 2 - 3240x2464 Full 4:3, up to 15fps
- 3 - 3240x2464 Full 4:3, up to 15fps (identical to 2)
- 4 - 1640x1232 binned 4:3, up 40fps
- 5 - 1640x922 2x2 binned 16:9 (310 pixels off top/bottom before binning), up to 40fps
- 6 - 720P binned and cropped (360 pixels off left/right, 512 pixels off top/bottom before binning), 40 to 90fps (120fps if overclocked)
- 7 - VGA binned and cropped (1000 pixels off left/right, 752 pixels off top/bottom before binning), 40 to 90fps (120fps if overclocked)
Modes 1-5 should all allow up to 10second exposure times if you request appropriate frame rates.

Prior to those releases, the mode list was:
- 1280x720 binned and cropped up to 60fps.
- 1280x720 binned(? may be skipping) and cropped, at 60-120 fps. Please note that the H264 encoder will not be able to consume video at above 720P60, although we're looking into where the limit actually sits. Currently the codec will enforce a max of level 4, which is 720P at max 68.3fps (see https://en.wikipedia.org/wiki/H.264/MPE ... Levels). I'm not expecting to be able to claim 4.2 and 720P145 even with mega overclocking, but we'll try to push the limits.
- 1080P cropped up to 30fps.
- 1640x1232 full FOV binned mode, up to 30fps.
- 3280x2464 full FOV, allegedly 0.1fps to 15fps. (Yes, that in theory means 10second exposures).


edit: The H264 encoder will now allow the app to request level 4.2, but will only achieve any significant gain with overclocking. An update to raspivid is in order to allow > 720P68. 720P120 is almost working reliably but requires a significant overclock (achieved on a Pi3, but not on a Pi2 yet). Settings for how much overclocking, and any other trade-offs that can be made, are still being determined.

- The camera LED appears to have been removed.
- Firmware has supported the sensor for a while, but there have been updates in the last couple of days. Raspistill app and V4L2 driver have been updated to ask the GPU what the max sensor resolution is and set default/max resolutions appropriately - source repos are both updated.
- It does work on the Compute Module in stereoscopic mode, and the CM and software should also work correctly with one IMX219 and one OV5647 connected. (Fixed as of 8th June 2016 firmware update)
- HDR is NOT supported. The ISP doesn't have suitable processing to implement it.
- For obvious reasons, the size of the raw data captured using "raspistill --raw" has changed. There is an updated version of dcraw in my test repo at https://github.com/6by9/RPiTest/tree/master/dcraw. You will need to rebuild it manually as I haven't updated the binary in there.
- My rawcam code for capturing the raw Bayer data has not been updated, and again register sets are under NDA. Support will come eventually, or may be added via V4L2 instead.

Please ensure you have updated to recent firmware (ideally after 22nd April 2016) to get the best of the new sensor. I'm not sure if "sudo apt-get update" "sudo apt-get upgrade" is sufficient at the moment, but hopefully will be soon.
If your Pi isn't critical, then "sudo rpi-update" will get the absolute latest, but that also bumps the kernel to 4.4 which has a few minor issues at present.

Please ensure you apt-get upgrade to get the best from the sensor. Ideally use the 16th May Raspbian update to raspberrypi-bootloader.

I think that covers the main points. If other useful items come out of questions then I'll update that list.

(Updated 10/6/16 as one OV5647 and one IMX219 on the Compute Module is now working).
Last edited by 6by9 on Fri Jun 10, 2016 7:49 pm, edited 4 times in total.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
Mettauk
Posts: 204
Joined: Mon Dec 10, 2012 12:40 pm
Location: Zarg

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 10:49 am

Anyone know what the light sensitivity or f is for the new 8mp camera/lens combo on the standard and IR models?
As humans we have been the same for a very very long time, technology changes how we do, not who we are as people.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 11:14 am

Mettauk wrote:Anyone know what the light sensitivity or f is for the new 8mp camera/lens combo on the standard and IR models?
The driver source has an update from February with values provided by Sony, so hopefully correct.
Focal length 3.04mm.
f number 2.0.
Full FOV 62.2x48.8 degrees.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

shuckle
Posts: 565
Joined: Sun Aug 26, 2012 11:49 am
Location: Finland

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 11:38 am

Does this: https://www.raspberrypi.org/learning/infrared-bird-box/ still work?
Specially the
Adjusting the camera focus
section?

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 11:46 am

shuckle wrote:Does this: https://www.raspberrypi.org/learning/infrared-bird-box/ still work?
Specially the
Adjusting the camera focus
section?
Yes. It is a fixed focus lens which by default will be set to somewhere in the couple of metres range (I haven't checked it myself). It's still on a screw thread and can be twisted to adjust the focus.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 11:54 am

The original Pi camera had a 'problem' when using it with another lens. I experimented a lot with Nikon lenses but always got a magenta circle in the frame. This was apparently caused by either the lens shading algorithm (without a vignetting lens this caused corners to be colored) and / or micro prisms optimized for the short lens to sensor distance. Any hope this will be better with the V2 camera board?

See the right side of this image:
20486.jpg
Magenta cast when using camera board V1 with a Nikon lens
20486.jpg (63.03 KiB) Viewed 35924 times

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 12:06 pm

poing wrote:The original Pi camera had a 'problem' when using it with another lens. I experimented a lot with Nikon lenses but always got a magenta circle in the frame. This was apparently caused by either the lens shading algorithm (without a vignetting lens this caused corners to be colored) and / or micro prisms optimized for the short lens to sensor distance. Any hope this will be better with the V2 camera board?
Hopefully we've beaten the auto lens shading correction algorithm into submission, but changing the lens is still not a fully supported option.

In hopefully sorting it for IMX219 I have added an option to enable the revised behaviour on OV5647. I don't have masses of lenses to play with to test so haven't enabled it by default. If you do then you can try adding "ov5647_acls=1" to /boot/config.txt and respond on viewtopic.php?f=43&t=73998&start=25 with results.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 12:19 pm

OK, thanks. I stopped using the camera V1 (and basically the Pi altogether) because of this issue. Glad to see you've been working on it.

The nice thing of the camera board when using it with lenses for 35mm cameras is that it has a 'cropfactor' of 10 so a simple 50mm lens becomes an equivalent 500mm lens (used for the image posted earlier). Since the lens is made for a much bigger sensor there is no shading at all when using it with the Pi camera. So if at all possible it would be great if you could create an option that shuts off or bypasses the shading algorithm altogether.

echmain
Posts: 79
Joined: Fri Mar 04, 2016 8:26 pm

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 12:48 pm

@poing...I'm curious how you use the camera board with another lens.

Could you please post some details how you do that?

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 1:47 pm

Very simple, I made a hole in a rear lens cap and glued a pvc sewer pipe end cap to it. In this cap I drilled a hole large enough for the sensor (without lens) to peek through and glued four nuts to it on the inside with 2mm holes right above them. Then I used four 2mm bolts with springs around them to mount the sensor board at around 43mm, which is the registration distance for Nikon between lens and sensor. Then I leveled the sensor perpendicular to the lens with the four bolts looking at a live image of a test chart on the computer as it's extremely important to get that exactly right.

Here's an image, not pretty but it works:
Image

The result was not good enough sadly. As the image I posted was taken from RAW I now realize it's probably not the shading algorithm but the array of micro lenses on the sensor that causes the color shift. But I'm not sure, just a simple photographer ;-)

twVolc
Posts: 21
Joined: Wed Mar 16, 2016 11:41 am

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 1:57 pm

I'm not sure if this is a stupid question or not, but will the python picamera module still work to control this camera in the same way as the previous one? Or is that now obsolete,/being updated?

MikeDunn
Posts: 81
Joined: Wed Jul 01, 2015 6:58 pm

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 1:59 pm

echmain,

There's a link on another thread (the Astrophotography one, I think ?) to adapters that have a screw connection to the RasPi camera board & allows lenses & other devices ? One of these may suit ?

I have one on mine connecting to a webcam adapter with a filter; looks weird but works OK :lol: Had to cut a small access to go over the Sunny (instead of lying on top), but that was it.

Mike

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 2:41 pm

twVolc wrote:I'm not sure if this is a stupid question or not, but will the python picamera module still work to control this camera in the same way as the previous one? Or is that now obsolete,/being updated?
Picamera will work as is. There may currently be a restriction that limits you to 5MPix captures - there's a define in the code of "MAX_RESOLUTION = (2592, 1944)", but I can't see with a quick glance anywhere where it is actually used.
Any hard coded use of specific sensor modes will not match and give quirky results - I'll have a quick chat with others involved and see whether it is sensible to reorder the modes to give a better match to OV5647.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

echmain
Posts: 79
Joined: Fri Mar 04, 2016 8:26 pm

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 2:44 pm

@poing and mikedunn....thanks!

Hmmm...brainstorming...

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 2:48 pm

poing wrote:The result was not good enough sadly. As the image I posted was taken from RAW I now realize it's probably not the shading algorithm but the array of micro lenses on the sensor that causes the color shift. But I'm not sure, just a simple photographer ;-)
A little request that this thread is kept for discussion of the new camera and doesn't go too far off topic.

I think it's a fact of life that with these small sensors there is always some lens shading correction required, whether due to main lens or the sensor design.
Hopefully the lens shading algorithm will now adapt a little better to different sensors, but I can't guarantee it.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 4:21 pm

From the video overview at https://www.youtube.com/watch?v=W8SdTZR ... e=youtu.be it looks like the new (v2.1) and old (v1.3) RPi camera boards are physically the same size (25 mm wide), except the new one has rounded corners. Would be nice to have it confirmed that the dimensions and the 4 holes are the same.
EDIT: I see 23.86 x 25 x 9mm according to http://cdn-reichelt.de/documents/datenb ... _CAN_2.pdf
Comparing with the v1.3 board in my hand, it is the same size.

Looks like a slightly wider field of view, is this right? which will be welcome in many applications.

Original RPi camera (v1.3) OmniVision OV5647

Lens: f=3.6 mm, f/2.9
Angle of View: 54 x 41 degrees
(from http://elinux.org/Rpi_Camera_Module#Tec ... Parameters )

New Rpi camera (v2.1) Sony IMX219
Lens: f=3.04 mm, f/2.0
Angle of view: 62.2 x 48.8 degrees

One more question: has any photo been published showing the BACK side of the board? I'm curious if it has its own separate crystal clock, as PiCam v1.3, or it takes a clock signal via flex from the SOM (accounting for the missing "camera active" LED) which may make the software PLL frame-sync hack viewtopic.php?f=43&t=143820#p959246 more stable.

I've got the new camera on order and I will look forward to trying it out!
Last edited by jbeale on Thu Apr 28, 2016 3:32 pm, edited 2 times in total.

User avatar
CaptSunset
Posts: 140
Joined: Fri Mar 20, 2015 2:55 pm

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 4:48 pm

PiSupply just sent me an email saying the new 219 board is in stock; current cost is U$ 38.49 and there are a lot of photos & technical details here:

https://www.pi-supply.com/product/raspb ... -8mp-1080p

One thing I haven't found is whether the mounting holes are in exactly the same place.

US Addendum : MCM has the 219 stocked in North America for U$25.
Last edited by CaptSunset on Tue Apr 26, 2016 5:52 pm, edited 1 time in total.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 4:57 pm

CaptSunset wrote:PiSupply just sent me an email saying the new 219 board is in stock; current cost is U$ 38.49 and there are a lot of photos & technical details here: https://www.pi-supply.com/product/raspb ... -8mp-1080p
That link claims "1.4 um OmniBSI" pixels, but that does not match the 1.12 um pixels described on Sony's page for IMX219PQ, and "OmniBSI" is a trademark of OmniVision, not Sony; clearly that line was cut-and-pasted from the old RPi camera with OminiVision OV5647).

From Sony's page at http://www.sony.net/Products/SC-HP/new_ ... 219_e.html

Code: Select all

Total Pixels:    3296 (H) x 2512 (V)
Active Pixels:   3280 (H) x 2464 (V)
Pixel unit cell: 1.12 µm (H) × 1.12 µm (V)
Sensor size:     Diagonal 4.60 mm
Multiply total pixels by unit cell to get total pixel array size of 3.692 x 2.813 mm (diagonal 4.64 mm)
and active array size of 3.674 x 2.760 mm (diagonal 4.595 mm) so Sony's numbers are consistent. If it really had 1.4 um pixels, at that count it would be closer to a 1/3" sensor format instead of 1/4"
Last edited by jbeale on Mon Apr 25, 2016 5:20 pm, edited 5 times in total.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 4:58 pm

jbeale wrote:One more question: has any photo been published showing the BACK side of the board? I'm curious if it has its own separate crystal clock, as PiCam v1.3, or it takes a clock signal via flex from the SOM (accounting for the missing "camera active" LED) which may make the software PLL frame-sync hack viewtopic.php?f=43&t=143820#p959246 more stable.
Onboard oscillator still. No way to get through EMC otherwise.
Sorry, I have no answers on your other questions.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 5:42 pm

I have summarized some of the new information so far here, feel free to point out errors or add detail:

http://elinux.org/Rpi_Camera_Module#Tec ... 2_board.29

sorbonne
Posts: 49
Joined: Thu Jan 14, 2016 10:25 am

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 5:57 pm

6by9 wrote:I think that covers the main points. If other useful items come out of questions then I'll update that list.
How to distinguish the new camera from old one with MMAL?

woodside
Posts: 16
Joined: Mon Oct 22, 2012 7:42 am

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 6:08 pm

I assume the new camera is still static sensitive - can anyone confirm? Thanks

David Crawley
Posts: 5
Joined: Thu Apr 21, 2016 4:07 pm

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 6:23 pm

Outstanding work! Getting camera drivers to function is the work of saints.

We have a project where we use RaspPi cameras mounted on a fast moving robot to pick off features on walls and ceilings to determine the location of robot. We need high speed modes otherwise motion blur kills us.

Question on the high speed modes. You mentioned
"720P at max 68.3fps "
which raspberry pi are you operating on? Our project uses RaspPi 2 right now (upgrades will happen carefully once our software is more stable)? Is this frame rate available on RaspPi 2 or 3 or 1? Do we know what it is for the raspberry pi other than the one you were testing on? (I am particularly interested in RaspPi 2 or 3). If this is not known would you hazard a guess based on where you think the bottlenecks are.

How is the viewing angle affected when in these modes?

Are any of the other high speed modes available? I know that in theory the sensor can do up to 180 fps, but your response implies this isn't supported. What is supported right now what isn't?

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 6:45 pm

David Crawley wrote:We need high speed modes otherwise motion blur kills us.
Seems to me a fast shutter speed by itself prevents motion blur, independent of frame rate. For any given shutter speed, higher frame rates will just reduce the latency (and also increase the amount of data your algorithm deals with).

Unless by blur you mean rolling-shutter artifacts (vertical features moving sideways become diagonal). If you know your velocity, you can correct that with a software de-skew.

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

Re: New 8MP Camera - Q&A thread

Mon Apr 25, 2016 8:21 pm

sorbonne wrote:How to distinguish the new camera from old one with MMAL?
See Raspistill - https://github.com/raspberrypi/userland ... ill.c#L276
I guess we ought to think about making it into a helper function - so many tasks....
woodside wrote:I assume the new camera is still static sensitive - can anyone confirm? Thanks
Almost all electronics are static sensitive to some degree. I'd suggest a modicum of caution as before, but I don't know if it is significantly better or worse than the old one.
David Crawley wrote:Question on the high speed modes. You mentioned
"720P at max 68.3fps "
which raspberry pi are you operating on? Our project uses RaspPi 2 right now (upgrades will happen carefully once our software is more stable)? Is this frame rate available on RaspPi 2 or 3 or 1? Do we know what it is for the raspberry pi other than the one you were testing on? (I am particularly interested in RaspPi 2 or 3). If this is not known would you hazard a guess based on where you think the bottlenecks are.
I mention 720P 68.3 because that is the max that H264 level 4 or 4.1 supports. AFAIK currently things have been tested up to 720P60, or VGA90 on the output side only (both will be running the sensor at 720P on the input side - there are supposedly differences in the readout parameters, but I have no details).
David Crawley wrote:How is the viewing angle affected when in these modes?
All cropped modes are centre crops to that resolution.
David Crawley wrote:Are any of the other high speed modes available? I know that in theory the sensor can do up to 180 fps, but your response implies this isn't supported. What is supported right now what isn't?
Read the first post - that lists the exact modes that are currently supported. I may reorder them to more closely match OV5647, and others may be added in the fullness of time, but not for now.

jbeale has already correctly stated that exposure time is the main factor on motion blur.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot] and 4 guests