How do I retrieve picture snapshots from a web cam? - c++

How difficult is it to make software for a webcam such as the Gateway USB 2.0 Web Cam? I would like to be able to retrieve picture snapshots on demand. Is there a C++ library or other API that I may use to do so?

The answer depends on what platform you are using. For example, if on Windows, you can retrieve data from the camera using the DirectX API, Linux has Video4Linux and Mac has QuickTime.
There are some cross-platform wrappers which provide a layer above the native video API, and therefore offer a common API across multiple platforms. One such project is OpenCV which - although not intended primarily for camera capture use cases - does support them via the cvCaptureFromCAM and cvQueryFrame functions.
The QtMobility Multimedia APIs will also offer cross-platform camera support, but this API is not yet implemented. Check back in Qt 4.7 if this library looks interesting to you.

Related

Options for Camera Enumeration and HAL for UWP App (WPF/C++ CLI DLL)

I am creating video processing application. The application is written using a mixture of WPF and C++/CLI (a DLL). I currently connect to a machine vision camera and use a few functions in the camera's native driver e.g. I grab image data, I set hardware region-of-interest (roi).
I am currently using windows 10. The application is currently converted to UWP with the Desktop bridge.
What I would like is to use some sort of Hardware-Abstraction-Layer to connect to a range of cameras and to access image data and ROI functions (if available).
I was wondering if someone experienced in this could take me through the options (if they exist) and what are the main considerations.
When I web-search I get lost in the search results (for example, is Windows Media Foundation a possibility, if not why not etc.). Much of the web results are pretty old.
So really I would like someone to give me a few pointers so I can feel sure I am on the right track.
It is impossible use DirectShow cameras from UWP - in MSDN Win32 and COM for Universal Windows Platform (UWP) apps (multimedia). You can use DirectShow cameras from direct calling as COM object, but it is workable only on Desktop Windows with full supporting of COM. Universal Windows Platform (UWP) is a platform for programming on Desktop and Mobile - these are Windows with different architecture and UWP is an abstract layer for simple deploying on different platforms - it leads to limit functionality.

How to access iPhone filesystems via USB (from Windows)

I wish to make an SMS analysis tool that downloads the SMS.db file from an iPhone device, connected via USB. I am coding in C++ and would like to know how applications such as DiskAid and iPhone Explorer access the entire filesystem via USB?
Thanks in advance!
iPhone Explorer requires iTunes; probably it works by employing the iTunes COM API (I know there is one). Anyway, it does not show the full filesystem; just the parts that iTunes exposes. And AFAIK, the SMB.db is not exposed.
Or maybe it taps into some lower-level API that iTunes itself consumes.
Not sure about DiskAid.
I imagine it will use either Manzana, or something similar to it. It uses one of the iTunes libraries.

Writing a 3D rendering browser plugin

I understand that it's possible to write a plugin for a browser which lets you render to the browser window, so you can effectively run a normal app within the browser. NOT using JS or client technology, but a plugin which basically wraps your application - in our case C++ which does 3D rendering using DirectX or OpenGL.
I know that we'd have to have versions for both IE and other browsers but how does this work - in Windows-speak do we get a HWND through the plugin architecture or is it more complex?
Do you have to write a version of the plugin compiled for each platform - Win/Mac/Linux, since a plugin is a binary I assume this is the case, so you have one version for IE and then multiple versions for FF, Chrome, Safari (which share the same plugin setup IIRC)
With FF - is this an example of a plugin or an extension specifically?
An example of what I mean is QuakeLive - proper 3D rendering within the browser. We're actually using Ogre (cross-platform C++) but this uses Direct3D/OpenGL so it's the same thing.
Things like QuakeLive can be done rather quite simply with Google's NativeClient SDK. It abstracts away the whole plugin architecture so that you can focus on writing your software, and provides support for nearly all plugin-capable browsers on Windows, Mac OS X, and Linux, portably. The user installs the NaCl plugin (which is included in some versions of Chrome and Chromium), and your software runs inside NaCl, seamlessly on all supported platforms, from a single binary.
Note that you can use OpenGL portably from within NaCl, but not DirectX. Future versions will also support ARM and x86_64 with technology from the LLVM project.
FireBreath is a great cross-platform, cross-browser library for developing C++ browser plugins.
Flash Player 11 provides true 3D support via Stage API over DirectX, OpenGL or whatever available at the device:
http://techzoom.org/adobe-flash-player-11-air-3-beta-stage3d-and-64bit-support-on-linux-mac-and-windows/
Its in beta now, so user needs to install it manually, but when Adobe release it then majority of browsers will provide true 3D support instantly. Latest Away3D beta already supports Stage API.
I have a need to get some of this done soon, so if anyone here is an expert on this please look me up.
Steve Bell
Archiform 3D animation studio

Windows Mobile 6.5 Change the camera focus

I have a project to scan some QR-code or bar-code with camera on windows mobile. (phone x01t)
Programing in C++ and using DirectShow.
Tired to change focus with IAMCameraControl interface, but return the error like "...request is not supported".
Are there any way else?
Thanks
Most (if not all) Windows Mobile phones I've used so far used custom camera drivers, which means OEMs decide which functionalities to implement/support. IAMCameraControl is most likely not one of them.
However, you might want to look for OEM-specific SDKs. For instance, Samsung provides custom APIs enabling to change such parameters as camera focus or ISO. Maybe such APIs exist for your device.

Are there any generic C++ APIs or SDKS for cameras that work on CE and Win32

I have a mobile application with versions run on TabletPCs (Win32) and Rugged PDAs (Windows CE, Windows Mobile 4 & 5). Are there any SDKs out there that I can use that will work with a range of cameras across these operating systems?
On Windows CE I can use SHCameraCapture which will work with built in cameras, but typically not with externally connected cameras. On Win32 there are vendor specific SDKs, such as those offered by Canon, but not much generic other than FireWire based.
Has anyone come across any SDKs that abstract all of this into a simpler interface, or do I have to do this myself with various bits of hardware on an adhoc basis? My requirement is to get a JPEG from the camera to the application on demand.
Well there is DirectShow but I wouldn't call it a simple interface. That said when you get used to it its pretty easy and you won't be after much more functionality than ICaptureGraphBuilder