Site Network: Personal | My Company | Vision Research Lab @ UCSB |

Marco's Code

Here I will share some of my notes and some of my code, mostly in Matlab and C++. Please let me know if you find bugs or if you have any suggetions for improving the quality of the code.

If you use some of these routines for any published work, acknwledgments will be greatly appreciated. Hope you will find something interesting/useful!



Xcode, Matlab, MEX, IPP, MKL and all that stuff... In these notes I will describe my first (successful) attempt to compile and link MEX files for Matlab using Xcode IDE on a Intel Core 2 MacBook Pro.

Computer Vision



RANSAC Toolbox This is a research (and didactic) oriented Matlab/Octave toolbox to explore the RANSAC algorithm. The functions are reasonably well documented and the package comes with several examples for different estimation problems. You can download the package from Github (if you have git installed on your system just type from the command line git clone
get_line_hough.m Matlab function to calculate the N most voted lines using the Hough transform. The lines are parameterized as: cos(theta)*x + sin(theta)*y = rho.

Image Processing

compute_image_derivatives.m Matlab function to compute image derivatives via Gaussian kernels. The gradient magnitude and its phase are computed as well. The Matlab function taking advantage of the IPP accelerated routines.
get_intensity_interp.m test_get_intensity_interp_01.m Matlab function and test script to compute the intesity values at the points x using nearest neighbour, bilinear or cubic interpolation. Note that the coordinates x do not need to be interger values.
imscale.m Matlab function to scales the dynamic range of the input image according to its type.
Grep-like and image batch processing functions get_file_list is a function to recursively retrieve files whose name match a given regular expression. imbatchconvert uses get_file_list to perform image batch processing.
imtile.m Matlab function to divide an image in (possibly overlapping) tiles.


conv2FFT.m Matlab function to perform the 2D convolution via FFT.
fp_quantize.m Matlab function to quantize a number using N_int bits for the integer part and N_frac bits for the fractional part and one bit for the sign.
Generate Array Two simple functions to convert a Matlab array in a set of instructions for LaTeX or C. The functions generate a string that can be printed in the Matlab command window and the copied and pasted into your code.
normalize_data.m Matlab function to normalize the data to zero mean and identity covariance matrix.


align_vectors.m Matlab function to align the vectors u and v via a Householder reflector Q.
get_ellipse.m Matlab function to compute the points that satisfy the quadratic equation x'*P*x=1, as long as P is symmetric positive definite.
norm_schatten.m Matlab function to compute the p Schatten norm of a matrix.
par2sym.m Matlab function to compute the symmetric 2x2 matrix which represents an ellipse with semiaxis a, b and rotation angle theta.
sym2par.m Matlab function to compute the semiaxis a, b and rotation angle theta of the ellipse represented by the symmetric matrix A.
tri_area.m Matlab function to compute the the triangle area given the triangle vertices (using Heron's formula).