how to transfer the paper to the box ?

47

Upload: deloitte

Post on 19-Feb-2017

108 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: How to transfer the paper to the box ?
Page 2: How to transfer the paper to the box ?

Electrical Engineering MajorTechnical Management Sub MajorPresident of Student Association

Han Yang Chang張翰揚

The Automation Design CompetitionProject Leader

Young Entrepreneurs of the Future2015 YEFer (member)

Lakala E-billing Technology & Service Co.Technical Assistant , Intern

Page 3: How to transfer the paper to the box ?

Outline1 • Concept

2 • System

3 • Question & Algorithm

4 • Demo

5 • Conclusion & Application

6 • Q&A

Page 4: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

三軸移動平台

固定外部參考圖形

Page 5: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

Page 6: How to transfer the paper to the box ?

機構 獨立量測設計外部圖形

Concept System Algorith

m Demo Conclusion Q&A

Page 7: How to transfer the paper to the box ?

多個鏡頭 三點定位移動測量

Concept System Algorith

m Demo Conclusion Q&A

Page 8: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

深度演算單一鏡頭

Page 9: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

Page 10: How to transfer the paper to the box ?

影像校正

影像銳化

提取訊息

計算分析

三維座標

回傳位置

Concept System Algorith

m Demo Conclusion Q&A

Page 11: How to transfer the paper to the box ?

1th 2th 3th 4th

Concept System Algorith

m Demo Conclusion Q&A

Page 12: How to transfer the paper to the box ?

PCI-DMC-B01*1 三軸伺服馬達 -ECMA-C105/6馬達驅動器 -ASD-A20421-F

Concept System Algorith

m Demo Conclusion Q&A

Page 13: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

Page 14: How to transfer the paper to the box ?

• x *1280000 ( pulse)• y *1280000 ( pulse)• z*1280000*2( pulse)單位換算 _DMC_01_start_ta_m

ove送入指令

一、指定座標

Concept System Algorith

m Demo Conclusion Q&A

Page 15: How to transfer the paper to the box ?

二、圓弧移動

X’=r*

X=r*

ΔX=X-X’ (變動量)θ

Concept System Algorith

m Demo Conclusion Q&A

Page 16: How to transfer the paper to the box ?

三、立方運動於介面設定八個定點,依序移動至以下: (0,0,0),(0,0,r),(0,r,0),(0,r,r),(r,0,0),(r,0,r),(r,r,0),(r,r,r)

Concept System Algorith

m Demo Conclusion Q&A

Page 17: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

Page 18: How to transfer the paper to the box ?

3D scatter chart-motor 3D scatter chart-image

Concept System Algorith

m Demo Conclusion Q&A

Page 19: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

一、如何的得到三維立體座標?

二、照光的角度不同,造成顏色難以區分?

三、三角形的邊長會有方格狀,造成取頂點時的誤差?

四、在移動過程中,如何解決看不到三角形的問題?

五、遮罩的傾斜度會造成誤差?

Page 20: How to transfer the paper to the box ?

一、如何的得到三維立體座標? 1. 計算 xy 平面的移動距離• 重心座標(x ,y)=( (x1+x2+x3)/3, (y1+y2+y3)/3)• 計算三角形重心與鏡像中心點的距離(D) Dx﹐y= 座標像素點差距( pixel ) *( 三角形實際邊長( cm ) )/( 三角形影像邊長( pixel ) )

• 三角形實際邊長( cm ): 大三角形為15公分,小三角形則為 8 公分• 座標像素點差距( pixel ): x-W / 2;y-L / 2

Concept System Algorith

m Demo Conclusion Q&A

Page 21: How to transfer the paper to the box ?

感光元件

Webcam

校正後量測距離

Concept System Algorith

m Demo Conclusion Q&A

Page 22: How to transfer the paper to the box ?

Webcam

Z 軸移動移動距離= 在感光元件上的影像三角形的邊長變化

Concept System Algorith

