User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Tue May 03, 2016 12:55 pm

Hi Naushir,

http://www.sony.net/Products/SC-HP/new_ ... 219_e.html
Lens Shading Correction Function

The IMX219PQ has a lens shading correction function with four independent colors. It can be used for not only normal lens shading correction, and also can serve as an individual module adjustment of deviation in the lens assembly process during the module fabrication.
Calibration data is written in a built-in OTP during the module inspection to contribute to the short loading time when the camera is turned on.
One from three tables can be selected according to color temperature and there exists two-table blending mode for interpolation.
Does not say RGBW in brief
http://www.sony.net/Products/SC-HP/IS/s ... 140910.pdf

IMX219 is an upgrade to the IMX111, mainly 4 lane MIPI for faster video.

RGBW get a mention here
http://www.xperiablog.net/2012/01/23/so ... artphones/

List of Exmor chips, IMX111 - RGB, IMX219 ? Wiki is100% accurate?
https://en.wikipedia.org/wiki/Exmor

More mentionof RGBW
http://www.engadget.com/2012/08/20/sony ... hdr-video/

Seems like RGBW is common in chips with 1.1? pixel pitch, to keep sensitivity similar to the older 1.4um sensors.

Now it gets interesting, RGBW is gone?
http://pocketnow.com/2012/09/22/sony-rg ... rts-to-rgb

It's back now?
http://image-sensors-world.blogspot.com ... flyer.html

Was or is there two models of the IMX219? RGBW and RGB

Sony has 40% of the market, have they finally got the RGBW issues sorted and have forgotten to update the data sheets?
http://www.imaging-resource.com/news/20 ... -13mp-rgbw
http://wccftech.com/iphone-6s-sony-camera-sensor/
http://www.dpreview.com/forums/post/55897719

Dye based micro lens RGB filters are added after the silicon is made. Easy to change to RGBW from RGGB.

I will bet the time taken to get RGBW working was sorting out bugs in the colour correction matrix etc software. Bayer has been around for ages, same old code used over and over, guy who wrote it has probably retired.

I also have a suspicion the IR filter might not be 100% blocking, improving low light sensitivity.
RGBW would allow for this as the RGB filters block quite bit of IR but not all.
No filter on the White pixel makes it more sensitive to IR, subtract it from the RGB.
Would be interesting to get the V2 Noir and cover the lens with a IR filter from the V1.
Then compare colours to normal v2.

Sony going to give you the algorithm?
Taken them 3-4years to figure out, how many man years? $$$$$$$ er yen,yen, yen...
Adafruit offered bounty on MS Kinect.
RPI offer one to figure out the code?
Sony going to hire the school kid that figures this out to replace the retired guy?

Cyper chip? or just secret algorithm?
Will be interesting to see what the raw data shows.
Grab raw data, run some python over it, RGB or RGBW.
They might even have done some tricky stuff, RWBG:)

My night shots with yellow floodlights are red coloured, indicating missing green.
White light colour balancing won't pick this up, but will they look washed out?

Is the focus issue a side effect of very strong noise filters?
When the modules are made and focused, not going to be using RPi's for testing.
Noise filters not needed/used in the factory?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Tue May 03, 2016 1:07 pm

Hi Naushir

Quick check, pop lens off, use microscope to check filter pattern.
RGRGRGRG
WBWBWBWB

or
RGRGRGRG
BGBGBGBG

or ???????
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Tue May 03, 2016 1:15 pm

Jbeale,

Those wrecked V2's of yours, got a microscope handy?
What is the filter pattern?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Tue May 03, 2016 1:24 pm

Bleeding edge when you end up forth on a google search:)

Patterns we are looking for
https://en.wikipedia.org/wiki/Color_filter_array

hmm, RGBW similar to RGB, might slip through unnoticed?
https://en.wikipedia.org/wiki/Demosaicing

links to software, lovely, got a deb for Pi?
https://en.wikipedia.org/wiki/RawTherapee
My brain gets a break:)
Add this to the standard Raspbian?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

naushir
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31
Joined: Mon Apr 25, 2016 10:21 am

Re: New 8MP Camera - Q&A thread

