To find the lower array of black pixels of a word in an image

I want the lower array of black pixels of this word.I know to count the black pixels but how to get the lower array? Please help me. Thank you

Réponses (1)

hprof = ~all(YourImage,2);
first_row_with_black = find(hprof, 1, 'first');
last_row_with_black = find(hprof, 1, 'last');

3 commentaires

Thanks for the reply sir.But i'm not getting anything in the matlab terminal! should i make any changes?
Change to
hprof = ~all(YourImage,2);
first_row_with_black = find(hprof, 1, 'first')
last_row_with_black = find(hprof, 1, 'last')
sir,this is what i'm getting .empty array!!

Cette question est clôturée.

Question posée :

le 14 Déc 2015

Clôturé :

le 20 Août 2021

Community Treasure Hunt

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

Start Hunting!

Translated by