How to build FastHOG

FastHOG is a Histogram of Oriented Gradients (HOG) library that uses CUDA to compute on the GPU. The original source code can be obtained here. However, this code cannot be compiled with recent CUDA SDKs. I’ve made the changes needed to compile it and shared the code here.

To build and install this FastHOG in a few steps:

  • Install 5.5 or a more recent version of CUDA. Instructions can be found here.

  • Install Xinerama and FreeImage libraries:

$ sudo apt install libxinerama-dev libfreeimage-dev
  • Build and install the 2.0 branch of FLTK. This is an abandoned branch of the library and instructions to build it can be found here. Note that FastHOG will not compile with the current 1.x branch of FLTK.

  • Clone the fixed source code of FastHOG, build it and test whether it works:

$ git clone https://github.com/ashwin/fasthog.git
$ cd fasthog/source/fastHOG
$ make
$ bin/release/fastHOG

The test program displays an image of pedestrians. Click anywhere on it and the detected people will be drawn in red boxes.

Tried with: CUDA 5.5 and Ubuntu 12.04

8 thoughts on “How to build FastHOG”

  1. Thanks for the instructions. I downloaded the code and it worked for me with Ubuntu 14.04 + CUDA 6.5. I must mention, though, that I had to modify common.mk and add the libraries fontconfig, Xrender and X11, otherwise it complained that it couldn’t find some symbols:

    LIBS += -lftonconfig -lXrender -lX11

    Also, for compiling succesully fltk, I followed the instructions from here: http://stackoverflow.com/questions/14036485/compiling-fast-light-toolkit-fltk-2-0-to-use-with-fasthog, and modified makeinclude to add:

    LDLIBS += -lfontconfig -lXrender
    GDLIBS += -lfontconfig -lXrender -lfreetype

    Like

    1. To cristianruz

      I am not able to set up the system is there any tip on adding the
      LDLIBS += -lfontconfig -lXrender
      GDLIBS += -lfontconfig -lXrender -lfreetype

      i dont know where to add this lib

      Also is it a messy typing one

      LIBS += -lftonconfig -lXrender -lX11 should it be like LIBS += -lfontconfig -lXrender -lX11

      and where to add this lib

      thanks for your help

      Like

  2. my problem is fallow

    rex@rex-All-Series:~/Desktop/new fasthog-master/source/fastHOG$ make
    /usr/bin/ld: //usr/local/lib/libfltk2.a(Font.o): undefined reference to symbol ‘FcInit’
    //usr/lib/x86_64-linux-gnu/libfontconfig.so.1: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    make: *** [bin/release/fastHOG] Error 1
    rex@rex-All-Series:~/Desktop/new fasthog-master/source/fastHOG$ make
    /usr/bin/ld: //usr/local/lib/libfltk2.a(Font.o): undefined reference to symbol ‘FcInit’
    //usr/lib/x86_64-linux-gnu/libfontconfig.so.1: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status
    make: *** [bin/release/fastHOG] Error 1
    rex@rex-All-Series:~/Desktop/new fasthog-master/source/fastHOG$

    Like

  3. Same problem here. Please help.

    /fasthog/source/fastHOG$ make
    /usr/bin/ld: //usr/local/lib/libfltk2.a(Font.o): undefined reference to symbol ‘FcInit’
    /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libfontconfig.so: error adding symbols: DSO missing from command line
    collect2: error: ld returned 1 exit status

    Like

    1. Problem solved. I ahve just added the following line before LINKLINE = $(LINK) -o $(TARGET) $(OBJS) $(LIB)

      LIB += -lfontconfig -lXrender -lX11

      Like

  4. Also, to successfully compile with CUDA 7.0 on Ubuntu 14.04.3 64bits, you should replace CUDA_INSTALL_PATH ?= /usr/local/cuda
    with
    CUDA_INSTALL_PATH ?= /usr/local/cuda-7.0

    Otherwise, it will link to the incompatible libcudart.so library.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s