Tag Archives: camera

OTTO: A hackable camera powered by Raspberry Pi

via Raspberry Pi

One of our goals in launching the Raspberry Pi Compute Module was to provide people with a way to take products they’ve prototyped with the Raspberry Pi and bring them to market quickly and easily. We know that historically there have been a lot of people out there with great ideas for electronic products that they can’t afford to produce economically, even with the help of crowdfunding, so we were very pleased to hear from Dave Rauchwerk and friends about their Kickstarter campaign for a hackable point-and-shoot camera based on the Compute Module.

OTTO and compute module

OTTO and compute module

We can’t wait to see how this one turns out, and hope it’s the first of many appearances of the Compute Module on Kickstarter.

Build an Arduino Yún powered cat camera

via Arduino Blog

Arduino Yun

Hotte submitted to our blog a tutorial to monitor his 2 little cats in their favorite spots when he’s  at work:

This is a very, very small project that shows just how to build an Arduino Yún powered Camera application: It grabs photos from an USB camera connected to the Yún, saves them periodically on a uSD card and uploads them to a web host where a gallery is automatically created based upon the number of images in the upload folder. This project might be for interest for people that are just getting started with the Yún and want to explore more of its capabilities…

Every 5 minutes the Arduino Yún grabs pictures from a connected USB Webcam and saves it on its micro-SD card. From there the newest photo gets uploaded automatically to this webspace here where a little script transforms all the pictures in one folder to a photo gallery. The optional step adds an PIR motion sensor to get a snapshot if anything moves.

In three simple steps and the help of MJPEG Streamer library for openWRT,  you can set it up following the tutorial on this page . And here’s an example of the output:

cat

 

OpenMV: The Camera For Your Next Project

via Hack a Day» hardware

Camera

Last month we saw [Ibrahim] tackle the lack of cheap, high speed, high resolution serial cameras with full force. He designed a serial camera based on the STM32F4 microcontroller that’s the perfect solution to anyone wanting to add visual processing or machine vision to a project. It’s cheap, too: instead of the $100 or so you’d spend on a high-end serial camera, [Ibrahim]‘s version only has about $15 in parts.

Now he’s back at it again, with 25 FPS face detection, 30 FPS color detection, a new board with a micro SD socket, and support for USB OTG full speed. [Ibrahim] has been hard at work deep in the bowels of the STM32F4 micro, playing around with the core coupled memory. This allows for some very fast image processing, combined with the micro running at 168 MHz makes for very fast face and color detection.

As for a few benchmarks for this camera, the maximum resolution is 1280×1024, and at 88×72 resolution this little board can output at 60 FPS. Of course everything is limited by the speed of the serial connection, but there’s a lot of potential in this small serial camera.

No word on how much this board will cost, but [Ibrahim] may be putting a few boards up on Tindie shortly. Here’s to hoping he’ll send us an email telling us when his store is open.


Filed under: hardware

Pi 3D scanner: a DIY body scanner

via Raspberry Pi

The blog’s rather late today but definitely worth the wait we think. It’s an jaw-droppingly brilliant Raspberry Pi-driven 3D scanner by Richard Garsthagen . He used it recently to scan over 200 people at the Groningen Makerfaire with spectacular results:

Richard’s site has details on recent events (including the best party ever: a scanning party) and instructions on how to build your own. It uses 40 Raspberry Pis and cameras but Richard says that he has had impressive results with 12 Pis.

Setting up the scanner. Each of the ‘arms’ has three Pis and cameras mounted top, middle and bottom.

Of course once you’ve been scanned you can be 3D printed:

An early sample taken with 21 cameras. Notice the lettering on the shirt.

There are lots of 3D scanners popping up at the moment. The standout thing about Richard’s build is that the scan is instant—the Pi cameras take simultaneous photos—so there’s no standing still in a ker-ayzee pose whilst lasers or Kinects wibble about doing their thing.

But best of all is that you can build your own 3D scanner and then print yourself. For a science fiction-brewed child of the 70s like myself this is a deeply magical thing and it makes me insanely happy. And just bit overawed.

Guest post #5: Raspberry Pi tutorials for complete beginners

via Raspberry Pi

When Henry asked us for a camera module to write a beginners’ tutorial we knew that he would put it to good use. We weren’t disappointed — keep up the good work Henry, we look forward to seeing more tutorials in future.

