3

I would like to make a program that would offer tethered operation for a digital video/still camera (consumer cameras other than DSLR), so that you could plug the camera into a computer (USB or other) and use it's functions (take photo, record video, zoom, focus, etc.). The intended platform for now is Linux.

As far as I know, no manufacturers offer an SDK for their products, except a few who do (Canon, Olympus, Nikon), but only for their DSLRs.

I'm not new to c++ but I haven't worked on many projects with it. However, I am completely new to OpenCV, and I do not yet know the capabilities of this library. To test the opencv build and my configuration I've made a simple app which just takes the stream from the webcam and displays it on a form. (using cvCreateCameraCapture)

Would this work with a digital camera or camcorder? I'm guessing they would have to have a "webcam mode" available, but that's not so common (at least not in camcorders). How about firewire or are there any other HD capable connectors? Would they be recognizable by OpenCV? I would like to stay away from HDMI and capturing devices if possible (extra cost).

So i guess my question is, if anyone had any experience with a project like this: what would be the preferred camera specifications for such usage (what features)? And are there any libraries available to ease my troubles :)

I'm looking into libgphoto2 as well. And if need be I would try something like writing a driver for the camera, if possible using libusb, but I honestly do not know where to start with that. Sniffing the USB port (with their native drivers), what to do with that information afterwards?

I would be very grateful if someone could shed some light on that subject as well - how to get started, any good books to recommend on writing driver software?

Also, I am aware that Linux Kino offers similar functions so I could check out the source, but is it only for IEEE 1394?

One last question, how could I achieve that the camera starts up automatically on computer start up, given that it's connected through USB?

Sorry for the long post,

Thank you and best wishes!

Matekk

Matekk
  • 683
  • 2
  • 8
  • 21

1 Answers1

3

To start a program that talks with an USB-conneected device you add an udev rule for it, like this. You may want to use ATTR{device} and ATTR{vendor} and not KERNEL as shown in the example.

As for the cameras themselves, older Canon P&S cameras can do tethered shooting. Some are supported by gphoto. If there's no Linux support for your camera, but it is able to work tethered in other OSes, you will have to reverse-engineer support. Yes, issue commands from the supplied software, sniff USB ports, figure out message formats, make your program write/read messages via libusb2 (or perhaps add support to libgphoto2).

Another possibility is an Android-based camera (not a phone but a real P&S). Nikon and Samsung both make these things. There's probably no need to reverse-engineer anything, but you may have to write an Android app for the camera. There are some apps out there that can do this but work via WiFi/3G, so this should be possible for USB too.

n. m. could be an AI
  • 112,515
  • 14
  • 128
  • 243
  • hey, tnx for the reply, great suggestions here. I didn't know about the udev, will surely check it out more, seems useful here! The android-based cameras are a great idea, but as I've found out only one Samsung and one Nikon model are available, and both of them exceed the cost of a Canon EOS 1100D which for now seems like the best choice for me. Though it's more expensive than I was hoping for, it has tethering and SDK albeit for Windows and Mac OS, I should be able to sniff out some stuff there I feel ;). Plus, it's already supported by gphoto lib! – Matekk Dec 18 '12 at 17:03
  • Also, would it be possible to power a camera on or off via the PC? Could this be resolved by software by any chance like a boot program or should i look into electronics hacking? :) – Matekk Dec 18 '12 at 17:29
  • If you plan on capturing a live HD video stream you will need a capture device anyway, with either DSLR or camcorder. Stills only need USB. Live preview (not full HD quality) also can be streamed via USB. I have no idea whatsoever how hard it would be to reverse engineer this stuff. As for powering on/off, DSLRs tend to have mechanical on/off switches, so you will probably have to do electronics and/or mechanics hacking. – n. m. could be an AI Dec 18 '12 at 18:03