
146
5 章 疎行列を用いた分割表
thresholds = range(0, 110, 10)
vi_per_threshold = [vi_at_threshold(seg, tiger, human_seg, threshold)
for threshold in thresholds]
plt.plot(thresholds, vi_per_threshold);
■
やはり、目測で選んだ
threshold=80
でのセグメンテーションで、最もよい結果が得られました
(図
5-11
)。その上、我々にはもう、どんな画像にも対応するようにこの処理を自動化する手段が
あるのです。
auto_seg = rag_segmentation(seg, tiger, threshold=80)
plt.imshow(color.label2rgb(auto_seg, tiger));
5.9.1
追加の課題:セグメンテーションの実践
Berkeley Segmentation Dataset and Benchmark
(
http://bit.ly/2sdHN92
)にある他の画像の
最適な閾値を探してみましょう
†
。これらの閾値の平均値か中央値を使って、新たな画像を領域分割
してみましょう。妥当なセグメンテーションが得られましたか?
疎行列は、隙間が多いデータを表す効率的な方法ですが、そのような状況は意外とよくありま
す。本章を読んだ後では、疎行列が使えそうな機会が頻繁に見つかるようになることでしょう。そ
して、使い方もわかっているでしょう。 ...