silversword411
Posts: 2
Joined: Fri Jun 03, 2016 10:31 pm

Understanding the Pi Camera with a M12 lens/mount

Fri Jun 03, 2016 10:54 pm

I'm trying to build up a lexicon and understand how to calculate/adapt/choose lenses to work with the Pi Camera.

I'm starting with the standard Pi Camera: https://www.raspberrypi.org/products/camera-module/
or v2 camera: https://www.raspberrypi.org/products/camera-module-v2/
or Pi NoIR: https://www.raspberrypi.org/products/pi-noir-camera/
or Pi NoIR v2: https://www.raspberrypi.org/products/pi-noir-camera-v2/

And adding a standard M12 mount: http://www.amazon.com/Black-Plastic-Spa ... B016FBNYNM

How do I figure out what lens I need to have xyz. I'm looking for a good telephoto specifically, but I think it would be beneficial for everyone to have some reading material that will explain how all these work together:
- Sensor size (Pi is 1/4" right)
- Focal Length
- aperture
etc.

Thanks to the optical gurus out there :)
David

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

Re: Understanding the Pi Camera with a M12 lens/mount

Sat Jun 04, 2016 11:59 pm

First off, the mounting holes on both v1 and v2 RPi cameras are on 21 mm centers [1], so the 20 mm spacing of the M12 mount you link isn't a perfect fit. Depending on your mounting screw size, you may still be able to force it. Second, you have to manually cut or file down a notch in the M12 mount for the micro-flex cable that comes out of the camera module. That isn't too hard, but if you want, there is also a M12 mount specifically designed for the RPi cameras, with a notch already [2].

The v1 and v2 sensor sizes are the same, the so-called 1/4-inch format. On V1 the lens focal length is f=3.6mm with Angle of View: 54 x 41 degrees and on V2 it is f=3.0mm with Angle of View: 62.2 x 48.8 degrees [1]. Note the angle of view is quoted at full-frame; remember some video modes use a cropped subset of the full frame. This is a moderately wide angle lens. If you double the focal length, you'll get half the field of view. If you get a 8mm lens that's a moderate telephoto, and a 16mm lens is definitely telephoto. I've tried a number of cheap M12 lenses [3] that work "ok" but don't expect perfectly sharp images with the tiny 1.4 or 1.1 micron pixels these camera sensors use. Lower f-number lenses are "faster" (let in more light) but will have more shallow depth of field and more blurry overall. You will see f/1.4 or lower sold for use in low light, but I have not had good images with those; I would recommend f/2.0 or above if you want decent resolution.

The longest lens I've tried is a reversed 4x microscope objective, about f=27mm delivering 8 degrees horizontal field of view [4]. I made a 3D printed holder for it [5]. That lens is good enough to recognize faces from over 100 feet away. Attached image is a crop from 1640x1232 (full-frame) mp4 video from v2 camera, using that lens.
PiCam-PersonWalking-4xObj.jpg
person about 140 feet (43 m) away
PiCam-PersonWalking-4xObj.jpg (6.78 KiB) Viewed 11178 times
References:
----------------------
[1] http://elinux.org/Rpi_Camera_Module#Tec ... 1_board.29
[2] http://www.m12lenses.com/CNC-Machined-R ... 020rpm.htm
[3] http://www.m12lenses.com/M12-Mount-Mega ... s-s/21.htm
[4] viewtopic.php?f=43&t=148328
[5] http://www.thingiverse.com/thing:1565909

silversword411
Posts: 2
Joined: Fri Jun 03, 2016 10:31 pm

Re: Understanding the Pi Camera with a M12 lens/mount

Mon Jun 06, 2016 12:17 pm

Awesome info thanks.

Is there an equation that translates the mm to zoom factor/angle of view (other than doubling focal length halves field of view)?

F= makes sense. When I look at my DSLR's zoom lens (35-70 or 75-300), I can see how much zoom/angle I get just be playing with the zoom. But since my numbers on the DSLR is different than the Raspberry Pi lenses [3] I'm assuming the sensor size is part of the equation dictating what magnification/angle of view I'm going to get (understanding that fish eye lenses are going to add extra angle of view in the calculation but will introduce distortion).

For now, I'm trying to get a good face/license plate capture on the main roadway access to my residence but I'm hoping to gain information that will allow me to calculate results in advance for Raspberry Pi cameras of the future (v3, v4 etc :) )

Thanks!
David


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

Re: Understanding the Pi Camera with a M12 lens/mount

Mon Jun 06, 2016 2:02 pm