Tue May 03, 2016 1:47 pm

From http://www.sony.net/Products/SC-HP/IS/s ... index.html, IMX219 does not have an RGBW array filter. No mention of any conversion hardware in the datasheet either.

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

Re: New 8MP Camera - Q&A thread

Tue May 03, 2016 1:59 pm

I worked briefly with an RGBW (actually, R-G-B-nofilter) sensor from another vendor, supposedly better when you wanted both normal color and IR capability, but the debayer algorithm was not mature and after a year the vendor didn't improve it; the project was dropped.

User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Wed May 04, 2016 1:20 am

Hi Naushir, Jbeale.

Don't believe data sheets, spent 40+yrs reading them and finding mistakes.
Until I get a nice microscope image of the colour filter on the sensor I am not convinced.
Even then there could be batches with RGB and others with RGBW.

Sony could even be doing it deliberately to annoy certain people in a certain country.
If you believes the images on Sony's webpages we are not even close to getting that quality out of the V2.

Hmm someone mentioned loose lens and gluing.
If the lens is loose and glued it could be twisted off angle a little, causing out of focus on some sides.
Does not take much at these tiny sizes, even surface tension on the glue could pull it out of focus.

There is an interesting pattern in the Raw V2 page, what does it mean, secret code?
viewtopic.php?f=43&t=146310
There is some OTP memory in the chip, what is it for?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Wed May 04, 2016 2:04 am

Press release is interesting
http://www.sony.net/Products/SC-HP/new_ ... 219_e.html

It is a 4 lane replacement for the IMX111, but it has BME-HDR capability.
4 colours, typo or clue?
The IMX219PQ has a lens shading correction function with four independent colors.
Is this done during module testing?
Calibration data is written in a built-in OTP during the module inspection to contribute to the short loading time when the camera is turned on.
Furthermore, synthesizing from these two different exposure conditions by ISP (Image Signal Processor chip) and applying tone curve optimization enables HDR video recording.
ISP, Image signal processing, the magic sauce recipe is done here.
Miss an ingredient or two and you get a bad taste/picture.
Is Broadcom's recipes better than Sony's?

Automatic Optical Black clamping on chip probably explains the nice night time shots.

IMX219PQ, wonder what the PQ bit means? Q for quad- 2x2 binning?

Again 4 pixel calculation, does that refer to 2x2 binning or 4 colors RGBW?
http://www.sony.net/Products/SC-HP/IS/s ... index.html
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

naushir
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 31
Joined: Mon Apr 25, 2016 10:21 am

Re: New 8MP Camera - Q&A thread

Wed May 04, 2016 8:28 am

Let me correct any misconceptions; 4 colours refers to the 4 colours in the bayer pattern, i.e. R, Gr, B, Gb. It is standard practice in ISP pipelines to treat the two G pixels independently. It does not mean there is a W pixel.
Gavinmc42 wrote:Press release is interesting
http://www.sony.net/Products/SC-HP/new_ ... 219_e.html

It is a 4 lane replacement for the IMX111, but it has BME-HDR capability.
4 colours, typo or clue?
The IMX219PQ has a lens shading correction function with four independent colors.

User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Wed May 04, 2016 11:56 am

Two separate greens for demosaic use etc?
Time to look at the raw data, to figure out the weird colours.

Maybe when the 12Mp V3 appears I can get a RGBW to play with:)
The original prototype was a 14Mp, V4?
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

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

Re: New 8MP Camera - Q&A thread

Wed May 04, 2016 3:47 pm

jbeale wrote:
hystrix wrote:There's virtually nothing in focus in my shots with the V2.1 camera. The dragon in this photo is 70cm from the lens:
https://www.dropbox.com/s/lfxvr2hu8mirf ... 3.jpg?dl=0
Moving the camera 40cm from the subject is a bit better: https://www.dropbox.com/s/dlav27jry1dwz ... 4.jpg?dl=0
The second image looks very good to me. It shows at 40 cm (at least in the center of the frame) the lens resolves so well it would benefit from better moire filtering. That agrees with my result that my lens worked well at 30 cm: http://bealecorner.org/best/RPi/PiCamV2-test7.jpg

