Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
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

回答(1 个)

Walter Roberson
Walter Roberson 2015-12-14
hprof = ~all(YourImage,2);
first_row_with_black = find(hprof, 1, 'first');
last_row_with_black = find(hprof, 1, 'last');
  3 个评论
Walter Roberson
Walter Roberson 2015-12-14
Change to
hprof = ~all(YourImage,2);
first_row_with_black = find(hprof, 1, 'first')
last_row_with_black = find(hprof, 1, 'last')

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by