How to apply imfilter function in 3d
Show older comments
oh = [-1 9 -45 0 45 -9 1] / 60;
V_x = imfilter( V, oh, 'corr', 'replicate', 'same' );
V_y = imfilter( V, oh', 'corr', 'replicate', 'same' );
Now, for applying imfilter with respect to z direction, I made this:
function V_z = central_diff_wrt_z( V )
[nRow, nCol, nDep] = size(V);
idx = 2:nDep-1;
V_z = zeros( size(V) );
V_z(:,:,2:end-1) = ( V(:,:,idx+1) - V(:,:,idx-1) ) / 2;
V_z(:,:,1) = ( V(:,:,2) - V(:,:,1) ) / 2;
V_z(:,:,end) = ( V(:,:,end) - V(:,:,end-1) ) / 2;
end
However, I want to use imfilter in z-direction. How to use it?
Answers (0)
Categories
Find more on Simulink 3D Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!