Working with fastHOG on Windows

How to run fastHOG on Windows? Follow these steps.

Working with fastHOG on Windows

The fastHOG library has a parallel implementation of the Histogram of Oriented Gradients(HOG) algorithm for object detection. It is published in the paper fastHOG-a realtime GPUimplementation of HOG in 2012. The implementation is based on NVIDIA CUDA framework and the library is open-source. However, what is difficult is that there is little documentation for the code and we do not know how to use it. Fortunately, some people have compiled the library on Ubuntu and publish their detailed steps. See this link. As a windows user, I decide to run it on windows and I found it not difficult.

Environment preparation

My operating system is Windows 7 64 bit. I have installed visual studio 2010. My Graphic card is NVIDIA Geforce GTX 650 and I have updated its driver to newest version.

Library dependency

Resolving library dependency is always a trouble thing both on Linux and Windows. This program depends on four libraries: CUDA, fltk, FreeImage and boost. Let us solve them one by one.

CUDA

First download CUDA install package from NVIDIA website . After selecting Operating System, Architecture, Version and Installer Type, the download link appears below. So download and install it. It is easy.

FreeImage

FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. It can be downloaded from here . There are 3 files in the zip file: FreeImage.dll, FreeImage.h, FreeImage.lib.

FLTK

The most tough thing is fltk library. Its official website is here. But I don't know why the author used fltk2 in the program. I can't find fltk2 even on its official website. Then, I googled several times and finally found the SVN address in this blog. "FLTK 2.0 is an experimental new version of the library that was later abandoned." All right... But we have to go on.

Check out the codes using tortoiseSVN. We need to compile the library ourselves. So open the fltk_static.sln in the ide/vcnet folder, it will upgrade to Visual Studio 2010 solution. Build the solution under Debug and Release then we will got static libraried in the lib folder. We will use it later.

boost

Boost C++ libraries are famous and widely used. The built binaries can be downloaded from its website. The newest version 1.60.0 works well in this program.

Build fastHOG

The original source code of fastHOG was developed using CUDA 4.5 or 5.0 maybe. So a few changes have to be made if we use CUDA 7.5. I follewed this blog to make it compatible with CUDA 7.5. Replace the header files and replace all cutilSafeCall() with checkCudaErrors().

Open the "Build Customization" option in the project context menu and check "CUDA 7.5(.targets, .props)". This will tell the compiler how to deal with .cu files. Add your CUDA include path and samples include path into "VC++ Directories/Include Directories", also add your CUDA library path to "VC++ Directories/Library Directories". For example, my include directories are:

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v7.5\common\inc;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\include;$(IncludePath)  

and library directories:

C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5\lib\Win32;$(LibraryPath)

Then add the header file folder and library folder to "Additional Include Directories" and "Additional Library Directories" as we usually do in C++ development. Do not forget to add the compiled lib files to "Additional Dependencies", especially, cuda.lib and cudart.lib.

For now, we have finished the procedures of configuration the fastHOG project. Then we could build, run, substitute with our own test images and do whatever your want to do.

At last, there are some images of run effect:


最后編輯于
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,088評論 0 23
  • 草能益母,藥到病除。 人卻各殊,草之不如? 覓人之初,歸真返樸, 默默奉獻,草為師乎?
    珠江潮平閱讀 716評論 18 15
  • 很好的陽光,上午散了步。 下午沒有午睡,喝了茶,泡了腳,四點四十五分上盤。 今天右腳在上,八十分鐘,有所突破,先前...
    冬日蝴蝶結閱讀 160評論 0 0
  • 自信最重要~
    鹿菓兒哦閱讀 152評論 0 0
  • 我每次談戀愛都開始在冬天,然后夏天到來時分開。所以我對在夏天戀愛的回憶少得可憐,倒是記憶里在冬天的街頭冷得瑟瑟發(fā)抖...
    花未全閱讀 698評論 2 7

友情鏈接更多精彩內(nèi)容