How to apply imfilter function in 3d

13 visualizaciones (últimos 30 días)
jakeoung koo
jakeoung koo el 18 de Abr. de 2016
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?

Respuestas (0)

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by