We have recently developed a tracking system capable of following several individuals keeping their correct identities in spite of crossings or overlaps (www.idtracker.es). It will be published in Nature Methods in June. The current version of the software is in Matlab, and we are now considering changing to another programming language. The main reason to change is to make it easy for other developers to join the project.
We have two questions, and even if you are not an expert in the pros and cons of the different languages, we would like to know your opinion about the first one:
1- If you considered contributing to an open-source project, what programming language would be easier and more attractive for you?
2- What is in your opinion the most adequate programming language for our project, and why?
Our requirements are:
- Powerful image processing tools
- Possibility of having a user-friendly interface
Additional advantages we would value:
- A large community of developers
- Multi-platform
- Simplicity of the language
- Good performance
Depends on what stage of your project. Perhaps if you are prototyping, Matlab or Python could be useful.
However, for production purposes, go with C/C++.
You might what to check out OpenCV: http://opencv.org/
My limited knowledge lead me to think that the C language has everything you need accept easy of development. If you are looking for something simple to write but nearly as fast as C, then I would like to suggest you to have a look at Julia, which is a new breed of high level computing language designed and advocated by MIT.
With Julia, I think you have to look ahead into the future to see if you really want to commit. Julia is free, easy and fast. It is so far the only one of its own kind. If there will be a lot of people agree with this, I think the community support will grow very quickly. You also have a chance to contribute to something new.
Have a look and best of wishes!
http://julialang.org/
PS: I forgot to mention that Julia can call C code directly, without using any API.
Depends on what stage of your project. Perhaps if you are prototyping, Matlab or Python could be useful.
However, for production purposes, go with C/C++.
You might what to check out OpenCV: http://opencv.org/
If you are looking for signal/image processing contributors, Matlab is fine (I guess python also).
If you are thinking on production, performance or any implementation on a "real system" you should be looking at C/C++.
Once your code is running in C, you can always re-implement several parts of it using other tools for performance (OpenCL, OpenVX) or you can tackle re-usability by using OpenCV (as suggested above).
Thank you very much for all the answers! I would like to clarify some points:
- The software is already working, we have a user-friendly version which is robust and is being used by several researchers worldwide.
- We would do the translation of the current version to a new language ourselves, this is not the task we want external developers to do. What we do want is to build a platform so that external developers may add contributions later.
- The most useful contributions would involve improvements in the image processing routines, and also improvements to solve the specific challenges involved in behavioral studies. Therefore, it would be a plus to use a platform which is simple and of widespread use among experimental scientists. My impression is that Matlab would be very good for this type of developers, but worse for computer scientists. Python would be an intermediate solution, and I guess C++ would be attractive almost only for computer scientists. This is also the reason why this question is posted with the tags of ethology, animal behavior, etc.
First of all, a great clip…
I think you expect a kind of voting. So I would vote for C/C++ for object tracking tasks.
However, if you consider future development beyond object tracking, you sholud focus on designing an open architecture allowing integration of componens written in another langages.
1. You may wish to collect hours of observations and write synthetic information into a database for further analysis.
2. You may wish to capture a language describing behavior of individuals. It would be an offline task, but you should design carefully data structures, XML mappings, etc.
3. You may wish do specify and automatically detect video events (e.g. a new mouse subject was attacked by old cage inhabitants). For this you may need abstractions and tools that are rather not supported by Matlab.
If you provide good transparent interfaces (even data formats), many people may contribute using their preferred language and tools.
If you want to make use of OpenCV, C/C++ is best, but you can also use the Python or Java API as well. I've been impressed too by the Halide language built on LLVM and Clang (http://halide-lang.org/). Halide is more of an open research project, but shows lots of promise to decouple the resource scheduling and low level mapping details from specification.
I think, OpenCV is de facto standard. You should follow the mainstream.
In my opinion, the combination of C++ with QT libraries shold provide good start point even with OpenCV. QT provide some easy-to-usage structures/classes, such as QImage for working with image (rgb32, grayscale etc), but the speed of c language is preserved. Of cource, you can compile the same source code with QT inside in all mains platforms. Bonus is that in QT you can create user interface (form based), use OpenGL, acces hw camera (without solving existing drivers) etc etc. You can try it, its for free http://qt-project.org/
Just as an extra option, costing minimum porting, you could also consider GNU Octave (mostly compatible with MATLAB) for (part of) the new version of your product. I like the C++/QT idea, but then I have some Computer Science background and very little knowledge of MATLAB/Octave and its capabilities.
To answer some of Peter Breuer's questions, I think in this case the people (users) whose itch you want to scratch are those working in animal behaviour. And then the question becomes to finding a language that _they_ will be comfortable with rather than simply the largest group of open-source programmers (C/C++). In that case, Python and/or GNU Octave might be better options?
Yop, probably is matbal (or octave) better choice for somody because of his knowledege or habbits. Another important factor can be computation speed (uff, usual flame), for example there http://digitalcommons.calpoly.edu/cgi/viewcontent.cgi?article=1080&context=aerosp is c++ more than 500x times faster. Do any have similar experience with so strong difference of them between them? And the point is that you can improve the c++ speed even faster using QThreads from QT -> easy to usage, similar to java (inherit and reimplement start method). So if the "good performance" is priority for you, in my opinion its good choice in comparison power/comfort.
Petr,
Thank you very much for your answers (thanks also to everyone else, this discussion is being very useful for us!).
My experience with Matlab and C is quite different to that reported in the document you mention. It is true that the same code may run hundreds of times slower in Matlab than in C. But when optimizing the code for Matlab (for example by pre-allocating variables and using matrix operations instead of loops), the difference is not so large. My experience is that the same algorithm will run in C about 2-3 times faster than in Matlab. Still quite a difference for some applications, but orders of magnitude lower than the one reported there.
Hello,
in my opinion, C/C++ faster and you have more libriaries to use, Java - no dependence on the hardware platform.
Regards
Wojtek
Hello!
I took a look at the previous answers. But I did not read then carefully. Thus, if I'm repeating someone else, I apologize.
First, congratulations. Open source initiatives are always welcome.
I may be oversimplifying things, but I do believe that python is a great alternative. The language is really simple, and has a great learning curve. Libraries are plentiful, as well as documentation. Numerical processing may not be as swift as it is in lower level languages. However, in some cases, this may not be translated in slow processing.
I do believe, also, that image processing is quite simple within Python.
A second alternative, if you don't plan in distancing yourself from MATLAB that much, is Scilab.
Scilab is also a open source software, and quite similar to MATLAB. Much of the code may be utilized fully, without translation.
I do hope my answer help in somehow. Again, sorry if I'm repeating someone else.
Hi,
open source is always the best....
For ur specifications i think opencv / openni would serve the purpose...
I think C/C++ should the most performant language. This language is not always the most performant, but in most cases, and specifically for the image processing, it is. Java, which is a multiplateform language should be more confortable (with good performances), since it is a more evolved language (garbage collector, fonctional interfaces, thread programming, API, lambdas, etc.). Moreover, it is easier to produce stable programs with Java, than with C/C++. However, it does not manage templates with native types, which should be usefull for image processing. Else, I have eared about Python that it is a good language.
It looks most people prefer C++. I think it is easier to change from matlab to R. R is good at statistical computing and graphics. R is open-source. R has lots of users and packages ready to use. But R is quite slow compare to C++, and R can not handle huge data.
OpenCV is the most used language in vision system development ( for its rapidity ),
Matlab can be used also ( more functionality but with more application response time)
OpenCV is the best library for vision projects. And it is open source as well.
Not have more to discuss, most have indicated c / c + + mostly using the OpenCV libraries, but it is worth thinking in C # with Mono / SharpDevelop for intefaces of User.
Hi, I suggest you use for prototyping Python with OpenCV. For a more complex project I would use C++ with OpenCV. However, you can combine easily OpenCV with Qt to get high quility GUI's within your existing C++ or even Python project.
Sorry... I would say Phyton. In my opinion, the number of people using Phyton is increasing fast (I am an example). Good luck with the project! For what I've been listening, it has a lot of success!
C/C++... I think for image processing is the best option in terms of performance and available code (as most people already said... OpenCV).
I think that depends on application fields.Each programming language has its advantages and disadvantages. I think C/C++ maybe the best for control fields and execution system for its hige performance. On multiplatform , Java is the best choice, also becaice there are many source codes can be acquired.
My advice is to select MATLAB for your project - is has a very large number of function for image processing as well as for image acquisition. In addition a number of prominent machine learning labs (Ng in Stanford, Hinton in Toronto) has many of their programs written in Matlab, and some can be downloaded at no charge. Finally should you need to have the best possible execution speed, MATLAB allows for interfacing with C/C++.
I think there is not better language and your technical background.
You will be more efficient in the language you already know.
Additionnaly It's function of availability of the package you need and target you need.
If you want prototype without having something proof to the industry you can use matlab, python but for industry need you often need performance and so C++ is advised...
For prototyping there is newcomers: like interative Python or ceemple http://www.ceemple.com/ ...
After I think the main point it's a question of library (the function you need must be available and really functional, I mean do what you need):
OpenCV is good for image processing and image display and more
OpenMVG and OpenGV are good for multiple view geometry, Structure from Motion
PCL is good for 3D processing and display.
But it's important that in each domain many alternative exists to let community evolve along different pathes and so produce various things.
So each library target some people but cannot cover nicely all the domain... so it's always matter of choice.
Hi,
In my current state of mind I would go for:
C++11 (api),
OpenCV (base cv/image library),
ffmpeg (video -- also ships in OpenCV )
OpenGL(graphics --also ships in OpenCV ),
QT (GUI -- also ships in OpenCV),
boost (everything else)
Then to please the scriptors:
Matlab wrapper
Python wrapper
(also available from OpenCV)
So to sum it up, use OpenCV, and save yourself years of dev. :)
In my opinion C++ and the OpenCV Computer Vision library would be most suitable for the project and would facilitate contributions from outside your research group.
I would say that you have to choose between C/C++ and Python. C/C++ due to its performance, speed and in my opinion the development of a better GUI. Python has its advantages in a very broad user community and libraries, the programming language is easy to learn and it provides great visualization capabilities with e.g. Matplotlib
As Napoleon Eduardo Cornejo, said It will be depend on what types of computer vision project you are going to developed. As you mention tracking system then i guess you should choose MATLAB and OpenCV because both languages provide you excellent platform for image input and output and both of them have computer vision library which will provide you easy accessibility for image operation.
Other hand if you want fast and real time results then C/C++ could be useful but in this case you need to write thousand of line code for single image operation which may be harder.
I would add, the essential is to have a readable code to make it easy to maintain/extend by you and the community.
Additionnally you don't have to forgot that your code must run on low level platform (like ARM) if you want maximize the community, smartphone will use more and more opensource libraries.
So C/C++ is the best, and later you can offer Python wrapper for the core functionnalities.
I worked in a very similar project (tracking of moving targets) many years ago. Tracking was implemented in C on RTLinux (as hard real time program), and visualization was implemented in C# on Windows. From Windows the user was also able to control the RTLinux system.
1- If you considered contributing to an open-source project, what programming language would be easier and more attractive for you?
This is subjective, but for me surely C/C++, as this is the language I use everyday.
2- What is in your opinion the most adequate programming language for our project, and why?
Our requirements are:
- Powerful image processing tools
Using C++, Java or Python you have access to openCV, which is widely use in computer vision and is portable.
- Possibility of having a user-friendly interface
I don't know about python, but for C++ and Java you can use Qt, which you can use to develop a friendly graphic interface easily (using Qt Designer).
Qt is also well integrated to visual C++ and portable.
Additional advantages we would value:
- A large community of developers
Python, Java and C++ have all a large community, with differente forum with really hlepfull people.
- Multi-platform
Python, Java and C++ (depend of the library used!)
- Simplicity of the language
Python, Java.
C++ is may be a bit more permissive and so "less easy", but more flexible.
- Good performance
Python is an interpreted language (no compilation) and so is less efficient.
Java is based on a kind of virtual machine, which allow the portability, (but at the cost of less performance?), nevertheless, it exist some real time application in Java.
C++, the best performance? Depend of the implementation, but with a good programmation, it is surely a really efficient language.
I would still vote C++ (more than C) for flaxibility (Object Oriented), performance and existing library (openCV, Qt...)
I used C++/OpenCV . It is easy to use and well documented
I used to use Matlab for simulations and data processing. Now I start using Python, and plan to get rid of Matlab in the near future. The main reason is Matlab is not free, and huge - occupied too many resources on my laptop. If you chose Python, I am happy to join the project. :-)
I have programmed in several programming languages and I've say the main language for me are Java and C++. Also I consider other languages for distinct kind of projects, for example Python for research projects, HTML5 for web porjects or PL/SQL for projects based on database management
If you have knowledge principles of programming languages, every language have its merits and demerits. I have programmed in several programming languages. I've say the main language for me are C and C++. consider other languages for distinct usage projects orientation ,
C and C++ are probably the most adequate for practical implementation, since the code will run faster. But they need more programming maturity (specially C++) and expertise. Matlab or Phyton are simpler, specially Matlab. And there is a very large community developing in Matlab.The last versions of Matlab are quite sophisticated in programming tools and there is a Matlab/C compiler that translates Matlab code into C code (eventually not so optimized as native C code).
I usually used C++/OpenCV. For simulations and data processing use MATLAB..
Depends on what you consider under "development", meaning, in which part of the library you expect that most "ouside" contributions come from. One option is C/C++ core with Python/MATLAB bindings. That would be bottom-up approach, which is a bit slow for development, but as most people already advised the correct thing to do in terms of portability, which might be an important issue.
I would be more attracted to contribute to a project that uses top-down approach, like Python, using Cython where ad-hoc speed-ups are needed. There are OpenCV and QT bindings for Python, and a bunch of numerical libraries are available (NumPy offers just a bare minimum, which keeps getting better in terms of functionality and performance). This way you'd get quick improvements in terms of speed with minimal intervention in already existing Python code, and you can write the performance bottlenecks in C/C++ and interface them from Python via e.g. swig.
People keep mentioning OpenCV. O'Reilly has a book, "Learning OpenCV." Their books are usually very good. At least today (6/13/2014), it's an early-release book and they have a 50% discount.
http://shop.oreilly.com/product/0636920022497.do
I would recommend c++. there are many resources out there that you can look up to.
I agree with those who recommended C++ in combination with OpenCV to fulfill the purpose under consideration, because they are fast and supported by a large open-source community.
Well I mean C++ is not bad, which should go well, in most cases fits well into such project perhaps because of its object oriented style of programming.
OpenCV has options for Matlab, Java, Python, and C/C++. I would choose one that best complements the other specific requirements of your project.
I think Python would be the way to go to make it easier for others to contribute.
May i suggest C and C++ for your requires and codeblocks as ide or wt (witty)
My opinion is that you should find a platform and follow their ways rather than finding a language and starting from scratch, see slides 11-14 in this presentation
https://www.dropbox.com/s/svwxrqvj3taswi4/Pinter_MedUniWien2014March_SlicerRt_Introduction.pptx
Otherwise in general I think C++ is best for performance and because its wide use in the scientific world, and python because of its flexibility and easy learning curve
In my opinion Python is the best choice if you want to address all of your targets:
- Open-source
- Object oriented programming language
- Powerful image processing tools
- Possibility of having a user-friendly interface
- Large community of developers
- Multi-platform
- Simplicity of the language
- Good performance
Python is an interpreted language, hence you do not have to compile it. On the other hand, this means that it is slower than C++. Anyway, if you need high performances you can do huge computations with C++ and use Python to build the interface.
Moreover, a large number of tools are already developed for Python. Following you'll find several links that illustrate you the power of the Python language:
https://www.python.org
http://www.numpy.org
http://www.scipy.org
http://matplotlib.org
C++
Combined with OpenCV, PCL, ROS or MRPT libraries, you can achieve great results, also in terms of performance.
I will not suggest Python for large scale projects, it tends to be messy.
I think, if you want to distribute this system widely, you have use C or C++ for core implementation. For front-end you can use Qt, or even make different front-ends for different platforms. For advanced users the possibility to make scripting (batch job automatization) in easy to learn and widely known language (eg. in Python) would be very useful.
There are two curiuos question, if i really consider contribute a open source proyect Java (OpenJava) is my first option. Why? object oriented, severals powerfull IDEs (netbeans, eclipse), several open source libraries, mobility support (a.k.a. Android, J2ME), multiplatform, several bindings form other languages and several other things.
The second question is, in fact, easy to respond, Java+OpenCV give your proyect efficiency of C++ OpenCV , and several image tools bindings (JMagick,JGimp, etc...) and libraries (JMF) implementation and friendly GUI with java swing or javafx, is multiplarform, simple and have good performace from a movile phone to a core i7.
AForge.NET is an open source C# framework designed for developers and researchers in the fields of Computer Vision and Artificial Intelligence - image processing, neural networks, genetic algorithms, fuzzy logic, machine learning, robotics, etc.
http://www.aforgenet.com/ web site you can find articles, forums, and computer vision projects.
Image Processing Lab is an image processing application written in C#, which includes different filters and tools available in AForge.NET framework to analyze images.
*Thanks to the Software Developer Andrew Kirillov.
http://www.aforgenet.com/
But who know Ada? Maybe 1% of programmers in general have heard of... :-(
Ada is ok but Wojciech said true WHO HAVE HEARD:( There some other nice like Cobol, FOX and some more but all of this are not suitable for students because they are fixated on easy to learn and profitable enough in future.
I agree that Ada is not an option if language popularity is a requirement, but question 1 was what language would be "easier and more attractive" to me.
If you want efficency, portability and the ability to interoperate with many imaging libraries, C or C++ are the clear winners. Which of these two you select is a matter of preference. For example, I would select a subset of C++ that uses templates (STL) but not inheritance.
One library you should consider is leptonica, which has a large set of fast image processing and image analysis functions and is used by several popular open source projects, such as tesseract (OCR):
http://www.leptonica.org
I'd agree with Tony Alfredo Stabile: Python is a good choice. It's easy to learn (good for students), very similar to Matlab (easy to switch), allows quick prototyping (lots of projects don't go much further than that anyway), is already known by a lot of people so that there is a huge community for support. Perhaps more importantly it has integration with OpenCV and R and several other tools, and allows you to write your own functions written in a faster language like C or C++ (for the more professional/hardcore programmers). So that it should appeal to people at all sorts of different levels of proficiency and with all sorts of different needs.
... you might find this interesting/useful:
http://spectrum.ieee.org/static/interactive-the-top-programming-languages
Good link from Hugh, I was going to include it myself. The top five languages each have greater than 90% popularity rating. I'd pitch any of them but would strongly recommend Python. It is very popular and has a high number of contributors in GitHub and SourceForge - the major consolidators of open source projects.
... personally, I would (and do) go straight to C++ for speed and the possibility of using CUDA. I might also add an upper C# layer if it was going to be a big and complex project with lots of other functionality (GUI, concurrency, networked/distributed etc). The XNA language extensions also add an interesting 'twist' to C# in image processing work. Although I didn't think that Microsoft development environments/languages were popular with the Open-Source community but Selman's post suggests I was wrong on that.
I am assuming you are asking about user-interfaces for desktop applications. For a cross platform user-friendly interface, i have always opted Qt. It is free(do not be confused with the commercial version if you happen to encounter it while googling). As per my knowledge, Qt is available for both C++ and Python(PyQt bindings) languages.
I believe C++ and Python are most widely used languages in industry. There are plethora of libraries in both C++ and Python that provide image processing functions. However, one should always choose based on project requirements. I choose C++ whenever possible as it allows me to add multiple backends for the compute heavy processing. By backend, i was referring to algorithm implementations using the following technologies:
* SSE/AVX
* CUDA
* OpenCL
My ideal choice for a computer vision project, especially if it involves lot of image processing, would be to use the following tools.
Core Language: C++
GUI: Qt5
Compute Language: SSE/AVX if GPU is not being considered. If GPU are a choice, you should definitely choose either OpenCL or CUDA.
My personal opinion is that you should try OpenCL as that allows you target all the following devices instead of getting stuck with one type of hardware which will happen if one uses SSE or CUDA.
* Intel/AMD CPUs that support OpenCL (most likely these are the devices you will end up with if you chose to go with SSE/AVX)
* NVIDIA/AMD GPU cards. Choosing CUDA will limit your target GPUs range.
If you choose to go with OpenCL compute backend, you might end up spending some additional time tuning the OpenCL kernels for CPUs and GPUS with some variations in code. However, i believe the additional time spent is worth it when you are getting such a wide range of target audience in terms of hardware.
Note: You also do not need to code standard image processing functions from scratch if you use CUDA/OpenCL. There are plenty of libraries that does the job for you, at least for basic image processing.
I think the best answer is Python. It is easy language. PIL module (Python Imaging Library) adds image processing capabilities. If you need processing power, you can use Cython to compile Python code into C.
O'Reilly has a book out called Programming Computer Vision with Python. I've purchased it myself and it has a variety of methods for various feature recognition and tracking algorithms - this is just a suggestion - I haven't yet had time to start programming in Python - I just received the book last week. Hope that helps - ToeKnee (o;'
C/C++ and Python (even Java) answer to your requirements and they are all of them very popular. Therefore, I suggest using the language that your team has a certain expertise/knowledge. If not, I strongly suggest Python. It is simple to use and it is much alike Matlab. Numpy and Scipy packages offer very powerful tools for scientific computing. There are also other packages like PIL and Matplotlib that you can use for image processing and plotting.
As a warning, do not use loops in Python. They slow down your processing a lot. So, in Python it is recommended, just like in Matlab, to express everything by matrices.
Good luck with your project, it is very interesting!
I used C# for my feature fingerspelling recognition research - but it's not open source - I used C++ frequently but as stated above it's not easy for a newbie to learn and would be better if you had an expert on board doing the coding - C# and Java are much easier and will most likely be expanded to do anything you need - I still don't have enough experience with Python to make any judgement but I've had employees that say Python is the best language to teach programming with (like Pascal used to be) and do things quickly without having tons of overhead and inclusions.
I'd cast a vote for Python. There are a number of computer vision options for Python including scikit-image. You can build a nice mutli-platform GUI with PyQT and if performance is an issue you can speed things up with Cython.
I'd probably lean towards Python anyway (over C/C++) but the fact that the current version is in Matlab really pushes Python over the top. There are a number of tools to help port Matlab code to Python (look here: http://stackoverflow.com/questions/9845292/a-tool-to-convert-matlab-code-to-python). If you're familiar with Matlab, the learning curve for Python will be much easier than the transition to C/C++.
Python also integrates really well with most GIS applications and there are heaps of Python libraries that will help you do just about anything with spatial data.
If you want buy-in from the open source software community, I think you'd want to stay well away from C# and .NET.
http://stackoverflow.com/questions/9845292/a-tool-to-convert-matlab-code-to-python
Beside the question of what lang to use in open source projects (i would go for python or javascript/V8/nodeJS: biggest number of coders; from an open source coders perspective c# is an unfree niche product, c/cpp developers go for industry) you will run straight into the problem that open source community likely will not contribute to a project including patented software (see promo video). Such patents/licenses produce to much legal fuss to get involved.
try to use R programming language.
I am sure you will get what you want in this language.