カメラレンズの被写界深度計算|DoF & Hyperfocal Distance Calculator

カメラレンズの被写界深度計算|DoF Calculator & Hyperfocal Distance

Calculate hyperfocal distance, near/far focus limits, and circle of confusion for your machine vision application. Essential for robotics engineers designing fixed-focus camera systems with M12 lenses.

Pixel-based Circle of Confusion
Nyquist Frequency Analysis
Free Tool No Registration

なぜ被写界深度がマシンビジョンに重要なのか?

Depth of field is the foundation of sharp, reliable machine vision. It determines which parts of your scene will be in focus and which will be blurry – directly impacting whether your computer vision algorithms can detect features, read barcodes, or guide robot movements accurately.

Think of DoF as your camera's "sharpness zone." Too shallow, and critical objects blur out of focus. Too deep (requiring small apertures), and you might not gather enough light for fast shutter speeds, causing motion blur instead.

経験則

For most robotics applications: Set your aperture, focus at the hyperfocal distance, and use the widest field of view that still captures necessary detail. This maximizes your working range while maintaining good light sensitivity.

電卓の結果は実際に何を意味するのか?

DoF計算機の結果を理解する
パラメータ 何がわかるか 代表値 アプリケーションへの影響
ニアフォーカスリミット 物体がシャープに見える最も近い距離 0.2m - 2m 検査のための最短作業距離
遠距離フォーカスの限界 許容できるシャープネスで最も遠い距離 1m - ∞ 最大検出範囲
超焦点距離 被写界深度を最大にするためにここにピントを合わせる 0.5m - 10m 最適な固定焦点設定
総面積 近距離と遠距離の範囲 0.1m - ∞ 作業封筒のサイズ
混乱の輪 最大ぼかしスポットでも "シャープ "に見える 1-4ピクセル シャープネスの許容範囲
ナイキスト周波数 Sensor sampling limit (lens MTF may cap resolution sooner) 100-500 lp/mm 解像度制限
焦点深度 センサーの位置決め公差 ±10-100µm 機械的精度が必要

自分のアプリケーションに適した設定を選ぶには?

移動ロボットナビゲーション

  • 目標:モーションブラーを最小限に抑える
  • 焦点距離:2.8-6mm
  • 絞り:F1.4-2.8
  • フォーカス:ハイパーフォーカル
  • CoC:2~4ピクセル

ピック&プレース・ビジョン

  • 目標:ワーキングディスタンスでのシャープさ
  • 焦点距離:6-25mm
  • 絞り:F2.8-4
  • フォーカス作業平面
  • CoC:1-2ピクセル

品質検査

  • 目標:最高のシャープネス
  • 焦点距離:12-35mm
  • 絞り:F2.8-6.0
  • フォーカス固定距離
  • CoC:1ピクセル

この計算に隠された物理学とは?

ガウス光学財団

This calculator uses the thin lens equation and geometric optics to determine depth of field. The basic formula relates object distance (u), image distance (v), and focal length (f):

超焦点距離

The hyperfocal distance is the distance at which if you focus a camera, everything from half the hyperfocal distance to infinity renders acceptably sharp for your chosen circle of confusion.

混迷の輪」が重要な理由

The circle of confusion (CoC) is your tolerance for blur. A point source that's out of focus becomes a blur circle on your sensor. When this circle is smaller than your CoC threshold, you perceive it as "sharp enough."

Choosing Your CoC

1 pixel CoC: Use for precision measurement and barcode reading
2 pixel CoC: Standard for most machine vision tasks
4 pixel CoC: Acceptable for object detection and tracking

Remember: Doubling your CoC roughly doubles your depth of field!

単純なDOF公式はいつ破綻するのか?

小口径における回折限界

Diffraction becomes significant once the Airy disk approaches your pixel size, which for the small pixels common in machine vision happens well before f/11. The Airy disk created by diffraction has a diameter of approximately:

d = 2.44 × λ × N

Where λ is wavelength (≈550nm for green light) and N is the f-number. At f/16, this gives about 21µm of blur – larger than many pixel sizes!

本物のレンズ収差

Real lenses aren't perfect. They suffer from spherical aberration, coma, and astigmatism that can reduce sharpness even within the calculated depth of field. High-quality M12 lenses optimized for machine vision minimize these aberrations through multi-element designs.

