User avatar
kimondouk
Posts: 5
Joined: Sat Jul 14, 2012 6:24 pm
Location: London
Contact: Website

Re: Working Fisheye Lens?

Tue Jun 18, 2013 4:02 pm

I've got a couple of different types on order - a metal magnetic one, and a 'jelly' type (both v cheap) - the other sort I might try is the screw in filter type = my Raspberry Pi is sat in a Holga Case:

Image

I think you can get lenses for the Holga that just clip over the lens.

More info on the case here - http://kimondo.co.uk/raspberry-pi-camer ... m-a-holga/ I've had to move to a smaller Wifi adapter that fits inside the case (my home-made right angle usb cable snapped) and there are a few other changes I need to write up.

SpringHalo
Posts: 9
Joined: Mon Jan 23, 2012 7:32 pm

Re: Working Fisheye Lens?

Sat Jun 29, 2013 10:20 pm

jbeale wrote:JamesH did imply that a 1296x972 resolution video mode with the full sensor field of view ( 2x2 binned on-chip) should be possible, when some configuration issues are sorted.
I stumbled on this thread after looking for a way to get more wide-angle video, and that looks like the answer.
jamesh wrote:We do have some work to do here. The 1080p mode uses a 1920x1080 window in the middle of the sensor, so loses a lot top/bottom/left/right. This gives pixel resolution, but looses some FOV. It also means the preview doesn't match the capture. So I need to generate a new camera mode that uses the whole sensor. BUT that cannot run at 30fps, so I need to 2x2 bin the sensor data to get 1296x972, then that will be scaled up to the required preview for capture resolution.
All good clean fun. Currently trying to figure out the timing registers for the sensor.
So the 2x2 binning process can be done within the GPU, but any resizing has to be done outside of that? For instance, to get nice wide 1280x720 video the resolution of 1296x972 would have to be scaled down by the CPU? If it's possible, simply cropping out 8 pixels on each size horizontally and 192 pixels on each side vertically seems like it would be a better use of resources, or even have the GPU cut off 16 and 384 pixels (on the top and bottom) before the binning process to get an even 2x2 bin.

I'm still waiting on the second/third batch of camera boards to be shipped around 7/3 so I can try stuff out, but I'm glad there's been progress made on wide-angle options for the camera module.

Once again, thanks to jamesh for all of the work he's put into this. It's highly appreciated!

valeron
Posts: 9
Joined: Wed Jun 12, 2013 3:38 pm

Re: Working Fisheye Lens?

Wed Jul 03, 2013 8:58 am

I've used an iPhone add on lens with decent results: http://www.youtube.com/watch?v=IPTU8NrVqmQ
See my other videos for comparisons with the stock lens.
Or static image comparison: http://www.flickr.com/photos/[email protected] ... 384996135/

This kit: http://www.amazon.co.uk/Quality-Camera- ... 670&sr=1-8
I paid £6.50 from the UK but can be had for as little as £5 from Hong Kong.
The wide angle and macro are not bad either.

sharix
Posts: 200
Joined: Thu Feb 16, 2012 11:29 am
Location: Slovenia

Re: Working Fisheye Lens?

Thu Jul 04, 2013 10:18 pm

So I bought a fisheye camera to try it with the RPi cam. It's this one: http://www.ebay.com/itm/Fisheye-Lens-18 ... 35c950a915
The pictures taken with it are not sharp, I tried with different spaces between the lenses. Will the sharpness improve if I remove the original lens from the RPi cam?

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

Re: Working Fisheye Lens?

Fri Jul 05, 2013 4:58 pm

It is possible that a wide- or fisheye-adaptor lens (especially a cheap one) is not quite focus-neutral, in other words it relies on the cellphone camera's autofocus to make some small adjustment needed for the whole optical system to work. With the R-Pi camera being a fixed-focus lens, unless you manually focus it (with pliers, etc.) you may have the blur problem, depending on your specific camera and adaptor lens.

