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

Re: Working Fisheye Lens?

Wed May 22, 2013 10:14 am

LeoWhite wrote:
Quasim0ndo wrote:
LeoWhite wrote:
My phone camera lenses arrived today and my lens mount doesn't look quite so good!
Ah sweet! Well, robot arm beats laser for sure.
Hmm, robot arms with lasers maybe? :)
Terminator :D Or a [url = http://theportalwiki.com/wiki/Turrets]turret[/url]
dan3008 wrote:Pays your money, takes your choice

axse
Posts: 7
Joined: Mon May 20, 2013 6:29 am

Re: Working Fisheye Lens?

Wed May 22, 2013 4:07 pm

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.
please jamesh keep in mind that not every one need the preview. I'll prefer so much to set the exposition parameters ad then take image, in order to do that as fast as it possible.
you mentioned 15 frame per second a full resolution it will be TOTALLY AWESOME if raspi will record 15 or even 10 jpg per second.!

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

Re: Working Fisheye Lens?

Wed May 22, 2013 4:21 pm

Well, I certainly didn't expect to see this much activity from my simple question about fisheye lenses.

It sounds like nobody has gotten a fisheye lens working yet, then. Right?

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

Re: Working Fisheye Lens?

Wed May 22, 2013 4:23 pm

I'm glad to hear that the discussion has led to some potential improvements to an already great camera solution!

Ravenous
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK

Re: Working Fisheye Lens?

Wed May 22, 2013 4:26 pm

It sounds like nobody has gotten a fisheye lens working yet, then. Right?
That's what I thought - it went off topic quite quickly :oops: . If you didn't see my earlier post, that link is the only place I've seen an actual wide angle referred to. (And it wasn't a proper fish-eye, but at least indicates a wider angle may be possible.)

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am

Re: Working Fisheye Lens?

Wed May 22, 2013 5:26 pm

Respectech wrote:Well, I certainly didn't expect to see this much activity from my simple question about fisheye lenses.

It sounds like nobody has gotten a fisheye lens working yet, then. Right?
Possibly no better than was originally reported. I've just put the fisheye lens on my camera board here which you can look by playing http://109.145.254.207:8091/streaming/stream.m3u8 in VLC. That's certainly a greater range than the wide angle lens I had on earlier but doesn't look much more than 90 degrees.

I got the lenses from http://www.amazon.co.uk/dp/B006P82R70/

Leo

User avatar
jbeale
Posts: 3928
Joined: Tue Nov 22, 2011 11:51 pm

Re: Working Fisheye Lens?

Wed May 22, 2013 5:29 pm

Note that you will not get full benefit from any fisheye lens until JamesH gets the full sensor field working. It is a 2592 x 1944 pixel "1/4 inch format" (3.67 x 2.74 mm) sensor, but right now we are only seeing a 1920x1080 center crop, so that is using only 74% horizontally and 56% vertically of the actual sensor area. (and it is even less horizontally if you chose a 4:3 aspect ratio, or anything more square than 16:9)

Once we do have full-sensor working, an add-on fisheye designed for 1/4 format lenses ought to work. Some resolution and contrast loss will be unavoidable, as with all add-on lenses. The only way to solve that is to replace the lens alltogether with a 1/4 format fisheye, like this lens (f = 1.1 mm !) http://www.optics-online.com/OOL/DSL/DSL221.PDF or this (f = 1.27 mm) http://www.optics-online.com/OOL/DSL/DSL216.PDF

By the way, so far I have done several different experiments with my R-Pi camera and even have a wireless webcam working right now, and I have not yet even seen or used any kind of preview (only worked command line mode, through TTY serial terminal and SSH). So if preview will be a long time coming, I'd be happy to vote for a full-frame mode right now, regardless of broken or no preview.
Last edited by jbeale on Wed May 22, 2013 5:32 pm, edited 2 times in total.

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

Re: Working Fisheye Lens?

Wed May 22, 2013 5:30 pm

That looks exactly like the lens I am using! Same text along the rim, same ridges, same everything. But mine is blurry no matter how I position it.

Yours isn't blurry?

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am

Re: Working Fisheye Lens?

Wed May 22, 2013 5:52 pm

Respectech wrote:That looks exactly like the lens I am using! Same text along the rim, same ridges, same everything. But mine is blurry no matter how I position it.

Yours isn't blurry?
When I was manually holding it up in front of the lens it did look a little blurry. The distance shot is a bit more pleasing to look at

I've uploaded a captured image to http://www.mybigideas.co.uk/RPi/images/fisheye2.jpg

Image

Leo

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

Re: Working Fisheye Lens?

Wed May 22, 2013 6:03 pm

dan3008 wrote: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

