Monday, August 24, 2009

You can make image of you drive by using a windows tool ImageX all you have to do is open command prompt from vista CD , click here to know how to open command prompt from vista cd, and go to the path of imagex.exe file and then type in the following command ( I am assuming you want to make image of c: drive and want to store at d:\image\vista.wim you can change as per your requirements)wait before I tell you the command make points of the following1) you should clean the drive as much as possible otherwise it will take a long time. typically for more than 15 GB it will take really long.2) if you want to make image of a drive which is not your OS drive then you can make image from the OS itself no need to boot from vista CD.and the command is

imagex /capture c: d\image\vista.wim "d drive"

you can type in imagex /capture /? for help on this command.

Now this image can come in great use, you can anytime revert your system at the point you made the image by simply applying the following command

imagex /apply d\image\vista.wim 1 c:

and you will have all your software and drivers installed already, no more headache of installing all software and drivers.

Saturday, August 8, 2009

Histograms of Oriented Gradients or HOG features in combination with a support vector machine have been successfully used for object Detection (most popularly pedestrian detection).
An Integral Histogram representation can be used for fast calculation of Histograms of Oriented Gradients over arbitrary rectangular regions of the image. The idea of an integral histogram is analogous to that of an integral image, used by viola and jones for fast calculation of haar features for face detection. Mathematically,

where b represents the bin number of the histogram. This way the calculation of hog over any arbitrary rectangle in the image requires just 4*bins number of array references. For more details on integral histogram representation, please refer,

/* Create an array of 9 images (9 because I assume bin size 20 degrees and unsigned gradient ( 180/20 = 9), one for each bin which will have zeroes for all pixels, except for the pixels in the original image for which the gradient values correspond to the particular bin. These will be referred to as bin images. These bin images will be then used to calculate the integral histogram, which will quicken the calculation of HOG descriptors */

/* Create an array of 9 images ( note the dimensions of the image, the cvIntegral() function requires the size to be that), to store the integral images calculated from the above bin images. These 9 integral images together constitute the integral histogram */

IplImage** integrals = (IplImage**) malloc(9 * sizeof(IplImage*)); for (int i = 0; i < 9 ; i++) {integrals[i] = cvCreateImage(cvSize(in->width + 1, in->height + 1), IPL_DEPTH_64F,1); }/* Calculate the bin images. The magnitude and orientation of the gradient at each pixel is calculated using the xsobel and ysobel images.{Magnitude = sqrt(sq(xsobel) + sq(ysobel) ), gradient = itan (ysobel/xsobel) }. Then according to the orientation of the gradient, the value of the corresponding pixel in the corresponding image is set */

/*For every pixel in a row gradient orientation and magnitude are calculated and corresponding values set for the bin images. */

for (x = 0; x <in->width; x++) {

/* if the xsobel derivative is zero for a pixel, a small value is added to it, to avoid division by zero. atan returns values in radians, which on being converted to degrees, correspond to values between -90 and 90 degrees. 90 is added to each orientation, to shift the orientation values range from {-90-90} to {0-180}. This is just a matter of convention. {-90-90} values can also be used for the calculation. */

/*The function returns an array of 9 images which consitute the integral histogram*/

return (integrals);
}

The following demonstrates how the integral histogram calculated using the above function can be used to calculate the histogram of oriented gradients for any rectangular region in the image:

/* The following function takes as input the rectangular cell for which the histogram of oriented gradients has to be calculated, a matrix hog_cell of dimensions 1x9 to store the bin values for the histogram, the integral histogram, and the normalization scheme to be used. No normalization is done if normalization = -1 */