1

I need to write an application that runs on a Raspberry Pi and camera board that listens to a network trigger, then captures an image and sends it back.

I have a lot of C# experience, but never worked with a Raspberry Pi before.

Where should I start? Is there a library for camera stuff?

  • That's a pretty broad question. What kind of camera? What manner of network trigger? What parts of this project are you looking for help/advice with? – maniacyak Dec 12 '13 at 23:50
  • It's the Pi board camera , the 5mp official one. Network trigger - can be anything. An http web request would be simplest ? – Shachar Weis Dec 13 '13 at 3:11
3

Once you've installed the camera and set up the software, the raspistill program will handle the camera details for you.

You can make your remote trigger something as simple as using ssh to launch raspistill:

ssh -l{username} -i{certificate path} {hostname of pi} raspistill  -o - >{output filename}

On a linux client, this command will login to the pi, launch raspistill, and pipe the camera output (the .jpg) back to you. Using a certificate avoids scripting a password (see SSH login without password for an example of how to set up the cert). Syntax will vary, but the same thing can be done with windows ssh clients.

I prefer this method for simple tasks, because it avoids the overhead of running a web server on the pi.

0

There's quite a few recipes included in the docs for my picamera library which happens to include one for capturing images to a network stream, although I should stress the library is written in Python. If you want to stick with C#, it might be worth checking out the official V4L2 driver and something like OpenCV?

0

I work with C# myself. I haven't played with camera capture, but other sorts of hardware. You can install MONO (opensource version of .NET incase you didnt know) and then you can make your application in C#.

You can either write the application on a "bigger" platform using MonoDeveloper (Visualstudio kinda thing) or you can just use command line compiling directly on the PI. I havent done the latter, as my hardware was only USB driven so I just developed directly on Windows and tested as far as I could.

It's not the "complete solution" to your answer, I am afraid, but... look for "install MONO on raspberry pi"... that ought to get you started.

NOTE Just researched a bit. It looks like it's installed with a driver on the Raspberry PI, so you might just be able to execute the commandline interface in a console kinda behaviour.

Anyways, found some docs: http://www.element14.com/community/servlet/JiveServlet/downloadBody/54413-102-1-273177/Unofficial%20guide%20to%20getting%20up%20and%20running%20with%20the%20Raspberry%20Pi%20Camera.pdf

on this page: http://www.adafruit.com/products/1367

Directly copy/paste from the last pages in the PDF

Once your Raspberry Pi computer has rebooted, you can login again and run the camera software to take photographs or record video.

  1. Online help (gives you all of the command-line options available)

    pi@raspberrypi ~ $ /opt/vc/bin/raspicam

  2. Taking a simple photograph

    pi@raspberrypi ~ $ /opt/vc/bin/raspicam –o file.jpg

  3. Recording a simple video

    pi@raspberrypi ~ $ /opt/vc/bin/raspivid –o file.h264

    Please note that when recording video the camera module will not record any sound – this unit will only capture HD video images only.

  4. Taking some time lapsed images (in this case the images are 30ms apart)

    pi@raspberrypi ~ $ /opt/vc/bin/raspicam –tl 30 –o file%d.jpg

    Note the filename – the %d will be replaced with an integer (creating file1.jpg, file2.jpg etc).

    This software will continue taking images until you press ‘CTRL-C’ to terminate the program.

  5. Using the image effects when taking photographs or capturing video This command will take a picture in ‘negative’ pi@raspberrypi ~ $ /opt/vc/bin/raspicam –ifx negative –o negative_image.jpg

    For a full list of image effects when taking photographs type:

    pi@raspberrypi ~ $ /opt/vc/bin/raspicam

    To read the help screen and all available command line options.

    For a full list of image effects when recording video type:

    pi@raspberrypi ~ $ /opt/vc/bin/raspivid

    To read the help screen and all available command line options.

OR IF YOU CAN PROGRAM C/C++

http://robotblogging.blogspot.dk/2013/10/an-efficient-and-simple-c-api-for.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.