Which feature detection algorithm does cv2.Stitcher() use? - opencv

I just learnt about SIFT, ORB & SURF algorithms and how they are used for feature detection & extraction, and Homography & RANSAC techniques used in Image Fusion. While SIFT & SURF algorithms are patented and mostly have better accuracy (source1, source2), ORB algorithm is lightweight and Open Sourced.
OpenCV Stitcher function (documentation) is built such that it can be used even without knowing the entire image stitching pipeline.
So I am curious to know, which algorithms are used (especially for feature detection & extraction) in the cv2.Stitcher class? Also is it possible to choose different algorithms other than the default ones, used in its implementation?

The stitcher class uses ORB by Default:
stitcher->setFeaturesFinder(ORB::create());
in stitcher.cpp
You can use stitching_detailed.py/stitching_detailed.cpp or the stitching python package to play around with different detectors

Related

Explanation of feature descriptors in computer vision and machine learning

I've started working with computer vision techniques quite a bit, mainly deep learning but I want to try and get a good understanding of the more traditional techniques as well for a good grounding. I have been playing around with some manual feature engineering techniques for classification with RF and SVM classifiers. I've looked at texture representations like HOG and LBP descriptors as well as edge filters, gabor filters and spacial features such as fourier descriptors. What i'm kind of lacking is a good idea of how the different features group and what categories they each belong to. I know some are defined as global and local but what does this mean exactly and which ones? and are there others categories like texture and geometric that I should consider? Any explanation would be useful and much appreciated (i've looked a lot online but it all seems a bit fragmented)
Thanks!
Features are the information extracted from images in terms of numerical values that are difficult to understand and correlate by human. Suppose we consider the image as data the information extracted from the data is known as features. Generally, features extracted from an image are of much more lower dimension than the original image. The reduction in dimentionality reduces the overheads of processing the bunch of images.
Basically there are two types of features are extracted from the images based on the application. They are local and global features. Features are sometimes referred to as descriptors. Global descriptors are generally used in image retrieval, object detection and classification, while the local descriptors are used for object recognition/identification. There is a large difference between detection and identification. Detection is finding the existence of something/object (Finding whether an object is exist in image/video) where as Recognition is finding the identity (Recognizing a person/object) of an object.
Global features describe the image as a whole to the generalize the entire object where as the local features describe the image patches (key points in the image) of an object. Global features include contour representations, shape descriptors, and texture features and local features represents the texture in an image patch. Shape Matrices, Invariant Moments (Hu, Zerinke), Histogram Oriented Gradients (HOG) and Co-HOG are some examples of global descriptors. SIFT, SURF, LBP, BRISK, MSER and FREAK are some examples of local descriptors.
Generally, for low level applications such as object detection and classification, global features are used and for higher level applications such as object recognition, local features are used. Combination of global and local features improves the accuracy of the recognition with the side-effect of computational overheads.

OpenCV: what is the difference between feature2d and imgproc feature detection algorithms?

Both imgproc and feature2d modules of OpenCV have feature detection, however I did not see anywhere any text explaining the difference between the two and why there are two distinct parts of OpenCV bearing the same name.
Please, could anybody shed some light on this matter ?
Feature detection in imgproc is basically about geometric features, such as:
edges
corners
lines
circles
and is related to image processing (hence these functions are in imgproc).
Feature detection in features2d is about local features and descriptors (such as ORB, AKAZE, MSER, ...), and is more related to computer vision and machine learning (classification) fields. You can use Harris corner (in imgproc) as keypoints of local features, but that's not the only way to find keypoints (e.g. see MSER).
So, the name feature refers to different kind of features, and are so in different modules.

FeatureDetector vs. FeatureFinder in OpenCV

I'm trying to understand the difference between the FeatureDetector class and the FeatureFinder class. I've seen panorama examples written in OpenCV use both of these classes and it appears to be possible to use the SURF algorithm with either one. It was my understanding that the SURF FeatureDetector was moved to /nonfree because of possible issues with the SURF algorithm, but yet, FeatureFinder also can employ the SURF algorithm.
What's the difference between these two classes?
FeatureFinder can use the SURF algorithm because it is implemented using FeatureDetector.
Whichever you use, you are actually getting the same SURF implementation, just different interface.
FeatureFinder has an interface compatible with the stitching pipeline whereas FeatureDetector has an interface to match the 2d features framework.

Using Weka on Images

I am new to Weka, and from the examples on how to use it, I have only seen text problems. Can I use images in Weka with the machine learning classifiers?
You can directly do pixel classification using the Trainable Weka Segmentation plugin (former Advanced Weka Segmentation plugin) from Fiji/ImageJ.
The plugin is designed for segmentation via interactive learning. This means the user is expected to select a set of features (edge detectors, texture filters, etc.), choose the number of classes (by default there are 2) and interactively draw (with the ROI tools) samples of all classes. After training the classifier based on those samples, the whole image pixels will be classified and the segmentation result will be displayed overlaying the original image. The idea is to repeat this process (drawing + training) until obtaining a satisfying segmentation.
The plugin provides as well a set of tools to save/load the samples in ARFF format and save/load the classifier in .model format, so it's completely compatible with the latest version of WEKA.
If what you want to do is image classification, you might be able to reuse some of the plugin's methods as well.
You can use open source Image processing application such as ImageJ and Fiji to extract features from your image and use it in Weka
Fiji has a plugin called Advanced Weka Segmentation which should be very useful in applying Weka classifiers to Image
Weka machine learning classifiers works with numerical and categorical features. Before using weka with images, you need to extract features from your images.
According to your needs, simple features like average, maximum, mean may be enough. Or you may need to use some other algorithms for your images.
Below wikipedia feature extraction algorithms.
Low-level
Edge detection
Corner detection
Blob detection
Ridge detection
Scale-invariant feature transform
I suggest reading a optical character recognition survey to understand how they are used. OCR is pretty simple example for you to use. Standard data sets and algorithms exists for OCR. Therefore it is very instructive to learn about it.

How does HOG feature descriptor training work?

There doesn't seem to be any implementations of HOG training in openCV and little sources about how HOG training works. From what I gathered, HOG training can be done in real time. But what are the requirements of training? How does the training process actually work?
As with most computer vision algorithms, Google Scholar is your friend :) I would suggest reading a few papers on how it works. Here is one of the most referenced papers on HoG for you to start with.
Another tip when researching in computer vision is to note the authors of the papers you find interesting, and try to find their websites. They will tend to have an implementation of their algorithms as well as rules of thumb on how to use them. Also, look up the references that are sited in the paper about your algorithm. This can be very helpful in aquiring the background knowledge to truly understand how the algorithm works and why.
Your terminology is a bit mixed up. HOG is a feature descriptor. You can train a classifier using HOG, which can in turn be used for object detection. OpenCV includes a people detector that uses HOG features and an SVM classifier. It also includes CascadeClassifier, which can use HOG, and which is typically used for face detection.
There is a program in OpenCV called opencv_traincascade, which lets you train a cascade object detector, an which gives you the option to use HOG. There is a function in the Computer Vision System Toolbox for MATLAB called trainCascadeObjectDetector, which does the same thing.

Resources