Archive for June, 2012

Close all open files in matlab after error

Friday, June 29th, 2012

I got a funny error running a matlab batch script:


/Applications/MATLAB_R2011b.app/toolbox/matlab/lang/message.m:
Too many files open.

Error in dlmread (line 62)

The solution was easy:


fclose('all')

Smooth Shape-Aware Functions with Controlled Extrema video

Friday, June 29th, 2012

Here’s the video to go along with our paper, Smooth Shape-Aware Functions with Controlled Extrema, that we’ll present at SGP 2012.

Smooth Shape-Aware Functions with Controlled Extrema project page

Friday, June 29th, 2012

Smooth Shape-Aware Functions with Controlled Extrema cacti
I put up a project page for our new paper that we’ll present at SGP (Symposium of Geometry Processing) this month. The paper’s called, “Smooth Shape-Aware Functions with Controlled Extrema” and it’s a collaboration between me, my advisor, Olga Sorkine and my ex- officemate at NYU Tino Weinkauf, who’s now at MPI in Saarbrucken.

Abstract:
Functions that optimize Laplacian-based energies have become popular in geometry processing, e.g. for shape deformation, smoothing, multi scale kernel construction and interpolation. Minimizers of Dirichlet energies, or solutions of Laplace equations, are harmonic functions that enjoy the maximum principle, ensuring no spurious local extrema in the interior of the solved domain occur. However, these functions are only C0 at the constrained points, which often causes smoothness problems. For this reason, many applications optimize higher-order Laplacian energies such as biharmonic or triharmonic. Their minimizers exhibit increasing orders of continuity but also increasing oscillation, immediately releasing the maximum principle. In this work, we identify characteristic artifacts caused by spurious local extrema, and provide a framework for minimizing quadratic energies on manifolds while constraining the solution to obey the maximum principle in the solved region. Our framework allows the user to specify locations and values of desired local maxima and minima, while preventing any other local extrema. We demonstrate our method on the smoothness energies corresponding to popular polyharmonic functions and show its usefulness for fast handle-based shape deformation, controllable color diffusion, and topologically-constrained data smoothing.

To two tutus too

Thursday, June 28th, 2012

Frankie and Johnny walk into a tutu shop.

Frankie: I’d like one tutu.
Johnny: I’d also like one tutu.
Frankie: Actually, I’ll have two tutus.
Johnny: Oh, I’ll change my order to two tutus, too.

is cindy sherman receiving this award posthumously

Thursday, June 28th, 2012

is cindy sherman receiving this award posthumously

http://alecjacobson.com/art/digital/
http://alecjacobson.com/art/

Save Matlab myaa image to png file

Wednesday, June 27th, 2012

I use the myaa (My Anti Aliasing) tool frequently to create nice camera-ready graphics directly in matlab. Often I’ll just take screen captures, but when scripting it’s nice to save procedurally. Now I do this by calling:


drawnow
imwrite(getfield(getframe(gca),'cdata'),'myaa.png')

Unless I’m unaware of something, saving to an image file is not directly supported in myaa.

Update: Awkwardly this is not so good for scripting because getframe seems to take a screengrab rather than a buffer dump.

Update: Try also:


imwrite(hardcopy(gca, '-Dzbuffer', '-r0'),'myaa.png');

Turn off all the lights in Matlab

Wednesday, June 27th, 2012

One-liner to hit the lights on the current figure:


delete(findall(gcf,'Type','light'))