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

Re: Camera focus distance and macro lenses

Fri May 17, 2013 7:06 pm

See here . http://www.raspberrypi.org/phpBB3/viewt ... 86#p351286

May not be using the full resolution of the sensor. I'll investigate when back at work Monday ( don't have access to firmware source at home)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Camera focus distance and macro lenses

Fri May 17, 2013 7:24 pm

Errmm, wrong thread I think James....
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

towolf
Posts: 421
Joined: Fri Jan 18, 2013 2:11 pm

Re: Camera focus distance and macro lenses

Fri May 17, 2013 8:16 pm

I’ve strapped the whole assembly to my Zeiss bino and with the right amount of TP roll spacing it gives a fairly clear field of view.
bino.jpg
bino.jpg (61.48 KiB) Viewed 9230 times
bino2.jpg
bino2.jpg (47.3 KiB) Viewed 9230 times
bino1.jpg
bino1.jpg (55.69 KiB) Viewed 9230 times

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

Re: Camera focus distance and macro lenses

Fri May 17, 2013 8:59 pm

That looks like a nice clear view through the microscope, thanks for posting that! At work a few years ago, somebody bought a small video camera that was designed to mount on a microscope eyepiece, and it was definitely less clear than this example.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Camera focus distance and macro lenses

Fri May 17, 2013 9:42 pm

jbeale wrote:That looks like a nice clear view through the microscope, thanks for posting that! At work a few years ago, somebody bought a small video camera that was designed to mount on a microscope eyepiece, and it was definitely less clear than this example.
Yes it's good isn't it? Gives me silly ideas about binoculars, SLR camera lenses and all sorts of things. :D
Alex Eames RasPi.TV, RasP.iO

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Camera focus distance and macro lenses

Tue May 21, 2013 3:24 pm

pluggy wrote:Find a pair (or buy a pair - they are very cheap) of +2 or stronger reading glasses, pull one of the lenses out and mount it in front of the camera lens.
I happened to walk past Poundland today and popped in for a look. I saw reading glasses and thought of you. Two pairs mysteriously jumped into my hand and before I knew it I was the proud owner of +2 and +3D reading glasses - enough for several Pi cameras.

Just tried them out - they're seriously good for a quid. They did have +3.5 as well, but I think what I have will do for what I want. I was sceptical, but I think you were right. They seem to be plenty good enough. :D
Alex Eames RasPi.TV, RasP.iO

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: Camera focus distance and macro lenses

Tue May 21, 2013 5:02 pm

Especially since it transpires the stills software is resizing a subset from the middle of the image.

Seriously though, its fixed focus, in phone camera land, that equates to cheap. Poundland reading specs aren't going to degrade the quality by much.

I get stuff like that on-line, the nearest Poundland costs about 10 quid to get to by car, kind of defeats the object. A downside of living in the sticks......
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Camera focus distance and macro lenses

Tue May 21, 2013 5:51 pm

mmm, I'm just wondering if this DIY solution (link) would work

that or i'm seriously considering trying this Iphone type approach (link)

looks like the lenses actually work quite well
dan3008 wrote:Pays your money, takes your choice

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

Re: Camera focus distance and macro lenses

Tue May 21, 2013 6:21 pm

Single front lenses with 2D for cameras are available for about 6 Euro - but they are rather large, starting at 52 mm. But may be the cheapest solution and won't degrade the image quality very much, I think. And if you build a kind of case for it, you may be able to switch between different lenses (4D and 8D also available).

