pixel position and its value
Mostrar comentarios más antiguos
I have a grayscale image,with four double values 0.25, 0.75 1 and 0.
I need to plot the X-axis co-ordination for each pixel and its intensity (0.25, 0.75, 1 but not 0) . How can Access the X and Y pixel position on the image? is there a straight forward method other than using for loops?
Respuesta aceptada
Más respuestas (1)
try this:
[Y, X] = ind2sub(size(b), find(ismember(b, 1)))
here b is your image matrix. It gives you X and Y positions for value 1. you can extend it to other values according to ur need
Categorías
Más información sobre Image Arithmetic 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!