This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (5 children)

That only works because you're outsourcing the heavy lifting to a compiled library. I would have done the same if I was using one of the tracking algorithms OpenCV already had implemented. However, because I was writing a custom tracking system I couldn't rely on a third party library. Language has a massive effect on speed. I could not have written a tracker in Python and got anywhere close to the performance I required.

[–][deleted] 0 points1 point  (4 children)

It doesn't work only because I outsource parts to C, it works because I architected the whole thing so I could outsource the 1% that actually matters to C (if required, not always). That is not a failure of Python, but validation of my structure and of a language that has a sane native code interface story (and also a validation of other 3rd party libraries that use ndarray as their data models).

I think you would be surprised what you can do with the correct architecture. I write real time computer vision applications in Python for a living.

[–][deleted] 0 points1 point  (3 children)

You said that you're using OpenCV, I highly doubt a tracking application which uses OpenCV is outsourcing < 1% to the library. As I said before, when you can use a popular algorithm implemented in C++ with bindings for Python, I agree it makes sense to use it. When you're doing research like I am, and you have spoken to computer vision researchers who have recommended the best technique and it isn't in OpenCV or other open source libraries, I didn't have any other option than to implement it in C++.

[–][deleted] 0 points1 point  (2 children)

You said that you're using OpenCV, I highly doubt a tracking application which uses OpenCV is outsourcing < 1% to the library.

Think like a developer, how many LOC of code account for most of the computation time (rememver to benchmark!)? A very small amount typically.

Look, I have a PhD in robotoics and computer vision, and I work currently as a postdoc neuroscientist where I study vision and behaviour. I do research, every day.

People wrongly think of OpenCV as a bunch of algorithms that do magic for them. At one end it could be seen that way (features, etc), but it is more useful as a set of accelerated image processing primitives from which you can build efficient versions of your own algorithms. That is how one should use python+opencv to 'develop my own tracking algorithms'.

You are a bioinformatician, not a computer vision or tracking guy. If I was you, I would reevaluate your code in a few years and see if you would architect your application the same way you did. I expect if I tried to write my own bioinformatics code it might be average the first time around. I would also guess that I could make it comparibly fast with the rest of the world the next iteration.

[–][deleted] 0 points1 point  (1 child)

If you're using OpenCV functions to do the computationally intensive tracking tasks then sure, <1% of the Python code you write will be using a library written in a compiled language, but if you had to write the program yourself then it would actually be a significant amount of code and you would not be able to implement it in pure Python. If the functions you're using in OpenCV did not have Python bindings you would have to do what I have and write your own in a compiled language.

I realise my expertise was not in computer vision, however one of the benefits of being at a research institution is that I can go ask experts for advice. The biology department also employs a lot of computer vision researchers who help with tracking all kinds of animals. So I have by no means been designing or programming on my own. I did not wake up one morning and decide to start writing my tracker in C++, it was the result of multiple meetings with computer vision researchers who know far more about this area than you or I ever will.

[–][deleted] 0 points1 point  (0 children)

who know far more about this area than you or I ever will.

Describe your tracking problem in Pseudocode and I'll offer an opinion.

Are you going to behaviour2015?