Try   HackMD

二維自動化光學檢測及應用_吳先晃_機器視覺簡介及取像系統的選擇(上)_相機與鏡頭的搭配

tags: DeltaMOOCx 二維自動化光學檢測及應用 機器視覺

影片連結

人眼視覺

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

人眼要看到東西一定要有光,光打到物件上面然後反射到人眼,水晶體將景物聚焦到視網膜上,然後視網膜成像之後再送往大腦,大腦再根據所得資訊與記憶來跟我們說這是什麼。以上圖為例,大腦會跟我們說這是一棵樹。

機器視覺

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

機器視覺就是模仿人眼視覺而來的,像是LED打光在一個物體上,經過鏡頭然後在相機裡面成像,再將這張影像送去電腦處理。

基本成像原理

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

基本原理大致就是,鏡頭將物體資訊投像到像面(像面所指即為相機反光元件所放置的地方),投影資訊會上下左右相反。

裡面最重要的一個公式就是

1f=1u+1v。其中
v
為像距,也就是鏡頭到成像平面的距離,而
u
則為物距,即為物體到鏡頭的距離。

放大倍率

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

這是另一個重要的公式。圖上可以看的出有兩個相似的三角形,其中

d為成像面,而
D
為物面。

放大倍率會是

dD=vu=α

這個公式跟稍早基本成像原理所談到的公式兩個合併就可以做很多的推導。

放大倍率 - 練習題1-1

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

給定

f=30mm,並且放大倍率=
0.5
,求
u,v

放大倍率 - 練習題1-2

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

給定

f=50mm,並且放大倍率=
0.5
,求
u,v

這個題目給了我們一個推理,那就是相同倍率之下,焦距越長則光程越長,其中光程所指為物體到成像的距離,也就是

u+v

這主要考量到你的實際操作環境,環境不允許的情況下,你的焦距也無法太近,自然就要選長焦鏡頭。

Image Circle & Sensor Size

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

鏡頭瞭解之後接著說明跟鏡頭搭配的相機,相機裡面有個感光元件,也就是Sensor。

首先要知道,像面的直徑稱之為Image Circle,它是圓型的(鏡頭本身的成像是圓型),而感光元件是矩型(因為人類視覺是看矩型的)。裡面有一個很重要的條件,那就是感光元件一定小於Image Circle。

Image Circle & Sensor Size - 練習題2-1

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

上圖給出感光元件大於Image Circle的結果。可以明顯看出有些許的成像是黑色的,因為那些黑色區域的感光元件已經超出成像面。

Image Circle & Sensor Size

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

上面給出相同感光元件,不同鏡頭(Image Circle)搭配所產生的結果。

由左至右的Image Circle逐漸加大,可以明顯看出黑色區域不斷減少,最終得到一個最適影像。

Image Circle & Sensor Size - 練習題2-2

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

這個練習題主要要判斷這樣的鏡頭與感光元件是搭配是否可行。

首先計算對角線(利用畢式定理)長度,可得到

11mm,這明顯小於Image Circle,因此這樣的搭配是可行的。

FOV(Field of View)

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

FOV即為整個外界的景物能夠進到相機並且在感光元件上成像的範圍,這個部份是用Sensor Size與

α所決定,其中
α
即為放大倍率,也就是
vu

FOV(Field of View) - 練習題3

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

給定感光元件大小與鏡頭倍率的情況下求其FOV。

FOV(Field of View)

Image Not Showing Possible Reasons
  • The image was uploaded to a note which you don't have access to
  • The note which the image was originally uploaded to has been deleted
Learn More →

如果覺得FOV不符,那就需要改變:

  • 在Image Circle夠大的情況下加大感光元件即可放大FOV
  • 放大倍率,即可縮小FOV,同時也會提高分辨率,這意謂著看到的物體可以更為仔細
  • 焦距(
    f
    )變長,那光程(
    u+v
    )也會跟著變長