Archived entries for i hate matlab

Total Variational L1 and Anisotropic Huber L1 Optical Flow

In 2007, a very nice implementation of a variational implementation of optical flow was described in: A Duality Based Approach for Realtime TV-L1 Optical Flow by C. Zach et. al. I won’t get into the details too much, but the formulation is described by this equation:

E = int_?{?|I0(x) ? I1(x + u(x))| + |?u| dx}

If you are familiar with the seminal work of Horn and Schunck, you will notice it is fairly similar to their variational formulation:

min_u{ int_?{ (|?u1|^2 + |?u2|^2) d? } + ? int_?{ ((I1(x + u(x)) ? I0(x))^2) d? }

And although it looks incredibly simple now, it is in fact fairly difficult computationally since now both terms are not continuously differentiable. To overcome this difficulty, they follow the work of Rudin-Osher-Fatemi energy for total variation image denoising.

Another big contribution comes in their implementation on the GPU. By linearization of the generally non-convex energy functional shown above, the problem is reduced to a pixel-wise convex energy minimization problem. Additionally, by employing coarse-to-fine image pyramids, they are able to account for both small and large movements. Luckily, graphics cards are great at doing both of these sorts of computations very quickly. You … Continue reading...

SiftGPU (Cg/GLSL/CUDA) for Matlab

Changchang Wu has a beautiful implementation of David Lowe’s scale invariant feature transform (SIFT) inspired by Andrea Vedaldi’s sift++ and Sudipta N Sinha et al’s GPU-SIFT. Adam Chapman has also made a MATLAB mex version which will allow you to pass in the filename of an image and retrieve the SIFT descriptors and keys as well as perform the matching. If that sounds like a lot of people have implemented this algorithm, then check this out.

I had tried using Adam Chapman’s version though, unfortunately, I already had my images loaded into the MATLAB workspace after performing some manipulations and didn’t want to keep writing/reading from disk, thinking that it would be a waste of computation time. I was also processing a lot of images in turn and was running into a lot of crashes, perhaps from continually loading and unloading the library? I haven’t seen anyone complain about this version on the mathworks site, so maybe it is just me.

In finding a way to avoid writing and reading to disk, I did not foresee a problem in the way MATLAB and OpenGL handle their image data. After a brief exchange with Changchang Wu, he led me on … Continue reading...


Copyright © 2010 Parag K Mital. All rights reserved. Made with Wordpress. RSS