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

Re: Foundation Camera Board information

Wed Mar 27, 2013 8:37 am

RaTTuS wrote:
poing wrote:.... Guess I'll have to buy two and use a hacksaw on one of them :D
Scalpel !
Having spoken to the Omnivision people, getting it apart may be almost impossible.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 8:38 am

fastmapper wrote:I'm very interested in the camera board, but I do have some questions.

I've seen the question asked several times before, but I haven't seen it answered: what is the camera focal length? I need to know in order to determine what resolution and field of view I can expect from photos collected by the camera.

I am also interested to know: will the ARM processor have access to camera timing signals such as vertical sync or horizontal reference?
No access to the timing signals as far as I know.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 8:42 am

JDWraspberryPi wrote:I would like to suggest command-line software that would open a file, capture video data from the Foundation Camera Board, write the data to the file, and close the file after receiving a termination signal. This method would would allow the user to interactively stop the video capture at any arbitrary time after starting the capture. A user-interactive session might look like the following example:

Code: Select all

$ vcap video.mp4 &
$ kill `ps | grep "grep" --invert-match | grep "vcap.sh video.mp4" | head -n 1 | awk '{print $1}'`;
Here "$ " represents a Linux command prompt, "vcap" is the name of the command, and "video.mp4" is the name of the file. The user would execute the first command to begin the video capture, wait for some time, and then execute the second command to end the video capture. The big deal here is that the software gives the user control over when to stop the video capture. Unfortunately, some command-line, video-capture commands do not provide the user with this capability.

This method would also allow the user to non-interactively stop the video capture after a predetermined time using a shell script like the following:

Code: Select all

#!/bin/bash
vcap $1 &
sleep $2 
kill `ps | grep "grep" --invert-match | grep "vcap.sh video.mp4" | head -n 1 | awk '{print $1}'`;
With this script the user could capture video to a file for a specified time interval by entering the following commands at a Linux prompt:

Code: Select all

$ chmod +x vcap.sh
$ vcap.sh video.mp4 60 &
Here "vcap.sh" is the name of the shell script, "video.mp4" is the name of the file, and "60" is the number of seconds in the specified time interval.

The vcap program would trap the termination signal, close the video-capture file, and exit gracefully. Alternatively, the program could achieve the same functionality by monitoring a file. When the user or a shell script modified that file in a predetermined way then the program would treat that as a termination signal, close the video-capture file, and exit gracefully. Of course the video-capture program could also write to stdout and the user could redirect the output to a file using a command like the following:

Code: Select all

$ vcap > video.mp4 &
This last method would give the user even more control and greater modularity for software developers. For instance the user could pipe the data through a "transcoder" program before saving it to the file.

Code: Select all

$ vcap | transcoder > video.mp4 &
Then any number of people could work on different transcoders without touching the code for the video-capture program. In the last example I am not sure how the transcoder would identify which bits of information were part of the data and which bits of information were part of the wrapper but this method would work well if it were actually possible.
The video app allows you to specify the amount of time the recording is to run for, and I think if you ctrl- C is will leave a readable stream. If it doesn't the source is/will be available so you can modify it yourself - I've tried to make the code as clear as possible to it should be an easy job.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 9:15 am

jamesh wrote:
RaTTuS wrote:
poing wrote:.... Guess I'll have to buy two and use a hacksaw on one of them :D
Scalpel !
Having spoken to the Omnivision people, getting it apart may be almost impossible.
I was thinking of carefully sanding it until the lens is gone. Surely there needs to be some air between the back of the lens and the sensor?

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 12:31 pm

@jamesh:

There is one information I could not find anywhere: What is the MOD (minimum object distance) of the camera lens and how large ist the imaging area at minimum distance?

And another question: does the camera software allow to set white point and black point before taking an image?
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
jbeale
Posts: 3474
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Foundation Camera Board information

Wed Mar 27, 2013 4:41 pm

I don't know the focal length, MOD or magnification ratio, maybe a beta tester with a camera can measure it. All I know is it is a fixed-focus (and I assume fixed-aperture?) lens. Of course, as with any other camera, nothing prevents you from adding another lens in front to have a shorter focal length, with higher magnification and smaller depth of field.

I don't have a R-Pi camera, but trying just now with my cellphone camera (Samsung "Galaxy Ace" GT-S5830L) in the close-focus/macro setting, I see a field of view at the focal plane of 45 mm across (distance to lens ~ 50 mm). Putting a small 10x loupe* in front of the lens, the field of view drops down to 17 mm, so that auxiliary lens gives me an image that is expanded by 2.6x

*10x Bausch & Lomb Hastings Triplet, this one: http://www.edmundoptics.com/microscopy/ ... lets/30344

gordon77
Posts: 4110
Joined: Sun Aug 05, 2012 3:12 pm

Re: Foundation Camera Board information

Wed Mar 27, 2013 5:04 pm

