I am currently doing some research on capturing images from an SLR camera, either Canon or Nikon branded from within a .NET WinForms application.
I know Canon and Nikon have SDK's but after reading around the net for a few hours I have come to the conclusion that integrating their SDK's is going to be a long and painful process.
My question: Does anyone know of any commercial (or free) .NET components for communicating with either Canon or Nikon cameras? I realise any component is just going to be a wrapper of the respective SDK, but we don't have the time nor resources to fiddle with C++ wrappers and everything that comes with that.
Any advice regarding this is appreciated!
Regards
You can try the WPD apis from Microsoft. Here is the WPD Team Blog for more information.
There is also a Canon EOS framework which claims to provide a better and more convenient way to integrate the Canon EOS SDK into .NET applications [Never tried, you may want to give it a shot].
Since you asked the question NikonCsWrapper project became available, it is just a C# wrapper for Nikon SDK, but it integrates fine with .NET.
It is as good and reliable as Nikon SDK it uses.
Related
I'm trying to find the way for getting image (only image, not video stream) from webcam in managed C#.
Usually people suggesting libraries, but they are old or commercial or under gpl.
How get image from webcam without third-party libraries?
upd.: thanks for Media Foundation, I shall use that.
Web cameras are supposed to deliver video feeds, not stills. So the native API you might be interested in is the one for video capture, which are DirectShow and Media Foundation.
The one you would most likely want is DirectShow, but it is not well suited to be interfaced from managed code, so you will need a DirectShow.NET which is open source wrapper. You typically start video streaming there and once you have a good image you stop the activity.
Or instead you might keep looking for a ready to use library which does the mentioned above for you.
One of DirectShow.NET samples does what you look for.
DxSnap – Use DirectShow to take snapshots from the Still pin of a
capture device. Note the MS encourages you to use WIA for this, but if
you want to do in with DirectShow and C#, here's how.
It mentions WIA, however WIA API is not available for all (or any in recent OSes?) web cameras, WIA more targets device like scanners.
Other APIs are perhaps less suitable.
VFW ("avicap32.dll") limits you to a subset of devices, is simple yet not well interfaced into managed code
Media Foundation is not well available in earlier OS versions
I wrote this many years ago
http://www.vbforums.com/showthread.php?344471-Vb.Net-WebCam-Class-(ICam)) in VB.net
You could easily port it to c#?
Is avicap32.dll out of the question?
Otherwise I think this is a simple and straightforward way:
http://www.creativecodedesign.com/node/66
http://www.c-sharpcorner.com/uploadfile/yougerthen/integrate-the-web-webcam-functionality-using-C-Sharp-net-and-com-part-viii/
Does .NET have a native support for getting input from webcam?
If not, what is the best/recommended way to get input from webcam using C#/.NET?
.NET does not have a native support for webcams. You can use OpenCV library. Also a .NET wrapper exists for OpenCV - Emgu CV.
You might like to look at the easywebcam codeplex project:
http://easywebcam.codeplex.com/
On the other hand, the "native" option is to develop this using DirectShow. However, there is no (as far as I know), official managed interface for DirectShow, so it can have a steep learning curve to develop with.
This was also asked in How to get web cam images in C#? and you might find the following useful:
I've just released the complete sourcecode of my Windows app CamTimer (written in .NET/C#). Download/view the complete code (with working Webcam examples) at https://github.com/johanssonrobotics/CamTimer
Happy coding!
There is also an SDK called MetriCam. It is supposed for Kinect and Time-of-Flight cameras, but also supports webcams. You can download it for free at http://www.metricam.net
It includes samples and tutorials how to integrate a DirectShow webcam into C#/.NET The webcam tutorial can be watched here: http://www.youtube.com/watch?v=BvnRpby8mSE
there is any body know any library that enable us to detect the body border or help me notify to body movment according to stream of images
Microsoft has such a library, called Kinect.
However, I rather doubt they will license it to you.
There is not always a library for everything, especially if the problem is difficult to precisely define and on the cutting edge of technology.
The basic element of this sort of processing is Blob Detection.
There are examples in the wild for blob detection algorithms. There are libraries too, but I'm not sure about free ones.
See this:
http://www.aforgenet.com/articles/hands_gesture_recognition/
Did you look at open CV ? It's an open-source framework for image processing so it has a lot of helpful algorithms for contour detection, filtering, hull etc...
Also OpenNI was just released. It's a framework for natural interaction. For now it's mostly set up to work with depth sensors such that Kinect and PrimeSense sensors, but in the not-so-far future it might be able to deal with other type of hardware, maybe standard video cameras...
Link to MSFT SDK site
Update:
Just in from ZD.NET "Microsoft readies hobbyist Kinect development kit; promises commercial version later" link
Prior Post
The makers/OEM of the Kinect is PrimeSense. They make both the kinect and an independent devkit. They recently released open source drivers that are compatible with both XBox's Kinect and the smaller DevKit. You might as well get the drivers straight from the source. I'm not sure what value a 3rd party library (openKinect) will offer.
Get the unified Kinect and DevKit drivers here: http://www.openni.org/ Windows and Unix support is available.
I am hoping to receive some general guidance on accomplishing a seemingly simple goal. I have a DSLR camera (Canon EOS 50D) and need to write an application that will tell the camera to take a picture. I also need to transfer the picture to the computer and possibly delete it from the camera's storage. A bonus would be to get a live preview from the camera in my application. My environment will be Windows (either XP Pro or Vista Enterprise) and .Net 3.5 (C#).
I have done some research and found a couple of options. One I know will work, but limits me to using only Canon cameras in the future. I have found and downloaded an SDK from Canon that provides a lot of this functionality. I've looked over the SDK and while it's extensive and written in C it does have C# wrappers that will speed up development a bit.
Another option I've found is called Windows Portable Devices. Apparently, it is an API that will talk to devices that implement PTP and MTP standards. It is COM based and as far as I can tell it has no .Net wrappers. This is not however a show stopper. I could P/Invoke the functionality I need or write a Managed C++ DLL to use in my application to talk to the camera.
I am looking for anyone with experience with WPD to give me pointers. I've perused the documentation and seen references to transferring images and deleting images. I have not, however, seen mention of commands to take a picture, get a preview image, or say focus/auto-focus.
The WPD api provides the command WPD_COMMAND_STILL_IMAGE_CAPTURE_INITIATE
I am not sure whether your camera supports it but it should be simple enough to find out. If you can get the "wpdinfo" tool from the driver development kit and start it with your camera connected then send it a WPD_COMMAND_CAPABILITIES_GET_SUPPORTED_COMMANDS command and see if it supports the still image capture command. IF so then you could give that a try.
The comment from TallGanglyGuy is incorrect. ptp does allow you to trigger new images and change exposure, etc. Some cameras have firmware that only exposes some of the ptp commands.
PTP supports common device controls, such as taking a picture, so that
the user could take advantage of the PC/camera combination in new and
different ways again, without requiring additional software.
quoted from http://msdn.microsoft.com/en-us/windows/hardware/gg463507.aspx#EXC
try my Eos Framework: https://github.com/esskar/Canon.Eos.Framework
IMHO it's a better alternative then the .cs file that comes with the SDK.
PTP and MTP are both protocols for transferring files from a digital still camera (DSC). The protocols provide no functionality for triggering new images, or setting exposure control. You will be stuck using the camera specific SDK. If you want multiple vendor support Nikon has an SDK that provides similar support as the Canon SDK for their cameras.
More info on PTP and MTP can be found here:
http://en.wikipedia.org/wiki/Picture_Transfer_Protocol
and
http://en.wikipedia.org/wiki/Media_Transfer_Protocol
EDIT
I forgot to mention that WIA may be interesting to you, assuming your camera's driver provides a WIA interface.
This is really generic, but it may help.
I had to write an application that used two different bar code scanners from two different vendors with different SDK's. I created an interface that defined the methods and events that I wanted to code for, and then wrote adapter classes that implemented my interface.
This worked well in my case, and switching from one to the other was pretty seamless. If you took the same approach, you wouldn't be totally dependent upon one SDK.
I am trying to figure out what APIs to use to connect and record from a webcam. In al of my research, Google, I have found many OLD articles which discus Directshow and COM. I don't want to write code that is using an obsolete API.
Any direction with this is greatly appreciated.
DiectShow is still the best way to connect to Webcams (or other sources).
You can use DirectShow.NET which is a thin warpper arund DirectShow.
If you are using Vista, you can use the new Media Foundation APIs. But, they are not available on XP, so DirectShow is the way to go. The DirectShow.NET wrapper pointed to by Shay works great with C#. Be sure to also download the Samples, there are several capture samples worth checking out like PlayCap and CapWMV.
UberDemo wrote an article about another way of capturing using the Windows Media Encoder SDK with WPF in this article.
avicap32.dll I guess is the safest option due to its readily availability... http://channel9.msdn.com/forums/TechOff/93476-Programatically-Using-A-Webcam-In-C has the PInvoke code you will be needing.
http://codeplex.com/touchless is an interesting related project!