-
Created by Unknown User (jarisav), last modified on 20.9.2010
You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 4
Next »
function f = HaePalikka()
I = imread('Palikoita.bmp');
figure, imshow(I), title('Palikka.bmp');
hold on
[rows,cols] = size(I)
x = ones(rows,1)*[1:cols]; % Matriisi x with each pixel set to its x coordinate
y = [1:rows]'*ones(1,cols)
area = sum(sum(I));
meanx = sum(sum(double(I).*x))/area
meany = sum(sum(double(I).*y))/area
%Segout=Segout
imshow(I), title('kuva ja keskipiste'),;
plot(meanx,meany,'X')
hold off
You must log in to comment.