jamesh wrote:
RaTTuS wrote:
poing wrote:.... Guess I'll have to buy two and use a hacksaw on one of them :D
Scalpel !
Having spoken to the Omnivision people, getting it apart may be almost impossible.
That sounds a disappointing if the lens can't be removed, I wanted to mount it without lens on a telescope for auto guiding.

Will there be the facility to use it with python, eg pygame.camera, or calling something like fswebcam from python to capture a single snapshot ?

Gordon77

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 5:08 pm

gordon77 wrote:
jamesh wrote:
RaTTuS wrote: Scalpel !
Having spoken to the Omnivision people, getting it apart may be almost impossible.
That sounds a disappointing if the lens can't be removed, I wanted to mount it without lens on a telescope for auto guiding.

Will there be the facility to use it with python, eg pygame.camera, or calling something like fswebcam from python to capture a single snapshot ?

Gordon77
We've always said it had a fixed lens...

The command line apps are all written in C, but it would be pretty simply to make a Python wrapper for them (on my list of stuff to do). I've tried to make the C apps as simple as possible, so any half competent programmer should be able to figure out how they work (I've also well commented the code). I'd expect a whole bunch of libraries to get written as soon as the code is out there.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 5:10 pm

jbeale wrote:I don't know the focal length, MOD or magnification ratio, maybe a beta tester with a camera can measure it. All I know is it is a fixed-focus (and I assume fixed-aperture?) lens. Of course, as with any other camera, nothing prevents you from adding another lens in front to have a shorter focal length, with higher magnification and smaller depth of field.

I don't have a R-Pi camera, but trying just now with my cellphone camera (Samsung "Galaxy Ace" GT-S5830L) in the close-focus/macro setting, I see a field of view at the focal plane of 45 mm across (distance to lens ~ 50 mm). Putting a small 10x loupe* in front of the lens, the field of view drops down to 17 mm, so that auxiliary lens gives me an image that is expanded by 2.6x

*10x Bausch & Lomb Hastings Triplet, this one: http://www.edmundoptics.com/microscopy/ ... lets/30344
Just tried a 7x loupe on the Raspi camera and it did magnify and allow much closer focussing.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

gordon77
Posts: 4110
Joined: Sun Aug 05, 2012 3:12 pm

Re: Foundation Camera Board information

Wed Mar 27, 2013 5:11 pm

Thanks for the info.

There's fixed and fixed ;)

Gordon77

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 5:16 pm

gordon77 wrote:That sounds a disappointing if the lens can't be removed, I wanted to mount it without lens on a telescope for auto guiding.
You might be able to mount the whole (unmodified) camera behind the eyepiece of a small finderscope. Exactly like doing afocal photography. With a bit of fiddling, that might give both the magnification and the focus necessary for autoguiding... at a guess...

User avatar
MattHawkinsUK
Posts: 538
Joined: Tue Jan 10, 2012 8:48 pm
Location: UK
Contact: Website

Re: Foundation Camera Board information

Wed Mar 27, 2013 5:29 pm

I saw the camera module at the Bristol Maker Faire. I wish I paid more attention to it but I had a choice of the camera or talking to Liz :D

jamesh, your efforts are much appreciated.
My Raspberry Pi blog and home of the BerryClip Add-on board : http://www.raspberrypi-spy.co.uk/
Follow me on Google+, Facebook, Pinterest and Twitter (@RPiSpy)

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 6:42 pm

MattHawkinsUK wrote:I saw the camera module at the Bristol Maker Faire. I wish I paid more attention to it but I had a choice of the camera or talking to Liz :D

jamesh, your efforts are much appreciated.
No doubt Liz was better looking. :D

If it takes stills with a believable colour balance and good clarity at the resolution of the camera module it'll do me. I've stuck old reading glasses lenses over webcams own lenses to make them do close ups.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 8:06 pm

For what it's worth, here is an example showing the difference between my cell phone camera unaided, and with a small external lens having focal length = 25mm (labelled as "10x loupe").
better resolution image here: https://picasaweb.google.com/lh/photo/W ... directlink
2013-03-27-Loupe-Test-004.jpg
2013-03-27-Loupe-Test-004.jpg (57.32 KiB) Viewed 10770 times

User avatar
recantha2
Posts: 280
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Foundation Camera Board information

Wed Mar 27, 2013 9:13 pm

I've written a PHP wrapper with a little interface to just call the raspicam and raspivid scripts, so I doubt a Python wrapper would take very long.

The pictures the camera takes have _very_ good colour, easily up there with the kind of quality you get from a Samsung phone camera.
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 9:25 pm

recantha2 wrote: The pictures the camera takes have _very_ good colour, easily up there with the kind of quality you get from a Samsung phone camera.
What an amazing coincidence....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5201
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

Re: Foundation Camera Board information

Wed Mar 27, 2013 9:27 pm

jamesh wrote:
recantha2 wrote: The pictures the camera takes have _very_ good colour, easily up there with the kind of quality you get from a Samsung phone camera.
What an amazing coincidence....
Eben and I are falling about laughing. Thanks both!
Director of Communications, Raspberry Pi

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

