Here is an excellent Matlab code that fully implements Dalal's algorithm. I have tested and used this code for many major academic projects.
http://hi.baidu.com/fpmaldfoamdfmze/item/4f3b3ac881affcb00c0a7b11
All credit goes to the person who posted this!
HOG is not specific to pedestrian detection. You can use it with any rigid (or apploximately rigid) object.
To use this code, you need to understand how HOG is calculated over a region. The region is divided into overlapping 'blocks'. Blocks consist of a number of 'cells'. A spatial orientation histogram is computed in each block. The final vector is formed by concatenating these spatial histograms.
The parameters that you can tweak are
cellpw, cellph: cell's pixel width and height respectively.
nblockw, nblockh: block size counted by cells number in x and y directions respectively.
nthet: Number of angle bins.
issigned: whether signed or unsigned gradient is taken
overlap: amount of overlap between blocks specified as a fraction
isglobalinterpolate: whether global or local interpolation of 3d histogram
normmethod: type of norm used
You can fist try with the default parameters -
cellpw = 8;
cellph = 8;
nblockw = 2;
nblockh = 2;
nthet = 9;
overlap = 0.5;
isglobalinterpolate = 'localinterpolate';
issigned = 'unsigned';
normmethod = 'l2hys';
In matlab getting the feature is something like
I = imread('car.png');
Ig = rgb2gray(I);
F = hogcalculator(Ig, 8, 8, 2, 2, 9, 0.5,'localinterpolate', 'unsigned', 'l2hys');
The dimension/length of F depends on the paramenters you choose.
Answering your comment,
Yes, you have to build these features for your positive(car) and negative(non-car) images to build a detection system. SVM is typically used as classifier. I suggest using libsvm library -
http://www.csie.ntu.edu.tw/~cjlin/libsvm/
Once you build your training set, train with your training set. Tweak SVM parameters to get the highest accuracy.
The parameters given in the example may not be the best, you can always try a different set. I would try changing nthet, cellpw and cellph first.
Good luck!