3D mesh transform using sparse control points
Written by Daniel Markel 2014
this function performs a non-rigid deformation based on a 3D interpretation of the algorithm described by
Wang Y., Lee O., "Use of two-dimensional deformable mesh structures for video coding, part 1 - the synthesis problem: mesh-based function approximation and mapping", IEEE transactions on circuits and systems for video technology, Vol. 6, No. 6 (1996).
This does not require the transformation vectors to be regularly spaced as is the case with every version of the interp3 function. Currently using Matlab2014a the code takes about 5.6 seconds to run on a 136x301x91 sized volume. If anyone wishes to try and improve the performance using mex or CUDA by all means give it a shot. The current code does not run on the GPU. I'm putting this up simply because this function does not exist for Matlab elsewhere as far as I've seen.
Inputs
im -- the 3D volume being transformed
bold -- a 3xn matrix describing the initial (x,y,z) coordinates of the
control points where n is the number of control points
bnew -- a 3xn matrix describing the final (x,y,z) coordinates of the
control points
tmesh -- a mx4 matrix of the connectivity structure for each tetrahedron
connecting the control points, see delaunay for the output.
X,Y,Z -- coordinate matrices output from meshgrid for the size of im.
Outputs
imT -- the warped image
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
acknowledgements -- code makes heavy use of the inhull function written by
John D'Errico (2006). Special thanks to Piotr Pater
for assistance in improving the efficiency of the code.
Cite As
Daniel Markel (2024). 3D mesh transform using sparse control points (https://www.mathworks.com/matlabcentral/fileexchange/48044-3d-mesh-transform-using-sparse-control-points), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Platform Compatibility
Windows macOS LinuxCategories
- Image Processing and Computer Vision > Image Processing Toolbox > Geometric Transformation and Image Registration >
- Image Processing and Computer Vision > Image Processing Toolbox > 3-D Volumetric Image Processing >
- MATLAB > Graphics > Images > Read, Write, and Modify Image >
Tags
Acknowledgements
Inspired by: Inhull
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0.0.0 |