FindThreshold[image]
image の強度値を2つの区間に分ける大域的閾値を求める.
FindThreshold
FindThreshold[image]
image の強度値を2つの区間に分ける大域的閾値を求める.
詳細とオプション
- 閾値化は,二値クラスタリングあるいは分割を行う最も一般的な技術である.
- FindThresholdは,2Dおよび3Dの画像と任意階数のデータ配列に使うことができる.これは,多チャンネル画像とカラー画像をグレースケールの画像に変換してから大域的閾値を求める.
- FindThreshold[image,Method->method]は閾値を決めるために使用するメソッドを指定する.
- Methodオプションの使用可能な設定値
-
{"BlackFraction",b} すべての画素を b の割合で黒にする "Cluster" クタスタ分散最大化法(大津アルゴリズム) "Entropy" ヒストグラムエントロピーの最小化(Kapurのアルゴリズム) "Mean" レベル平均を閾値として使う "Median" 画素レベルの中央値を閾値として使う "MinimumError" Kittler–Illingworth最小誤差閾値法 - デフォルト設定はMethod->"Cluster"である.
例題
すべて開く すべて閉じる例 (1)
スコープ (3)
オプション (5)
Method (5)
デフォルトで,2つのクラスタ間の分散を最大にする"Cluster"法が使われる:
r = RandomReal[MixtureDistribution[{3 / 5, 2 / 5}, {NormalDistribution[1, 1 / 2], NormalDistribution[2, 1 / 6]}], 10 ^ 6];
t = FindThreshold[r]Histogram[r, 50, Epilog -> {Blue, InfiniteLine[{t, 0}, {0, 1}]}]"MinimumError"法を用いて2つのガウス分布から導かれたデータを分類する:
r = RandomReal[MixtureDistribution[{3 / 5, 2 / 5}, {NormalDistribution[1, 1 / 2], NormalDistribution[2, 1 / 6]}], 10 ^ 6];
t = FindThreshold[r, Method -> "MinimumError"]Histogram[r, 50, Epilog -> {Blue, InfiniteLine[{t, 0}, {0, 1}]}]"BlackFraction"法を用いてデータのどのくらいが閾値以下であるべきかを指定する:
r = RandomReal[NormalDistribution[1, 1 / 2], 10 ^ 6];Table[
t = FindThreshold[r, Method -> {"BlackFraction", f}];Histogram[r, 50, Epilog -> {Blue, InfiniteLine[{t, 0}, {0, 1}]}],
{f, {.2, .5, .8}}]r = RandomReal[MixtureDistribution[{3 / 5, 2 / 5}, {NormalDistribution[1, 1 / 2], NormalDistribution[2, 1 / 6]}], 10 ^ 6];Table[
t = FindThreshold[r, Method -> method];Histogram[r, 50, Epilog -> {Blue, InfiniteLine[{t, 0}, {0, 1}]}, PlotLabel -> method, Axes -> {True, False}],
{method, {"Cluster", {"BlackFraction", .5}, "Entropy", "Mean", "Median", "MinimumError"}}]カラー画像の閾値を計算して各メソッドについての値を比較する:
methods = {{"BlackFraction", 0.6}, "Cluster", "Entropy", "Mean", "Median", "MinimumError"};i = [image];With[{t = FindThreshold[i, Method -> #]}, {#, t, Binarize[i, t]}]& /@ methods//TextGrid[#, Frame -> All]&アプリケーション (1)
i = [image];
l = FindThreshold[(Differences /@ ComponentMeasurements[i, "BoundingBox"][[All, 2]])[[All, 1, 2]]]SelectComponents[i, Differences[#BoundingBox][[1, 2]] > l&]HighlightImage[i, %]関連項目
テクニカルノート
-
▪
- 画像処理
テキスト
Wolfram Research (2010), FindThreshold, Wolfram言語関数, https://reference.wolfram.com/language/ref/FindThreshold.html (2012年に更新).
CMS
Wolfram Language. 2010. "FindThreshold." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/FindThreshold.html.
APA
Wolfram Language. (2010). FindThreshold. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/FindThreshold.html
BibTeX
@misc{reference.wolfram_2026_findthreshold, author="Wolfram Research", title="{FindThreshold}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/FindThreshold.html}", note=[Accessed: 14-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_findthreshold, organization={Wolfram Research}, title={FindThreshold}, year={2012}, url={https://reference.wolfram.com/language/ref/FindThreshold.html}, note=[Accessed: 14-November-2026]}