Giter VIP home page Giter VIP logo

opencvdeviceenumerator's People

Contributors

studiosi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencvdeviceenumerator's Issues

Differences with WMI and Camera order

Hi and thanks for you project!

Since I'm not good with C++, neither with low level Windows libraries, I'd like to ask you two questions, please.

  1. What's the difference between your code and the builtin Windows WMI camera enumeration? (Here it is C# code)
public static List<CameraDevice> GetAllConnectedCameras()
{
    var cameras = new List<CameraDevice>();
    using (var searcher = new ManagementObjectSearcher("SELECT * FROM Win32_PnPEntity WHERE (PNPClass = 'Camera')"))
    {
        foreach (var device in searcher.Get())
        {
            cameras.Add(new CameraDevice()
            {
                Name = device["Caption"].ToString(),
                Status = device["Status"].ToString(),
                DeviceId = device["DeviceID"].ToString()
            });
        }
    }

    cameras = cameras.OrderBy(c => c.DeviceId).ToList();
    for (int i = 0; i < cameras.Count; ++i)
        cameras[i].OpenCvId = i;

    return cameras;
}

public class CameraDevice
{
    public int OpenCvId { get; set; }

    public string Name { get; set; }
    public string DeviceId { get; set; }
    public string Status { get; set; }
}
  1. To map your enumeration result to the correct OpenCv indexes, how do you sort the enumeration? In other words, why these two cameras have that ids? Did you sort by Path?
== VIDEO DEVICE (id:0) ==
Name: HD Pro Webcam C920
Path: \\?\usb#vid_046d&pid_082d&mi_00#7&3561b19d&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global
== VIDEO DEVICE (id:1) ==
Name: FLIR USB Video
Path: \\?\usb#vid_09cb&pid_1007&mi_00#6&1e15415f&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\global

Thanks a lot!

Devices id's are switched

image

Program listing 'A4 TECH HD PC Camera' as id 1 but when i open VideoCapture from opencv on id 1 it opens defualt laptop camera, and if i put 0 it'll open that usb camera 'A4 TECH HD PC Camera'.

Feature Request : Hot Plug support

thanks for creating nice small lib to detect usb devices , am wondering can you add Hot Plug feature to it so that it can watch for new Usb Devices added and removed

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.