How to find approximate coordinates of two corner points in an image without using ginput?
Mostrar comentarios más antiguos
Dear all,
I have two corner points (I marked them in red so you can see it) in black and white image. I want to find coordinates of the points automatically without using 'ginput'.

I have tried to use bwmorph(), but it gives too many endpoints as show bellow:

Code:
clear all; clc; close all; workspace; format long g; format compact;
im = imread('LA.jpg');
figure; imshow(im,[]);
LA= im2bw(im, graythresh(im));
% Filtering from noize by measuring blow
[Clab num] = bwlabel(LA);
props = regionprops(Clab);
% [maxValue,index] = max([props.Area]);
CC = bwconncomp(LA);
[~,idx] = max(cellfun(@numel,CC.PixelIdxList));
L=labelmatrix(CC);
LA=L==idx;
figure; imshow(LA);
skelImage = bwmorph(LA, 'skel', inf); %
endPoints = bwmorph(skelImage, 'Endpoints'); %
[rows, columns] = find(endPoints); % Find coordinates of the End Points
figure; imshow(LA); hold on;
plot(columns,rows,'g*');
Thank you very much for any guidance or advice you could give me.
Regards,
Ivan
2 comentarios
Ashish Uthama
el 23 de En. de 2015
Editada: Ashish Uthama
el 23 de En. de 2015
Are you looking for an approach which just works on this one image? If not, are there any characteristics of these images that you can share? For example, is the white area always oriented as above? Is it roughly always in the same part of the image? Is it always the same size? Is there anything else in the raw (original image) which would help you? etc.. this kind of information would be very useful to figure out a way which would really solve your problem.
Ivan Shorokhov
el 23 de En. de 2015
Editada: Ivan Shorokhov
el 23 de En. de 2015
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Image Preview and Device Configuration en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