Re: Foundation Camera Board information

Wed Mar 27, 2013 9:29 pm

I really need to get in to the lab and take some decent controlled pictures, but time is against me (I have to do some proper work)...if I have time I'l attempt something tomorrow, but it's a busy day.

Just for those interested, I just added a time-lapse option for stills capture to the camera app. It's a bit power hungry though as the camera is left on between shots. OK if you are on mains power, not so good on batteries. Thought it might make a decent security camera thing, although the 2fps mode in video is pretty good for that as well and actually give better compression at low bit rates.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Foundation Camera Board information

Thu Mar 28, 2013 12:48 am

mh ,,, I'm still asking for a very simple information, which you can get for any camera lens; minimum object distance and focal lenght. Someone at the foundation must have the lens specs.
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
recantha2
Posts: 280
Joined: Wed Nov 14, 2012 9:34 am
Location: Potton, Bedfordshire
Contact: Website

Re: Foundation Camera Board information

Thu Mar 28, 2013 6:55 am

liz wrote:
jamesh wrote:
recantha2 wrote: The pictures the camera takes have _very_ good colour, easily up there with the kind of quality you get from a Samsung phone camera.
What an amazing coincidence....
Eben and I are falling about laughing. Thanks both!
Yeah, I was trying to be facetious, but forgot the ;-)
Now I just look a bit stoopid :-D
--
Michael Horne - @recantha
Raspberry Pi blog - http://www.recantha.co.uk/blog

Cambridge Raspberry Jam
Website: http://camjam.me
Facebook: https://www.facebook.com/cambridgeraspberryjam
Follow the Cambridge Raspberry Jam on Twitter - @cambridgejam

gordon77
Posts: 4110
Joined: Sun Aug 05, 2012 3:12 pm

Re: Foundation Camera Board information

Thu Mar 28, 2013 7:07 am

recantha2 wrote:I've written a PHP wrapper with a little interface to just call the raspicam and raspivid scripts, so I doubt a Python wrapper would take very long.

The pictures the camera takes have _very_ good colour, easily up there with the kind of quality you get from a Samsung phone camera.
Hi,

Was this in response to my query about taking a single snapshot from python ?

My project uses python and takes a single snapshot, I use pygame.camera as that's faster than my original method of calling fswebcam to save a picture to /tmp as I can simply put the picture into a string to work on it.

Having the facility to take a single snapshot, at approx 1 per second or faster, and then python work on it would be good.

Gordon77

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

Re: Foundation Camera Board information

Thu Mar 28, 2013 8:52 am

gkreidl wrote:mh ,,, I'm still asking for a very simple information, which you can get for any camera lens; minimum object distance and focal lenght. Someone at the foundation must have the lens specs.
In the opening post of this thread jamesh links to the product sheet of the camera. It says 'optical format 1/4" ' and if you click on the pdf it says "lens size 1/4" '. Whatever that may mean. I wouldn't be surprised if the actual focal length differs slightly between units. As it's a fixed focus lens the "minimum object distance" is "what you still find giving acceptable image quality", which will differ between users.

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

Re: Foundation Camera Board information

Thu Mar 28, 2013 8:57 am

poing wrote:
gkreidl wrote:mh ,,, I'm still asking for a very simple information, which you can get for any camera lens; minimum object distance and focal lenght. Someone at the foundation must have the lens specs.
In the opening post of this thread jamesh links to the product sheet of the camera. It says 'optical format 1/4" ' and if you click on the pdf it says "lens size 1/4" '. Whatever that may mean. I wouldn't be surprised if the actual focal length differs slightly between units. As it's a fixed focus lens the "minimum object distance" is "what you still find giving acceptable image quality", which will differ between users.
In fact that datasheet is all we have to go on. If the spec you want isn't in there, we don't have it.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

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

Re: Foundation Camera Board information

Thu Mar 28, 2013 11:48 am

jamesh wrote:The 2fps mode in video is pretty good for that as well and actually give better compression at low bit rates.
That's what I mentioned earlier to you, right? A video codec exploits redundancies in between frames compared to just storing independent JPGs (i.e., equivalent to MJPG).

So with a video codec you might be able to point the thing at your construction site, dump the H264 files onto the SD card and a year later you can go pick it up and have your building appear.

Would be good to chunk the videos though.

This 2fps thing seems arbitrary, though. Why not even fewer frames per second (or minute, or hour)?

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

Re: Foundation Camera Board information

Thu Mar 28, 2013 11:50 am

JDWraspberryPi wrote:

Code: Select all

$ vcap video.mp4 &
$ kill `ps | grep "grep" --invert-match | grep "vcap.sh video.mp4" | head -n 1 | awk '{print $1}'`;
That a nice pipeline you have there.

Did you ever hear of `pkill`?

And anyway, you'd want to respond to SIGHUP to write out the file.

Return to “Camera board”