I wonder if adding an external -3 diopter (concave; diverging) lens would give a good result on distant objects. Having now destroyed two lenses with pliers trying to refocus them myself, I do not recommend that route, unless you arrange a jig so the pliers cannot snap closed when slipping off the edge and damage the lens.
Just an odd thought, but isn't 30-70 cm ( 12"-28" ) about what you'd call 'selfie' range?
The faster lens in those more typically low light situations ?

Ouch! on that lens mount damage; I've used a fresh #2 pencil eraser, which worked but I wouldn't call it good technique.

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

Re: New 8MP Camera - Q&A thread

Wed May 04, 2016 8:16 pm

CaptSunset wrote:Just an odd thought, but isn't 30-70 cm ( 12"-28" ) about what you'd call 'selfie' range?
The faster lens in those more typically low light situations ?
In my quick test here viewtopic.php?f=43&t=146579#p967325 I believe the new 8MP RPi camera compares well against my 3-year-old Samsung 5MP cellphone camera, so long as you place the target at 30 cm. Yes, close focus is probably is good for a "selfie" shot but I do not think the RPi folks intended a stealth focus change from the v.1 camera, after suggesting the new model is a drop in replacement.

I could only just barely unscrew the lens even with the pliers, and the high force needed contributed to the lens damage. Maybe would have gone better had I taken the time to scrape off the glue dots. I had managed without doing that in my v.1 camera refocus experiments, leading to overconfidence. On the positive side, the v2.1 sensors were still fine and allowed continued testing with a v1.3 lens, and a M12 lens mount + lens.

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

Re: New 8MP Camera - Q&A thread

Thu May 05, 2016 1:19 am

jbeale wrote: I do not think the RPi folks intended a stealth focus change from the v.1 camera, after suggesting the new model is a drop in replacement.
Ha! Totally agree; do we know where in the chain the lens is installed & aligned? It's within Sony, right?
Perhaps we should ask for an unglued UG model too?

I'm thinking about filing a very small PVC pipe into a suitable 3-pronged tool (something like what you get free as a lawn mower plug wrench) but first I'm checking with Edmund Scientific as was... and playing with my newly arrived camera to catch up to you guys.
you might like some of their stuff:
http://www.photonics.com/Company.aspx?CompanyID=4064
(They used to have a German optics kit for kids that was sooo cool; tubes and plastic lenses, fiber optics & front surface mirrors...made microscopes, telescopes, 35mm camera, etc)

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

Re: New 8MP Camera - Q&A thread

Thu May 05, 2016 3:12 am

I believe Sony provides the sensor only; lenses and packaging are 3rd parties. Just like OmniVision made the sensor only for v.1, and it was Sunny Optical Group that did the package: http://www.sunnyoptical.com/en/pro/009003/index.html

User avatar
Gavinmc42
Posts: 4388
Joined: Wed Aug 28, 2013 3:31 am

Re: New 8MP Camera - Q&A thread

Thu May 05, 2016 3:38 am

Been lens glue removing under a microscope on V1 and V2.

Modules are held down with a round dot of double side tape.
The modules wobbles around, some not even flat to the PCB.
Anyone modifying for a M12 should probably pop off module, remove tape and glue it down flat.

Still trying to figure out a lens twister, the plastic is quite soft.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

pootle
Posts: 362
Joined: Wed Sep 04, 2013 10:20 am
Location: Staffordshire
Contact: Website

Re: New 8MP Camera - Q&A thread

Fri May 06, 2016 2:21 pm

The plastic around the lens is indeed very soft, I have managed to remove the lens by trimming away the glue with a craft knife - including going slightly down the outside 'tube' as the glue had gone down there, then hoiked it out with needle nose pliers - made a real mess of the plastic! I have mounted the pi camera onto a canon lens cap (the cap that goes on the camera end of the lens), and I'm just waiting for some extension tubes to arrive so I can get the sensor back the right distance from the lens. Then I'll give it a whirl with some of my EF lenses.

9aed
Posts: 17
Joined: Wed Sep 24, 2014 11:49 pm