(here, in German: http://www.fotolinsen24.de/nahlinsen/2- ... ptrien.php )
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

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Camera focus distance and macro lenses

Tue May 21, 2013 8:35 pm

gkreidl wrote:Single front lenses with 2D for cameras are available for about 6 Euro - but they are rather large, starting at 52 mm. But may be the cheapest solution and won't degrade the image quality very much, I think. And if you build a kind of case for it, you may be able to switch between different lenses (4D and 8D also available).

(here, in German: http://www.fotolinsen24.de/nahlinsen/2- ... ptrien.php )
Actually I have one of those already. I thought it would be much better than the cheap and nasty plastic reading glasses. The truth is, I can't tell the difference between them. [edit]I could when I viewed them at the same time[/edit] They both make things beautifully sharp close-up, at the expense of some contrast - even the "proper camera" optic.

Actually, scratch that, the camera optic loses less contrast, but the cheap glasses "ain't bad"
Last edited by alexeames on Wed May 22, 2013 8:42 am, edited 2 times in total.
Alex Eames RasPi.TV, RasP.iO

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

Re: Camera focus distance and macro lenses

Tue May 21, 2013 11:53 pm

Generally speaking, the more lens surfaces you have in your optical system, the lower the contrast. You know those olde-time photos that have a sort of misty-dream quality? Part of that is low contrast due to uncoated optics. You can improve things if all your surfaces are AR-coated (anti-reflection). AR coatings are often easily scratched, and they always add cost, so cheap lenses are probably not coated.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Camera focus distance and macro lenses

Wed May 22, 2013 6:31 am

jbeale wrote:Generally speaking, the more lens surfaces you have in your optical system, the lower the contrast. You know those olde-time photos that have a sort of misty-dream quality? Part of that is low contrast due to uncoated optics. You can improve things if all your surfaces are AR-coated (anti-reflection). AR coatings are often easily scratched, and they always add cost, so cheap lenses are probably not coated.
Yes I was thinking last night that it's really doubtful that the £1 reading glasses have any kind of anti-reflective coating. :lol:
Alex Eames RasPi.TV, RasP.iO

Trav
Posts: 20
Joined: Mon Mar 05, 2012 10:02 pm

Re: Camera focus distance and macro lenses

Wed May 22, 2013 8:32 am

If you want a bit more quality, you could use photographic close-up filters. They come in 1, 2, 4 and 10 dioptre strengths and are usually made of optical glass. a set of all 4 can be bought on Amazon for less than £9, though the qualtiy may not be brilliant for that price, but still better than pound land specs.The diameter is usually 50+mm to fit SLR lenses, so the whole raspicam would fit behind one.
For those not into photography and optics, the dioptre value is the reciprical of the focal length in metres, so 1 dioptre is 1m focal length, 2 dioptre 500mm, 4 = 250mm and 10 = 100mm. By putting them in front of a camera lens you shorten the closest focussing point without affecting the focal length too much.
The formula is:
(New closest point) = x/(Dx +1)
where x is the old closest focus point (in metres) and D is the dioptre value of the close up lens.

So, if the current lens gives sharpish focus to 2 foot = 600mm = 0.6m, then with a 10dioptre lens the new closest focus will be:
0.6/((10 x 0.6) + 1) = 0.6/(6+1) = 0.6/7 = .086m = 86mm
or about 3.4 inches with similar sharpness.
(I will leave the calculation for other dioptre values as an exercise for the reader ;) )
Last edited by Trav on Wed May 22, 2013 8:42 am, edited 1 time in total.
1st Batch Model B (256M) running Raspbian, Pibrow case, with RaspiCam.
Model A (256M) running Raspbmc, caseless.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Camera focus distance and macro lenses

Wed May 22, 2013 8:40 am

Got one of those already. :)

It is optically better, but rather large. :lol:

Image
Alex Eames RasPi.TV, RasP.iO

Trav
Posts: 20
Joined: Mon Mar 05, 2012 10:02 pm

Re: Camera focus distance and macro lenses

Wed May 22, 2013 10:29 am

You can get them down to 37mm diameter:
http://www.amazon.co.uk/New-~37MM-Close ... oseup+37mm

Once upon a time you could get even smaller ones, like 32mm, but you would probably only find those at camera collectors' fairs nowadys.
1st Batch Model B (256M) running Raspbian, Pibrow case, with RaspiCam.
Model A (256M) running Raspbmc, caseless.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Camera focus distance and macro lenses

Wed May 22, 2013 11:35 am

Trav wrote:You can get them down to 37mm diameter:
http://www.amazon.co.uk/New-~37MM-Close ... oseup+37mm

Once upon a time you could get even smaller ones, like 32mm, but you would probably only find those at camera collectors' fairs nowadys.
Will they be any good at four for a tenner though? I remember paying a tenner for that 52mm one in the photo at least 15 years ago. The reading glasses are good enough for most things. The loss of contrast isn't that bad.
Alex Eames RasPi.TV, RasP.iO

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

Re: Camera focus distance and macro lenses

Wed May 22, 2013 11:58 am

Too get as little contrast loss as possible you should hack the glasses so you have a small piece and then make a good lens hood to avoid light falling on it as much as possible.

Trav
Posts: 20
Joined: Mon Mar 05, 2012 10:02 pm

Re: Camera focus distance and macro lenses

Wed May 22, 2013 1:06 pm

alexeames wrote: Will they be any good at four for a tenner though? I remember paying a tenner for that 52mm one in the photo at least 15 years ago. The reading glasses are good enough for most things. The loss of contrast isn't that bad.
Well you get what you pay for, but the same applies to £1 plastic spectacles. A glass close up lens should give less distortion at the edge than plastic specs, but then with the tiny raspicam lens, you're only going to be using the centre anyway, so not a problem.