My Name is Henry Budden and I am a 13 year old Pi enthusiast. Since the Raspberry Pi came out, I have been very busy programming, tinkering and teaching in all of my spare time. I am the owner of the site www.raspberrypitutorials.yolasite.com. This site is designed to teach computing beginners how to use the raspberry pi to the max! On this site I have tutorials on gaming, printing, and lots more!

Raspberry Pi stuff in the post — happy days!

I set up my site about half a year ago, and I have been very successful, as I have 255 followers at this moment, and about 100 people visit my site each day.

Recently, I received an email from a computing teacher from Jersey. He told me that he was running an after-school club and that he has put a link to my site on the school’s page. This will be used in all of the after-school sessions. I felt pretty proud of myself when I read this!

I have also made a holder / case for my camera module (very kindly donated by the foundation) which you can view on my twitter account [and above], and judge my woodwork skills!

If you wish to contact me for any reason at all, then please do not hesitate. I have a Facebook page  and a Twitter account. I also have a separate email address: raspberrypitutorials@hotmail.com

Thank you very much for taking your time to read my short blog post.

Henry

Zoological Society of London: saving rhinos with the Pi

via Raspberry Pi

We’ve been talking a bit about London Zoo’s efforts with the camera board to set affordable camera traps in Kenya, looking not only for wild animals, but also for poachers. This is incredibly important work; rhinos, elephants and other terribly endangered animals are targeted for their body parts, which fetch large sums in some markets.

This project is one of several up for a £500,000 grant from Google, but to get that grant, they need your help: please go and vote for them this evening on the Google Global Impact Challenge website.

You’ve only got a few hours left to vote, so please get clicking!

Camera board available for sale!

via Raspberry Pi

The camera boards are now available for order! You can buy one from RS Components or from Premier Farnell/Element14. We’ve been very grateful for your patience as we’ve tweaked and refined things; it’d have been good to get the camera board out to you last month, but we wanted your experience to be as good as possible, and we’ve been working on the software right up until last night. Thank you to Gordon and Rob at Raspberry Pi and to Dom Cobley for their work on the firmware (Rob also worked on the documentation); to JamesH for his work on the software; to the Broadcom Cambridge ISP team, particularly David Plowman and Naush Patuck, for volunteering to help with tuning; to Bruce Gentles at Broadcom for his volunteering to help with some of the initial bring-up; to James Adams at Raspberry Pi for running the hardware project, and everybody at Sony Pencoed for making it happen.

Tehzeeb Gunza at OmniVision coordinated things from their end, and helped us with sensor selection. Thanks also to Gert van Loo and Rob Gwynne for their work on the hardware design. (And thank you to Broadcom for letting us take advantage of your team’s willingness to volunteer for us!) This, for the curious, is the camera lab we’ve been borrowing from Broadcom for testing. The mannequin’s name is Veronica. She’s lousy company. The room gives us a calibrated and fixed target to use during tuning; it’s designed to be filled with examples of the sorts of things people tend to take pictures of. Which makes it a kind of creepy place to hang out. Between this and anechoic chambers, we’re getting the full range of testing chambers that give us the shivers.

Click to enlarge. You might be interested to learn that this was snapped with a Nokia N8, which uses an earlier version of the imaging core that’s in the Raspberry Pi (but a different sensor and optics).

For such a small device, this has been an enormous project, and a year-long effort for everybody involved. We’re pretty proud of it: we hope you like it!

How to set up the camera hardware

Please note that the camera can be damaged by static electricity. Before removing the camera from its grey anti-static bag, please make sure you have discharged yourself by touching an earthed object (e.g. a radiator or water tap).

The flex cable inserts into the connector situated between the Ethernet and HDMI ports, with the silver connectors facing the HDMI port. The flex cable connector should be opened by pulling the tabs on the top of the connector upwards then towards the Ethernet port. The flex cable should be inserted firmly into the connector, with care taken not to bend the flex at too acute an angle. The top part of the connector should then be pushed towards the HDMI connector and down, while the flex cable is held in place. (Please view the video above to watch the cable being inserted.)

The camera may come with a small piece of translucent blue plastic film covering the lens. This is only present to protect the lens while it is being mailed to you, and needs to be removed by gently peeling it off.

