Regionprops fails to identify binary image - ERROR

2 ビュー (過去 30 日間)
Ahmed Ismail
Ahmed Ismail 2016 年 8 月 25 日
コメント済み: Ahmed Ismail 2016 年 8 月 25 日
So I have a 'logical-binary' image I would like to perform region props on. The image consists of what you expect, 0's and 1's only. However, when I try to run regionprops on the image, all the centroids and Diameters are listed as NaN. Does the image need to be in a different format?
Thanks
  1 件のコメント
Ahmed Ismail
Ahmed Ismail 2016 年 8 月 25 日
The image is a 'uint8'

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

採用された回答

Adam
Adam 2016 年 8 月 25 日
The help says the input must be a logical array - i.e. type logical, not just 0s and 1s in any data type.
  2 件のコメント
Ahmed Ismail
Ahmed Ismail 2016 年 8 月 25 日
So what I do is read the image into Matlab, consists of 255's and 0's I convert to binary, using im2bw, so now it's a logical. Still the regionprops won't work.
Ahmed Ismail
Ahmed Ismail 2016 年 8 月 25 日
Wait! I see my problem now, when I was using regionprops I was using my original uint8 image not the logical binary, my bad!

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

その他の回答 (0 件)

製品

Community Treasure Hunt

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

Start Hunting!

Translated by