Note, these add-on wide-angle or fisheye converter lenses are just that- accessory conversion lenses you add to an existing lens. They do not work to focus the image all by themselves, so you cannot remove the pre-existing lens and have it work.

sharix
Posts: 200
Joined: Thu Feb 16, 2012 11:29 am
Location: Slovenia

Re: Working Fisheye Lens?

Sat Jul 06, 2013 9:44 am

allright, I'll try to adjust the focus of the rpi-cam lens. Now if only I could find that utility calculator of the focus range ...

edit: found it! http://www.raspberrypi.org/phpBB3/viewt ... 43&t=46637

sharix
Posts: 200
Joined: Thu Feb 16, 2012 11:29 am
Location: Slovenia

Re: Working Fisheye Lens?

Sat Jul 06, 2013 11:28 am

Allright, after losing a substantial amount of nerves and patience, I managed to turn the lens by about 45° using only a safety pin and tweezers from a medical kit. Now the picture is completely in focus with the fisheye lens attached. whew!

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

Re: Working Fisheye Lens?

Sat Jul 06, 2013 11:57 am

SpringHalo wrote: So the 2x2 binning process can be done within the GPU, but any resizing has to be done outside of that? For instance, to get nice wide 1280x720 video the resolution of 1296x972 would have to be scaled down by the CPU? If it's possible, simply cropping out 8 pixels on each size horizontally and 192 pixels on each side vertically seems like it would be a better use of resources, or even have the GPU cut off 16 and 384 pixels (on the top and bottom) before the binning process to get an even 2x2 bin.

I'm still waiting on the second/third batch of camera boards to be shipped around 7/3 so I can try stuff out, but I'm glad there's been progress made on wide-angle options for the camera module.

Once again, thanks to jamesh for all of the work he's put into this. It's highly appreciated!
Actually, the sensor itself does some binning, so half the full res comes out of the sensor. This is then scaled up by dedicated HW in the ISP/GPU (No impact on the CPU) to the required resolution. This is all done in real time at 30fps.
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."

mpeter
Posts: 10
Joined: Fri Oct 18, 2013 8:50 pm

Re: Working Fisheye Lens?

Wed Dec 18, 2013 7:46 pm

Hi guys/ Jamesh,

Did we ever get the preview window and capture mismatch issue solved? If not, is there a way to match the stills taken to the preview resolution?

Thanks,
Melinda

ant_thomas
Posts: 115
Joined: Fri May 04, 2012 4:33 pm

Re: Working Fisheye Lens?

Mon Dec 30, 2013 5:47 pm

