Prosty program w Matlabie do wykrywania krawędzi. Zastosowano filtr Sobel. Wersja kompatybilna z programem Octave w osobnym dziale.
[pictureone, user_canceled1] = imgetfile;scale = 20;threshold = 25;if (user_canceled1) fprintf('nAnulowales wybieranie plikow do porownania!n')else %read file Aread = imread(pictureone); A = double(rgb2gray(Aread)); %kernels kGx = [1 0 -1;2 0 -2;1 0 -1]; kGy = [1 2 1;0 0 0;-1 -2 -1]; %Sobel %kGx = [3 0 -3;10 0 -10;3 0 -3]; kGy = [3 10 3;0 0 0;-3 -10 -3]; % Sobel-Scharr Gx = conv2(kGx,A); Gy = conv2(kGy,A); %magnitude calculation G = (Gx.^2 + Gy.^2).^0.5; G = uint8(G); %output a file imshow(G)end