Computational complexity of openCV algorithms/methods - opencv

After it came up in a question, I realised, that up to this point I never stumbled upon any information about the computational complexity of the algorithms or methods openCV provides. Are there any articles or information about it? For example (as it came up in this question), the complexity of reading/accessing a video stream in Landau notation, or any of the algorithm implementation like SIFT/SURF (I only read that the openSURF library is supposed to be more efficient than the openCV implementation).

I'd say that most of the high-level algorithms are documented, at least with pointer to an academic article, where you can have hints about the complexity of the algorithm

Related

Difference between SVM implementations

I am trying to implement an SVM in Rapidminer. However I am presented with several SVM implementations, libsvm, mysvm,JMySVM, Particle Swarm Optimization based SVM and Evolutionary SVM. Know I know the basic differences between the implementations but what are the advantages and disadvantages of them to know which one to implement?
I am not finding much information about this online, I would like to avoid a try them all to see which one presents the best results. So I would like to know in which situation I should use them.
From the first, you seem to confuse different implementations and algorithms. As far as I know, libsvm, mysvm and JmySVM are standard implementation which solve the SVM optimization problem by algorithms such as sequential minimal optimization.
On the contrary, the other SVMs you mentioned (additionally) use less common approaches like particle swarm optimization or evolutionary algorithms for the optimization. Such methods usually give you good approximation with small effort, which might be advantageous for large-scale problems (--but I admit I don't know the exact motivation for their invention).
If you are looking for the SVM model which is common in machine learning and related fields, I would suggest you to try the library libsvm. Alternatively, you can have a look on the collection here.

algorithm for finding feature points of a face in opencv

I am doing a project on expression recognition in opencv and have successfully extracted the face region,i am having trouble building my own algorithm for the feature points extraction of a face,can someone help me with it?
since this is my first try to answer question, I will try to do my best. I cannot post more than two links, so I will try at least to give some hints.
Your question is quite broad. It depends on the type of application and requirements. Are you doing on-line detection, is it static etc.? Based on that, you should consider keypoint detection algorithm. I do not think it is a good idea to build your own algorithm, because OpenCV already has a lot of methods that you can choose from. All you have to do in most cases is to do some pre-processing, but it depends as well.
Most popular feature detection methods are: SURF (Opencv SURF), SIFT, ORB, FAST etc. Keep in mind that SURF and SIFT ar non-free. SURF and SIFT brings a lot of features and are quite accurate, somewhat scale and rotation invariant, but also a bit slow (especially on online tracking). FAST and ORB are fast, but they are more sensitive to noise and have their own disadvantages (see descriptions on OpenCV documentation). If I were you, I would try most of them and see which one does the best job (it is not difficult to test them).
Secondly, you have to choose descriptors. Very goog introduction is here:
Descriptors tutorial. There you will find all basic info. It is important to say, that you can mix various keypoint detection algorithms and feature description algorithms (but keep in mind that not all are compatible, tutorial will explain this).
I am out of links for this post, but OpenCV documentation provides a lot of sample code for this problem, so go ahead and have a look.
Hope you succeed. Good luck.

Implementation of state-of-the-art video shot boundary detection

I am working on a wide project involving object retrieval from videos.
According to "A Survey on Visual Content-Based Video Indexing and Retrieval", most popular methods are divided in:
simple "threshold based approach" (global or adaptative)
supervised learning-based classifiers (with SVM or AdaBoost)
unsupervised learning-based algorithm (mainly K-Means)
For the moment I implemented on my own a very simple and old-fashioned method based on differences of color-histograms among successive frames.
Nevertheless, I would like to try something more efficient and up to date, without spending too much time, considering that shot boundary detection is not the main topic of my research.
Does anybody know an implementation of an effective algorithm?
I've found the following implementation extremely useful and effective in my own research:
https://github.com/johmathe/Shotdetect
The workhorse of the codebase happens here:
https://github.com/johmathe/Shotdetect/blob/master/src/film.cc#L117-237
It mostly relies on color information for detection of shots.
Computing Chi-Square distance of RGB histograms of adjacent frames is one of the fast, simple and robust methods for shot boundary detection. You can see my implementation and usage of this method in here.

Can the Hough Transform be used in commercial software?

Can the Hough Transform be used in commercial software?
I mean, it is one of those things that seem research only and unstable.
You would not put it in a commercial compositing software for example
and have the user rely on it at all times.
Any opinions?
Thanks
The Hough transform has been in use in commercial and industrial applications all over the world for years, decades even. From the wikipedia page you can see that it was first developed in 1972, based on earlier ideas from 1962. That means it is older than the CCD that you use to capture the images you use in the compositing software.
Given that it "seems research only and unstable" to you, I would suggest you spend some time learning various computer vision and image analysis algorithms and techniques, and get a good mathematical basis in the field in general before you implement the Hough transform in commercial compositing software.
And when you are done studying I'd suggest you use a well tested open source implementation.
Yes. In fact, I've written Hough transform code for a piece of commercial software that wasn't meant to be a research tool like MATLAB. Though I put a lot of time into its robustness towards a specific application, it worked great.
The Hough transform by itself can sometimes be unreliable in applications where you have some level noise, such in webcams, or when there are some distortions in the shape you need to extract. This may be what you are seeing. In this case you may need to do a little more tuning towards your application, or try some basic image preprocessing.
I'm a bit annoyed with the condescending tone in both the comment to the question (by High Performance Mark), as well as the accepted answer here.
Firstly, that programming libraries/frameworks provide an implementation of an algorithm does not mean it is used, or rather, suited for commercial applications (i.e. getting the job done, robustly, on less pristine conditions). The Hough transform is a well defined algorithm (with possible uses and limitations) which is simple enough to understand, and very commonly taught in introductory image processing courses. Not surprisingly, it has been implemented in general purpose libraries such as Matlab's, Octave's and OpenCV. I don't believe the question was intended to discuss the robustness of an implementation and possibility of inclusion in commercial image processing frameworks, but rather if the algorithm itself is well suited for end user software (an application that counts circles, or what not).
The accepted answer, as it stands, is "The algorithm is very old. Here is a book on image processing, here is a link to a image processing library that has implemented it". The other answer with zero score seems to be on topic (i.e. discussion possible applications), though isn't very specific ("worked for me").
So, why do some people get the impression that the hough transform is unreliable for shape detection? Here is a good example: Unreliable results with cv2.HoughCircles
The input seems to be very well defined circles. However, the more robust, suggested working solution doesn't use Hough transform. I've had similar experience with my own projects. Usually, the more robust way is some kind of object segmentation, distance transform, watershed and peak localization. Have I ever used Hough transform with good results? No. I think it could be useful in some cases. In particular if the shapes of the imaged objects are perfectly defined, and partially occluded.
In other words, I'm also curious as to commercial applications that ended up benefiting from Hough transform. That's how I came across this question, and subsequently disappointed in the "you wouldn't ask that question if you understood the subject better", responses.

what are the steps in object detection?

I'm new to image processing and I want to do a project in object detection. So help me by suggesting a step-by-step procedure to this project. Thanx.
Object detection is a very complex problem that includes some real hardcore math and long tuning of parameters to the computation methods involved. Your best bet is to use some freely available library for that - Google will help.
There are lot of algorithms about the theme and no one is the best of all. It's usually a mixture of them what makes the best solution to the solution.
For example, for object movement detection you could look at frame differencing and misture of gaussians.
Also, it's very dependent of your application, the environment (i.e. noise, signal quality), the processing capacity you may have available, the allowable error margin...
Besides, for it to work, most of time it's first necessary to do some kind of image processing to the input data like median filter, sobel filter, contrast enhancement and a large so on.
I think you should start reading all you can: books, google and, very important, a lot of papers about the subjects (there are many free in internet) you are interested in.
And first of all, i think it's fundamental (at least it has been for me) having a good library for testing. The one i have used/use is OpenCV. It's very complete, implement many of the actual more advanced algorithms, is very active, has a big community and it's free.
Open Computer Vision Library (OpenCV)
Have luck ;)
Take a look at AForge.NET. It's nowhere near Project Natal's levels of accuracy or usefulness, but it does give you the tools to learn the algorithms easily. It's an image processing and AI library and there are several tutorials on colored object tracking and motion detection.
Another one to look at is OpenCV from Intel. I believe it's a bit more advanced, but it's written in C.
Take a look at this. It might get you started in this complex field. The algorithm pages that it links to are interesting reading.
http://sun-valley.stanford.edu/projects/helicopters/final.html
This lecture by Jeff Hawkins, will give you an idea about the state of the art in this super-difficult field.
Seems that video disappeared... but this vid should cover similar ground.

Resources