How to find sum of all pixel value of ROI in a grayscale image?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Shashi TG
el 4 de Jul. de 2016
Comentada: Image Analyst
el 22 de Mzo. de 2018
I am trying to draw a ROI of a grayscale image using imfreehand. After drawing this, I want to count all the intensity levels contained in this ROI. How can I do this?
0 comentarios
Respuesta aceptada
Walter Roberson
el 4 de Jul. de 2016
Use the createMask method of the imfreehand object to create a binary mask. Suppose we call that mask . Then,
selected_values = YourImage(mask);
sum_of_selected = sum(selected_values);
count_intensity_values = length( unique(selected_values) );
3 comentarios
Más respuestas (1)
Image Analyst
el 4 de Jul. de 2016
See attached demo to freehand mask an image and find the drawn region's mean and centroid.
6 comentarios
Fahad Alharbi
el 22 de Mzo. de 2018
can I apply this demo on a folder of images insisted of one by one ? thanks again.
Image Analyst
el 22 de Mzo. de 2018
Yes. See the FAQ for code samples http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!