I thought i'd posted it here, but apparently I posted it on another thread about closeups lol

Definatially a set worth looking at :)

When i finally get my new bank card, and all my parts, i'll test it and post the results.
dan3008 wrote:Pays your money, takes your choice

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

Re: Working Fisheye Lens?

Wed May 22, 2013 6:24 pm

axse 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.
please jamesh keep in mind that not every one need the preview. I'll prefer so much to set the exposition parameters ad then take image, in order to do that as fast as it possible.
you mentioned 15 frame per second a full resolution it will be TOTALLY AWESOME if raspi will record 15 or even 10 jpg per second.!
I also have to keep in mind the complete opposite....that people DO want a preview that matches the capture. I have got the full res capture going, but the difference from preview to that is huge which makes the preview fairly pointless.

There's still lots of work to do, and my time is very limited so for some of the more esoteric options people will just have to be patient.

I don't think we can do 15fps at full res btw, the system isn't fast enough. But it's a quick change to the code to try it out, so I am sure someone will be able to say what the max speed is fairly soon. This doesn't rely on GPU code so anyone out there can test it. Just need to pump the JPG output from the encoder to internal buffers rather than SD (a major bottleneck), flag when image is complete, then fire off another capture. Could probably mod the timelapse mode to do that.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

User avatar
jbeale
Posts: 3928
Joined: Tue Nov 22, 2011 11:51 pm

Re: Working Fisheye Lens?

Wed May 22, 2013 6:45 pm

jamesh wrote:There's still lots of work to do, and my time is very limited so for some of the more esoteric options people will just have to be patient.
We need to get you an intern to hold back the press of bug fix and feature requests on the forum, so you can get some coding time! ...although, come to think of it, that's how any normal company operates, and it is amazing to have such direct feedback from people actually doing the work.

Hrabroslav
Posts: 1
Joined: Wed May 22, 2013 7:35 pm

Re: Working Fisheye Lens?

Wed May 22, 2013 8:11 pm

Today I tried a DIY fisheye lens (some lens from the objective of old camera, viewfinder lenses of the same camera and some duct tape).

I should be able to get it in focus but I have to make more stable mount.

http://www.youtube.com/watch?v=n7LkO9RjcEE

Image
Image
Last edited by Hrabroslav on Wed May 22, 2013 9:56 pm, edited 1 time in total.

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

Re: Working Fisheye Lens?

Wed May 22, 2013 9:33 pm

jbeale wrote:
jamesh wrote:There's still lots of work to do, and my time is very limited so for some of the more esoteric options people will just have to be patient.
We need to get you an intern to hold back the press of bug fix and feature requests on the forum, so you can get some coding time! ...although, come to think of it, that's how any normal company operates, and it is amazing to have such direct feedback from people actually doing the work.
I don't actually work for the Foundation (Yes, I do all this for free, although they did give me a T shirt the other day!), I actually work for Broadcom who have let me spend any spare (ha ha) time I have on Raspberry Pi stuff, but most of the app code was done in the evenings. I have to do GPU work whilst at work since I don't have access to source when I'm at home. And of course all the smart people are in the office when I need to ask questions!
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

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

Re: Working Fisheye Lens?

Thu May 23, 2013 4:28 am

jamesh wrote:
jbeale wrote:
jamesh wrote:There's still lots of work to do, and my time is very limited so for some of the more esoteric options people will just have to be patient.
We need to get you an intern to hold back the press of bug fix and feature requests on the forum, so you can get some coding time! ...although, come to think of it, that's how any normal company operates, and it is amazing to have such direct feedback from people actually doing the work.
I don't actually work for the Foundation (Yes, I do all this for free, although they did give me a T shirt the other day!), I actually work for Broadcom who have let me spend any spare (ha ha) time I have on Raspberry Pi stuff, but most of the app code was done in the evenings. I have to do GPU work whilst at work since I don't have access to source when I'm at home. And of course all the smart people are in the office when I need to ask questions!
@jamesh: You work for Broadcom? That is very interesting.

Perhaps you can tell me if it is possible to perform any advanced frame comparisons in the GPU between the capture and the stream compression steps? If so, how does one get the reference information for the functions provided by the videocore?

This is very valuable information for me to know as it will greatly help me in my project!

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

Re: Working Fisheye Lens?

Thu May 23, 2013 6:45 am

There is an option to display the preview after compression if you want to, but not sure that would help with before/after comparison. I think it would be possible in the GPU, but a load of work (needs VPU assembler).
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

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

Re: Working Fisheye Lens?

Thu May 23, 2013 5:06 pm

