File Exchange

image thumbnail

Surface Reconstruction from Gradient Fields: grad2Surf Version 1.0

This toolbox is for the regularized reconstruction of a surface from its measured gradient field.

19 Downloads

Updated

View License

Regularized Least-Squares Surface Reconstruction from Gradient Fields: grad2Surf Version 1.0

This toolbox is for the reconstruction of a surface from its measured gradient field. It is assumed that the gradient field is corrupted by noise, and thereby the package provides algorithms which compute the least-squares solution to the problem, along with various forms of regularization, including:

1) Spectral Regularization
2) Tikhonov Regularization
3) Constrained Regularization (Dirichlet Boundary Values)
4) Weighted Least-Squares

Examples of these types of regularization and how to use the toolbox are given in the accompanying documentation file: g2sIntro.pdf

This toolbox requires the Discrete Orthogonal Polynomial Toolbox (DOPbox):
http://www.mathworks.com/matlabcentral/fileexchange/41250

The theory behind this toolbox is described in the papers:
[1] Harker, M., O’Leary, P., Regularized Reconstruction of a Surface from its Measured Gradient Field, (preprint available at arxiv.org)
[2] Harker, M., O’Leary, P., Direct regularized surface reconstruction from gradients for Industrial Photometric Stereo, Computers in Industry, In Press, 2013.
http://dx.doi.org/10.1016/j.compind.2013.03.013

See also:
[3] Harker, M., O’Leary, P., Least squares surface reconstruction from measured gradient fields, IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2008, pp. 1-7.
http://dx.doi.org/10.1109/CVPR.2008.4587414
[4] Harker, M., O’Leary, P., Least squares surface reconstruction from gradients: Direct algebraic methods with spectral, Tikhonov, and constrained regularization, IEEE Conference on Computer Vision and Pattern Recognition, CVPR 2011, pp. 2529-2536.
http://dx.doi.org/10.1109/CVPR.2011.5995427

Comments and Ratings (5)

V

V (view profile)

Hello ! Great work, the results are awesome.

May I ask a question ? Maybe it's stupid, I don't understand everything, but would it be possible to use Dirichlet Boundaries with the Tikhonov regularization ?

Thanks

Indeed there was an error in dopDiffLocal which was a result of a change made in Version 1.6. We have deposited a corrected version of the library (Version 1.7).

E

E (view profile)

Hello again,

I just got the code working by replacing line 157 in the m-file "dopDiffLocal.m" from

rS = rank( S );

to

rS = sprank( S );

since the error I was getting before seemed to have been generated by the fact that the matrix S is sparse, and the function rank does not work with sparse matrices.

Please let me know your take on this modification (i.e., if this was your intended meaning in the context).

Thanks again,

E.

E

E (view profile)

Dear authors,

I have downloaded your code for surface reconstruction from gradient for comparison purposes. I am in the early testing stages, and I tried generating a test surface using the function provided "g2sTestSurf.m". Specifically, I tried:

[Z,Zx,Zy,x,y] = g2sTestSurf(121,121,'even',1);

This works, and I can see the test surface as well as its gradient components, but when I try to reconstruct the surface from the gradient, by typing in the command:

Zr = g2s( Zx, Zy, x, y );

I get the following error message:

Error using svd
Use svds for sparse singular values and vectors.

Error in rank (line 15)
s = svd(A);

Error in dopDiffLocal (line 157)
rS = rank( S );

Error in g2s (line 82)
Dx = dopDiffLocal( x, N, N, 'sparse' ) ;

Could you please let me know what it is that I am doing wrong?

Thank you in advance,

E.

MATLAB Release
MATLAB 7.14 (R2012a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today