1

I've been looking for a library so that I can take pictures on the pi using the pi camera (not a usb webcam). I've tried RaspiCam but that is having issues compiling in visual studio 2015 (yes i'm not developing on the pi itself).

Is there another library that allows images to be taken from the pi camera?

  • 1
    What operating system are you running on the Pi? Windows IoT doesn't support the Pi camera in any way. – goobering Sep 18 '16 at 17:18
  • I'm developing on Windows 10 then running in on raspian – user3797758 Sep 18 '16 at 22:04
  • That's not going to work, visual studio can't do that. – John Keates Sep 18 '16 at 22:58
  • Actually, it might, but I don't fancy trying it. Looks complicated! It'll be slower, but you'll probably have better results shifting your source files over to the Pi and compiling it there. – goobering Sep 18 '16 at 23:10
  • Why wouldn't it work? So far all the code that I've written has worked with it, this being a bit more fussy than the other stuff... – user3797758 Sep 19 '16 at 5:03
1

The usual way to use the camera from C/C++ is to use libmmal (this is the library used by raspistill and raspivid). The source is part of the userland repository, specifically look under interface/mmal in there and you'll find all the headers.

For examples of MMAL use, have a look at the raspistill and raspivid source code, which you can find under host_applications/linux/apps/raspicam in the same repository. Whether this will compile under Visual Studio I don't know (from goobering's link it looks like it's using GCC, so there's a chance).

| improve this answer | |
  • Cool, I'll look into this and see what happens and report back in a week or so :) – user3797758 Sep 20 '16 at 19:57
  • Ok, I tried to get this going but there were quite a lot of errors when i tried to make it work with Visual Studio. I ended up using the Python camera version and then just stated a python engine and called the python methods from that in C#. I might look back into this at some point just to see if it can be done... – user3797758 Oct 11 '16 at 18:05
0

An alternative is to use gstreamer with Raspicam. I only used gstreamer with Pi Zero streaming from cheap USB webcam to LCD (see details). It has a huge number of plugins you can just use. And you can write your own plugins (I have not done that yet, GStreamer Plugin Writer's Guide, gstreamer.freedesktop.org/data/doc/gstreamer/head/pwg/html/). see details

Hermann.

| improve this answer | |

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.