Variant characterizations of the camera module lens


40 posts   Page 1 of 2   1, 2
by rkinch » Tue Jun 04, 2013 8:45 pm
Update: I stand corrected. After repeating my measurements, I am retracting my original finding of f=4mm for the lens, and agreeing with the f=3.6mm f/2.9 finding that others have made. Here is my original report:
rkinch wrote:My lens measurements and characterization as 4mm f/3.2 at http://www.truetex.com/raspberrypi differ from the 3.6mm f/2 report at http://elinux.org/Rpi_Camera_Module . Since the latter doesn't state the primary measurement data or metrological methods, I cannot review that report to try to account for the difference.

We should also consider the unhappy possibility that there may be more than one type of lens being delivered in the camera module, leading to this confusion of characterizations. As is typical of these fine parts and their diligent Asian manufacturers, they bear neither make nor model indicia, making proper engineering applications difficult. Interchangeable parts and standardization were key to the industrial revolution and remain critical today, which implies part numbering and marking, but that bit of engineering discipline seems not to get across when it comes to offshore sources. Rather, "it is what it is" seems to be the rule.

To remedy this, we could photograph the specimen lenses, but at 6mm diameter this will require a microscope to get decent resolution.
Last edited by rkinch on Fri Jun 07, 2013 4:57 am, edited 1 time in total.
User avatar
Posts: 68
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
by towolf » Tue Jun 04, 2013 10:51 pm
I have access to the equipment. Can you advise how to measure the pupil properly? Does the refraction of the lens affect estimating the pupil diameter?
Posts: 388
Joined: Fri Jan 18, 2013 2:11 pm
by jamesh » Wed Jun 05, 2013 8:20 am
Don't forget it's a cheap camera with a cheap lens.
Soon to be employed engineer - Hurrah! Volunteer at the Raspberry Pi Foundation, helper at PiAcademy September 2014.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11930
Joined: Sat Jul 30, 2011 7:41 pm
by towolf » Wed Jun 05, 2013 10:35 am
But it has an aperture? I mean not a bladed diaphragm but an aperture.
Posts: 388
Joined: Fri Jan 18, 2013 2:11 pm
by jamesh » Wed Jun 05, 2013 11:21 am
towolf wrote:But it has an aperture? I mean not a bladed diaphragm but an aperture.


Well, it certainly has a hole where the light gets in! Not sure if there is any specific bit of 'aperture' plastic in there apart from the lens mount and the IR filter.
Soon to be employed engineer - Hurrah! Volunteer at the Raspberry Pi Foundation, helper at PiAcademy September 2014.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11930
Joined: Sat Jul 30, 2011 7:41 pm
by towolf » Wed Jun 05, 2013 2:13 pm
No no, aperture merely refers to "the cone of light that the light falls through" or rather its diameter.
Posts: 388
Joined: Fri Jan 18, 2013 2:11 pm
by jbeale » Wed Jun 05, 2013 2:32 pm
I was the one who added the camera info to the elinux wiki site, relying on this post from "fastmapper" who quoted 3.60 mm +/- 0.01 mm viewtopic.php?f=43&t=32605&start=325#p357018

With such an inexpensive lens I don't expect exact standardization. I know that many $50 SLR "50mm" lenses vary at least a few percent in focal length. I assume this lens is a plastic molding; that is usually used for the similar-sized lenses in optical mice, anyway. A difference of 10% suggests there might be different manufacturers, I would not expect polycarbonate index to vary that much. I will try to measure my own device and report back.
User avatar
Posts: 2076
Joined: Tue Nov 22, 2011 11:51 pm
by towolf » Wed Jun 05, 2013 3:16 pm
jbeale wrote:I know that many $50 SLR "50mm" lenses vary at least a few percent in focal length. I assume this lens is a plastic molding; that is usually used for the similar-sized lenses in optical mice, anyway.


Regarding aperture the difference between f/2 and f/3.2 is 1.3 stops, i.e., more than twice as much light. Don't think that falls under tolerance threshold. It would invalidate the calibrations.
Posts: 388
Joined: Fri Jan 18, 2013 2:11 pm
by poing » Wed Jun 05, 2013 3:30 pm
Which calibrations? There's only auto exposure at the moment so the actual f-stop doesn't really matter.
Posts: 1097
Joined: Thu Mar 08, 2012 3:32 pm
by jbeale » Wed Jun 05, 2013 4:23 pm
Thinking about lens focal length... the OV5647 datasheet quotes the image area dimensions to 5 digits, with a resolution of 100 nanometers [1] so I'm going to assume those dimensions are well known. So if we can measure field of view, we then know focal length with similar accuracy. A simple way to measure field of view is to take a photo of a 1-meter stick at a distance of 2 meters (for example). Another way is to take a 360 panorama with photos every 30 degrees (for example) rotating the camera about the zero-parallax point (in this case, front of lens element probably good enough) and then use "panotools" [2] or similar to stitch the photos and in the process, determine true focal length and lens distortion parameters through self-consistency. This would require no manual measurements at all. I'll see what I can do.

