CV: Difference between MATLAB and OpenCV camera calibration techniques - matlab

I calibrated a camera with checkerboard pattern using OpenCV and MATLAB. I got .489 and .187 for Mean Re-projection errors in OpenCV and MATLAB respectively. From the looks of it, MATLAB is more precise. But my adviser feels both MATLAB and OpenCV use the same BOUGET's algorithm and should report same error (or close). Is it so ? Can someone explain the difference b/w MATLAB and OpenCV camera calibration methods ?
Thanks!

Your adviser is correct in that both MATLAB and OpenCV use essentially the same calibration algorithm. However, MATLAB uses the Levenberg-Marquardt non-linear least squares algorithm for the optimization (see documentation), whereas OpenCV uses gradient descent. I would guess that this accounts for most of the difference in the reprojection errors.
Additionally, MATLAB and OpenCV use different algorithms for checkerboard detection.

Related

What algorithm does MATLAB use to find eigenvectors?

So I am using MATLAB for a project and am discussing the use of the power method for finding stationary distributions of Markov chains and its convergence rate. I was wondering what method/algorithms MATLAB's eig() function uses to find the eigenvectors of a matrix?
Normally Matlab is using LAPACK routines to do calculation. With that in mind I guess that from here you will be able to find the code that matlab runs. Be Aware LAPACK is in Fortran.
MATLAB Incorporates LAPACK

How to obtain damping ratio with Curve Fitting Toolbox

I have some experimental data from an oscillating system (time domaine) and I would like to get an approximation of the damping ratio (zeta). I have already try to use the half-power band width method with the vibrationdata Matlab package. But I would like to compare the result with another method.
I found several methods in this paper : www.vce.at/sites/default/files/uploads/downloads/2007_damping_estimation.pdf and I would like to try to do the curve fitting method with the Curve Fitting Toolbox of Matlab (R2014b) (chapter 2.2.2 Curve fitting in the paper).
It's the first time I use this Toolbox with a custom equation, so, I do not really know how to do it with my sample data.
I do not know how to write in the Curve Fitting Toolbow, the equation of the paper as it involves differentiate equation...
Can anyone help me regarding this.

Why is SIFT not available in Matlab?

SIFT is an important and useful algorithm in computer vision but it seems that it is not part of Matlab or any of its toolboxes.
Why ? Does Matlab offer something better or equivalent ?
MATLAB has SURF available as part of the Computer Vision Toolbox but not SIFT: http://www.mathworks.com/help/vision/ref/surfpoints-class.html. However, both algorithms are pretty much the same with some minor (but crucial) differences, such as using integral images and a fast Hessian detector. I won't go into those differences in any further detail, but you can certainly read up on the work here: http://www.vision.ee.ethz.ch/~surf/eccv06.pdf. As to the reason why MathWorks decided to use SURF instead of SIFT... it could be any reason really. AFAIK, there is no official reason why one was chosen over the other as they are both subject to being patented.
However, if you want to use SIFT within MATLAB, one suggestion I have is to use the VLFeat toolbox where a C and MATLAB implementation of the keypoint, detection and matching framework has been made available and is open source. It also has a variety of other nice computer vision algorithms implemented, but VLFeat is one of the libraries that I know of that manages to compute SIFT as accurately as the original patented algorithm.
If you're dead set on using SIFT, check VLFeat out! Specifically, check out the official VLFeat tutorial on SIFT using the MATLAB wrappers: http://www.vlfeat.org/overview/sift.html

How to find Region of interest of color image in matlab using opencv?

I want to find Region of interest of a color image in MatLab.
Is it good to use openCV inside matlab to find ROI?
Please help me how to achieve this
Matlab and OpenCV are two completely different things. OpenCV is a vision library that you can use in C++ or Python, and you should see Matlab as a programming language, which uses its own libraries (toolboxes), among those you may be interested in the Image processing toolbox and the Computer vision system toolbox.
If you wish to manually mark a ROI in Matlab there are few ways to do it. The easiest, is to use
BW = roipoly.
See roipoly documentation
To the best of my knowledge, no similar generic function such as Matlab's roipoly exists in OpenCV.

SIFT and SURF feature extraction Implementation using MATLAB

I am doing an ancient coins recognition system using matlab. What I have done so far is:
convert to grayscale
remove noise using Gaussian filter
contrast enhancement
edge detection using canny edge detector.
Now I want to extract feature for classification. Features I thought to select are roundness, area, colour, SIFT and SURF. My problem is how I can apply SIFT and SURF algorithms to my project. I couldn't find built-in functions for both.
You can find SIFT as a C implementation with MATLAB bindings at: http://www.vlfeat.org/index.html
For anyone else coming across this thread as I did, I noticed the implementation at http://www.vlfeat.org/index.html was far more than I required and also fairly hard to adjust to my code.
The following link; http://robwhess.github.io/opensift/, has an implementation of just the SIFT algorithm accompanied with an example executable, with the source code available (unlike http://www.cs.ubc.ca/~lowe/keypoints/ which only has the sift binary executable).
you can find a matlab implementation of SIFT features here: http://www.cs.ubc.ca/~lowe/keypoints/