Superimpose a coloured Marker on a tiff image

2 views (last 30 days)
I have a 12 bit Tif image and want to highlight on the image itself with a red circle all the pixels that have a value >4000. This was my attempt, but Im missing something?
[ii,jj]=find(IM>4000) %Get x,y coordinates of all values >4000 and plot
hold on
plot(ii,jj,'Color','r','o')
Thanks Jason

Accepted Answer

Image Analyst
Image Analyst on 14 Feb 2014
You got (the very badly named) ii and jj reversed. find() returns [rows, columns] which is [y, x]. You plotted ii,jj which is y,x, not x,y like you incorrectly assumed, so you're plotting the transpose. Don't worry, confusing row,column with x,y is a very very common mistake. Try this:
[rows, columns] = find(IM>4000);
plot(columns, rows, 'ro');
Or better yet, just create an image with red pixels instead of plotting circles in the overlay.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!