How to grab a picture from a camera? - c#

I'm looking for a solution which will allow me to grab a picture from any camera (or many cameras at the same time) connected to the PC running under Windows. This solution should be provided with API so I could somehow control the Video with it's resolution, quality etc.
I'm not sure where to look for...
I prefer free solution, however those with reasonable prices would be also much appreciated.
Do you know any, if so are You able to point it's strengths and weaknesses?

Most scanners and cameras support WIA, which is probably a good place to start. There are plenty of examples of how to use WIA in .net, so I would start there and see if they meet your requirements.

Related

different images from different point of view

I want different images to be displayed from different point of view. For the whole concept explaination please look at the images. they explain my idea/query!
As in the first image you see that there are three people at different angle looking at the monitor. Now i want the webcam to track the eyes and show the particular defined image to the user> For example: If user is at 45 degree angle then show image1.png
Depending upon the user's prespective of watching. The computer should show the image.
(the lady is the game character for representation purpose)
Can you please guide me on what steps can be taken to accomplish this? Is there any plugin available for unity that tracks faces? Please guide me
Also thanks for the compliments on my sketching skills xD
Stackoverflow is not really meant to recommend plugins, since the choice is usually opinion based so there is no exact answer.
That being said, on of the most common used API for computer vision (meaning interpreting images, including face recognition) is OpenCV, so that could be a good start for you to look at that.
And fortunately for you, there is a Unity plugin for OpenCV
It is too broad to give you more details about how it works here. You should try to make it work, and if you have a problem with your code, open a new question with the code portion that you struggle with.
PS: nice sketching skills
Perhaps easier option would be to use Kinect
(trying to detect face or eyes from that far might be shaky?)
With Kinect you can get skeletons for multiple people, and getting the angle between target and those kinect avatars would be easy.
If there is no space to put kinect in good position,
could consider placing it on the ceiling above (and then use depth data only to detect people in its view)
Only issue is that apparently Microsoft has stopped Windows kinect support,
so you would need to find 2nd hand versions.. (Unity Asset store still has some kinect plugins and examples available)
https://www.polygon.com/2018/1/2/16842072/xbox-one-kinect-adapter-out-of-stock-production-ended
Or look for kinect alternatives that work with unity, try RealSense cameras:
https://www.intel.sg/content/www/xa/en/architecture-and-technology/realsense-overview.html

Any free C# libraries for video recording (of the screen) around?

I am looking for free C#(.net) libraries that allow me to record videos(plus sound) of the screen of my computer (basically, to do what camtasia does).
Is there anything easy to use, around?
Thanks
I came across this solution to your problem, which uses Windows Media Encoder 9 to record the desktop. It's a bit dated, but I think you might find it interesting or helpful: http://www.c-sharpcorner.com/UploadFile/satisharveti/EnhancedDesktopRecorder07222008041309AM/EnhancedDesktopRecorder.aspx

Creating a usb time lapse for Cannon EOS Rebel XS using a c# program

