edge & non-edge pixels

1 回表示 (過去 30 日間)
matlab_image
matlab_image 2012 年 8 月 31 日
コメント済み: Ram 2016 年 2 月 23 日
How to find total no. of edge and non-edge pixels from any edge detected image. I am finding no. of edge images with nnz(img) method. Is this right way? If yes then tell me how to count non-edge pixels & If not then tell me about both.. Thanks in advance.

採用された回答

Kevin Moerman
Kevin Moerman 2012 年 8 月 31 日
編集済み: Kevin Moerman 2012 年 8 月 31 日
If img is a logic say where ones define edge pixels and zeros define non-edge pixels then you are correct nnz(img): counts the number of non-zero entries and therefore the number of edge pixels this would be equivalent to say: sum(img(:)) If img is a logic then you can also count the non-edge pixels using the nnz command, e.g. : nnz(~img) Where ~ is NOT. Another method would be to say that the non-edge pixels are simply: numel(img)-nnz(img) I.e. the number of elements (all) minus the edge pixels.
Good luck,
Kevin
  2 件のコメント
matlab_image
matlab_image 2012 年 9 月 4 日
thanks a lot.......
Ram
Ram 2016 年 2 月 23 日
what are edge pixels in a image ? how to find edge pixels for a given image

サインインしてコメントする。

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by