Re: New 8MP Camera - Q&A thread

Sat May 07, 2016 8:07 pm

These camera modules have finally reached the very rudimentary testing facilities of 9aed! Naturally some tests have been made.

Contrary to quite popular opinion, the module under test (green V2.1) is not nearsighted. In fact, it starts to resolve around 45 cm and behaves fairly linearly at least up to 6.8 m, after which the improvised test bench arrangement ends.

According to testing the module can resolve objects around 0.56 mm thick 1 meter away. If the calculation is correct, this corresponds to about 1.9 arc minutes of angular resolution. Not quite 20/20, but quite good for a digital camera.

Testing was performed using a preferred number scheme around 12th root of 10 (1.21152765863), quite resembling the E12 series. A set of test objects was printed, based on concentric circles, with variable feature (black and white) widths. These targets were normalized at 1 m. This arrangement permits simple angular measurement comparison, since test targets are simply scaled according to distance from 1 m, for example starting the series at 0.316 m, scaling down with the same amount gives equal angular size for the target. Target ring groups are marked with natural feature size at 1 m.

As attachment there are 12^H^Hsome (*) cropped images, produced with raspistill, without any other directions. Some .jpeg artifacts result from this, but since we are interested about the performance of the whole system, this is as intended.

Tested distances were 0.316, 0.383, 0.464, 0.562, 0.681, 0.825, 1.000, 1.470. 2.150, 3.160, 4.640 and 6.810 m. Accuracy is, however, not quite as good as stated, but these values should not be more than 10 mm off. Cropped parts are concentrated on the most interesting area of angular resolution. Since the target size got considerably large after 3 m, just 2 ring sets could be fit on 1 A4 sheet. In hindsight, a 0.464 target might have been more interesting, but time did not allow more operations and light was running out.

During testing it was found out that, as of yesterday, rpi-update is still a necessary operation, since updating using conventional methods yielded upside-down mirror images, with previous image sizes. (And, of course this revelation came after all the material was first collected. Although this made the operation last a day, bits are cheap and targets were already printed.)

Only image center area was tested. Corners and borders need further attention, but this is just to show that not all modules are necessarily fully bad and inoperable. As it seems to be, the resolution of V2.1 is even slightly better than V1.3, in at least some scenarios.

(*) The file is too big, maximum allowed size is 64 KiB. -- forum software
Attachments
cropped.tar
(60 KiB) Downloaded 313 times

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

Re: New 8MP Camera - Q&A thread

Sat May 07, 2016 11:38 pm

9aed wrote:Contrary to quite popular opinion, the module under test (green V2.1) is not nearsighted. In fact, it starts to resolve around 45 cm and behaves fairly linearly at least up to 6.8 m, after which the improvised test bench arrangement ends.
According to testing the module can resolve objects around 0.56 mm thick 1 meter away. If the calculation is correct, this corresponds to about 1.9 arc minutes of angular resolution.
Thanks for doing the test, and posting those results! Glad to hear not all the v2 cameras are bad; yours is quite different from mine was. I'm curious how the corners compare to the center; as the older v1.3 camera still did pretty well in the corners. Is that set of resolution rings available as a PDF for download somewhere?

Koepi
Posts: 68
Joined: Fri Apr 29, 2016 7:18 am

Re: New 8MP Camera - Q&A thread

Sun May 08, 2016 4:32 am

Thanks for the test. But it is necessary to emphase: You're talking about a small area in the center!
As you can see from all sample images, every shot has a small, well focussed area around the center somewhere. Which is so small that the visual impression of 'unsharpness' stays overwhelming.

So no hooray moment for me, as the small sharp area is of no use in practice.

anat
Posts: 19
Joined: Mon Aug 27, 2012 12:45 am

Re: New 8MP Camera - Q&A thread

Sun May 08, 2016 4:58 am

I found that raspistill could not correctly control the exposure time. See the attached file
https://drive.google.com/file/d/0B3RSuv ... sp=sharing

I took images with ISO400 with exposure time 1 2 4 and 6 sec. as you can see from the filename: im400_2.jpg = ISO400 2s exposure