m Demo Conclusion Q&A

Page 23: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

一、如何的得到三維立體座標? 2. 計算深度距離(利用攝影機拍攝速率及馬達實際運動速率)原理:假設馬達的速率恆定在區域二內動作,不考慮響應上的延遲時(區域一、三)。利用照相機在某個頻率取樣時,依照此頻率的倒數,我們可以得知此馬達運動的時間,在藉由此段時間及相對應的運動速率,我們可以知道實際上照相機移動的距離,再藉由影像所取得的 xy 平面移動距離,我們及可以推論出深度的移動距離。

Page 24: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

一、如何的得到三維立體座標? 2. 計算深度距離(利用攝影機拍攝速率及馬達實際運動速率)影像擷取速率:P(張/秒)馬達轉速:V(公分/秒)整體移動距離:S(公分)xy平面移動距離:K(公分)影像深度:D(公分)前一次x , y , z的數值:(x before, y before, zbefore )目前的x , y , z的數值:(x now, y now, znow )D2 = S2 - K2 K=  z now =z before± D( ± 代表馬達的正逆轉)

立體運動示意圖K

SD

Page 25: How to transfer the paper to the box ?

二、照光的角度不同,造成顏色難以區分? Ans : 利用RGB轉HSV做調整

利用 cvtColor 作色彩空間轉換 RGB to HSV如果H <0 然後H <= H + 360 。在輸出時0≦V≦1 , 0 S 1≦ ≦ , 0 H 360≦ ≦ 。

Concept System Algorith

m Demo Conclusion Q&A

Page 26: How to transfer the paper to the box ?

二、照光的角度不同,造成顏色難以區分?

Concept System Algorith

m Demo Conclusion Q&A

Page 27: How to transfer the paper to the box ?

三、三角形的邊長會有方格狀,造成取頂點時的誤差?

對於求一個銳化後的像素點( sharpened_pixel ),這個基於拉普拉斯算子的簡單算法主要是遍歷圖像中的像素點,根據領域像素確定其銳化後的值計算公式:Sharpened pixel = 5 * current - left - right - up - down ;

Ans :圖像銳化  Up  

Left Current(Sharpened pixel)

Right

  Down  

  -1  -1 5 -1  -1  

Concept System Algorith

m Demo Conclusion Q&A

Page 28: How to transfer the paper to the box ?

三、三角形的邊長會有方格狀,造成取頂點時的誤差?

銳化前: 銳化後:

Concept System Algorith

m Demo Conclusion Q&A

Page 29: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?1. 大三角形且完整的,原始圖像是移動至( 5,5,0 ) 輸出結果:x= 4.94009cmy= 4.95842cmz= -

0.418609cm

Concept System Algorith

m Demo Conclusion Q&A

Page 30: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?2. 大三角形且不完整的,原始圖像是移動至( 15,5,0 ) 輸出結果:x= 14.9538cmy= 5.47584cmz= 2.16041cm

Concept System Algorith

m Demo Conclusion Q&A

Page 31: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?3. 小三角形且完整的,原始圖像是移動至( 10,5,0 ) 輸出結果:x= 9.90236cmy= 5.05249cmz= 1.2815cm

Concept System Algorith

m Demo Conclusion Q&A

Page 32: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?4. 小三角形且不完整的,原始圖像是移動至( 5,5,0 ) 輸出結果:x= 4.46787cmy= 5.17408cmz= -0.8535cm

Concept System Algorith

m Demo Conclusion Q&A

Z軸的影響最大 !!

Page 33: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題? 1. 遮罩設計

• 大三角形為 15cm ,小三角形為 8cm

• 大三角形:以顏色較為分明的為主• 小三角形:其黑色與綠 / 黃分開• 兩種三角形以大三角形最多

Concept System Algorith

m Demo Conclusion Q&A

Page 34: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?

範例:移動至(5 , 5 ,0)座標1. 遮罩設計-大三角形精度高