The RPi v2 camera sensor size is 3.67 x 2.76 mm (1/4" format). The horizontal dimension is almost 10x smaller than a traditional 35 mm film SLR or "full-frame" DSLR with a 36x24 mm image area.

So if you have a "full-frame" DSLR, the "crop factor" of a 1/4 sensor relative to that is about 10. So a 200 mm lens on a full-frame DSLR gives you very nearly the same horizontal field of view as a 20 mm lens on the Raspberry Pi sensor, and a 50mm SLR lens compares to a 5 mm lens on the RPi.

duanereilly
Posts: 1
Joined: Tue Mar 21, 2017 2:29 pm

Re: Understanding the Pi Camera with a M12 lens/mount

Tue Mar 21, 2017 3:01 pm

Thank you very much jbeale for posting this, ive made one myself and from rough tests with the clarity at distance is amazing,
That microscope objective you suggested fits perfectly snugly in the barrel.
heres some pics of it, no pics with it yet, when i get it mounted, ill come back and re-necro this thread with pics.
http://imgur.com/gallery/i0Plm
Once again, thanks heaps jbeale, learnt a tonne doing,

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

Re: Understanding the Pi Camera with a M12 lens/mount

Tue Mar 21, 2017 8:08 pm

Glad to help! If anyone else needs a long lens, I can recommend this f=25mm M12 lens http://www.ebay.com/itm/282167088666
I found it to have better image quality than the cheap microscope objective I used before, and the threads mean you can set focus more easily by turning it. This does mean that you will need a M12 lens mount, but there are apparently solutions for that: http://www.thingiverse.com/thing:1963856 (which looks right, but I haven't tried that one myself)

Chrobry
Posts: 6
Joined: Sun Apr 02, 2017 12:15 am

Re: Understanding the Pi Camera with a M12 lens/mount

Tue Apr 04, 2017 6:14 pm

The Raspberry lens mount appears to be a M6. Are M6 lens available or are these only sold by OEMs? Are the M12 lenses and mounts the smallest board mount available retail? I don't see other sizes on ebay.

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

Re: Understanding the Pi Camera with a M12 lens/mount

Tue Apr 04, 2017 6:44 pm

M12 lenses are by far the most common small "board camera" lens, you see them used in security cameras, dashcams etc. I'm not aware of any smaller interchangeable lens format.

M6, M7, etc. lenses are really only used for mobile phone type devices and there is little standardization on thread pitch, etc. Normally these are OEM-only and you buy your lens and your lens mount from the same vendor, otherwise it probably won't fit. As an example- the RPi v1 and v2 cameras both use a nominally M6 lens, but the threads are just slightly different and they don't interchange. You actually can force a v1 lens onto a v2 camera, but that is only because the plastic parts can be deformed.

Namwoong Kong
Posts: 1
Joined: Fri Jul 21, 2017 6:49 am

Re: Understanding the Pi Camera with a M12 lens/mount

Fri Jul 21, 2017 7:33 am

Your post has helped my project a lot. Thank you.
I have a question.
Is using a 4x microscope for use as a telephoto lens?
Does the M12 25mm lens you recommend on the post have the same function?
I want to use the raspberry camera to take precise pictures at close range.
I would like to use a raspberry camera to capture 3mm size objects clearly and clearly.
Please advise which lens to use.

sehwert
Posts: 2
Joined: Sat Aug 05, 2017 3:15 pm

Re: Understanding the Pi Camera with a M12 lens/mount

Sat Aug 05, 2017 3:21 pm

Hi there,

I am trying to built a little "photo box" to take images of mostly flat objects under the same conditions. The idead is to mount the V2 camera about 60cm max above the area that I want to cover (approx. 30 x 40 cm).

Can someone suggest what lens (M12) to use for such a device in order to get sharp images.

Thanks!

sehwert

closefan
Posts: 1
Joined: Sat Aug 12, 2017 5:49 pm

Re: Understanding the Pi Camera with a M12 lens/mount

Sat Aug 12, 2017 5:56 pm

David,

I am interested in the list you have compiled so far. I am interested in buying a pi v2 and a mount and lens. So far I have come across
http://www.m12lenses.com/CNC-Machined-R ... 023rpp.htm

This is a m12 mount specifically made for the pi v2 from this m12 lenses .com

I am unsure what lens to buy. I would like to make a selfie cam that you can hold about 6-12 inches from the face and still get the top of head down to mid chest. Not sure if the v2 can do that just fine since it may be a wide angle out of box.

Any info on that would be greatly appreciated.

ms_1987
Posts: 1
Joined: Wed Aug 16, 2017 1:25 am

Re: Understanding the Pi Camera with a M12 lens/mount

Wed Aug 16, 2017 1:42 am

Hi John,

Your post is very useful, many thanks!

I am working with the Pi V2 camera and I would like to change the actual focal lens with a 16-25 mm because I need longer focal in my work (I will be 100 m far away).

Could you suggest me some lens compatible with the M12 Mount for Raspberry Pi V2 Camera (https://www.thingiverse.com/thing:1963856/#comments)?

Many thanks

Return to “Camera board”

Who is online

Users browsing this forum: No registered users and 9 guests