trainCascadeObjectDetector How does it work? - matlab

Can someone direct me to a document or some kind of source about the "magic" behind trainCascadeObjectDetector? I was looking around for quite a bit but couldn't find anything. Thank you for your time.

Check the answer on MATLAB Answers:
Hello Dai,
Do you need to explain how the face detector itself works, or how the training of the face detector works?
vision.CascadeObjectDetector implements the deletection algorithm by Viola and Jones. It is a "sliding-window" approach, which slides a window across an image, and tries to determine whether or not there is a face in each location using a cascade of boosted classifiers. The original algorithm uses Haar-like features. vision.CacadeObjectDetector also gives you the option to use LBP or HOG features.
The Algorithms section of the vision.CascadeObjectDetector documentation gives a good high-level overview of what it is doing.
As far as the training process, there is a tutorial in the documentation explaining some of the details.

Related

Find image within image (template matching?)

I need to find the location of an image that the user provides within an image that I provide.
It is safe to assume at the time of the analysis that the user provided image is certain to be contained within the image to be compared with.
I’ve looked through and even have some experience with Core ML and Vision image classification however I am struggling to convince myself that it is the correct way to approach this problem. I feel like the way “feature values” is handled in Vision it is almost the reverse of what I’m looking for.
My question: Is there a feature of Core ML or Vision that tackles this particular problem head on?
Other information that may be needed;
It is not safe to assume that images provided are pixel to pixel perfect due to possible resolution differences.
They may also be provided in any shape although possible to crop to a standardised shape before analysis.
Rotation will also need to be accounted for.
There would not be cases where the image is in the image twice.
Take a look at some of the feature detection and matching algorithms.
For example, you could use SIFT (scale-invariant feature transform algorithm) with RANSAC (Random sample consensus algorithm) to do exactly what you described.
If you are using OpenCV there are plenty of such algorithms which you can easily use. (FAST, Shi-Tomasi, etc.)
I think you need something like this expale in OpenCV

A good example for using HMM in Matlab

I want to do hand gesture recognition with hmm in matlab. I studied the theoretical materials in both hmm concept and hmm in mathwork . But I need to see some real examples which uses matlab instructions for dealing with hmm. I searched in the web but could not find a good one. Does any one know a reference which uses matlab instructions in a hmm process?
I suggest you look at the toolbox by K. Murphy and its tutorial.
The built-in hmm functions in Matlab are pretty limited I find (though I did not use the very last edition of Matlab). However you can look at the Matlab tutorial too.
Finally, you can check this toolbox. It contains a demo file.
On a side note, be aware that your question is somewhat off-topic here. Adding some code to show that you a least tried something and clearly spot what is causing you trouble (training the model? formatting the data? applying the Viterbi algorithm?) would make this question much more interesting to the community.

Haar classifier for segmenting lips

I have tried building my own Haar for segmenting out lips. But I have not achieved very good results. Can I get any Haar for lips segmentation just like the one we have for eyes. I searched the internet for such haar but couldn't find one.
My aim is to find if my mouth is widely open or closed.
If no one has done such haar. I will build one and opensource it.
If there are no Haar cascades in the OpenCV distribution that currently implement how to segment out lips, consider building your own. Take a look at the guide to building Haar cascades from the OpenCV project for more details:
http://docs.opencv.org/trunk/doc/user_guide/ug_traincascade.html
I am assuming you already have positive and negative examples of what you want to classify, and so you can build your own cascades using your own ground truth data. The above guide will get you started on creating your own Haar cascades.
NB: I am usually against deferring people to external links without some sort of closure in my posts, but the process to do this is quite involved, and I can't invest the effort in repeating that information here.
This will help u in matlab use Viola-Jones algorithm
vision.CascadeObjectDetector System object
Detect objects using the Viola-Jones algorithm
Description
The cascade object detector uses the Viola-Jones algorithm to detect people's faces, noses, eyes, mouth, or upper body. You can also use the Training Image Labeler to train a custom classifier to use with this System object. For details on how the function works, see Train a Cascade Object Detector.

Neural Networks for Pattern Recognition

Hey guys, Am wondering if anybody can help me with a starting point for the design of a Neural Network system that can recognize visual patterns, e.g. checked, and strippes. I have knowledge of the theory, but little practical knowledge. And net searches are give me an information overload. Can anybody recommend a good book or tutorial that is more focus on the practical side.
Thank you!
Are you only trying to recognize patterns such as checkerboards and stripes? Do you have to use a neural network system?
Basically, you want to define a bunch of simple features on the board and use them as input to the learning system. It can often be easier to define a lot of binary features and feed them into a single-layer network (what can become essentially linear regression).
Look at how neural networks were used for learning to play backgammon (http://www.research.ibm.com/massive/tdl.html), as this will help give you a sense of the types of features that make learning with a neural network work well.
As suggested above, you probably want to reduce your image a set of features. A corner detector (perhaps the Harris method) could be used to determine features in the checkerboard pattern. Likewise, an edge detector (perhaps Canny) could be used in the stripes case. As mentioned above, the Hough transform is a good line detection method.
MATLAB's image processing toolbox contains these methods, so you might try those for rapid prototyping. OpenCV is an open-source computer vision library that also provides these tools (and many others).

Threshold decomposition in Matlab

How do you do reconstruction by threshold decomposition in Matlab? Is there a function for it?
Can you provide some more details of the steps in such a procedure? Some of us are not well versed in DSP theory. I did find a link from a book in Google books here.
If this is exactly what you want it does not seem difficult to code it up. On the other hand if you want something reliable and optimized for speed maybe on of the DSP toolkit users knows a way.