利用較小的三角形進行計算,結果( 4.46,5.17,4.28 )差 0.5cm!

Concept System Algorith

m Demo Conclusion Q&A

Page 35: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?

範例:移動至(5 , 5 ,0)座標1. 遮罩設計-大三角形精度高

利用較大的三角形進行計算,結果( 4.94,4.95,-0.41 ) 勝

Concept System Algorith

m Demo Conclusion Q&A

Page 36: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?

求解兩條直線方程式,分別是:ax+by+c=0dx+ey+f=0x=(b *f-e *c)/(a *e-b*d)y=(a *f-d *c)/(b *d-a*e)

2. 利用直線方程式求解三頂點

因此可以求得三角形的三頂點解(x1 , y1)(x2 , y2)(x3 , y3)

Concept System Algorith

m Demo Conclusion Q&A

Page 37: How to transfer the paper to the box ?

四、在移動過程中,如何解決看不到三角形的問題?

Concept System Algorith

m Demo Conclusion Q&A

Page 38: How to transfer the paper to the box ?

五、遮罩的傾斜度會造成誤差? 1. 計算傾斜角度(固定深度)

H=L */2(三角形的高度)h=點到直線的距離θ=(+:向前傾斜;-:向後傾斜)

H

h

修正後三角形 

傾斜後三角形θ

H=L */2 (三角形的高度)h=點到直線的距離θ =(+:向前傾斜;-:向後傾斜)

Concept System Algorith

m Demo Conclusion Q&A

Page 39: How to transfer the paper to the box ?

五、遮罩的傾斜度會造成誤差? 2. 初始化鏡頭校準

(x , y)為此鏡頭之鏡像中心點位置=此校準三角形之重心位置 當上述條件成立後x , y補償量=(鏡像中心點-三角形重心位置) * 轉換比

• (x , y)為鏡像中心點位置 =校準三角形之重心

• x , y補償量=(鏡像中心點-三角形重心位置) * 轉換比

Concept System Algorith

m Demo Conclusion Q&A

Page 40: How to transfer the paper to the box ?

五、遮罩的傾斜度會造成誤差? 3. 馬達運動過程,三頂點校準

(x , y)為此鏡頭之鏡像中心點位置=此校準三角形之重心位置 當上述條件成立後x , y補償量=(鏡像中心點-三角形重心位置) * 轉換比

Concept System Algorith

m Demo Conclusion Q&A

Page 41: How to transfer the paper to the box ?

五、遮罩的傾斜度會造成誤差?

(x , y)為此鏡頭之鏡像中心點位置=此校準三角形之重心位置x , y補償量=(鏡像中心點-三角形重心位置) * 轉換比

輸入:( 15,0,0 )輸出結果:x=15.2149cmy=0.166982cmz=3.03181cm

Concept System Algorith

m Demo Conclusion Q&A

Page 42: How to transfer the paper to the box ?

五、遮罩的傾斜度會造成誤差?

(x , y)為此鏡頭之鏡像中心點位置=此校準三角形之重心位置x , y補償量=(鏡像中心點-三角形重心位置) * 轉換比

輸入:( 15,0,0 )輸出結果:x=15.2149cmy=0.166982cmz=0.259964cm

Concept System Algorith

m Demo Conclusion Q&A

減少約 90%誤差 !!

Page 43: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

(x , y)為此鏡頭之鏡像中三十秒影片介紹位置=此校準三角形之重心位置

當上述條件成立後x , y補償量=(鏡像中心點-三角形重心位置) * 轉換比

Page 44: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

影像 馬達 信息結合

編碼、工件誤差直接量測獨立量測累積誤差降低成本

Page 45: How to transfer the paper to the box ?

We Need You !!

Page 46: How to transfer the paper to the box ?

Concept System Algorith

m Demo Conclusion Q&A

Page 47: How to transfer the paper to the box ?

 Thanks for your attention !!

Linkedin

Facebook

Han Yang Chang