實作:先run起emgu cv gpu的函式,以及針對靜態影像做簡易的影像處理。
Step1: GPU package
GPU for image processing is only available for Emgu CV rev 2.2.1 and later. Only package containing -gpu in its name (e.g.
libemgucv-xxx-gpu-xxx
) has GPU processing enabled.- Install the latest cuda graphic card driver from NVIDIA on your running platform.
- Copy the cuda and npp dll files:
cudart{bit}_{maj_rev}_{min_rev}.dll
andnpp{bit}_{maj_rev}_{min_rev}.dll
to the execution directory - Add
Emgu.CV.GPU.dll
to References - Optionally put the following lines in the top of your code to include the Emgu.CV.GPU namespace.
Step2:
針對同一張800*533影像做灰階->FastCorner->轉bitmapsouce後用元件show圖,過程皆用Image類型運算。GPU cost time 是 82ms,non-gpu cost time是 17ms。
記錄:第一台ASUS BM6650 i5-2500 3.3GHz intel內顯 品牌電腦。執行時會有unknown error,初估是非nvidia的顯卡。第二台配備nvidia quadro工作站顯卡,成功執行。
結論:gpu函式再初始階段較耗時,在簡易的影像處理函式中無法展現高效能特性,或許在更高計算量的影像處理需要時,能展現其高效能之特性,像是KinectFusion(real-time 3D reconstruction)。
沒有留言:
張貼留言