Get pixel where the intensity is 255

Hi I have an immage 2048x2448 grayscale, I want to find all the pixel where the intensity is "255".
After i have find them i want to print this point on the immage

 Risposta accettata

img; % 2048x2448 matrix
[r, c] = find(img==255); % r and c contain all row and columns
If you want to mark these points on the image
plot(c, r, '+')
It will draw '+' marker at those locations.

7 Commenti

With this code i recive the error " Assigning the function output to this
expression is not supported."
Ok i have solved it, but the problem is that I want to plot this point on the immage, how can i do that? Thanks a lot for the answer i will vote you
Which lines caused the error? Can you share your image file and show the code which gives the error?
The error was solved thx, i only want to plot the point on the immage
plot(c, r, '+')
will plot the points on the image. Something like this
img; % 2048x2448 matrix
[r, c] = find(img==255); % r and c contain all row and columns
imshow(img);
hold on
plot(c, r, '+')
thx a lot!
I am glad to be of help!

Accedi per commentare.

Più risposte (0)

Prodotti

Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by