I am wondering if this is even possible. I want to make my own software to control the release of the shutter via the remote shutter release. From the diagrams I have seen it has a 3.3 v (no load) and a threshold voltage of 1.8v. I am wondering if I can use limit a usb cables voltage which is around 5.25v, if I am understanding correctly. Is this even possible, or do I need to look in a new direction. I am hoping to write the software in c# which I am fairly confident in.
Thank you in advance for your help :)
I've played a lot with these type of shutter remotes, for both the sony alpha and for the canon line of dslr's. For the cannon, it is usually a 2.5mm stereo plug. It has 3 contacts: ground, focus and shutter. Shorting each one of them and you will trigger that function in the camera.
http://www.doc-diy.net/photo/eos_wired_remote/
A few years ago, I designed my own circuitry that would take serial commands from the host (in my case an HP Pocket PC) and drive one of the lines down using a microcontroller GPIO port.
Nowadays there are similar devices with much easier connection and control options. And if you'd like to take the DIY road, there are very nice options such as the arduinos or if you're a c# addict, there are the netduinos.
Here's a commercially available solution, including SDK:
http://www.breezesys.com/DSLRRemotePro/features.htm
Working with USB devices in .Net is not the most straightforward task... There are no libraries in the BCL to deal with USB. However, it is possible to use Win32 API's.
This article should get you started in the right direction, as far as accessing a USB device if you want to pursue this.
As for whether it's possible, it might be... I don't rule anything out, but I think you're in for a LOT of research time to make it work if it's possible at all. (I've never seen anything in the Win32 API documentation that allows you to control the voltage, for example). However, it would be very cool if you could make it work, and the satisfaction factor alone may be worth the try.
Added
I took a look at PInvoke.net (a very good site for learning about Win32 API calls) to see if they cover power management for USB drives, and I see nothing at all.
http://www.pinvoke.net/search.aspx?search=usb&namespace=[All]#

DirectShow DVD manipulation and capturing

I am new to DirectShow.
My intention was to develope a small application (C#) that handles video processing.
The main tasks i need are :
1 - Display video content from a DVD.
2 - Navigate to specific points of time in the video.
3 - Capture specific frames into still images and save them to files.
Sounded easy at first, but after reading thousands of blogs, forums and code samples i can't figure out how this can be done .
I am pretty sure these tasks have been implemented plenty of times, so if anyone has anything that can help i would be very happy to hear it.
As i am getting desperate on this issue, buying external DLLs or paying for some advice is an option.
Thanks.
Not sure if this will help, but I have a DvdPlayerElement control in my WPF MediaKit.
You must install an audio codec if you want audio as the built in one with Windows is locked down due to licensing.
perhaps you can wrap the MSVidWebDVD object, combined with some screen capture techniques [?] see also Extract frame from VOB(DVD) file
Thanks Jeremiah, I do know WPF MediaKit and tried working with it.
It is pretty cool, but does not allow all of the functionality available in DirectShow.
There are some events missing and the seeking operation does not seem to work for me.
I guess i can dig in the code and figure it out, but the time pressure won't allow it.
If you have an example of an application that accomplishes what i am looking for (display, seek, capture) i would be very happy to take a look.
Thanks again.

Using webcam's button in my own program

My webcam has a button, with which you take a photo of current frame
when using it's original software what came with it when I bought it.
Is there any way to use that button to take photos in my program.
I would be using C#.
I was thinking of using Windows Image Acquisition (WIA) or avicap32
for using webcam in my software.
Any help would be appreciated. Where do I start?
EDIT:
I see that you didn't understand me. I need to know if my phisycal camera button is pressed.
I am using DigiMicro 1.3 camera (Manufacturer is DNT), which isn't really a webcam but a USB microscope, but
it behaves like a webcam.
Does the camera actually require that the software be running when you press the button? I know some webcams implement this feature at the driver level. If that's the case, I don't think there's much you can do without interacting directly with the USB port, which would be incredibly difficult and likely not worth the trouble. I can't find any technical documentation on the vendor's website with that kind of information.
The "MicroCapture" software doesn't come with any DLLs that have exported functions, so P/Invoking doesn't appear to be an option. Unfortunately, I can't get the driver installed, so I can't check if it comes with any P/Invoke-able DLLs.
Sorry, but since there's no standard interface for that kind of functionality and the vendor doesn't provide any specific information on it, I don't think this is possible. I would suggest contacting DNT directly about it. They may have some component that will do what you need.
This Coding4Fun post guides you through pretty much everything you need to do to get started using WIA, including adding the reference to a project, displaying the select a device dialog, and of course actually taking the picture :P.
Coding4Fun - Look at me! Windows Image Acquisition
I suggest that you take a look at the DirectShow.NET library. It has great functionality for capturing images/videos off connected devices. It also comes with several samples to get you started quickly.

Categories