[1] Image Area 3673.6 x 2738.4 microns, page 2, http://www.ovt.com/download_document.ph ... ensorid=66
[2] http://wiki.panotools.org/
User avatar
Posts: 2076
Joined: Tue Nov 22, 2011 11:51 pm
by rkinch » Wed Jun 05, 2013 6:43 pm
towolf wrote:Can you advise how to measure the pupil properly?

You can start with just measuring the diameter of the aperture in the front. In general for lenses this may or may not be the actual pupil, but it certainly is an upper bound because nothing further back can enlarge the appearance of the front aperture. In the case of these simple lens designs, however, the front aperture *is* the entrance pupil, unlike an SLR lens where the aperture stop is a mechanical iris further inside the multiple elements.

The entrance pupil is defined to be the *image* of the aperture stop as you see it looking in from the front. That is, what is the smallest passage limiting (stopping) the light getting through the lens to the sensor. Since this can be inside the lens behind some glass when there are multiple elements, one must measure how the aperture appears from the front, when refracted by any intervening glass. On an SLR lens the aperture stop is the iris providing f/stop adjustment in the middle of the lens. In this little Raspberry Pi fixed lens, the aperture stop is just the front opening.

On the human eye, the pupil created by the iris is the entrance pupil. It is actually smaller in size than it appears, because you only see it magnified by the cornea. This apparent diameter is what determines the f/stop of your eye.

See http://en.wikipedia.org/wiki/Entrance_pupil
User avatar
Posts: 68
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
by pluggy » Wed Jun 05, 2013 7:19 pm
jamesh wrote:Don't forget it's a cheap camera with a cheap lens.


Shhhh, you're giving the game away........ ;)
Don't judge Linux by the Pi.......
User avatar
Posts: 2617
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
by jamesh » Wed Jun 05, 2013 7:34 pm
pluggy wrote:
jamesh wrote:Don't forget it's a cheap camera with a cheap lens.


Shhhh, you're giving the game away........ ;)


I though the fact it's $25 gave the game away...
Soon to be employed engineer - Hurrah! Volunteer at the Raspberry Pi Foundation, helper at PiAcademy September 2014.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11930
Joined: Sat Jul 30, 2011 7:41 pm
by rkinch » Wed Jun 05, 2013 8:16 pm
jamesh wrote:Don't forget it's a cheap camera with a cheap lens.

