フィルターのクリア

Storing multiple labels In one Array

3 ビュー (過去 30 日間)
sameen
sameen 2012 年 8 月 4 日
hi friends ..... please help me out in solving this problem
i want all labeled neighbor pixel values should be represented as 1 integer value... like 1....max value and will further store in one array ..
like here is one labeled image on 8 neighborhood basis
0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 2 2 2 2 2 2 2
0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2 2 2
0 0 0 0 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 0 0 0 0
now i want the Label 1 and its neighbor will just give me 1 and same for Label 2 just return 2 and so on til maximum labeled pixels and finally store in one array like [1 2 3 4 ........ maximum]
Regards
Sameeen Amjad

回答 (1 件)

Walter Roberson
Walter Roberson 2012 年 8 月 10 日
Ummm... possibly
unique(YourLabelMatrix(:))

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by