You can see that the images are not brighter when the exposure time increases and the property of the image im400_6.jpg shows the exposure time of 1.7s ?! I believe something is wrong. I had no such problem with the camera V1.3.

I use both raspistill after apt-get upgrade and the one compiled from
git clone https://github.com/raspberrypi/userland.git
This is the log of my command. I notice that after "Starting capture 0" there is no wait time equal to the specified exposure time. "Finished capture 0" comes in a second for all exposure times.

[email protected]:/home/pi/userland/build/bin# ./raspistill -ISO 400 -ss 4000000 -o im400_4.jpg -v

raspistill Camera App v1.3.8

Width 2592, Height 1944, quality 85, filename im400_4.jpg
Time delay 5000, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Link to latest frame enabled no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 400, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
Camera component done
Encoder component done
Starting component connection stage
Connecting camera preview port to video render.
Connecting camera stills port to encoder input port
Opening output file im400_4.jpg
Enabling encoder output port
Starting capture 0
Finished capture 0
Closing down
Close down completed, all components disconnected, disabled and destroyed


Please advise if I miss something.

Koepi
Posts: 68
Joined: Fri Apr 29, 2016 7:18 am

Re: New 8MP Camera - Q&A thread

Sun May 08, 2016 5:37 am

You seem to miss:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi-update
sudo rpi-update
-> Reboot

You obviously still use an old kernel or packages:
-> Width 2592, Height 1944
which multiplies up nicely to round about 5 MP

Pi Cam V2 has
-> Width 3280, Height 2464
which in turn is 8 MP. You need a newer kernel with proper drivers though, that's what the commands given above will do to your Pi.

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

Re: New 8MP Camera - Q&A thread

Sun May 08, 2016 7:41 am

Gavinmc42 wrote:Two separate greens for demosaic use etc?
Time to look at the raw data, to figure out the weird colours.

Maybe when the 12Mp V3 appears I can get a RGBW to play with:)
The original prototype was a 14Mp, V4?
Bayer sensors always have two greens. The demosaic algorithm converts those 4 colour channels (RG1BG2 of whatever order) in to RGB. It's one of the first processes done by the ISP in the GPU (not done on sensor). I think black level maybe done first, and perhaps some defective pixel correction.

Note, Naushir is a very experienced camera developer, probably one of the most experienced on the planet, so does know what he is doing, although he is not the only person working on this tuning. However, tuning a camera sensor like this is a very long winded job, and very subjective, so expect some teething troubles as more and more use cases are explored.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

anat
Posts: 19
Joined: Mon Aug 27, 2012 12:45 am

Re: New 8MP Camera - Q&A thread

Sun May 08, 2016 7:55 am

Koepi wrote:You seem to miss:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi-update
sudo rpi-update
-> Reboot

You obviously still use an old kernel or packages:
-> Width 2592, Height 1944
which multiplies up nicely to round about 5 MP

Pi Cam V2 has
-> Width 3280, Height 2464
which in turn is 8 MP. You need a newer kernel with proper drivers though, that's what the commands given above will do to your Pi.
Is it possible to use the camera V2 without the kernel update? Thanks. I have some modules which are tied to the current kernel.

Koepi
Posts: 68
Joined: Fri Apr 29, 2016 7:18 am

Re: New 8MP Camera - Q&A thread

Sun May 08, 2016 9:25 am

@anat: Only with the restrictions/drawbacks you're experiencing.

gordon77
Posts: 4930
Joined: Sun Aug 05, 2012 3:12 pm

Re: New 8MP Camera - Q&A thread

Sun May 08, 2016 9:46 am

Koepi wrote:You seem to miss:

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi-update
sudo rpi-update
-> Reboot

You obviously still use an old kernel or packages:
-> Width 2592, Height 1944
which multiplies up nicely to round about 5 MP

Pi Cam V2 has
-> Width 3280, Height 2464
which in turn is 8 MP. You need a newer kernel with proper drivers though, that's what the commands given above will do to your Pi.
Do I need both of these...?

sudo apt-get install rpi-update
sudo rpi-update

I've only been using the 2nd.

Gordon

Return to “Camera board”