choice between win32 APIs and .NET framework

前端 未结 5 2027
你的背包
你的背包 2021-02-09 00:36

I have to develop an application for windows that will enable controlling the mouse through web cam by recognizing hand gestures. I will be using vc++ 2008 for development. But

相关标签:
5条回答
  • 2021-02-09 01:05

    If you are acquainted with Win32 API, then go Win32 API. It is the natural choice in your case since most of your source code will be video capturing, image processing, algorithms, and interfaces to mouse in Windows. When you are interested in performance, be closer to the hardware avoiding thick layers like .NET.

    I believe that .NET is for complex business applications not for real-time applications or device drivers.

    0 讨论(0)
  • 2021-02-09 01:14

    .NET is nice for GUIs and for general programming in non-performance-intensive areas. If you need to do anything more than a trivial GUI, I would suggest writing at least that part in a .NET language.

    In what you've described of you program, recognizing hand gestures is going to be the only computationally intensive part. The actual process of controlling the mouse is trivial. So as long as the gesture recognition part performs well enough for your needs, it probably won't matter what the rest of the program is written in.

    First step, you should research what libraries are out there that do gesture recognition or similar image processing. (I would hope that you're not intending to write that part from scratch anyway.) If you find any .NET based libraries that claim to have performance good enough for your needs, then you could give them a try. Otherwise, you would probably end up with a library based on C or C++ or similar. Either way though, it's possible to integrate such a thing with a .NET-based program.

    0 讨论(0)
  • 2021-02-09 01:20

    I think you should limit .NET usage for GUI building.Rest of the works try to do in Win32. Remained question about object recognition , there is nice library called OPENCV (open source Computer Vision Library). this lib contains all possible methods which you would require in project. Also there is Intel's hardware specific library, IPP, which boost Opencv's performance.

    0 讨论(0)
  • 2021-02-09 01:23

    A quick way to put it: the performance difference between the native API and .Net can be compensated for by buying a more expensive processor. You would pay somewhere between $1 and $100 more, with $10 being a reasonable estimate - per CPU of course. So, if you expect more than a million users, do choose the native API. If you expect to use it on 2-3 demo PCs, it really doesn't matter at all.

    0 讨论(0)
  • Unless you are a very experienced C++, programmer, C# is a much more productive language (speaking as someone with over 15 years C++ experience and 2 years C#).

    The .Net libraries offer a wealth of high-quality functionality that's easier to use than the standard C++ library.

    So, I'd go with using .Net.

    I also recommend using C++/CLI to directly call complex native libraries if you have to integrate them, rather than P/Invoke. That's good for odd calls but doesn't let you easily access data structures or mingle native and managed code.

    0 讨论(0)
提交回复
热议问题