It looks like this has been gone over already but I bought a very cheap wide angle lens off eBay (http://www.ebay.co.uk/itm/400586870974 - £1.23) that works surprisingly well.

Just to test I stuck one of the metal rings to the Pimoroni camera mount then the lens magnetically attaches to the ring. Picture seems clear, focused and much wider.

Video isn't as nearly as wide. I assume this is because of the video image being cropped rather than full sensor.

dancri77
Posts: 5
Joined: Mon Jan 20, 2014 10:02 pm

Re: Working Fisheye Lens?

Mon Jan 20, 2014 10:09 pm

I have also mounted a fish yen len on my Pi Noir camera and get the blurry image. isn't there any sort of lens I could maybe put before the fish eye ones to correct this?

I have attached a sample small size blurred image, is anyone getting better quality?

Thanks
Attachments
28_drum fata_Cam_2014-01-20_16-11-44.jpg
blurry picture
28_drum fata_Cam_2014-01-20_16-11-44.jpg (8.31 KiB) Viewed 10590 times

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

Re: Working Fisheye Lens?

Tue Jan 21, 2014 12:41 am

dancri77 wrote:I have also mounted a fish eye lens on my Pi Noir camera and get the blurry image...is anyone getting better quality?
Looks like that lens requires your R-Pi camera to be refocused, which is possible to do.

Have a look at my post in this same thread just a few back using a 0.67x wide angle lens. I think it is pretty good quality. I did not need to change the focus for this, it depends which lens you get. http://www.raspberrypi.org/forum/viewto ... 50#p372138

I got this 3-lens kit: http://www.amazon.com/gp/product/B0073C0QSE/ the "fisheye" was blurry, but the 0.67x lens worked well. To make the fisheye lens work I could have adjusted the R-Pi camera lens to compensate, I just didn't bother.

Respectech
Posts: 53
Joined: Sat Sep 29, 2012 12:27 am

Re: Working Fisheye Lens?

Tue Jan 21, 2014 2:02 am

jbeale wrote:
Respectech wrote:The good news is that I found a fisheye lens that works great with the camera module. The bad news is that there are a lot of "mobile phone camera compatible" fisheye lenses that are blurry with the camera module. I tried 5 different fisheye lenses before I found one that works.
Well don't leave us in suspense! Which one works well?
Sorry, I haven't been on the forums for a while. Here is the link to the fisheye lens that works well for me on Amazon.com:

http://www.amazon.com/gp/product/B00AAT ... UTF8&psc=1

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

Re: Working Fisheye Lens?

Tue Jan 21, 2014 2:53 pm

Respectech wrote:Sorry, I haven't been on the forums for a while. Here is the link to the fisheye lens that works well for me on Amazon.com: http://www.amazon.com/gp/product/B00AAT ... UTF8&psc=1
Thanks, I just ordered one! Looks like the shipping delay is pretty uncertain though:

Code: Select all

 Your estimated delivery date is:
Thursday, February 13, 2014 - Tuesday, March 4, 2014 

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

Re: Working Fisheye Lens?

Tue Jan 21, 2014 2:56 pm

He's based in Hong Kong, so that's quite normal.

dancri77
Posts: 5
Joined: Mon Jan 20, 2014 10:02 pm

Re: Working Fisheye Lens?

Tue Jan 21, 2014 8:38 pm

jbeale wrote: Looks like that lens requires your R-Pi camera to be refocused, which is possible to do.

Have a look at my post in this same thread just a few back using a 0.67x wide angle lens. I think it is pretty good quality. I did not need to change the focus for this, it depends which lens you get. http://www.raspberrypi.org/forum/viewto ... 50#p372138

I got this 3-lens kit: http://www.amazon.com/gp/product/B0073C0QSE/ the "fisheye" was blurry, but the 0.67x lens worked well. To make the fisheye lens work I could have adjusted the R-Pi camera lens to compensate, I just didn't bother.
I have actually a similar, if not the same 3 lens kit but ordered from a chinese supplier via ebay (http://www.ebay.co.uk/itm/390676696266? ... 1439.l2649). I took out the fish eye len and put the wide angle set, after a quick test the quality seems much better, will post some pictures soon. However angle is smaller than I wanted, fish eye lens was exactly what I needed. I'm reluctant a bit to change the camera focus as you suggested.

Found one video that shows how to remove the blurry effect (http://www.youtube.com/watch?v=SLogA1a8vPE), however I have not managed to unscrew the fish eye lens set I have, maybe others are lucky.

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

Re: Working Fisheye Lens?

Sun Jan 26, 2014 7:34 am

I got the recommended "180deg Fisheye" from Amazon and, while it is not the last word in quality, it is more-or-less in focus, at least toward the center. It certainly is a fisheye type lens, although not 180 deg. FOV with the RPi, I would say maybe 120 deg. Seems to work best when the back surface is about 2 mm in front of the R-Pi camera lens. The edges become more blurry if you are either closer or farther away. Image taken indoors with Pi-NoIR and the fisheye lens is handheld in front of camera. For about $11, I'd say it's worth it if you need a fisheye.
PiNoir-Fisheye-600.jpg
PiNoir-Fisheye-600.jpg (46.23 KiB) Viewed 10453 times

Maxhdroom
Posts: 13
Joined: Sat Jan 25, 2014 11:22 pm

Re: Working Fisheye Lens?

Sun Jan 26, 2014 12:59 pm

Hi, I'm a Pi noob,
I've seen a GL shader to "remove" fisheye distortion. Can GLSL effects be somehow applied on the stream or does it have to be implemented directly in the raspivid code like the -ifx effects?

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

Re: Working Fisheye Lens?

Tue Jan 28, 2014 6:30 am

This lens has heavy fisheye distortion, I think the image would have to be heavily cropped if you completely un-distorted it and wanted to fit it in a rectangular frame. The border of the full image area mapped into rectilinear space would look like a 4-armed starfish, with very long arms.

The fisheye effect does make for some fun images, though.

Image
Original full-res image at https://picasaweb.google.com/lh/photo/I ... directlink

Maxhdroom
Posts: 13
Joined: Sat Jan 25, 2014 11:22 pm

Re: Working Fisheye Lens?

Tue Jan 28, 2014 12:03 pm

Here's an example with all the math stuff for inquiring minds and a GLSL at the end
http://paulbourke.net/dome/fish2/

I wish raspivid could take a .glsl script file and compile on-the-fly with GPU acceleration. It's already doing this with hardcoded glsl effects in -ifx parameter. Openmax accelerated gstreamer gst-gl-plugins for the Pi would also be awesome, the little ARM cpu can barely stich two SD frames together at 1 fps...

User avatar
chisel
Posts: 1
Joined: Tue Jan 28, 2014 3:16 pm
Location: London, UK
Contact: Website

Re: Working Fisheye Lens?

Tue Jan 28, 2014 3:21 pm

mpeter wrote:Did we ever get the preview window and capture mismatch issue solved? If not, is there a way to match the stills taken to the preview resolution?
I was using the camera module last week for a RaspberryPi/Photo-Booth project - using the latest kernel modules from github - and the camera preview still appears to have the mismatch issue.

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

Re: Working Fisheye Lens?

Tue Jan 28, 2014 3:41 pm

Maxhdroom wrote:Here's an example with all the math stuff for inquiring minds and a GLSL at the end
http://paulbourke.net/dome/fish2/

I wish raspivid could take a .glsl script file and compile on-the-fly with GPU acceleration. It's already doing this with hardcoded glsl effects in -ifx parameter. Openmax accelerated gstreamer gst-gl-plugins for the Pi would also be awesome, the little ARM cpu can barely stich two SD frames together at 1 fps...
The ifx parameters doesn't use GLSL shaders. They are either in ISP HW or in SW stages using the vector unit.
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
jbeale
Posts: 3581
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Working Fisheye Lens?

Tue Jan 28, 2014 8:00 pm

mpeter wrote:Did we ever get the preview window and capture mismatch issue solved? If not, is there a way to match the stills taken to the preview resolution?
If you mean the full sensor field of view, you can get that in the preview by using the '-fp' option to raspistill. The downside is that preview then becomes 15 fps instead of 30 fps, I guess that is why it doesn't default to using this mode. I find it still quite usable even at 15 fps, though.

Code: Select all

-fp --fullpreview : Run the preview using the still capture resoltuion (may reduce fps)

Maxhdroom
Posts: 13
Joined: Sat Jan 25, 2014 11:22 pm

Re: Working Fisheye Lens?

Wed Jan 29, 2014 12:14 am

I looked at the gl_scenes code in raspicam and to a layman like me parts of it looked a lot like ordinary vertex+shader glsl code. :oops:

Jackroom
Posts: 3
Joined: Tue Sep 19, 2017 2:40 am

Re: Working Fisheye Lens?

Wed Oct 11, 2017 2:27 am

ELP Mni fisheye lens working for robot https://youtu.be/ojDRt-MIXf4

Return to “Camera board”