1

I am currently doing a project which involves controlling couple of maxon DC motors, reading from force sensors, and image processing in windows OS. I am trying to find the right programming language or combination of them in order to get high speed communication rate with hardwares as well as real-time image processing. The application needs to have GUI. It also needs to be multi-threaded. My options that I am investigating are:

1) C++ and QT for GUI - I couldn't get Qt working with Opencv. I was unable to compile Opencv for Qt.

2) C# with Emgucv - I am still struggling to get what I want using Emgucv.

3) Making DLL for the image processing part in C++ with Opencv and use in c# for GUI - all of the hardwares are working in C# through DLLs.

4) Making DLL for the maxon DC motor controls in C++ and use in python for GUI - the good about this solution is that Opencv works very well with python. But I am not sure whether python is the right language for real-time hardware communication.

5) Matlab - very slow

I very much like to use just one language, and for doing so, my only choice is number 1 which I cannot get it running. So my questions:

Do you know any other solution? If I have to choose another language as well as C++ to make GUI and also be able to have multi-threading easily (like python and backgroundworker in C#), which one do you recommend c# or python, or any other? Speed is important for this application.

Thanks in advance

NESHOM
  • 899
  • 16
  • 46

1 Answers1

0

Option 1 sound the best, c++ for the speed, QT for a nice UI + cross platform support. I have also had trouble with QT and OpenCV in the past. I have successfully managed to use OpenCV in Visual Studio 2010 with a QT add-in.

A good guide for OpenCV is here - http://opencv-srf.blogspot.co.uk/2013/05/installing-configuring-opencv-with-vs.html

Plenty of stuff about getting QT working in VS as well - How to build Qt for Visual Studio 2010

Community
  • 1
  • 1
MikeS159
  • 1,884
  • 3
  • 29
  • 54
  • thanks, I tried all of these links before, but with no luck! Do you know how slow it would be if I use c# or python to call DLLs from c++? – NESHOM Jun 15 '14 at 15:28
  • I have use DDL's written in C++ in C# before, but never to time sensitive operations. The speed will depend on how much you want the GUI to be doing. Have you got open CV working in VS? If so you just need to go to this link: http://qt-project.org/downloads Then click show downloads and look for the Visual Studio one. – MikeS159 Jun 15 '14 at 15:32
  • Thank you for your comment. This is good, but I am not sure how hard would it be to have multi-threaded code this way? Do you have any experience with multi-threding? Do you know if that would be something as easy as backgroundworkers in C# – NESHOM Jun 15 '14 at 16:16
  • I think using the pthread.h library isn't much harder than threads in C#, it follows the same principal. This is a good place to start - http://www.tutorialspoint.com/cplusplus/cpp_multithreading.htm If performance is critical you might also consider setting up CUDA which can be used to run processes on a GPU, or Intel IPP: https://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-open-source-computer-vision-library-opencv-faq – MikeS159 Jun 15 '14 at 22:05
  • thank you! Do you know if I use Qt add-on for visual studio, I still need to compile Opencv for Qt in order to show Opencv images/videos on Qt forms? – NESHOM Jun 16 '14 at 03:10
  • No, they should not need to be aware of each other. You can write your C++ application using OpenCV functions, then use QT functions to display what needs to go on your GUI. – MikeS159 Jun 16 '14 at 07:46