有用な被写界深度を最大化するためのプロのヒント

  1. Start with the right sensor: Larger pixels are more forgiving. A 3.45µm pixel sensor needs less precise focus than a 1.4µm pixel sensor.
  2. Consider pixel binning: 2×2 binning doubles your effective pixel size, roughly doubling depth of field at the cost of resolution.
  3. Use the sweet spot: Most lenses perform best between f/2.8 and f/5.6. Too wide and aberrations dominate; too narrow and diffraction limits sharpness.
  4. Add light, not aperture: Instead of stopping down to f/11 for more DoF, add LED illumination and stay at f/5.6 for better overall sharpness.
  5. Test with your actual targets: Calculate first, but always verify with real-world testing using your specific patterns and contrast levels.

センサー技術は被写界深度にどう影響するか?

モノクロセンサーとカラーセンサー

Monochrome sensors typically deliver higher effective resolution because every pixel captures full luminance information. In Bayer color sensors, each pixel only captures one color channel, requiring interpolation that can soften edges.

センサータイプが被写界深度性能に与える影響
センサータイプ 解像度の効率 エッジの鋭さ 最適
モノクローム 100% 素晴らしい 測定、検査、SLAM
ベイヤーRGB ~50%-70% 良好(補間) オブジェクトの分類、ソート
RGB-IR ~50% フェア デイナイト監視

グローバルシャッターとローリングシャッター

While not directly affecting depth of field calculations, global shutter sensors are crucial for moving robotics applications. Rolling shutter can create distortion that appears similar to focus problems but is actually temporal skew. Global shutter pixels add in-pixel storage circuitry, which typically makes them larger. At the same resolution, larger pixels mean a larger sensor format, which changes field of view for a given lens, and the larger pixel size relaxes the pixel-based circle of confusion, deepening depth of field.

オートフォーカスと固定焦点は?

ロボティクスにおける固定焦点の利点

Most industrial and robotics applications benefit from fixed-focus systems set to the hyperfocal distance. This maximizes the usable depth of field for a given aperture.

Use this calculator to find your optimal fixed focus position, then lock it mechanically or with thread-locking compound. For M12 mount lenses, this is typically done by rotating the lens to the correct position and securing it.

被写界深度についてよくある質問

For focus distances well short of the hyperfocal distance, depth of field grows roughly with the square of distance; near the hyperfocal distance the far limit extends to infinity. At close range (macro), DoF might be just millimeters. At 10 meters, the same camera setup might have several meters of DoF. This is why close-up inspection requires very precise focus while surveillance cameras can use fixed focus for everything beyond a few meters.

Yes, through focus stacking (combining multiple images at different focus distances) or computational deconvolution methods. However, these require either multiple captures (slow) or significant processing power. For real-time robotics, optical DoF is usually preferable. Some newer sensors include dual-pixel autofocus that can create depth maps to assist with synthetic DoF.

Modulation Transfer Function (MTF) measures contrast at different spatial frequencies. A lens might be "in focus" by DoF calculations but have poor MTF, resulting in low contrast. MTF falls gradually with defocus, so a well-corrected lens keeps usable contrast over more of the calculated DoF range. Always check MTF charts when selecting lenses for measurement applications where edge sharpness is critical.

Telecentric lenses maintain constant magnification throughout their depth of field, making objects appear the same size regardless of distance. While they don't increase DoF, they make the usable DoF more valuable for measurement since dimensional accuracy is preserved. They typically have smaller apertures (f/8-f/11) and thus naturally deeper DoF.

This depends on your application. For measurement and inspection, prioritize resolution with controlled focus. For object detection and tracking, prioritize DoF for robustness. Remember: you can always downsample a high-resolution image, but you can't recover details lost to blur. Many successful robotics systems use moderate 2-5MP sensors with good DoF rather than pushing for maximum resolution.

Near-IR wavelengths used with silicon sensors (750-1000nm) are longer than visible light, resulting in larger diffraction limits and slightly different focus positions. Many lenses aren't corrected for IR, causing focus shift. For day/night applications, look for lenses specifically designed with IR correction, or plan for separate focus positions for visible and IR illumination.

以前の計算機を使いたいですか? こちらをクリックして開いてください!

「旧版被写界深度計算機」を開く

お問い合わせ

米国に拠点を置くエンジニアリング・チームとつながる