Finding TP, TN, FP, FN using histc. First Input must be a real non-sparse numeric array (error)
古いコメントを表示
I am finding TP, TN, FP, FN (confusion matrix) of predicted and actual image. smapImg is the predicted/output image and gtImg is the actual/ground truth image.
TP = histc(smapImg(gtImg), 0:255);
FP = histc(smapImg(~gtImg), 0:255);
FN = histc(~smapImg(gtImg), 0:255);
TN = histc(~smapImg(~gtImg), 0:255);
I am getting this error "First Input must be a real non-sparse numeric array" while computing FN and TN, while TP and FP are computing correctely. Please help.
2 件のコメント
Steven Lord
2019 年 8 月 20 日
What does the following command display? Show all the columns as any of them may contain information important to understanding why you receive that error.
whos smapImg gtImg
Nataliya
2019 年 8 月 20 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
