MATLAB: How to detect bright spot on image

imageimage analysisimage processingimage segmentationMATLAB

How find coordinates bright spot and placed dot on this? please could you help me
For example, we have pic(attach.) and need find centre this figure(centre of the image and centre of the figure on image its diffrent things, because they could be shifted relatively each other), we need find ROI with max intensity, who contained ~90%(10% is a noise and e.t.c.) all intensity. ROI containing max intensity include centre of the figure who i need to find. How i can do this? help me please.
(sorry for my bad English)

Best Answer

I = imread('11.JPG') ;
I1 = rgb2gray(I) ;
[y,x] = find(I1==255) ;
%% Fit circle to the data (x,y)
n=length(x); xx=x.*x; yy=y.*y; xy=x.*y;
A=[sum(x) sum(y) n;sum(xy) sum(yy) sum(y);sum(xx) sum(xy) sum(x)];
B=[-sum(xx+yy) ; -sum(xx.*y+yy.*y) ; -sum(xx.*x+xy.*y)];
a=A\B;
% Center of cricle
xc = -.5*a(1);
yc = -.5*a(2);
R = sqrt((a(1)^2+a(2)^2)/4-a(3));
% Plot
imshow(I)
hold on
plot(xc,yc,'*b')
Instead of fitting a circle, you can straight away, use mean of x and y also.