1

After finding out how to retrieve driver and device information from the Device Manager in Windows, I want to know how I can get the camera information on my computer. I am using C#. I can't find a suitable class listed on MSDN:

Computer System Hardware Classes

As can be seen in this image, the camera is located under the image processing devices.

image

Is there any possibility to check if the camera is activated?

EDIT: The device is deactivated:

enter image description here enter image description here

What I want to know is the following: Can I check the device's status code (currently 22) or some other property to check if the device is activated?

FranzHuber23
  • 3,311
  • 5
  • 24
  • 63

2 Answers2

0

The below post focuses on detecting USB devices, but I think it's the direction that you need to go:

USB Device Connected

Write a function to query for the desired device and verify that it is connected.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
  • 1
    Good luck! Hope it is helpful. I'm not certain what you mean by "activated", but if you mean "connected", then I think this could work for you. There might also be additional class helper methods you can access to get more specific information about the device, but I am not certain. Outside of 'hooking' an existing proc and reading activity in realtime, not sure how you would identify whether or not the camera is actively capturing an image. – Robert Hartshorn Aug 21 '17 at 14:37
  • 1
    Well, the code worked for getting the device information. Still I'm not sure how I can find out if the device changes its status. I updated my question regarding this ;) – FranzHuber23 Aug 21 '17 at 19:28
  • 1
    By the way: I'm sorry for the german language in the pictures... :D – FranzHuber23 Aug 21 '17 at 19:32
  • 1
    I think it's easier to try to make a capture with [emguCV](http://www.emgu.com/wiki/index.php/Main_Page) and if this fails, the camera is not connected. – FranzHuber23 Sep 01 '17 at 16:49
  • Nice find! It's cross platform too- very cool. You should type up an answer so I can upvote. – Robert Hartshorn Sep 02 '17 at 15:20
  • Hi [Robert Hartshorn](https://stackoverflow.com/users/5302038/robert-hartshorn), I've put an answer below ;) My computer had hardware problems in the last weeks, that's why the reply is so late actually :D – FranzHuber23 Sep 30 '17 at 09:57
0

I've now managed to check the camera activity by using the EmguCV framework. The solution can be found here: https://github.com/SeppPenner/CameraActivityChecker

FranzHuber23
  • 3,311
  • 5
  • 24
  • 63