🤖 AIによる機械翻訳(非公式) — これは OpenCV 4.13.0 公式リファレンス(英語)を AI (Claude) で自動翻訳したものです。訳に誤りを含む場合があります。正確な情報は 公式英語版(原文) を参照してください。
Package org.opencv.calib3d
クラス StereoBM
- java.lang.Object
-
- org.opencv.core.Algorithm
-
- org.opencv.calib3d.StereoMatcher
-
- org.opencv.calib3d.StereoBM
public class StereoBM extends StereoMatcher
ブロックマッチングアルゴリズムを用いてステレオ対応を計算するためのクラス。K. Konolige によって導入され、OpenCVに提供された。このクラスは、ステレオ画像ペアから視差マップを計算するために使用される、ステレオ対応のためのブロックマッチングアルゴリズムを実装する。プリフィルタリング、テクスチャしきい値、一意性比率、関心領域(ROI)などのパラメータを微調整し、性能と精度を最適化するためのメソッドを提供する。
-
-
フィールドの要約
フィールド Modifier and Type Field Description static intPREFILTER_NORMALIZED_RESPONSEstatic intPREFILTER_XSOBEL-
クラス org.opencv.calib3d.StereoMatcher から継承されたフィールド
DISP_SCALE, DISP_SHIFT
-
-
コンストラクタの要約
コンストラクタ Modifier Constructor Description protectedStereoBM​(long addr)
-
メソッドの要約
すべてのメソッド 静的メソッド インスタンスメソッド 具象メソッド Modifier and Type Method Description static StereoBM__fromPtr__​(long addr)static StereoBMcreate()Creates StereoBM objectstatic StereoBMcreate​(int numDisparities)Creates StereoBM objectstatic StereoBMcreate​(int numDisparities, int blockSize)Creates StereoBM objectintgetPreFilterCap()Gets the current truncation value for prefiltered pixels.intgetPreFilterSize()Gets the current size of the pre-filter kernel.intgetPreFilterType()Gets the type of pre-filtering currently used in the algorithm.RectgetROI1()Gets the current Region of Interest (ROI) for the left image.RectgetROI2()Gets the current Region of Interest (ROI) for the right image.intgetSmallerBlockSize()Gets the current size of the smaller block used for texture check.intgetTextureThreshold()Gets the current texture threshold value.intgetUniquenessRatio()Gets the current uniqueness ratio value.voidsetPreFilterCap​(int preFilterCap)Sets the truncation value for prefiltered pixels.voidsetPreFilterSize​(int preFilterSize)Sets the size of the pre-filter kernel.voidsetPreFilterType​(int preFilterType)Sets the type of pre-filtering used in the algorithm.voidsetROI1​(Rect roi1)Sets the Region of Interest (ROI) for the left image.voidsetROI2​(Rect roi2)Sets the Region of Interest (ROI) for the right image.voidsetSmallerBlockSize​(int blockSize)Sets the size of the smaller block used for texture check.voidsetTextureThreshold​(int textureThreshold)Sets the threshold for filtering low-texture regions.voidsetUniquenessRatio​(int uniquenessRatio)Sets the uniqueness ratio for filtering ambiguous matches.-
クラス org.opencv.calib3d.StereoMatcher から継承されたメソッド
compute, getBlockSize, getDisp12MaxDiff, getMinDisparity, getNumDisparities, getSpeckleRange, getSpeckleWindowSize, setBlockSize, setDisp12MaxDiff, setMinDisparity, setNumDisparities, setSpeckleRange, setSpeckleWindowSize
-
クラス org.opencv.core.Algorithm から継承されたメソッド
clear, empty, getDefaultName, getNativeObjAddr, save
-
-
-
-
メソッドの詳細
-
__fromPtr__
public static StereoBM __fromPtr__​(long addr)
-
getPreFilterType
public int getPreFilterType()
Gets the type of pre-filtering currently used in the algorithm.- 戻り値:
- 現在のプレフィルタの種類: PREFILTER_NORMALIZED_RESPONSE の場合は0、PREFILTER_XSOBEL の場合は1。
-
setPreFilterType
public void setPreFilterType​(int preFilterType)
Sets the type of pre-filtering used in the algorithm.- 引数:
preFilterType- 使用するプリフィルタの種類。取りうる値は: - PREFILTER_NORMALIZED_RESPONSE (0): プリフィルタリングに正規化応答を使用する。- PREFILTER_XSOBEL (1): プリフィルタリングにX-Sobel演算子を使用する。プリフィルタの種類は、視差マップを計算する前に画像をどのように準備するかに影響する。プリフィルタリングの手法が異なると、特定の画像特徴を強調したりノイズを低減したりでき、視差マップの品質に影響を与える。
-
getPreFilterSize
public int getPreFilterSize()
Gets the current size of the pre-filter kernel.- 戻り値:
- 現在のプレフィルタサイズ。
-
setPreFilterSize
public void setPreFilterSize​(int preFilterSize)
Sets the size of the pre-filter kernel.- 引数:
preFilterSize- プリフィルタカーネルのサイズ。奇数の整数でなければならず、通常は5から255の間。プリフィルタサイズは、輝度の正規化とテクスチャの強調によって視差計算のために画像を準備するプリフィルタリング操作の空間的範囲を決定する。サイズが大きいとノイズは低減するがディテールがぼやけることがあり、小さいとディテールは保持されるがノイズの影響を受けやすくなる。
-
getPreFilterCap
public int getPreFilterCap()
Gets the current truncation value for prefiltered pixels.- 戻り値:
- 現在のプレフィルタキャップ値。
-
setPreFilterCap
public void setPreFilterCap​(int preFilterCap)
Sets the truncation value for prefiltered pixels.- 引数:
preFilterCap- 切り捨て値。通常は [1, 63] の範囲。この値はプリフィルタの出力を [-preFilterCap, preFilterCap] に制限し、プリフィルタ処理後の画像におけるノイズや外れ値の影響を低減するのに役立つ。
-
getTextureThreshold
public int getTextureThreshold()
Gets the current texture threshold value.- 戻り値:
- 現在のテクスチャしきい値。
-
setTextureThreshold
public void setTextureThreshold​(int textureThreshold)
Sets the threshold for filtering low-texture regions.- 引数:
textureThreshold- しきい値。非負でなければならない。このパラメータは、対応付けが困難な低テクスチャの領域を除外し、視差マップのノイズを低減する。値が高いほど積極的に除外するが、有効な情報を破棄してしまうことがある。
-
getUniquenessRatio
public int getUniquenessRatio()
Gets the current uniqueness ratio value.- 戻り値:
- 現在の一意性比率。
-
setUniquenessRatio
public void setUniquenessRatio​(int uniquenessRatio)
Sets the uniqueness ratio for filtering ambiguous matches.- 引数:
uniquenessRatio- 一意性比率の値。通常は [5, 15] の範囲だが、0から100まで取りうる。このパラメータは、最良のマッチが次に良いマッチより十分に優れていることを保証し、誤検出を低減する。値が高いほど厳格だが、困難な領域では有効なマッチを除外してしまうことがある。
-
getSmallerBlockSize
public int getSmallerBlockSize()
Gets the current size of the smaller block used for texture check.- 戻り値:
- 現在の小さい方のブロックサイズ。
-
setSmallerBlockSize
public void setSmallerBlockSize​(int blockSize)
Sets the size of the smaller block used for texture check.- 引数:
blockSize- 小さいブロックのサイズ。5から255の間の奇数の整数でなければならない。このパラメータは、テクスチャ分散を計算するために使用するブロックのサイズを決定する。小さいブロックは細かいディテールを捉えるがノイズの影響を受けやすく、大きいブロックはより頑健だが細かいディテールを見逃すことがある。
-
getROI1
public Rect getROI1()
Gets the current Region of Interest (ROI) for the left image.- 戻り値:
- 左画像の現在のROI。
-
setROI1
public void setROI1​(Rect roi1)
Sets the Region of Interest (ROI) for the left image.- 引数:
roi1- 左画像のROI矩形。ROIを設定することで、ステレオマッチングの計算が指定領域に限定され、画像の関連部分に集中することで性能が向上し、精度も高まる可能性がある。
-
getROI2
public Rect getROI2()
Gets the current Region of Interest (ROI) for the right image.- 戻り値:
- 右画像の現在のROI。
-
setROI2
public void setROI2​(Rect roi2)
Sets the Region of Interest (ROI) for the right image.- 引数:
roi2- 右画像のROI矩形。setROI1と同様に、計算範囲を右画像内の指定領域に限定する。
-
create
public static StereoBM create​(int numDisparities, int blockSize)
Creates StereoBM object- 引数:
numDisparities- 視差の探索範囲。各ピクセルについて、アルゴリズムは0(デフォルトの最小視差)からnumDisparitiesまでの範囲で最適な視差を探す。最小視差を変更することで探索範囲をシフトできる。blockSize- アルゴリズムが比較するブロックの一辺のサイズ。ブロックは現在のピクセルを中心とするため、サイズは奇数でなければならない。ブロックサイズを大きくすると視差マップは滑らかになるが精度は下がる。小さくするとより詳細な視差マップが得られるが、誤った対応を見つける可能性が高くなる。- 戻り値:
- 作成されたStereoBMオブジェクトへのポインタ。この関数はStereoBMオブジェクトを作成する。その後、StereoBM::compute()を呼び出すことで特定のステレオペアの視差を計算できる。
-
create
public static StereoBM create​(int numDisparities)
Creates StereoBM object- 引数:
numDisparities- 視差の探索範囲。各ピクセルについて、アルゴリズムは0(デフォルトの最小視差)からnumDisparitiesまでの範囲で最適な視差を探す。最小視差を変更することで探索範囲をシフトできる。- 戻り値:
- 作成されたStereoBMオブジェクトへのポインタ。この関数はStereoBMオブジェクトを作成する。その後、StereoBM::compute()を呼び出すことで特定のステレオペアの視差を計算できる。
-
create
public static StereoBM create()
Creates StereoBM object- 戻り値:
- 作成されたStereoBMオブジェクトへのポインタ。この関数はStereoBMオブジェクトを作成する。その後、StereoBM::compute()を呼び出すことで特定のステレオペアの視差を計算できる。
-
-