Skip to content

Instantly share code, notes, and snippets.

@berkayakcay
Last active May 13, 2019 17:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save berkayakcay/86cdd029343b54617db17d4932e7ad39 to your computer and use it in GitHub Desktop.
Save berkayakcay/86cdd029343b54617db17d4932e7ad39 to your computer and use it in GitHub Desktop.
Image Processing MATLAB Mean Algoritması
clc; clear; close all;
I= imread('p.jpg');
I = rgb2gray(I);
[R,C] = size(I);
SI = uint8(zeros(R,C));
for r=1:R
for c=1:C
total = 0.0;
counter = 0;
for i=-1:1
for j=-1:1
if(((r+i)>0) && ((c+j)>0) && ((r+i)<=R) && ((c+j)<=C))
total = total + double(I(r+i,c+j));
counter = counter + 1;
end
end
end
SI(r,c)= total/counter;
end
end
imshow(I);
figure;
imshow(SI);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment