How to detect bright spot on image?

20 views (last 30 days)
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)
  3 Comments
KSSV
KSSV on 16 Nov 2018
Attach the original image without a mark at the center. So that users can work on the image.

Sign in to comment.

Accepted Answer

KSSV
KSSV on 16 Nov 2018
Edited: KSSV on 16 Nov 2018
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.
  8 Comments
Yaroslav Gimler
Yaroslav Gimler on 23 Nov 2018
I have an image. In this image there is a conoscopic cross, the center of the image and the center of the conoscopic cross are different things. I understood how to find the center of the conoscopic cross, but now I have to select the conoscopic cross itself and remove the unnecessary. For example, the entire image has 100% intensity, and the conoscopic cross is 90% (10% is background and noise).I need to leave only these 90% where we have a conoscopic cross.How to do this is hard for me to imagine.
Sorry for my bad english.
Image Analyst
Image Analyst on 23 Nov 2018
Just do
halfWindowWidth = 100; % Whatever size you want.
% row1 = round(yCentroid - halfWindowWidth);
row2 = row1 + 2 * halfWindowWidth - 1;
col1 = round(xCentroid - halfWindowWidth);
col2 = col1 + 2 * halfWindowWidth - 1;
croppedImage = rgbImage(row1:row2, col1:col2, :)

Sign in to comment.

More Answers (1)

Image Analyst
Image Analyst on 22 Nov 2018
You could do it based on just the largest blob, which will be at the center.
binaryImage = bwareafilt(binaryImage, 1); % Extract largest blob.
props = regionprops(binaryImage, 'Centroid'); % Find centroid (not weighted by gray level).
xCentroid = props.Centroid(1);
yCentroid = props.Centroid(2);
hold on;
plot(xCentroid, yCentroid, 'b+', 'MarkerSize', 50); % Plot cross over centroid.
  2 Comments
Yaroslav Gimler
Yaroslav Gimler on 23 Nov 2018
>bwareafilt
>Introduced in R2014b
I cant use this function, because i have Matlab R2012b version.
Image Analyst
Image Analyst on 23 Nov 2018
Use bwareaopen() instead.
Better yet, upgrade to R2018b since your version is 6 years old.

Sign in to comment.

Products


Release

R2012b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!