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:


最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末证膨,一起剝皮案震驚了整個(gè)濱河市逐沙,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌改艇,老刑警劉巖胖替,帶你破解...
    沈念sama閱讀 221,820評(píng)論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件研儒,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡刊殉,警方通過(guò)查閱死者的電腦和手機(jī)殉摔,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,648評(píng)論 3 399
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)记焊,“玉大人逸月,你說(shuō)我怎么就攤上這事”槟ぃ” “怎么了碗硬?”我有些...
    開封第一講書人閱讀 168,324評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵瓤湘,是天一觀的道長(zhǎng)。 經(jīng)常有香客問(wèn)我恩尾,道長(zhǎng)弛说,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 59,714評(píng)論 1 297
  • 正文 為了忘掉前任翰意,我火速辦了婚禮木人,結(jié)果婚禮上,老公的妹妹穿的比我還像新娘冀偶。我一直安慰自己醒第,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,724評(píng)論 6 397
  • 文/花漫 我一把揭開白布进鸠。 她就那樣靜靜地躺著稠曼,像睡著了一般。 火紅的嫁衣襯著肌膚如雪客年。 梳的紋絲不亂的頭發(fā)上霞幅,一...
    開封第一講書人閱讀 52,328評(píng)論 1 310
  • 那天,我揣著相機(jī)與錄音量瓜,去河邊找鬼司恳。 笑死,一個(gè)胖子當(dāng)著我的面吹牛榔至,可吹牛的內(nèi)容都是我干的抵赢。 我是一名探鬼主播,決...
    沈念sama閱讀 40,897評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開眼唧取,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼铅鲤!你這毒婦竟也來(lái)了?” 一聲冷哼從身側(cè)響起枫弟,我...
    開封第一講書人閱讀 39,804評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤邢享,失蹤者是張志新(化名)和其女友劉穎,沒(méi)想到半個(gè)月后淡诗,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體骇塘,經(jīng)...
    沈念sama閱讀 46,345評(píng)論 1 318
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,431評(píng)論 3 340
  • 正文 我和宋清朗相戀三年韩容,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了款违。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 40,561評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡群凶,死狀恐怖插爹,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤赠尾,帶...
    沈念sama閱讀 36,238評(píng)論 5 350
  • 正文 年R本政府宣布力穗,位于F島的核電站,受9級(jí)特大地震影響气嫁,放射性物質(zhì)發(fā)生泄漏当窗。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,928評(píng)論 3 334
  • 文/蒙蒙 一寸宵、第九天 我趴在偏房一處隱蔽的房頂上張望崖面。 院中可真熱鬧,春花似錦邓馒、人聲如沸嘶朱。這莊子的主人今日做“春日...
    開封第一講書人閱讀 32,417評(píng)論 0 24
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)。三九已至脉课,卻和暖如春救军,著一層夾襖步出監(jiān)牢的瞬間,已是汗流浹背倘零。 一陣腳步聲響...
    開封第一講書人閱讀 33,528評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工唱遭, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留,地道東北人呈驶。 一個(gè)月前我還...
    沈念sama閱讀 48,983評(píng)論 3 376
  • 正文 我出身青樓拷泽,卻偏偏與公主長(zhǎng)得像,于是被迫代替她去往敵國(guó)和親袖瞻。 傳聞我的和親對(duì)象是個(gè)殘疾皇子司致,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,573評(píng)論 2 359

推薦閱讀更多精彩內(nèi)容

  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 9,573評(píng)論 0 23
  • 草能益母,藥到病除聋迎。 人卻各殊脂矫,草之不如? 覓人之初霉晕,歸真返樸庭再, 默默奉獻(xiàn),草為師乎牺堰?
    珠江潮平閱讀 617評(píng)論 18 15
  • 很好的陽(yáng)光拄轻,上午散了步。 下午沒(méi)有午睡伟葫,喝了茶恨搓,泡了腳,四點(diǎn)四十五分上盤扒俯。 今天右腳在上奶卓,八十分鐘一疯,有所突破,先前...
    冬日蝴蝶結(jié)閱讀 117評(píng)論 0 0
  • 自信最重要~
    鹿菓兒哦閱讀 106評(píng)論 0 0
  • 我每次談戀愛都開始在冬天夺姑,然后夏天到來(lái)時(shí)分開墩邀。所以我對(duì)在夏天戀愛的回憶少得可憐,倒是記憶里在冬天的街頭冷得瑟瑟發(fā)抖...
    花未全閱讀 657評(píng)論 2 7