One advantage to the close up lens set is that you could get a threaded mounting ring glued onto your camera box (old filter or stepping ring) and change and combine the lenses to give you 1-7 or 10-17 dioptre combinations, and fit a lens hood, assuming you mount the camera in a box. Goodness knows what the quality would be like through four cheap lenses at 17 dioptre, though!
1st Batch Model B (256M) running Raspbian, Pibrow case, with RaspiCam.
Model A (256M) running Raspbmc, caseless.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2869
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Camera focus distance and macro lenses

Wed May 22, 2013 4:08 pm

Trav wrote:One advantage to the close up lens set is that you could get a threaded mounting ring glued onto your camera box (old filter or stepping ring) and change and combine the lenses to give you 1-7 or 10-17 dioptre combinations, and fit a lens hood, assuming you mount the camera in a box. Goodness knows what the quality would be like through four cheap lenses at 17 dioptre, though!
Yep - I had that thought this afternoon while driving. Make a mount with the right thread on and then the "proper" 52mm slr lenses/filters I already have can be used. That's more in the spirit of Pi - use what you already have (particularly if it's already quite good quality). I have a 52mm circular polariser (and a hood) as well if we ever get any weather bright enough to use it in.

Looks like it'll be cheaper to buy a crappy skylight filter and smash it for the thread than buying a step-ring. :lol:
Alex Eames RasPi.TV, RasP.iO

dan3008
Posts: 1172
Joined: Wed Aug 15, 2012 1:05 pm

Re: Camera focus distance and macro lenses

Wed May 22, 2013 5:58 pm

alexeames wrote: Looks like it'll be cheaper to buy a crappy skylight filter and smash it for the thread than buying a step-ring. :lol:
most certainly will :) http://www.ebay.co.uk/itm/58mm-UV-Prote ... 19db06a374
dan3008 wrote:Pays your money, takes your choice

RaspLogic
Posts: 8
Joined: Thu Mar 14, 2013 1:14 am

Re: Camera focus distance and macro lenses

Wed May 22, 2013 8:55 pm

Here is my 1 usd solution to get a perfect DIY near focus camera.

http://youtu.be/ofnxcjKaNnA

User avatar
cyrano
Posts: 714
Joined: Wed Dec 05, 2012 11:48 pm
Location: Belgium

Re: Camera focus distance and macro lenses

Wed May 22, 2013 9:09 pm

You're way too fast for Youtube. The video is still being processed... :lol:

RaspLogic
Posts: 8
Joined: Thu Mar 14, 2013 1:14 am

Re: Camera focus distance and macro lenses

Wed May 22, 2013 11:06 pm

Now it's ok, sorry :)

HowardP
Posts: 8
Joined: Fri Jun 07, 2013 6:45 pm

Re: Camera focus distance and macro lenses

Fri Jun 07, 2013 7:50 pm

Hi Everyone,

my first post - already glad to see how helpful people are here!

Thanks so much for this and related posts about focal length. I lack enough experience at this point to figure out what len(s) are needed to take still shots at about 4 cm away +/- 1 cm. The subject will not be moving. What would be the cheapest way to get that close ? Understood quality is always a factor. ... as in no color fringing, but a little blur on the outside ring would be OK. I'd say similar to what RaspLogic achieved, but a bit closer. I don't have the cam. yet ... soon ... would those cheap +2 lens work, or how about a cheap magnifying glass(**) ?
RaspLogic wrote:Here is my 1 usd solution to get a perfect DIY near focus camera.
http://youtu.be/ofnxcjKaNnA
Hi RaspLogic, thanks ! And I'd like to second the comment posted over on your youtube video: "where DID you get that $1 lens ?" 8-)

(**) BTW - at a store where I work, we have those old-style magnifying lenses --- you know, the ones with a handle on a ring --- in 3 sizes for about USD $1 to 1.50 each ... I can get tons of them, if that would be helpful to anyone interested.

- Howard
in North Florida

@my fellow Floridians: maybe we need some KeyLime to go with our Raspberries ? :roll: :lol:

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

Re: Camera focus distance and macro lenses

Fri Jun 07, 2013 8:20 pm

Despite their name "All Electronics" in the US also sells various small optics pieces. Right now they have a 73mm diameter +3 diopter lens at two for $1.

http://www.allelectronics.com/make-a-st ... 3.0/1.html
http://www.allelectronics.com/make-a-st ... ics/1.html

Return to “Camera board”