coordinates of intersaction between vector and a pixel in an image
Mostrar comentarios más antiguos
Hey
i have an a black/white image with a simpel shape, where i already run an edge detection on, i drawed an horizontal vector on the image.
How can i get the coordinates of all the intersection points, between my vector line and the white edge of the shape ?
any help will be appreciated. Thanks
Respuesta aceptada
Más respuestas (1)
If it is black and white image bw and you want to find the column number of the first white pixel in each row, you could do
[~,col]=max(bw,[],2);
If you want to find the last white pixel in each row, you could do, similarly
[~,col]=max(fliplr(bw),[],2);
col=size(bw,2)+1-col;
Categorías
Más información sobre Image Processing Toolbox en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!