How to enable camera support in Raspbian

Boot up the Pi and log in. The default username is pi, and the default password is raspberry. (Note: if you have changed these from the default then you will need to supply your own user/password details).

Run the following commands in a terminal to upgrade the Raspberry Pi firmware to the latest version:

sudo apt-get update

Click to enlarge

sudo apt-get upgrade

Click to enlarge

Access the configuration settings for the Pi by running the following command:

sudo raspi-config

Navigate to “camera” and select “enable”.

Click to enlarge

Click to enlarge

Select “Finish” and reboot.

Click to enlarge

How to use the Raspberry Pi camera software

raspivid is a command line application that allows you to capture video with the camera module, while the application raspistill allows you to capture images.

-o or –output specifies the output filename and -t or –timeout specifies the amount of time that the preview will be displayed in milliseconds. Note that this set to 5s by default and that raspistill will capture the final frame of the preview period.

-d or –demo runs the demo mode that will cycle through the various image effects that are available.

Example commands

Capture an image in jpeg format:

raspistill -o image.jpg

Capture a 5s video in h264 format:

raspivid -o video.h264

Capture a 10s video:

raspivid -o video.h264 -t 10000

Capture a 10s video in demo mode:

raspivid -o video.h264 -t 10000 -d

To see a list of possible options for running raspivid or raspistill, you can run:

raspivid | less

raspistill | less

Use the arrow keys to scroll and type q to exit.

Extended documentation is available.

Note that we recommend that you change SSH password if you are using a camera, in order to prevent unwanted access.

How to stream video from the Raspberry Pi camera over a network

To view the feed on Linux

Install the dependencies by running the following in a terminal:

sudo apt-get install mplayer netcat

Find your IP address by running ifconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Run the following command in a terminal to view the feed using MPlayer:

nc -l -p 5001 | mplayer -fps 31 -cache 1024 -

To view the feed on Windows

Install and run Linux instead.

Find your IP address by running ipconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Download MPlayer.

Download Netcat.

Note that your browser may complain that these files are malicious, as they are unsigned executables.

Press the Windows key and the ‘r’ key simultaneously to bring up the “Run” dialog. Enter cmd.exe into the dialog and press enter/return to open a DOS prompt.

Enter the following command at the prompt to view the feed using MPlayer:

[Path to nc.exe]\nc.exe -L -p 5001 | [Path to mplayer.exe]\mplayer.exe -fps 31 -cache 1024 -

To view the feed on OS X

Download MPlayer.

Alternatively, you can download mplayer using Brew, which we recommend.

Find your IP address by running ifconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Run the following command in Terminal to view the feed using MPlayer:

nc -l -p 5001 | mplayer -fps 31 -cache 1024 -

To view the feed on a Raspberry Pi:

Find your IP address by running ifconfig. (Your IP address will be listed in the console output and will probably be of the form 192.168.1.XXX).

Run the following commands in a terminal on the receiving Pi:

mkfifo buffer

nc -p 5001 -l > buffer | /opt/vc/src/hello_pi/hello_video/hello_video.bin buffer

To transmit the feed from the Pi with camera module attached

After setting up the “receiving” machine as per the instructions above, run the following commands in a terminal on the “transmitting” Pi:

raspivid -t 999999 -o – | nc [insert the IP address of the client] 5001

You can then use the commands listed in the “How to use the Raspberry Pi camera software” section above to change the capture time or to add a video effect.

How to submit bug reports or see the source code

You can see the source code and submit bug reports for raspivid and raspicam here.

A real thermal imaging camera for $300

via Hack a Day» hardware

mu_crosshair

If you want to check your house for hot air leaks, take pictures of the heat coming off a rack of equipment, or just chase the most dangerous animal, [Arnie], through the jungles of central america, a thermal imaging camera is your friend. These devices normally cost a few thousand dollars, but the team behind the Mu Thermal Camera managed to get the price down to about $300.

The basic idea behind the Mu Thermal Camera is overlaying the output of an infrared thermopile – basically, an infrared camera – on top of the video feed of a smart phone’s camera. This is an approach we’ve seen before and something that has even been turned into a successful Kickstarter. These previous incarnations suffered from terrible resolution, though; just 16×4 pixels for the infrared camera. The Mu thermal camera, on the other hand, has 160×120 pixels of resolution. That’s the same resolution as this $2500 Fluke IR camera. After the indiegogo campaign is over, the Mu camera will eventually sell for $325.

