function [Coordonnees] = DetectionRepereVert(Image) %UNTITLED Summary of this function goes here % Detailed explanation goes here Image = double(Image); v = size(Image); x = 0; y = 0; SommeCoef=0; for i = 1 : v(1) for j = 1 : v(2) coef=double(Image(i,j,2)); x = x + i*coef; y = y + j*coef; SommeCoef= SommeCoef + coef; end end x = round(x/SommeCoef); y = round(y/SommeCoef); Coordonnees = [x,y]; end