No, it is not a toy or a cheap gadget, although the price is cheap. This is a sophisticated board-level camera which has a potential to fulfill many applications that have been 10s or 100s of times more costly in the recent past. Applying cameras like this is my engineering field (http://www.truetex.com/micad). But this work cannot proceed without first properly characterizing the optical, mechanical, electronic, and software details making up the device. So while we have detailed published specifications on aspects like the OmniVision chip, we have nothing on the optics and mechanics. Those of us who envision serious applications for this sort of camera want to reverse-engineer specifications for details that have gone missing or non-disclosed from the Asian manufacturers. And we would want to come up with adapters to be able to use our own optics, as I have.
jbeale wrote:With such an inexpensive lens I don't expect exact standardization.

Why not? As a technical product they should all be coming off the assembly line with only tiny variations. The problem of standardization here is not that there isn't consistency in the product, but rather that Asian sourcing typically omits technical details of specifically what you're getting, or in marking and identifying parts. Or maybe they want latitude to slipstream whatever optics they have on hand at the last minute. In any case, such loose characterizations make serious applications impossible, unless you want to refit with custom optics.
User avatar
Posts: 68
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
by towolf » Wed Jun 05, 2013 8:34 pm
I fail at making consistent measurements, but this pretty much confirms ~ 1.25mm.

Image
Posts: 388
Joined: Fri Jan 18, 2013 2:11 pm
by jbeale » Wed Jun 05, 2013 9:35 pm
rkinch wrote:Or maybe they want latitude to slipstream whatever optics they have on hand at the last minute. In any case, such loose characterizations make serious applications impossible, unless you want to refit with custom optics.

Personally, I suspect this is the case. As far as I know, like the R-Pi itself, this camera board is designed for and provided to the educational market- and whoever else finds it useful. If you can find commercial or technical applications for it, so much the better, but it's up to you to make it work. I believe the camera module is made for the mobile phone market. Do cheap cellphones typically specify an exact focal length? Perhaps they do, but it seems no one at the foundation even knew what the focal length on their camera was (at least they have never said), suggesting to me it is not specified. But I am sure all parties have agreed on a price, and I daresay the vendor will use the cheapest available options to fulfill the contract.

In other words, yes it is a sophisticated board-level camera, but also it is built to a price, and to some unknown specification which may not include the parameters you expect from a device 10x or 100x as expensive. Actually I can be more precise: it is a sophisticated sensor chip from OmniVision in Santa Clara California, attached to some unknown lens housing & lens, mounted on a PCB designed & tested by the RPi Foundation team in Cambridge, and assembled by Sony Pencoed in Wales.
User avatar
Posts: 2076
Joined: Tue Nov 22, 2011 11:51 pm
by rkinch » Wed Jun 05, 2013 10:12 pm
towolf wrote:... this pretty much confirms ~ 1.25mm.

Thanks, nicely done. This lens looks like mine.
User avatar
Posts: 68
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
by rkinch » Wed Jun 05, 2013 10:19 pm
jbeale wrote:I was the one who added the camera info to the elinux wiki site, relying on this post from "fastmapper" who quoted 3.60 mm +/- 0.01 mm viewtopic.php?f=43&t=32605&start=325#p357018

Right, well, fastmapper's measurements seem credible, so I still do not understand why mine differ, unless somehow we have been shipped different lenses.

So I am waiting for fastmapper to confirm his 1.8mm pupil measurement, versus my 1.25mm. Here is my metrology with a millimeter scale (B&L StereoZoom 10x with eyepiece reticle). Click the image to see full resolution, as the forum presentation below seems to scale it down.

Image
User avatar
Posts: 68
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
by fastmapper » Thu Jun 06, 2013 4:37 am
rkinch wrote:So I am waiting for fastmapper to confirm his 1.8mm pupil measurement, versus my 1.25mm.

Please don't wait. I made a quick estimate of pupil diameter using a photo that was not as good as I would like and I only intended it to provide an upper bound.

The measurements I made with any level of seriousness were regarding focal length. I intend to use those measurements for photogrammetric applications where I can infer the geometry of those things that are imaged.
Posts: 27
Joined: Wed Mar 27, 2013 3:54 am
by rkinch » Thu Jun 06, 2013 6:15 am
fastmapper wrote:The measurements I made with any level of seriousness were regarding focal length.

OK, but could you at least look at my photo above, and at towolf's farther above, and compare to the lens you measured at f=3.6mm? Are they similarly featured with the spline edge? The 2.2mm OD bevel around the pupil? Do they look otherwise similar in proportions?
User avatar
Posts: 68
Joined: Sun Jun 02, 2013 7:19 am
Location: Palm Beach County, Florida USA
by jbeale » Thu Jun 06, 2013 6:19 am
My quick experiment tonight suggests the horizontal field of view of my camera more closely matches fastmapper's. I see 1723 mm +/- 2 mm wide HFOV at a distance from front of lens of 1712 mm +/- 3 mm. Full-width crop of test image here: http://bealecorner.org/best/RPi/RPi-819mm-HFOV.jpg

Note: The length reference bar is at an angle of about 1.5 degrees, but I measured only X pixels, meaning above numbers overestimate field of view by 1/cos(1.5 deg) = 1.0003 or 0.03%, which in this case is about half a millimeter.

The above measurements imply my lens focal length is 3.650 mm +/- 0.008 mm
If we assume the lens aperture is 1.25 mm in diameter, that gives us 3.65/1.25 which is an f-stop of 2.9 so my lens is 3.65 mm, f/2.9
NOTE: as rkinch pointed out, my estimate is a narrow-field approximation which is not accurate for wide-angle lenses such as this one.

If anyone else would like to try measuring their lens, including estimated uncertainty, it would be interesting to compare.
Last edited by jbeale on Thu Jun 06, 2013 10:35 pm, edited 5 times in total.
User avatar
Posts: 2076
Joined: Tue Nov 22, 2011 11:51 pm
by gkreidl » Thu Jun 06, 2013 9:01 am
I don't have a camera yet, so I cannot test anything, but perhaps the distance between lens and chip differs slightly due to some inacurracy during assembly.
Minimal Kiosk Browser
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
Posts: 1379
Joined: Thu Jan 26, 2012 1:07 pm
by poing » Thu Jun 06, 2013 9:12 am
gkreidl wrote:I don't have a camera yet, so I cannot test anything, but perhaps the distance between lens and chip differs slightly due to some inacurracy during assembly.

If the focal length is the same that would mean different focus. I've seen differences in focus between cameras but only slightly; I'm sure every single camera is focused on a test bench and then glued in to place.
Posts: 1097
Joined: Thu Mar 08, 2012 3:32 pm
by fastmapper » Thu Jun 06, 2013 12:22 pm
rkinch wrote:could you at least look at my photo above, and at towolf's farther above, and compare to the lens you measured at f=3.6mm? Are they similarly featured with the spline edge? The 2.2mm OD bevel around the pupil? Do they look otherwise similar in proportions?

Here is a photo of my camera.
Attachments
Raspberry Pi Camera.jpg
A photo of my camera
Raspberry Pi Camera.jpg (45.88 KiB) Viewed 2195 times
Posts: 27
Joined: Wed Mar 27, 2013 3:54 am
by MarkDaniels » Thu Jun 06, 2013 2:12 pm
@ RKinch

Just photographed my RPi camera lens and obtained the following:

Camera Body (measured with vernier calipers): 7.96 mm +/- 0.02 mm
Camera Body (Pixel Count: 1209 - 618 = 519 +/- 2): 7.96 mm
Lens (Pixel Count: 964 - 870 = 94 +/- 2): 1.27 mm

Looks like 1.25 mm is within the error bounds. The lens assembly looks very similar to yours and the one posted by fastmapper.

For reference, photograph taken with Nikon D3100, 55 mm Focal length, f/5.6.

Hope it helps.
Posts: 53
Joined: Sun Oct 28, 2012 2:01 pm