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:


最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • **2014真题Directions:Read the following text. Choose the be...
    又是夜半惊坐起阅读 9,890评论 0 23
  • 草能益母,药到病除。 人却各殊,草之不如? 觅人之初,归真返朴, 默默奉献,草为师乎?
    珠江潮平阅读 641评论 18 15
  • 很好的阳光,上午散了步。 下午没有午睡,喝了茶,泡了脚,四点四十五分上盘。 今天右脚在上,八十分钟,有所突破,先前...
    冬日蝴蝶结阅读 130评论 0 0
  • 自信最重要~
    鹿菓兒哦阅读 125评论 0 0
  • 我每次谈恋爱都开始在冬天,然后夏天到来时分开。所以我对在夏天恋爱的回忆少得可怜,倒是记忆里在冬天的街头冷得瑟瑟发抖...
    花未全阅读 668评论 2 7