jamesh wrote:There is an option to display the preview after compression if you want to, but not sure that would help with before/after comparison. I think it would be possible in the GPU, but a load of work (needs VPU assembler).
Is this something possible for an end user to do? I've programmed in machine code before, so I don't think that part would be a problem. The problem is getting the VPU assembler and the necessary reference docs so I would know what features are available and how to access them.

Is that something that would have to come from Broadcom?

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

Re: Working Fisheye Lens?

Thu May 23, 2013 6:50 pm

Respectech wrote:
jamesh wrote:There is an option to display the preview after compression if you want to, but not sure that would help with before/after comparison. I think it would be possible in the GPU, but a load of work (needs VPU assembler).
Is this something possible for an end user to do? I've programmed in machine code before, so I don't think that part would be a problem. The problem is getting the VPU assembler and the necessary reference docs so I would know what features are available and how to access them.

Is that something that would have to come from Broadcom?
Depends. If you want it to work in real time that would require GPU code, which could only be done by the Foundation or Broadcom. If you can cope with a pretty slow rate then you might be able to intercept the data between the camera and the encoder component to grab an uncompressed frame, and grab the data after the encoder to get the compressed one. Then decompress it to compare it with the original. Probably only get a few fps though.
Principal Software Engineer at Raspberry Pi Ltd.
Working in the Applications Team.

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

Re: Working Fisheye Lens?

Thu May 23, 2013 9:18 pm

jamesh wrote:
Respectech wrote:
jamesh wrote:There is an option to display the preview after compression if you want to, but not sure that would help with before/after comparison. I think it would be possible in the GPU, but a load of work (needs VPU assembler).
Is this something possible for an end user to do? I've programmed in machine code before, so I don't think that part would be a problem. The problem is getting the VPU assembler and the necessary reference docs so I would know what features are available and how to access them.

Is that something that would have to come from Broadcom?
Depends. If you want it to work in real time that would require GPU code, which could only be done by the Foundation or Broadcom. If you can cope with a pretty slow rate then you might be able to intercept the data between the camera and the encoder component to grab an uncompressed frame, and grab the data after the encoder to get the compressed one. Then decompress it to compare it with the original. Probably only get a few fps though.
Yes, I wanted to do the processing in the GPU. I already have my test program working at 2fps at low resolution using the CPU, but that's not going to work for my final application.

So the answer is that any GPU coding cannot be done by the end user. Is that because of patents, lack of end-user tools, or something else?

User avatar
jbeale
Posts: 3928
Joined: Tue Nov 22, 2011 11:51 pm

Re: Working Fisheye Lens?

Thu May 23, 2013 11:08 pm

Respectech wrote:So the answer is that any GPU coding cannot be done by the end user. Is that because of patents, lack of end-user tools, or something else?
For what it's worth... http://www.raspberrypi.org/phpBB3/viewt ... 597#p38597

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

Re: Working Fisheye Lens?

Fri May 24, 2013 12:11 am

jbeale wrote:
Respectech wrote:So the answer is that any GPU coding cannot be done by the end user. Is that because of patents, lack of end-user tools, or something else?
For what it's worth... http://www.raspberrypi.org/phpBB3/viewt ... 597#p38597
Can't say I'm surprised, and I do understand the complexities. It's just too bad that there isn't a user-level interface into the GPU API. I don't want to modify the VC4 code, just access the functions that are already there.

User avatar
jbeale
Posts: 3928
Joined: Tue Nov 22, 2011 11:51 pm

Re: Working Fisheye Lens?

Sat May 25, 2013 8:33 pm

If you like wider-angle views, try raspi-update if you haven't since yesterday. Other vendors offer digital zoom, but only the Ras-Pi offers you digital wide angle! :-)
(Sorry about the lousy image quality, I had to use extreme compression due to 65 kB image size limit on this board.)
Old-540.jpg
BEFORE rpi-update
Old-540.jpg (40.37 KiB) Viewed 6269 times
New-full-540.jpg
AFTER rpi-update
New-full-540.jpg (43.97 KiB) Viewed 6269 times

0b1
Posts: 1
Joined: Sun May 26, 2013 8:54 am

Re: Working Fisheye Lens?

Sun May 26, 2013 8:58 am

@ jbeale : How do you enable the digital wide angle? It looks great!

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

Re: Working Fisheye Lens?

Sun May 26, 2013 10:06 am

The digital wide angle, also known as the uncrop function, was a joke. Do rpi-update to get new firmware. Before only the center of the sensor was used for stills, with the new firmware the whole sensor is used.

LeoWhite
Posts: 131
Joined: Mon Apr 08, 2013 9:20 am

Re: Working Fisheye Lens?

Sun May 26, 2013 10:42 am

I've now done a rpi-update and my camera (with fisheye lens attached) has gone from

Image to Image

(Click for full size!)

Return to “Camera board”