We have no idea how the folks behind the Mu camera were able to create a thermal imaging with such exceptional resolution at this price point. The good news is the team will be open sourcing the Mu camera after their indiegogo run is over. W’e'd love to see those docs now, if only to figure out how a thousand dollars of infrared sensor is crammed into a $300 device.


Filed under: hardware, kickstarter

Streaming Your Webcam w/ Raspberry Pi

via Wolf Paulus » Embedded

[Last updated on Feb. 2. 2013 for (2012-12-16-wheezy-raspbian) Kernel Version 3.2.27+]

Three years ago, we bought two small Webcams and since we wanted to use them on Linux and OS X, we went with the UVC and Mac compatible Creative LIVE! CAM Video IM Ultra. This Webcam (Model VF0415) has a high-resolution sensor that lets you take 5.0-megapixel pictures and record videos at up to 1.3-megapixel; supported resolutions include 640×480, 1290×720, and 1280×960. If you like, you can go back and read what I was thinking about the IM Ultra, back in 2009. Today, it’s not much used anymore, but may just be the right accessory for a Raspberry Pi.

With the USB Camera attached to the Raspi, lsusb returns something like this:

lsusb

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Bus 001 Device 005: ID 041e:4071 Creative Technology, Ltd

Using the current Raspbian “wheezy” distribution (Kernel 3.2.27+), one can find the following related packages, ready for deployment:

  • luvcview, a camera viewer for UVC based webcams, which includes an mjpeg decoder and is able to save the video stream as an AVI file.
  • uvccapture, which can capture an image (JPEG) from a USB webcam at a specified interval

While these might be great tools, mpeg-streamer looks like a more complete, one-stop-shop kind-of solution.

Get the mpeg-streamer source code

Either install Subversion (svn) on the Raspberry Pi or use svn installed on your Mac or PC, to get the source-code before using Secure Copy (scp) to copy it over to your Raspi.

Here, I’m using svn, which is already installed on the Mac, before copying the files over to my Raspi, (username pi, hostname is phobos)

cd ~
mkdir tmp
cd tmp
svn co https://mjpg-streamer.svn.sourceforge.net/svnroot/mjpg-streamer mjpg-streamer
scp -r ./mjpg-streamer pi@phobos:mjpg-streamer

Please note: Looks like the repo got recently moved, Try this to check-out the code if the previous step does not work:

svn co https://svn.code.sf.net/p/mjpg-streamer/code/mjpg-streamer/ mjpg-streamer

Over on the Raspi, I tried to make the project, but quickly ran into error messages, hinting at a missing library.

ssh pi@phobos
cd mjpg-streamer/mjpg-streamer
make
...
jpeg_utils.c:27:21: fatal error: jpeglib.h: No such file or directory, compilation terminated.
make[1]: *** [jpeg_utils.lo] Error 1

After finding out, which libraries were available (apt-cache search libjpeg), I installed libjpeg8-dev like so: sudo apt-get install libjpeg8-dev. This time, I got a lot further, before hitting the next build error:


