How to create volume sobel filter

1 view (last 30 days)
sunday nwokolo
sunday nwokolo on 27 Aug 2014
I am working on volume image colorisation and i will like to create volume sobel filter, this is what i did but i kept getting errors %Gx=[[-1 0 1; -2 0 2; -1 0 1];[-2 0 2; -4 0 4; -2 0 2];[-1 0 1;-2 0 2;-1 0 1]]; Gx(1,:,:)=[-1 0 1; -2 0 2; -1 0 1]; Gx(2,:,:)=[-2 0 2; -4 0 4; -2 0 2]; Gx(3,:,:)=[-1 0 1;-2 0 2;-1 0 1]; %Gy=[[1 2 1; 0 0 0; -1 -2 -1];[2 4 2;0 0 0;-2 -4 -2];[1 2 1;0 0 0; -1 -2 -1]]; Gy(:,1,:)=[1 2 1; 0 0 0; -1 -2 -1]; Gy(:,2,:)=[2 4 2;0 0 0;-2 -4 -2]; Gy(:,3,:)=[1 2 1;0 0 0; -1 -2 -1]; %Gz=[[1 2 1; 2 4 2; 1 2 1];[0 0 0;0 0 0;0 0 0];[-1 -2 -1,-2 -4 -2,-1 -2 -1]]; Gz(:,:,1)=[1 2 1; 2 4 2; 1 2 1]; Gz(:,:,2)=[0 0 0;0 0 0;0 0 0]; Gz(:,:,3)=[-1 -2 -1,-2 -4 -2,-1 -2 -1]; % convolve the image Mx=convn(double(gy), double(Gx)); My=convn(double(gy), double(Gy)); Mz=convn(double(gy), double(Gz));

Answers (0)

Community Treasure Hunt

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

Start Hunting!