Azzera filtri
Azzera filtri

How can I find the length in a binary image?

1 visualizzazione (ultimi 30 giorni)
Sanghyeon Chang
Sanghyeon Chang il 18 Gen 2023
Risposto: Image Analyst il 18 Gen 2023
Hi. I'd like to calculate the average length of the redline that I drew.
Red lines are representing the longest length (in vertical-wise) of the each objects.
The original images are already in binary images

Risposte (1)

Image Analyst
Image Analyst il 18 Gen 2023
It looks like it goes from the first white pixel in two different columns down to the bottom of the image, which is just the sum of the white pixels in the whole column.
length1 = nnz(binaryImage(:, column1))
length2 = nnz(binaryImage(:, column2))
averageLength = (length1 + length2) / 2

Categorie

Scopri di più su Images in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by