make
...
make[1]: *** [pictures/640x480_1.jpg] Error 127
make[1]: Leaving directory `/home/pi/mjpg-streamer/mjpg-streamer/plugins/input_testpicture'

After some google-ing, which resulted in installing ImageMagick like so: sudo apt-get install imagemagick, the next build attempt looked much more promissing:

make
..

and ls -lt shows the newly built files on top:

-rwxr-xr-x 1 pi pi 13909 Sep 8 07:51 input_file.so
-rwxr-xr-x 1 pi pi 168454 Sep 8 07:51 input_testpicture.so
-rwxr-xr-x 1 pi pi 31840 Sep 8 07:50 output_http.so
-rwxr-xr-x 1 pi pi 14196 Sep 8 07:50 output_udp.so
-rwxr-xr-x 1 pi pi 19747 Sep 8 07:50 output_file.so
-rwxr-xr-x 1 pi pi 29729 Sep 8 07:50 input_uvc.so
-rwxr-xr-x 1 pi pi 15287 Sep 8 07:50 mjpg_streamer
-rw-r--r-- 1 pi pi 1764 Sep 8 07:50 utils.o
-rw-r--r-- 1 pi pi 9904 Sep 8 07:50 mjpg_streamer.o

MJPG-streamer

MJPG-streamer is a command line tool to stream JPEG files over an IP-based network. MJPG-streamer relies on input- and output-plugins, e.g. an input-plugin to copy JPEG images to a globally accessible memory location, while an output-plugin, like output_http.so, processes the images, e.g. serve a single JPEG file (provided by the input plugin), or streams them according to existing mpeg standards.

Therefore, the important files that were built in the previous step are:

  • mjpg_streamer – command line tool that copies JPGs from a single input plugin to one or more output plugins.
  • input_uvc.so – captures such JPG frames from a connected webcam. (Stream up to 960×720 pixel large images from your webcam at a high frame rate (>= 15 fps) with little CPU load.
  • output_http.so – HTTP 1.0 webserver, serves a single JPEG file of the input plugin, or streams them according to M-JPEG standard.

Starting the Webcam Server

A simple launch command would look like this:
./mjpg_streamer -i "./input_uvc.so" -o "./output_http.so -w ./www"

MJPG Streamer Version: svn rev:
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 640 x 480
i: Frames Per Second.: 5
i: Format…………: MJPEG
o: HTTP TCP port…..: 8080
o: username:password.: disabled
o: commands……….: enabled

Open a Webbrowser on another computer on the LAN and open this url: http://{name or IP-address of the Raspi}:8080

However, experimenting with the resolution and frame rate parameters is well worth it and can improved the outcome.

UVC Webcam Grabber Parameters

The following parameters can be passed to this plugin:

-d video device to open (your camera)
-r the resolution of the video device,
can be one of the following strings:
QSIF QCIF CGA QVGA CIF VGA SVGA XGA SXGA
or a custom value like: 640×480
-f frames per second
-y enable YUYV format and disable MJPEG mode
-q JPEG compression quality in percent
(activates YUYV format, disables MJPEG)
-m drop frames smaller then this limit, useful
if the webcam produces small-sized garbage frames
may happen under low light conditions
-n do not initalize dynctrls of Linux-UVC driver
-l switch the LED “on”, “off”, let it “blink” or leave
it up to the driver using the value “auto”

HTTP Output Parameters

The following parameters can be passed to this plugin:

-w folder that contains webpages in flat hierarchy (no subfolders)
-p TCP port for this HTTP server
-c ask for “username:password” on connect
-n disable execution of commands

I have seen some good results with this
./mjpg_streamer -i "./input_uvc.so -n -f 15 -r 640x480" -o "./output_http.so -n -w ./www"
but even a much higher resolution didn’t impact the actually observed frame-rate all that much:
./mjpg_streamer -i "./input_uvc.so -n -f 15 -r 1280x960" -o "./output_http.so -n -w ./www"

MJPG Streamer Version: svn rev:
i: Using V4L2 device.: /dev/video0
i: Desired Resolution: 1280 x 960
i: Frames Per Second.: 15
i: Format…………: MJPEG
o: www-folder-path…: ./www/
o: HTTP TCP port…..: 8080
o: username:password.: disabled
o: commands……….: disabled

Webcam Stream Clients

The included Website (http://{name or IP-address of the Raspi}:8080) shows examples for how to connect a client to the Webcam stream. The easiest way is obviously a simple HTML page that works great with Google Chrome and Firefox but not so much with Safari. Anyways, it’s important to specify the width and height that was configured with the output_http.so, in the HTML as well


  <img alt="" src="http://phobos:8080/?action=stream" width="1280" height="960" />

Raspberry Pi Webcam Streamer

Taking the Raspberry Pi Web Stream Server Outside

This is the Raspberry Pi powered by a 5VDC, 700mA battery, with an (Edimax EW-7811Un) USB-WiFi Adapter and the Creative LIVE! CAM Video IM Ultra connected.

Video Lan Client for Viewing and Recording

Using Video Lan Client, you can view and also record the video stream, served by the Raspi.

Recorded Webcam Streamer

Movie, streamed from a Raspberry Pi

Raspberry Pi Webcam from Tech Casita Productions on Vimeo.

Let me know what Webcam software you found that works well on the Raspberry Pi.