Borrar filtros
Borrar filtros

Sum of Pixels in an image

4 visualizaciones (últimos 30 días)
Tri Rowstenkowski
Tri Rowstenkowski el 8 de Feb. de 2021
Respondida: Walter Roberson el 8 de Feb. de 2021
Hi,
I have been trying to calculate the Vessel density which is the total image area occupied by the vasculature to the total image area in the binary vessel maps. Here's my code:
I=imread('VAD.png');
figure,imshow(image_read)
I_gray=rgb2gray(I);
figure,imshow(I_gray);
SumPixels = sum(I_gray(:));
T = adaptthresh(I_gray, 0.25);
BW = imbinarize(I_gray,T);
figure,imshowpair(I_gray, BW, 'montage')
Pixels = sum(BW(:));
VAD=Pixels/SumPixels
I am not sure if I am doing it the right way. How should I calculate the sum of pixel occupied by the vessel as the binary conversion gives a whole different value. Any help would be appreciated.

Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de Feb. de 2021
VAD = Pixels ./ numel(I_gray)

Más respuestas (0)

Categorías

Más información sobre Image Segmentation and Analysis en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by