Borrar filtros
Borrar filtros

Finding corners in grayscale images and plotting them

1 visualización (últimos 30 días)
Mithra
Mithra el 10 de Sept. de 2013
Hi everyone, I have a satellite grayscale image (double) from an urban area which I'm trying to find the corners in it using the function corner. I'm doing this according to matlab help for this function which says:
I = checkerboard(50,2,2);
C = corner(I);
imshow(I);
hold on
plot(C(:,1), C(:,2), 'r*');
but I have two problems with this:
1) in matching the plot function with size of my image which is 1593*2765! How should I change the numbers in plot function?
2) I've tried using this:
plot(C(:,:),'r.');
but I know it's wrong, cause it shows me a completely red picture (a page full of red dots). In this case C is a 200*2 double matrix with large numbers. What do these numbers mean? What should I do if I wanted every pixel which is a corner to be saved as 1 and every pixel which is not a corner to be saved as 0 in a matrix the same size as my original image?!
Thanks a lot

Respuesta aceptada

Image Analyst
Image Analyst el 10 de Sept. de 2013
Why don't you just use the plot function the way the help told you to? Why do you change it when you know that gives you incorrect display? plot() takes x as the first argument and y as the second argument so it's obvious that C(:,1) is the x coordinates and C(:,2) is the y coordinates. What happens if you just do it the way the example did it? Anything wrong with doing that?
In your case you should have 200 corners and each row in C is the (x,y) coordinate of one of the corners.
Did you try doing
out = zeros(size(I));
for row = 1 : size(I, 1)
out(C(row,1), C(row,2)) = 1;
end
  1 comentario
Mithra
Mithra el 11 de Sept. de 2013
Editada: Mithra el 11 de Sept. de 2013
Thanks for the explanation, now I understand what do they mean.
and the code works great, thnx again :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Visual Exploration en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by