<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;CEMDQH89cSp7ImA9WhBaFEQ.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669</id><updated>2013-05-25T07:34:31.169-07:00</updated><category term="task manager disabled" /><category term="speed up a program" /><category term="detecting devices" /><category term="create image wim" /><category term="rgb to bw" /><category term="proxy" /><category term="pedestrian detection" /><category term="dvd burn" /><category term="rename large number of files" /><category term="randomly generate" /><category term="google talk" /><category term="matlab basics" /><category term="registry disabled" /><category term="cumulative distribution function." /><category term="recover you operating system" /><category term="linux on windows" /><category term="syntax" /><category term="lyrics" /><category term="imapprox" /><category term="windows 7" /><category term="speedup vista" /><category term="fft implementation" /><category term="object detection" /><category term="MATLAB IP" /><category term="windows on linux" /><category term="integral histogram" /><category term="google talk received files" /><category term="ind2gray" /><category term="DisableTaskMgr" /><category term="subplot" /><category term="increasing RAM" /><category term="IP" /><category term="imshow" /><category term="gmail voice and video chat" /><category term="dell laptop format" /><category term="eclipse" /><category term="use of imagex tool" /><category term="grayscale" /><category term="svm" /><category term="shared libraries" /><category term="colormap" /><category term="improving performance" /><category term="video processing" /><category term="opencv" /><category term="hog features" /><category term="registry tweaks" /><category term="change default path of command prompt" /><category term="rename" /><category term="make image of drive" /><category term="firefox tweaks" /><category term="fft code" /><category term="vista slow" /><category term="simple way to use multithreading in java" /><category term="rgb2ind" /><category term="c" /><category term="matlab" /><category term="firefox starts slowly" /><category term="shared folders" /><category term="gaussian distribution" /><category term="color conversions matlab" /><category term="radix 2" /><category term="computer vision" /><category term="disable on start up" /><category term="installation problem" /><category term="dell factory image restore" /><category term="speedup firefox" /><category term="trick" /><category term="factory.wim" /><category term="c code fft" /><category term="hog" /><category term="normal distribution generation" /><category term="change default directory in vista" /><category term="virtual box" /><category term="best way to backup your system" /><category term="histogram of oriented gradients" /><category term="amarok" /><category term="image processing" /><category term="startup programs" /><category term="dell touchpad scroll" /><category term="error" /><category term="vmware tools" /><category term="touchpad problems" /><category term="dvd player" /><title>Solutions</title><subtitle type="html">Collection of writings related to technology, programming, solutions to common problems and a lot more :)</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://smsoftdev-solutions.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>Unknown</name><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>31</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/blogspot/KxdBp" /><feedburner:info uri="blogspot/kxdbp" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D0cGSHs_eyp7ImA9Wx9VFE0.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-6252769139942866624</id><published>2011-01-30T08:30:00.000-08:00</published><updated>2011-01-30T08:30:29.543-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-30T08:30:29.543-08:00</app:edited><title>Reading a bmp image directly in C++ : Part 1</title><content type="html">For this we need to first understand the bmp file format&lt;br /&gt;
&lt;br /&gt;
As illustrated by the figure below: &lt;br /&gt;
&lt;br /&gt;
The bitmap image consists of 3 main parts:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Header ( Including the signature and the image info data)&lt;br /&gt;
&lt;br /&gt;
2) Colour Profile&lt;br /&gt;
&lt;br /&gt;
3) Image data&lt;br /&gt;
&lt;br /&gt;
 &lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://upload.wikimedia.org/wikipedia/commons/c/c4/BMPfileFormat.png" imageanchor="1" style="margin-left:1em; margin-right:1em"&gt;&lt;img border="0" height="1033" width="440" src="http://upload.wikimedia.org/wikipedia/commons/c/c4/BMPfileFormat.png" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Image source: http://en.wikipedia.org/wiki/BMP_file_format&lt;br /&gt;
&lt;br /&gt;
The header data is of size 54 bits. This can be observed by adding up the size requirements of the individual entries as written below. Also mentioned is the offset value for individual entries. An interesting observation is that the total size is not a multiple of 4 which might create several problems as in most compilers memory is read in chunks of 4 bytes.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;offset  size  description &lt;/b&gt;&lt;br /&gt;
0  &amp;nbsp&amp;nbsp&amp;nbsp 2     &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbspsignature, must be 4D42 hex &lt;br /&gt;
2  &amp;nbsp&amp;nbsp&amp;nbsp 4     &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp   size of BMP file in bytes (not very reliable) &lt;br /&gt;
6  &amp;nbsp&amp;nbsp&amp;nbsp 2     &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp   reserved, must be zero &lt;br /&gt;
8  &amp;nbsp&amp;nbsp&amp;nbsp 2      &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp  reserved, must be zero &lt;br /&gt;
10 &amp;nbsp&amp;nbsp 4  &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp        offset to start of image data in bytes &lt;br /&gt;
14 &amp;nbsp&amp;nbsp 4  &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp  size of BITMAPINFOHEADER structure, must be 40 &lt;br /&gt;
18 &amp;nbsp&amp;nbsp 4  &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp  image width in pixels &lt;br /&gt;
22  &amp;nbsp&amp;nbsp4  &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp  image height in pixels &lt;br /&gt;
26  &amp;nbsp&amp;nbsp2   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp number of planes in the image, must be 1 &lt;br /&gt;
28  &amp;nbsp&amp;nbsp2   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp number of bits per pixel (1, 4, 8, or 24) &lt;br /&gt;
30  &amp;nbsp&amp;nbsp4   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp compression type (0=none, 1=Run Length Encoding (RLE)-8, 2=RLE-4) &lt;br /&gt;
34  &amp;nbsp&amp;nbsp4   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp size of image data in bytes (including padding, to make it a multiple of 4)&lt;br /&gt;
38  &amp;nbsp&amp;nbsp4   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp horizontal resolution in pixels per meter &lt;br /&gt;
42  &amp;nbsp&amp;nbsp4   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp vertical resolution in pixels per meter&lt;br /&gt;
46  &amp;nbsp&amp;nbsp4   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp number of colours in image, or zero &lt;br /&gt;
50  &amp;nbsp&amp;nbsp4   &amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp&amp;nbsp number of important colours, or zero &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(To be continued in next post)&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/IZWyP0ma0h0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/6252769139942866624/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2011/01/reading-bmp-image-directly-in-c-part-1.html#comment-form" title="91 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/6252769139942866624?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/6252769139942866624?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/IZWyP0ma0h0/reading-bmp-image-directly-in-c-part-1.html" title="Reading a bmp image directly in C++ : Part 1" /><author><name>risingsun</name><uri>http://www.blogger.com/profile/00560773894139187343</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://1.bp.blogspot.com/_--1-wDaeGiY/TPlNc3imnzI/AAAAAAAACiQ/xscILLXa8-o/S220/pic.jpg" /></author><thr:total>91</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2011/01/reading-bmp-image-directly-in-c-part-1.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0AFR30_eSp7ImA9Wx9WFk0.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-2078649045302755788</id><published>2011-01-21T01:21:00.000-08:00</published><updated>2011-01-21T01:21:56.341-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-21T01:21:56.341-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="increasing RAM" /><category scheme="http://www.blogger.com/atom/ns#" term="linux on windows" /><category scheme="http://www.blogger.com/atom/ns#" term="improving performance" /><title>Increasing RAM using a USB drive</title><content type="html">A disk cache component called ReadyBoost has been introduced by Microsoft in its two latest offerings &lt;b&gt;Windows Vista and also Windows 7.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Although it is best to physical add new RAM to your system, it is possible to improve the performance by using an external hard drive by about 5-10% using flash memory, a USB flash drive, SD card, CompactFlash or any kind of portable flash mass storage system as a cache.&lt;br /&gt;
&lt;br /&gt;
How to enable Ready Boost in your external disk:&lt;br /&gt;
&lt;br /&gt;
1)Go to My Computer&lt;br /&gt;
2)Right click on your device&lt;br /&gt;
3)Select Properties&lt;br /&gt;
4)Click on the ReadyBoost tab&lt;br /&gt;
5)You can select various options/space allotment from there.&lt;br /&gt;
&lt;br /&gt;
How to enable/disable Ready Boost in your system:&lt;br /&gt;
&lt;br /&gt;
1)Go to the Control Panel menu option.&lt;br /&gt;
2)Click on Performance Information and Tools&lt;br /&gt;
3)Click on Advanced Tools in the left hand navigation bar.&lt;br /&gt;
4)Click on Configure my Windows ReadyBoost device&lt;br /&gt;
5) Select the options you want.&lt;br /&gt;
&lt;br /&gt;
You can even check the performance imporvement by :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Go to Control Panel menu option. Change to classic view options&lt;br /&gt;
&lt;br /&gt;
2) Click on the Administrative Tools icon.&lt;br /&gt;
&lt;br /&gt;
3) Click on Reliability and Performance Monitor icon.&lt;br /&gt;
&lt;br /&gt;
Under the monitoring tools category, click on performance monitor&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/4Q5mV0OnQyQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/2078649045302755788/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2011/01/increasing-ram-using-usb-drive.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/2078649045302755788?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/2078649045302755788?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/4Q5mV0OnQyQ/increasing-ram-using-usb-drive.html" title="Increasing RAM using a USB drive" /><author><name>risingsun</name><uri>http://www.blogger.com/profile/00560773894139187343</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://1.bp.blogspot.com/_--1-wDaeGiY/TPlNc3imnzI/AAAAAAAACiQ/xscILLXa8-o/S220/pic.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2011/01/increasing-ram-using-usb-drive.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkQFRHYzcCp7ImA9Wx9WFUk.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-1391366791419426193</id><published>2011-01-20T08:18:00.001-08:00</published><updated>2011-01-20T08:18:35.888-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-20T08:18:35.888-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="subplot" /><category scheme="http://www.blogger.com/atom/ns#" term="imshow" /><category scheme="http://www.blogger.com/atom/ns#" term="matlab basics" /><title>Matlab-4 Display multiple images, plots in a single window in MATLAB</title><content type="html">How to display multiple images or graphs in a single window (frame) in MATLAB&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This is done by using the subplot command in MATLAB&lt;br /&gt;
&lt;br /&gt;
Suppose we have to display 4 images (aa,bb,cc,dd) in a single figure and arrange them in 2x2 fashion.&lt;br /&gt;
&lt;br /&gt;
We will use the following commands:&lt;br /&gt;
&lt;br /&gt;
figure;&lt;br /&gt;
&lt;br /&gt;
subplot(2,2,1);imshow(aa);&lt;br /&gt;
subplot(2,2,2);imshow(bb);&lt;br /&gt;
subplot(2,2,3);imshow(cc);&lt;br /&gt;
subplot(2,2,4);imshow(dd);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
similary to display two image in 2x1 fashion, we will use:&lt;br /&gt;
&lt;br /&gt;
subplot(2,1,1);imshow(aa);&lt;br /&gt;
subplot(2,1,2);imshow(bb);&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/8lwNt-wq0hs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/1391366791419426193/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2011/01/matlab-4-display-multiple-images-plots.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/1391366791419426193?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/1391366791419426193?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/8lwNt-wq0hs/matlab-4-display-multiple-images-plots.html" title="Matlab-4 Display multiple images, plots in a single window in MATLAB" /><author><name>risingsun</name><uri>http://www.blogger.com/profile/00560773894139187343</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://1.bp.blogspot.com/_--1-wDaeGiY/TPlNc3imnzI/AAAAAAAACiQ/xscILLXa8-o/S220/pic.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2011/01/matlab-4-display-multiple-images-plots.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkcMQXYyeCp7ImA9Wx9WFUk.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-7020269859617561574</id><published>2011-01-20T08:14:00.001-08:00</published><updated>2011-01-20T08:14:40.890-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-20T08:14:40.890-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="MATLAB IP" /><category scheme="http://www.blogger.com/atom/ns#" term="ind2gray" /><category scheme="http://www.blogger.com/atom/ns#" term="color conversions matlab" /><category scheme="http://www.blogger.com/atom/ns#" term="imapprox" /><category scheme="http://www.blogger.com/atom/ns#" term="colormap" /><category scheme="http://www.blogger.com/atom/ns#" term="rgb2ind" /><title>Matlab Image Processing-3 Converting a RGB image to indexed image</title><content type="html">We need to use the command rgb2ind to do this.&lt;br /&gt;
&lt;br /&gt;
A conversion like&lt;br /&gt;
&lt;br /&gt;
[X,map] = rgb2ind(aa, n) %% here aa is a rgb color image. n is an integer less than or equal to 65536.&lt;br /&gt;
&lt;br /&gt;
By using this operation we can reduce a RGB having almost 256*256*256 possible colors into an index image X with colormap map having the colors of RGB image mapped to the nearest color values.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Further making changes into the colour map.&lt;br /&gt;
&lt;br /&gt;
Suppose we need to change the total colours into say n.&lt;br /&gt;
&lt;br /&gt;
We can do the following:&lt;br /&gt;
&lt;br /&gt;
[X, map] = imread('image.jpg');&lt;br /&gt;
[Y, newmap] = imapprox(X, map, n); % n is the new number of colours (a positive int value)&lt;br /&gt;
imshow(Y, newmap);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converting the Ind Image into Grayscale:&lt;br /&gt;
&lt;br /&gt;
ind2gray removes the hue and saturation information from the input image while retaining the intensity portion(i.e the luminiscence).&lt;br /&gt;
&lt;br /&gt;
grayim = ind2gray(X,map);&lt;br /&gt;
imshow(X,map);&lt;br /&gt;
figure, imshow(grayim);&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/tytlyrGpja8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/7020269859617561574/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2011/01/matlab-image-processing-3-converting.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/7020269859617561574?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/7020269859617561574?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/tytlyrGpja8/matlab-image-processing-3-converting.html" title="Matlab Image Processing-3 Converting a RGB image to indexed image" /><author><name>risingsun</name><uri>http://www.blogger.com/profile/00560773894139187343</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://1.bp.blogspot.com/_--1-wDaeGiY/TPlNc3imnzI/AAAAAAAACiQ/xscILLXa8-o/S220/pic.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2011/01/matlab-image-processing-3-converting.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A08BQng5fCp7ImA9Wx9WFU4.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-6964525598605615543</id><published>2011-01-20T08:10:00.000-08:00</published><updated>2011-01-20T08:10:53.624-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-20T08:10:53.624-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="grayscale" /><category scheme="http://www.blogger.com/atom/ns#" term="rgb to bw" /><title>Matlab basics-2 : Format conversions in Matlab</title><content type="html">Suppose we have an image&lt;br /&gt;
&lt;br /&gt;
aa=imread("image.jpg");&lt;br /&gt;
&lt;br /&gt;
Conversion to grayscale:&lt;br /&gt;
&lt;br /&gt;
we can convert it to gray scale using the following operation&lt;br /&gt;
&lt;br /&gt;
grayaa=rgb2gray(aa);&lt;br /&gt;
&lt;br /&gt;
the matrix grayaa is the gray scale version of the image aa.&lt;br /&gt;
&lt;br /&gt;
rgb2gray converts RGB values to grayscale values by forming a weighted sum of the R, G, and B components:&lt;br /&gt;
&lt;br /&gt;
0.2989 * R + 0.5870 * G + 0.1140 * B &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Converting the image into black and white:&lt;br /&gt;
&lt;br /&gt;
It can be done in various ways depending on the threshold values.&lt;br /&gt;
&lt;br /&gt;
bw1=im2bw(aa);      %% Converts the image into bw using a default value&lt;br /&gt;
&lt;br /&gt;
bw2=im2bw(aa,i);    %%here i lies between 0 and 1. 'i' having a value of 0.3 means a threshold value of nearly 77 ( 0.3*256).&lt;br /&gt;
&lt;br /&gt;
An important observation here is that the input image aa can be a grayscale image, an intensity image or even a RGB image.&lt;br /&gt;
&lt;br /&gt;
If we give a RGB image as an input, MATLAB converts the RGB to grayscale first and then into black and white by itself.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/S2SGnJV_pXY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/6964525598605615543/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2011/01/matlab-basics-2-format-conversions-in.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/6964525598605615543?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/6964525598605615543?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/S2SGnJV_pXY/matlab-basics-2-format-conversions-in.html" title="Matlab basics-2 : Format conversions in Matlab" /><author><name>risingsun</name><uri>http://www.blogger.com/profile/00560773894139187343</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://1.bp.blogspot.com/_--1-wDaeGiY/TPlNc3imnzI/AAAAAAAACiQ/xscILLXa8-o/S220/pic.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2011/01/matlab-basics-2-format-conversions-in.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0AFSHo8fip7ImA9Wx9WFU4.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-3776343343953055897</id><published>2011-01-20T08:04:00.001-08:00</published><updated>2011-01-20T08:08:39.476-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-20T08:08:39.476-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="computer vision" /><category scheme="http://www.blogger.com/atom/ns#" term="matlab" /><title>Matlab Basics 1 : How to read and display image</title><content type="html">&lt;b&gt;Reading an image&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The simplest way to read an image is to store the image in the current directory (workspace) of Matlab and then use the function imread as follows:&lt;br /&gt;
&lt;br /&gt;
im = imread('aa.bmp'); %% where aa.bmp is the name of the image&lt;br /&gt;
&lt;br /&gt;
%% the image data has been stored in the variable 'im'&lt;br /&gt;
&lt;br /&gt;
Most of the commonly used formats like jpg, bmp, png are accepted by the imread function.&lt;br /&gt;
&lt;br /&gt;
Alternatively if the image is in a different directory one can use the imread function by specifying the total path of the image&lt;br /&gt;
&lt;br /&gt;
for example:&lt;br /&gt;
&lt;br /&gt;
im= imread('C:/Users/Admin/Desktop/aa.jpg');   %% reads from the folder admin&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Displaying an image&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The command to display images is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
imshow(im);  %% will show the image&lt;br /&gt;
&lt;br /&gt;
The problem here would be that the image would replace the current open image (if any).&lt;br /&gt;
&lt;br /&gt;
For this it is better to use :&lt;br /&gt;
&lt;br /&gt;
figure, imshow(im);   %% will open the image in a new window&lt;br /&gt;
&lt;br /&gt;
Once can even name the window using int values to use them for various purposes of display and processing post the display. For example :&lt;br /&gt;
&lt;br /&gt;
figure(5), imshow(im); &lt;br /&gt;
&lt;br /&gt;
To operate several graphic commands (or plot commands) one can use the option 'hold'.&lt;br /&gt;
&lt;br /&gt;
Default value of hold is set to the stage off. Enabling it to 'on' state enables it to hold the current plot and all axis properties so that subsequent graphing commands add to the existing graph.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An interesting graphing command :&lt;br /&gt;
&lt;br /&gt;
Suppose you want to find the co ordinates of a particular point in an image using matlab.&lt;br /&gt;
&lt;br /&gt;
you can use the command:&lt;br /&gt;
&lt;br /&gt;
[x, y]=ginput(i); plot(x, y, '+r');     %% where i is to replaced with the figure number in this case, for the above example we used 5&lt;br /&gt;
&lt;br /&gt;
and then click on the point on the respective image.&lt;br /&gt;
&lt;br /&gt;
the co ordinates will be stored in the matrix [x y].&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/HlNUQ3D6OGY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/3776343343953055897/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2011/01/matlab-basics-1-how-to-read-and-display.html#comment-form" title="6 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/3776343343953055897?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/3776343343953055897?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/HlNUQ3D6OGY/matlab-basics-1-how-to-read-and-display.html" title="Matlab Basics 1 : How to read and display image" /><author><name>risingsun</name><uri>http://www.blogger.com/profile/00560773894139187343</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://1.bp.blogspot.com/_--1-wDaeGiY/TPlNc3imnzI/AAAAAAAACiQ/xscILLXa8-o/S220/pic.jpg" /></author><thr:total>6</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2011/01/matlab-basics-1-how-to-read-and-display.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QDRnc_cCp7ImA9Wx9WFU4.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-961132210032489014</id><published>2011-01-20T08:02:00.000-08:00</published><updated>2011-01-20T08:02:57.948-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-01-20T08:02:57.948-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="IP" /><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="video processing" /><category scheme="http://www.blogger.com/atom/ns#" term="opencv" /><title>Loading images from a Camera or Video</title><content type="html">If you would like to do real time video processing you can even integrate your cameras into OpenCV.&lt;br /&gt;
&lt;br /&gt;
It is easy to load an image from a camera. Ensure that camera is properly connected and detected by your computer.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 102);font-size:100%;" &gt;CvCapture* capture = cvCaptureFromCAM(0); // capture from video device #0&lt;br /&gt;
CvCapture* capture = cvCaptureFromAVI("infile.avi");&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
Incase there is only one camera, or to select any camera from multiple connecterd cameras, 0 can be replaced with -1.&lt;br /&gt;
&lt;br /&gt;
The camera link is stored in the capture structure.&lt;br /&gt;
&lt;br /&gt;
Alternatively, frames can also be processed from a video :&lt;br /&gt;
&lt;span style="color: rgb(0, 0, 102);font-size:100%;" &gt;&lt;br /&gt;
CvCapture* capture = cvCaptureFromAVI("filename.avi");&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Retreiving the image frame from the link:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(51, 0, 153);"&gt;IplImage* img = 0;      // Declare a new image pointer&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(51, 0, 153);"&gt;if(!cvGrabFrame(capture)){              // capture a frame &lt;/span&gt;&lt;br /&gt;
&lt;span style="color: rgb(51, 0, 153);"&gt;  printf("Could not grab a frame\n\7");&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: rgb(51, 0, 153);"&gt;  exit(0);&lt;/span&gt;&lt;br /&gt;
&lt;span style="color: rgb(51, 0, 153);"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(51, 0, 153);"&gt;img=cvRetrieveFrame(capture);        // retrieve the captured frame&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Important Caution :&lt;br /&gt;
&lt;br /&gt;
One must release the image source after using it -&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(51, 0, 153);"&gt;cvReleaseCapture(&amp;amp;capture);          // releases the capture link&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/ZGWIpZwe2bw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/961132210032489014/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2011/01/loading-images-from-camera-or-video.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/961132210032489014?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/961132210032489014?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/ZGWIpZwe2bw/loading-images-from-camera-or-video.html" title="Loading images from a Camera or Video" /><author><name>risingsun</name><uri>http://www.blogger.com/profile/00560773894139187343</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://1.bp.blogspot.com/_--1-wDaeGiY/TPlNc3imnzI/AAAAAAAACiQ/xscILLXa8-o/S220/pic.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2011/01/loading-images-from-camera-or-video.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEACR3s5fyp7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-8896863347903866736</id><published>2009-10-23T01:35:00.000-07:00</published><updated>2010-03-23T02:32:46.527-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:32:46.527-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pedestrian detection" /><category scheme="http://www.blogger.com/atom/ns#" term="svm" /><category scheme="http://www.blogger.com/atom/ns#" term="object detection" /><category scheme="http://www.blogger.com/atom/ns#" term="hog features" /><category scheme="http://www.blogger.com/atom/ns#" term="opencv" /><title>Object Detection using opencv III - Training an svm for the extracted hog features</title><content type="html">This is a follow up post to an earlier post on calculation of hog feature vectors for object detection using opencv. Here I describe how a support vector machine (svm) can be trained for a dataset containing positive and negative examples of the object to detected. The code has been commented for easier understanding of how it works :&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="source-code"&gt;&lt;code&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0596516134&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;

/*This function takes in a the path and names of
64x128 pixel images, the size of the cell to be
used for calculation of hog features(which should
be 8x8 pixels, some modifications will have to be 
done in the code for a different cell size, which
could be easily done once the reader understands
how the code works), a default block size of 2x2
cells has been considered and the window size
parameter should be 64x128 pixels (appropriate
modifications can be easily done for other say
64x80 pixel window size). All the training images
are expected to be stored at the same location and
the names of all the images are expected to be in
sequential order like a1.jpg, a2.jpg, a3.jpg ..
and so on or a(1).jpg, a(2).jpg, a(3).jpg ... The
explanation of all the parameters below will make
clear the usage of the function. The synopsis of
the function is as follows :

prefix : it should be the path of the images, along
with the prefix in the image name for
example if the present working directory is
/home/saurabh/hog/ and the images are in
/home/saurabh/hog/images/positive/ and are
named like pos1.jpg, pos2.jpg, pos3.jpg ....,
then the prefix parameter would be
"images/positive/pos" or if the images are
named like pos(1).jpg, pos(2).jpg,
pos(3).jpg ... instead, the prefix parameter
would be "images/positive/pos("

suffix : it is the part of the name of the image
files after the number for example for the
above examples it would be ".jpg" or ").jpg"

cell   : it should be CvSize(8,8), appropriate changes
need to be made for other cell sizes

window : it should be CvSize(64,128), appropriate
changes need to be made for other window sizes

number_samples : it should be equal to the number of
training images, for example if the
training images are pos1.jpg, pos2.jpg
..... pos1216.jpg, then it should be
1216

start_index : it should be the start index of the images'
names for example for the above case it
should be 1 or if the images were named
like pos1000.jpg, pos1001.jpg, pos1002.jpg
.... pos2216.jpg, then it should be 1000

end_index : it should be the end index of the images'
name for example for the above cases it
should be 1216 or 2216

savexml   : if you want to store the extracted features,
then you can pass to it the name of an xml
file to which they should be saved

normalization : the normalization scheme to be used for
computing the hog features, any of the
opencv schemes could be passed or -1
could be passed if no normalization is
to be done */

CvMat* train_64x128(char *prefix, char *suffix, CvSize cell,
CvSize window, int number_samples, int start_index,
int end_index, char *savexml = NULL, int canny = 0,
int block = 1, int normalization = 4) 
{

char filename[50] = "\0", number[8];
int prefix_length;
prefix_length = strlen(prefix);
int bins = 9;

/* A default block size of 2x2 cells is considered */

int block_width = 2, block_height = 2;

/* Calculation of the length of a feature vector for
an image (64x128 pixels)*/

int feature_vector_length;
feature_vector_length = (((window.width -
cell.width * block_width)/ cell.width) + 1) *
(((window.height - cell.height * block_height)
/ cell.height) + 1) * 36;

/* Matrix to store the feature vectors for
all(number_samples) the training samples */

CvMat* training = cvCreateMat(number_samples,
feature_vector_length, CV_32FC1);

CvMat row;
CvMat* img_feature_vector;
IplImage** integrals;
int i = 0, j = 0;

printf("Beginning to extract HoG features from
positive images\n");

strcat(filename, prefix);

/* Loop to calculate hog features for each
image one by one */

for (i = start_index; i &amp;lt;= end_index; i++) 
{
cvtInt(number, i);
strcat(filename, number);
strcat(filename, suffix);
IplImage* img = cvLoadImage(filename);

/* Calculation of the integral histogram for
fast calculation of hog features*/

integrals = calculateIntegralHOG(img);
cvGetRow(training, &amp;amp;row, j);
img_feature_vector
= calculateHOG_window(integrals, cvRect(0, 0,
window.width, window.height), normalization);
cvCopy(img_feature_vector, &amp;amp;row);
j++;
printf("%s\n", filename);
filename[prefix_length] = '\0';
for (int k = 0; k &amp;lt; 9; k++) 
{
cvReleaseImage(&amp;amp;integrals[k]);
}
}
if (savexml != NULL) 
{
cvSave(savexml, training);
}

return training;
}

/* This function is almost the same as
train_64x128(...), except the fact that it can
take as input images of bigger sizes and
generate multiple samples out of a single
image.

It takes 2 more parameters than
train_64x128(...), horizontal_scans and
vertical_scans to determine how many samples
are to be generated from the image. It
generates horizontal_scans x vertical_scans
number of samples. The meaning of rest of the
parameters is same.

For example for a window size of
64x128 pixels, if a 320x240 pixel image is
given input with horizontal_scans = 5 and
vertical scans = 2, then it will generate to
samples by considering windows in the image
with (x,y,width,height) as (0,0,64,128),
(64,0,64,128), (128,0,64,128), .....,
(0,112,64,128), (64,112,64,128) .....
(256,112,64,128)

The function takes non-overlapping windows
from the image except the last row and last
column, which could overlap with the second
last row or second last column. So the values
of horizontal_scans and vertical_scans passed
should be such that it is possible to perform
that many scans in a non-overlapping fashion
on the given image. For example horizontal_scans
= 5 and vertical_scans = 3 cannot be passed for
a 320x240 pixel image as that many vertical scans
are not possible for an image of height 240
pixels and window of height 128 pixels. */

CvMat* train_large(char *prefix, char *suffix,
CvSize cell, CvSize window, int number_images,
int horizontal_scans, int vertical_scans,
int start_index, int end_index,
char *savexml = NULL, int normalization = 4)
{
char filename[50] = "\0", number[8];
int prefix_length;
prefix_length = strlen(prefix);
int bins = 9;

/* A default block size of 2x2 cells is considered */

int block_width = 2, block_height = 2;

/* Calculation of the length of a feature vector for
an image (64x128 pixels)*/

int feature_vector_length;
feature_vector_length = (((window.width -
cell.width * block_width) / cell.width) + 1) *
(((window.height - cell.height * block_height)
/ cell.height) + 1) * 36;

/* Matrix to store the feature vectors for
all(number_samples) the training samples */

CvMat* training = cvCreateMat(number_images
* horizontal_scans * vertical_scans,
feature_vector_length, CV_32FC1);

CvMat row;
CvMat* img_feature_vector;
IplImage** integrals;
int i = 0, j = 0;
strcat(filename, prefix);

printf("Beginning to extract HoG features
from negative images\n");

/* Loop to calculate hog features for each
image one by one */

for (i = start_index; i &amp;lt;= end_index; i++) 
{
cvtInt(number, i);
strcat(filename, number);
strcat(filename, suffix);
IplImage* img = cvLoadImage(filename);
integrals = calculateIntegralHOG(img);
for (int l = 0; l &amp;lt; vertical_scans - 1; l++)
{
for (int k = 0; k &amp;lt; horizontal_scans - 1; k++)
{
cvGetRow(training, &amp;amp;row, j);
img_feature_vector = calculateHOG_window(
integrals, cvRect(window.width * k,
window.height * l, window.width,
window.height), normalization);

cvCopy(img_feature_vector, &amp;amp;row);
j++;
}

cvGetRow(training, &amp;amp;row, j);

img_feature_vector = calculateHOG_window(
integrals, cvRect(img-&amp;gt;width - window.width,
window.height * l, window.width,
window.height), normalization);

cvCopy(img_feature_vector, &amp;amp;row);
j++;
}

for (int k = 0; k &amp;lt; horizontal_scans - 1; k++)
{
cvGetRow(training, &amp;amp;row, j);

img_feature_vector = calculateHOG_window(
integrals, cvRect(window.width * k,
img-&amp;gt;height - window.height, window.width,
window.height), normalization);

cvCopy(img_feature_vector, &amp;amp;row);
j++;
}
cvGetRow(training, &amp;amp;row, j);

img_feature_vector = calculateHOG_window(integrals,
cvRect(img-&amp;gt;width - window.width, img-&amp;gt;height -
window.height, window.width, window.height),
normalization);

cvCopy(img_feature_vector, &amp;amp;row);
j++;

printf("%s\n", filename);
filename[prefix_length] = '\0';
for (int k = 0; k &amp;lt; 9; k++)
{
cvReleaseImage(&amp;amp;integrals[k]);
}

cvReleaseImage(&amp;amp;img);

}

printf("%d negative samples created \n",
training-&amp;gt;rows);

if (savexml != NULL)
{
cvSave(savexml, training);
printf("Negative samples saved as %s\n",
savexml);
}

return training;

}


/* This function trains a linear support vector
machine for object classification. The synopsis is
as follows :

pos_mat : pointer to CvMat containing hog feature
vectors for positive samples. This may be
NULL if the feature vectors are to be read
from an xml file

neg_mat : pointer to CvMat containing hog feature
vectors for negative samples. This may be
NULL if the feature vectors are to be read
from an xml file

savexml : The name of the xml file to which the learnt
svm model should be saved

pos_file: The name of the xml file from which feature
vectors for positive samples are to be read.
It may be NULL if feature vectors are passed
as pos_mat

neg_file: The name of the xml file from which feature
vectors for negative samples are to be read.
It may be NULL if feature vectors are passed
as neg_mat*/


void trainSVM(CvMat* pos_mat, CvMat* neg_mat, char *savexml,
char *pos_file = NULL, char *neg_file = NULL) 
{


/* Read the feature vectors for positive samples */
if (pos_file != NULL) 
{
printf("positive loading...\n");
pos_mat = (CvMat*) cvLoad(pos_file);
printf("positive loaded\n");
}

/* Read the feature vectors for negative samples */
if (neg_file != NULL)
{
neg_mat = (CvMat*) cvLoad(neg_file);
printf("negative loaded\n");
}

int n_positive, n_negative;
n_positive = pos_mat-&amp;gt;rows;
n_negative = neg_mat-&amp;gt;rows;
int feature_vector_length = pos_mat-&amp;gt;cols;
int total_samples;
total_samples = n_positive + n_negative;

CvMat* trainData = cvCreateMat(total_samples,
feature_vector_length, CV_32FC1);

CvMat* trainClasses = cvCreateMat(total_samples,
1, CV_32FC1 );

CvMat trainData1, trainData2, trainClasses1,
trainClasses2;

printf("Number of positive Samples : %d\n",
pos_mat-&amp;gt;rows);

/*Copy the positive feature vectors to training
data*/

cvGetRows(trainData, &amp;amp;trainData1, 0, n_positive);
cvCopy(pos_mat, &amp;amp;trainData1);
cvReleaseMat(&amp;amp;pos_mat);

/*Copy the negative feature vectors to training
data*/

cvGetRows(trainData, &amp;amp;trainData2, n_positive,
total_samples);

cvCopy(neg_mat, &amp;amp;trainData2);
cvReleaseMat(&amp;amp;neg_mat);

printf("Number of negative Samples : %d\n",
trainData2.rows);

/*Form the training classes for positive and
negative samples. Positive samples belong to class
1 and negative samples belong to class 2 */

cvGetRows(trainClasses, &amp;amp;trainClasses1, 0, n_positive);
cvSet(&amp;amp;trainClasses1, cvScalar(1));

cvGetRows(trainClasses, &amp;amp;trainClasses2, n_positive,
total_samples);

cvSet(&amp;amp;trainClasses2, cvScalar(2));


/* Train a linear support vector machine to learn from
the training data. The parameters may played and
experimented with to see their effects*/

CvSVM svm(trainData, trainClasses, 0, 0,
CvSVMParams(CvSVM::C_SVC, CvSVM::LINEAR, 0, 0, 0, 2,
0, 0, 0, cvTermCriteria(CV_TERMCRIT_EPS,0, 0.01)));

printf("SVM Training Complete!!\n");

/*Save the learnt model*/

if (savexml != NULL) {
svm.save(savexml);
}
cvReleaseMat(&amp;amp;trainClasses);
cvReleaseMat(&amp;amp;trainData);

}

&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I hope the comments were helpful to understand and use the code. To see how a large collection of files can be renamed to a sequential order which is required by this implementation refer &lt;a href="http://smsoftdev-solutions.blogspot.com/2009/06/how-to-rename-large-number-of-files-at.html"&gt;here&lt;/a&gt;. Another way to read in the images of dataset could be to store the paths of all files in a text file and parse then parse the text file. I will follow up this post soon, describing how the learnt model can be used for actual detection of an object in an image.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/hOSWNxRr6Vc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/8896863347903866736/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/10/object-detection-using-opencv-iii.html#comment-form" title="51 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/8896863347903866736?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/8896863347903866736?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/hOSWNxRr6Vc/object-detection-using-opencv-iii.html" title="Object Detection using opencv III - Training an svm for the extracted hog features" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>51</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/10/object-detection-using-opencv-iii.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcASX8zfyp7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-5185245675443023339</id><published>2009-10-22T12:51:00.000-07:00</published><updated>2010-03-23T02:37:28.187-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:37:28.187-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="pedestrian detection" /><category scheme="http://www.blogger.com/atom/ns#" term="object detection" /><category scheme="http://www.blogger.com/atom/ns#" term="hog features" /><category scheme="http://www.blogger.com/atom/ns#" term="opencv" /><title>Object Detection using opencv II - Calculation of Hog Features</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0596516134&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;This is follow up post to an earlier post where I have described how an integral histogram can be obtained from an image for fast calculation of hog features. Here I am posting the code for how this integral histogram can be used to calculate the hog feature vectors for an image window. I have commented the code for easier understanding of how it works :&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id="ui-datepicker-div" style="display: none;"&gt;&lt;/div&gt;&lt;pre class="source-code"&gt;&lt;code&gt;
/* This function takes in a block as a rectangle and
calculates the hog features for the block by dividing
it into cells of size cell(the supplied parameter),
calculating the hog features for each cell using the
function calculateHOG_rect(...), concatenating the so
obtained vectors for each cell and then normalizing over
the concatenated vector to obtain the hog features for a
block */ 

void calculateHOG_block(CvRect block, CvMat* hog_block, 
IplImage** integrals,CvSize cell, int normalization) 
{
int cell_start_x, cell_start_y;
CvMat vector_cell;
int startcol = 0;
for (cell_start_y = block.y; cell_start_y &amp;lt;= 
block.y + block.height - cell.height; 
cell_start_y += cell.height) 
{
for (cell_start_x = block.x; cell_start_x &amp;lt;= 
block.x + block.width - cell.width; 
cell_start_x += cell.width) 
{
cvGetCols(hog_block, &amp;amp;vector_cell, startcol, 
startcol + 9);

calculateHOG_rect(cvRect(cell_start_x,
cell_start_y, cell.width, cell.height), 
&amp;amp;vector_cell, integrals, -1);

startcol += 9;
}
}
if (normalization != -1)
cvNormalize(hog_block, hog_block, 1, 0, 
normalization);
}

/* This function takes in a window(64x128 pixels,
but can be easily modified for other window sizes)
and calculates the hog features for the window. It
can be used to calculate the feature vector for a 
64x128 pixel image as well. This window/image is the
training/detection window which is used for training
or on which the final detection is done. The hog
features are computed by dividing the window into
overlapping blocks, calculating the hog vectors for
each block using calculateHOG_block(...) and
concatenating the so obtained vectors to obtain the
hog feature vector for the window*/

CvMat* calculateHOG_window(IplImage** integrals,
CvRect window, int normalization) 
{

/*A cell size of 8x8 pixels is considered and each
block is divided into 2x2 such cells (i.e. the block
is 16x16 pixels). So a 64x128 pixels window would be
divided into 7x15 overlapping blocks*/ 

int block_start_x, block_start_y, cell_width = 8;
int cell_height = 8;
int block_width = 2, block_height = 2;

/* The length of the feature vector for a cell is
9(since no. of bins is 9), for block it would  be
9*(no. of cells in the block) = 9*4 = 36. And the
length of the feature vector for a window would be
36*(no. of blocks in the window */

CvMat* window_feature_vector = cvCreateMat(1,
((((window.width - cell_width * block_width)
/ cell_width) + 1) * (((window.height -
cell_height * block_height) / cell_height)
+ 1)) * 36, CV_32FC1);

CvMat vector_block;
int startcol = 0;
for (block_start_y = window.y; block_start_y
&amp;lt;= window.y + window.height - cell_height
* block_height; block_start_y += cell_height)
{
for (block_start_x = window.x; block_start_x
&amp;lt;= window.x + window.width - cell_width
* block_width; block_start_x += cell_width)
{
cvGetCols(window_feature_vector, &amp;amp;vector_block,
startcol, startcol + 36);

calculateHOG_block(cvRect(block_start_x,
block_start_y, cell_width * block_width, cell_height
* block_height), &amp;amp;vector_block, integrals, cvSize(
cell_width, cell_height), normalization);

startcol += 36;
}
}
return (window_feature_vector);
}

&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0130307963&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;br /&gt;
I will very soon post how a support vector machine (svm) can trained using the above functions for an object using a dataset and how the learned model can be used to detect the corresponding object in an image.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/eljIXH_1sJo" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/5185245675443023339/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/10/object-detection-using-opencv-ii.html#comment-form" title="20 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/5185245675443023339?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/5185245675443023339?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/eljIXH_1sJo/object-detection-using-opencv-ii.html" title="Object Detection using opencv II - Calculation of Hog Features" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>20</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/10/object-detection-using-opencv-ii.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcNSXc7eCp7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-7765019465810111577</id><published>2009-10-16T08:48:00.001-07:00</published><updated>2010-03-23T02:38:18.900-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:38:18.900-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="radix 2" /><category scheme="http://www.blogger.com/atom/ns#" term="c code fft" /><category scheme="http://www.blogger.com/atom/ns#" term="fft code" /><category scheme="http://www.blogger.com/atom/ns#" term="fft implementation" /><title>Radix 2 floating point FFT Implementation</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0521004284&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;I searched for fft code over the internet but couldn't find a simple code for the FFT. So I am posting the code. I think I have explained everything in the code code is what follows:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="source-code"&gt;&lt;code&gt;/*
The program follows is for the FFT of a one dimensional input
fft algorithm used is radix 2
so works only for input lengths powers of 2
input is complex and output obviously is complex
changes can be made to use the function for your requirement.
I have tried to comment the code anyway there shouldnt be any
problem its such a small program.
*/
//Header Files
#include &amp;lt;stdio.h&amp;gt;
#include&amp;lt;stdlib.h&amp;gt;
#include&amp;lt;math.h&amp;gt;

//Complex number structure
typedef struct complex
{
float real;            //Real part of the number
float imaginary;    //Imaginary part of the number
} complex;

//Function to calculate the FFT Method used is Radix 2
complex* fft(complex *in,int N){
//Local variables
complex *X,*Xg,*Xh;
complex *xe,*xo;
int i=0;
//Memory allocation
xe = (complex*)malloc(sizeof(complex)*(N/2));
xo = (complex*)malloc(sizeof(complex)*(N/2));
X = (complex *)malloc(sizeof(complex)*N);
//every recursion has to stop
//so here is the stopping condition of the recursion
if(N==2){
X[0].real        = in[0].real + in[1].real;
X[0].imaginary    = in[0].imaginary + in[1].imaginary;
X[1].real        = in[0].real - in[1].real;
X[1].imaginary    = in[0].imaginary - in[1].imaginary;
return X;
}
//Breaking the input for recursion
for (i=0;i&amp;lt;N;i++){
if(i%2==0){//even indexes
xe[i/2].real        = in[i].real;
xe[i/2].imaginary    = in[i].imaginary;
}
else{//odd indexes
xo[(i-1)/2].real        = in[i].real;
xo[(i-1)/2].imaginary    = in[i].imaginary;
}
}
//recursive calls
Xg = fft(xe,N/2);
Xh = fft(xo,N/2);
//Combining the two halfs here is where magic happens
for (i=0;i&amp;lt;N;i++){
X[i].real=Xg[i%(N/2)].real + Xh[i%(N/2)].real*cos(2*3.14*i/N)+Xh[i%(N/2)].imaginary*sin(2*3.14*i/N);
X[i].imaginary=Xg[i%(N/2)].imaginary+Xh[i%(N/2)].imaginary*cos(2*3.14*i/N)-Xh[i%(N/2)].real*sin(2*3.14*i/N);
}
//deallocating the waste memory
free(Xg);
free(Xh);
return X;//returning the result
}
//the main function
int main(int argc,char *argv[])
{
int N,i;
complex *x;//input
complex *X;//variable to store FFT of the input
//Note : N has to be a power of 2 otherwise the function doesnt work
//asking for the no of points in the FFT
printf("\nenter N must be a power of 2:");
scanf("%d",&amp;amp;N);
//allocating memory for the input
x = (complex*)malloc(N*sizeof(complex));
//taking the input
for(i=0;i&amp;lt;N;i++){
printf("\nenter %dth element real then imaginary",i);
scanf("%f",&amp;amp;(x[i].real));  
scanf("%f",&amp;amp;(x[i].imaginary));
}
//calling the fft function
X = fft(x,N);
//displaying the result
printf("\nFFT of the input is as follows");
for(i=0;i&amp;lt;N;i++){
printf("\nXr[%d] = %.2f + j %.2f",i,X[i].real,X[i].imaginary);
}
return 0;
}
//end of the program
&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;
&lt;div id="ui-datepicker-div" style="display: none;"&gt;&lt;/div&gt;&lt;div id="ui-datepicker-div" style="display: none;"&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/0Ann-QRZr7c" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/7765019465810111577/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/10/radix-2-floating-point-fft.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/7765019465810111577?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/7765019465810111577?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/0Ann-QRZr7c/radix-2-floating-point-fft.html" title="Radix 2 floating point FFT Implementation" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/10/radix-2-floating-point-fft.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYDRHo6eip7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-4586856504055963667</id><published>2009-10-12T10:23:00.000-07:00</published><updated>2010-03-23T02:39:35.412-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:39:35.412-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="shared folders" /><category scheme="http://www.blogger.com/atom/ns#" term="linux on windows" /><category scheme="http://www.blogger.com/atom/ns#" term="windows on linux" /><category scheme="http://www.blogger.com/atom/ns#" term="virtual box" /><title>Virtual Box - Shared Folders</title><content type="html">&lt;div class="postBody" style="color: #777777;"&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B0018KAN9E&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;The VirtualBox Guest Additions are software packages which can be installed inside of supported guest systems to improve their performance and to provide additional integration and communication with the host system.&lt;br /&gt;
&lt;br /&gt;
After installing the Guest Additions, a virtual machine will support automatic adjustment of video resolutions, seamless windows and more.&lt;br /&gt;
&lt;br /&gt;
In particular, Guest Additions provide for “shared folders”, which let you access files from the host system from within a guest machine.&lt;br /&gt;
&lt;br /&gt;
This is how shared folders can be setup on a windows (xp) or linux (ubuntu) guest operating system :&lt;br /&gt;
&lt;br /&gt;
1. Open up the virtual box interface by clicking on the virtual box shortcut or from the start menu.&lt;br /&gt;
2. In the left pane which contains the list of installed guest operating systems, select the system with which you want to share folders from the host operating system.&lt;br /&gt;
3. In the right pane, click on shared folders and select the folder you want to share. After this the number of shared folders which appears just beneath the shared folders option will increment by 1.&lt;br /&gt;
4. Now boot the virtual system.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;span style="font-weight: bold;"&gt;For windows:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
5. Open My computer and right click on network places in the right pane and select map network drive.&lt;br /&gt;
6. Choose a drive letter and to select the folder click on the browse... button. In the browse dialog box, expand the VirtualBox Shared Folders option and you'll find the folder you had shared there. Select it and click Ok.&lt;br /&gt;
7.In the Map Network Drive dialog box, check the Reconnect at logon checkbox if not already so and click on finish.&lt;br /&gt;
8. Now your shared folder will appear in the Network drives everytime you boot your virtual system. You can access the virtual drives just like normal drives from My Computer.&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;For linux:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
5. To make folders mount everytime an ubuntu guest system is booted , you will have to edit the file with the filesystem static information, /etc/fstab.&lt;br /&gt;
6. To edit it open up a terminal and give the following commands :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;cp /etc/fstab ~/fstab.backup&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;sudo nano /etc/fstab&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
6.Append at the end of the file&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;{name of shared folder} {path of the mount point}&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;(which will be something like /home/{user}/Desktop/downloads) vboxsf rw 0 2&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
7.To save press CTRL+O, then press CTRL+X to exit.&lt;br /&gt;
8.Restart the guest system and the shared folders will be mounted at the respective mount points.&lt;/div&gt;&lt;input name="security_token" type="hidden" value="AOuZoY7QThMi__XT3JwhGJ23-xF0vzPJKg:1255368180548" /&gt;&lt;input name="postID" type="hidden" value="2999709931333572200" /&gt; &lt;input name="blogID" type="hidden" value="845572947712955694" /&gt;  &lt;br /&gt;
&lt;div class="errorbox-good"&gt;&lt;input name="securityToken" type="hidden" value="bFymeMpS_0KD6BpgCc77GVUfGuE:1255368180566" /&gt; &lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/zKbrmUaaKSs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/4586856504055963667/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/10/virtual-box-shared-folders.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/4586856504055963667?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/4586856504055963667?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/zKbrmUaaKSs/virtual-box-shared-folders.html" title="Virtual Box - Shared Folders" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>1</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/10/virtual-box-shared-folders.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEcNQng-fSp7ImA9WxNSEU8.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-692223605122283649</id><published>2009-08-24T07:18:00.000-07:00</published><updated>2009-08-24T08:01:33.655-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-08-24T08:01:33.655-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="make image of drive" /><category scheme="http://www.blogger.com/atom/ns#" term="best way to backup your system" /><category scheme="http://www.blogger.com/atom/ns#" term="use of imagex tool" /><category scheme="http://www.blogger.com/atom/ns#" term="recover you operating system" /><category scheme="http://www.blogger.com/atom/ns#" term="create image wim" /><title>Make Image of a drive</title><content type="html">You can make image of you drive by using a windows tool &lt;a href="http://www.tipandtrick.net/2008/imagex-600118000-x86-and-x64-for-windows-server-2008-and-vista-sp1-standalone-download/"&gt;ImageX&lt;/a&gt; all you have to do is open command prompt from vista CD , &lt;a href= "http://smsoftdev-solutions.blogspot.com/2009/03/how-to-restore-dell-factory-image-when.html"&gt;click here&lt;/a&gt; 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)&lt;br /&gt;wait before I tell you the command make points of the following&lt;br /&gt;1) 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.&lt;br /&gt;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.&lt;br /&gt;and the command is&lt;br /&gt;&lt;br /&gt;imagex /capture  c: d\image\vista.wim "d drive"&lt;br /&gt;&lt;br /&gt;you can type in imagex /capture /? for help on this command.&lt;br /&gt;&lt;br /&gt;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&lt;br /&gt;&lt;br /&gt;imagex /apply d\image\vista.wim 1 c:&lt;br /&gt;&lt;br /&gt;and you will have all your software and drivers installed already,  no more headache of installing all software and drivers.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/IErMocVnrJE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/692223605122283649/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/08/make-image-of-drive.html#comment-form" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/692223605122283649?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/692223605122283649?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/IErMocVnrJE/make-image-of-drive.html" title="Make Image of a drive" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/08/make-image-of-drive.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUNQ3w8cSp7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-62522524609239053</id><published>2009-08-08T03:07:00.001-07:00</published><updated>2010-03-23T02:41:32.279-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:41:32.279-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="hog" /><category scheme="http://www.blogger.com/atom/ns#" term="pedestrian detection" /><category scheme="http://www.blogger.com/atom/ns#" term="integral histogram" /><category scheme="http://www.blogger.com/atom/ns#" term="object detection" /><category scheme="http://www.blogger.com/atom/ns#" term="hog features" /><category scheme="http://www.blogger.com/atom/ns#" term="opencv" /><category scheme="http://www.blogger.com/atom/ns#" term="histogram of oriented gradients" /><title>Object Detection Using opencv I - Integral Histogram for fast Calculation of HOG Features</title><content type="html">&lt;span style="font-size: 130%;"&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0596516134&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;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).&lt;br /&gt;
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,&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://3.bp.blogspot.com/_xe595VzIzd4/Sn1SpW7ScNI/AAAAAAAAB2U/5pEJUmZruho/s1600-h/integral_hist.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"&gt;&lt;img alt="" border="0" id="BLOGGER_PHOTO_ID_5367537201377865938" src="http://3.bp.blogspot.com/_xe595VzIzd4/Sn1SpW7ScNI/AAAAAAAAB2U/5pEJUmZruho/s320/integral_hist.jpg" style="cursor: pointer; display: block; height: 60px; margin: 0px auto 10px; text-align: center; width: 320px;" /&gt;&lt;/a&gt;&lt;br /&gt;
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,&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://merl.com/papers/docs/TR2005-057.pdf"&gt;Integral Histogram&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The following demonstrates how such integral histogram can be calculated from an image and used for the calculation of hog features using the opencv computer vision library :&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt;/*Function to calculate the integral histogram*/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;IplImage** calculateIntegralHOG(IplImage* in)&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;{&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    &lt;span style="font-weight: bold;"&gt;/*Convert the input image to grayscale*/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    IplImage* img_gray = cvCreateImage(cvGetSize(in), IPL_DEPTH_8U,1);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;cvCvtColor(in, img_gray, CV_BGR2GRAY);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;cvEqualizeHist(img_gray,img_gray);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    &lt;span style="font-weight: bold;"&gt;/* Calculate the derivates of the grayscale image in the x and y directions using a sobel operator and obtain 2 gradient images for the x and y directions*/&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    IplImage *xsobel, *ysobel;&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;xsobel = doSobel(img_gray, 1, 0, 3);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;ysobel = doSobel(img_gray, 0, 1, 3);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;cvReleaseImage(&amp;amp;img_gray);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    &lt;span style="font-weight: bold;"&gt;/* 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 */&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    IplImage** bins = (IplImage**) malloc(9 * sizeof(IplImage*));&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;for (int i = 0; i &amp;lt; 9 ; i++) {&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;bins[i] = cvCreateImage(cvGetSize(in), IPL_DEPTH_32F,1);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;cvSetZero(bins[i]);&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;}&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    &lt;span style="font-weight: bold;"&gt;/* 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 */&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    IplImage** integrals = (IplImage**) malloc(9 * sizeof(IplImage*));&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br.&gt;&lt;span style="font-style: italic;"&gt;    for (int i = 0; i &amp;lt; 9 ; i++) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;integrals[i] = cvCreateImage(cvSize(in-&amp;gt;width + 1, in-&amp;gt;height + 1),&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                IPL_DEPTH_64F,1);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;/* 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 */&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/br.&gt;&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;int x, y;&lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-size: 130%; font-style: italic;"&gt;    &lt;/span&gt;&lt;span style="font-size: 130%;"&gt;&lt;br.&gt;&lt;span style="font-style: italic;"&gt;float temp_gradient, temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    for (y = 0; y &amp;lt;in-&amp;gt;height; y++) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        &lt;span style="font-weight: bold;"&gt;/* ptr1 and ptr2 point to beginning of the current row in the xsobel and ysobel images respectively. ptrs[i] point to the beginning of the current rows in the bin images */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        float* ptr1 = (float*) (xsobel-&amp;gt;imageData + y * (xsobel-&amp;gt;widthStep));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;float* ptr2 = (float*) (ysobel-&amp;gt;imageData + y * (ysobel-&amp;gt;widthStep));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;float** ptrs = (float**) malloc(9 * sizeof(float*));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;for (int i = 0; i &amp;lt; 9 ;i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;ptrs[i] = (float*) (bins[i]-&amp;gt;imageData + y * (bins[i]-&amp;gt;widthStep));&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        &lt;span style="font-weight: bold;"&gt;/*For every pixel in a row gradient orientation and magnitude are calculated and corresponding values set for the bin images. */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        for (x = 0; x &amp;lt;in-&amp;gt;width; x++) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;/* 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. */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            if (ptr1[x] == 0){&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;temp_gradient = ((atan(ptr2[x] / (ptr1[x] + 0.00001))) * (180&lt;/span&gt;&lt;span style="font-style: italic;"&gt;/ PI)) + 90;&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;else{&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic;"&gt;temp_gradient = ((atan(ptr2[x] / ptr1[x])) * (180 / PI)) + 90;&lt;/span&gt;&lt;br /&gt;
}&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            temp_magnitude = sqrt((ptr1[x] * ptr1[x]) + (ptr2[x] * ptr2[x]));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            &lt;span style="font-weight: bold;"&gt;/*The bin image is selected according to the gradient values. The corresponding pixel value is made equal to the gradient magnitude at that pixel in the corresponding bin image */&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        &lt;br /&gt;
if (temp_gradient &amp;lt;= 20) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[0][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;else if (temp_gradient &amp;lt;= 40) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[1][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;br /&gt;
else if (temp_gradient &amp;lt;= 60) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[2][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;br /&gt;
else if (temp_gradient &amp;lt;= 80) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[3][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;br /&gt;
else if (temp_gradient &amp;lt;= 100) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[4][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;br /&gt;
else if (temp_gradient &amp;lt;= 120) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[5][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;br /&gt;
else if (temp_gradient &amp;lt;= 140) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[6][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;br /&gt;
else if (temp_gradient &amp;lt;= 160) {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[7][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;br /&gt;
else {&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;                ptrs[8][x] = temp_magnitude;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;            }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        }&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    cvReleaseImage(&amp;amp;xsobel);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    cvReleaseImage(&amp;amp;ysobel);&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic;"&gt;    &lt;span style="font-weight: bold;"&gt;/*Integral images for each of the bin images are calculated*/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    for (int i = 0; i &amp;lt;9 ; i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        cvIntegral(bins[i], integrals[i]);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    for (int i = 0; i &amp;lt;9 ; i++){&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;        cvReleaseImage(&amp;amp;bins[i]);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;    }&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;    /*The function returns an array of 9 images which consitute the integral histogram*/&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic;"&gt;    return (integrals);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic; font-weight: bold;"&gt;/* 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&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;span style="font-weight: bold;"&gt; if normalization = -1 */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic;"&gt;void calculateHOG_rect(CvRect cell, CvMat* hog_cell,&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;
IplImage** integrals, int normalization) {&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic; font-weight: bold;"&gt;/* Calculate the bin values for each of the bin of the histogram one by one */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;for (int i = 0; i &amp;lt; 9 ; i++){&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt; float a =((double*)(integrals[i]-&amp;gt;imageData + (cell.y)&lt;br /&gt;
* (integrals[i]-&amp;gt;widthStep)))[cell.x];&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;float b = ((double*) (integrals[i]-&amp;gt;imageData + (cell.y + cell.height)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;               * (integrals[i]-&amp;gt;widthStep)))[cell.x + cell.width];&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;float c = ((double*) (integrals[i]-&amp;gt;imageData + (cell.y)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;               * (integrals[i]-&amp;gt;widthStep)))[cell.x + cell.width];&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;float d = ((double*) (integrals[i]-&amp;gt;imageData + (cell.y + cell.height)&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;               * (integrals[i]-&amp;gt;widthStep)))[cell.x];&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;((float*) hog_cell-&amp;gt;data.fl)[i] = (a + b) - (c + d);&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic;"&gt;}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;/*Normalize the matrix*/&lt;/span&gt;&lt;br /&gt;
if (normalization != -1){&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;      cvNormalize(hog_cell, hog_cell, 1, 0, normalization);&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-style: italic;"&gt;}&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-style: italic;"&gt;&lt;br /&gt;
}&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I will describe how the HOG features for pedestrian detection can be obtained using the above framework and how an svm can be trained for such features for pedestrian detection in a later post.&lt;/br.&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;br.&gt;&lt;br /&gt;
&lt;/br.&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-size: 130%;"&gt;&lt;br.&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0387310738&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/br.&gt;&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/plt2UYBY5_k" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/62522524609239053/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/08/integral-histogram-for-fast-calculation.html#comment-form" title="27 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/62522524609239053?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/62522524609239053?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/plt2UYBY5_k/integral-histogram-for-fast-calculation.html" title="Object Detection Using opencv I - Integral Histogram for fast Calculation of HOG Features" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_xe595VzIzd4/Sn1SpW7ScNI/AAAAAAAAB2U/5pEJUmZruho/s72-c/integral_hist.jpg" height="72" width="72" /><thr:total>27</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/08/integral-histogram-for-fast-calculation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Ak8DRnw_eip7ImA9WxJWE0U.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-2157972957784949005</id><published>2009-06-18T15:03:00.000-07:00</published><updated>2009-06-18T22:21:17.242-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-18T22:21:17.242-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="simple way to use multithreading in java" /><category scheme="http://www.blogger.com/atom/ns#" term="syntax" /><title>Multi-threading in Java</title><content type="html">Multi threading is really a nice feature a programming language can have. In multi threading you can make new threads in your program while it is running, which means program will be running in more than one thread simultaneously(parallel). It can be a very useful feature in some server client system. In java you can use multi threading in the following way.&lt;br /&gt;&lt;br /&gt;points&lt;br /&gt;1) to be able to run a class in a thread the class need to either extend Thread class or should implement Runnable.&lt;br /&gt;&lt;br /&gt;2)  The second requirement to be able to run a class into a thread is to have a method named run(), this method will contain what to run in the thread.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public ClassName extends Thread{&lt;br /&gt;      ClassName(){&lt;br /&gt;      }&lt;br /&gt;      run(){&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public ClassName implements Runnable{&lt;br /&gt;      ClassName(){&lt;br /&gt;      }&lt;br /&gt;      run(){&lt;br /&gt;      }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;3) Syntax to start the thread in some other class&lt;br /&gt;&lt;br /&gt;ClassName name = new ClassName();&lt;br /&gt;Thread t = newThread(name);&lt;br /&gt;t.start();&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/EJWnlmLItak" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/2157972957784949005/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/06/multi-threading-in-java.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/2157972957784949005?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/2157972957784949005?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/EJWnlmLItak/multi-threading-in-java.html" title="Multi-threading in Java" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/06/multi-threading-in-java.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CUEASXk_fCp7ImA9WxJWE0w.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-3839040954118752136</id><published>2009-06-18T01:19:00.000-07:00</published><updated>2009-06-18T01:27:28.744-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-06-18T01:27:28.744-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="rename" /><category scheme="http://www.blogger.com/atom/ns#" term="trick" /><category scheme="http://www.blogger.com/atom/ns#" term="rename large number of files" /><title>How to rename a large number of files at once in windows?</title><content type="html">If you have a large number of files with random names ( lets say images from different sources with random names) and want to rename them all systematically for some reason.&lt;br /&gt;On Microsoft windows there a simple trick to do this.&lt;br /&gt;&lt;br /&gt;Select all the files.&lt;br /&gt;Right click on any file and select rename ( or press F2 for rename)&lt;br /&gt;Then give a name like img(1).jpg&lt;br /&gt;And you are done. This will rename all the selected files as img(1).jpg, img(2).jpg, img(3).jpg .......&lt;br /&gt;&lt;br /&gt;Please note that this will work for all kinds of files and extensions, not just images ( I took jpgs just for an example to illustrate)&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/uGR8ManwcDc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/3839040954118752136/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/06/how-to-rename-large-number-of-files-at.html#comment-form" title="9 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/3839040954118752136?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/3839040954118752136?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/uGR8ManwcDc/how-to-rename-large-number-of-files-at.html" title="How to rename a large number of files at once in windows?" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>9</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/06/how-to-rename-large-number-of-files-at.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMGRXg9eCp7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-3612258923024259981</id><published>2009-06-06T05:43:00.000-07:00</published><updated>2010-03-23T02:43:44.660-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:43:44.660-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="amarok" /><category scheme="http://www.blogger.com/atom/ns#" term="lyrics" /><category scheme="http://www.blogger.com/atom/ns#" term="proxy" /><title>Amarok internet access behind proxy server</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B002WIDRM6&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;If you use amarok behind a proxy server and it cannot access internet (for example to fetch lyrics using a lyrics script, or to submit data to last.fm or any other task which requires it access the internet). The reason for this is that amarok does not read the system wide proxy settings from GNOME.  To solve this problem you need to edit the following file :&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
$HOME/.kde/share/config/kioslaverc&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: normal;"&gt;and add the following entries to it :&lt;/span&gt;&lt;/strong&gt;&lt;span style="font-family: monospace;"&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;[Proxy Settings][$i]&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;ProxyType=1&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;httpProxy=http://username:password@proxyserver:port/&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;httpsProxy=http://username:password@proxyserver:port/&lt;/span&gt;&lt;span style="font-family: monospace; font-weight: bold;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;span style="font-weight: bold;"&gt;ftpProxy=http://username:password@proxyserver:port/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
Save the file and Restart amarok.&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
&lt;/strong&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/juIIfhY9D9w" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/3612258923024259981/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/06/amarok-internet-access-behind-proxy.html#comment-form" title="4 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/3612258923024259981?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/3612258923024259981?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/juIIfhY9D9w/amarok-internet-access-behind-proxy.html" title="Amarok internet access behind proxy server" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>4</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/06/amarok-internet-access-behind-proxy.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUMMRnw5fip7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-734878286747106611</id><published>2009-06-03T07:13:00.000-07:00</published><updated>2010-03-23T02:44:47.226-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:44:47.226-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="eclipse" /><category scheme="http://www.blogger.com/atom/ns#" term="shared libraries" /><category scheme="http://www.blogger.com/atom/ns#" term="error" /><category scheme="http://www.blogger.com/atom/ns#" term="opencv" /><title>OpenCV shared libraries error</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0596516134&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;If you installed opencv on your linux machine and are able to compile opencv programs but cannot run them and are receiving the following error :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;error while loading shared libraries: libcxcore.so.2: cannot open shared object file: No such file or directory&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;This means that the program is not able to locate the shared libraries it needs to execute. To sort this out you to have set the &lt;span style="font-weight: bold;"&gt;LD_LIBRARY_PATH&lt;/span&gt; environment variable to the path of your opencv lib directory. This directory should be located in your opencv installation directory(if you installed opencv using the tar rather than using your linux distribution repositories). You can do this by the following command (assuming you have installed opencv in your user directory in a folder named "opencv" :&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;
export LD_LIBRARY_PATH=/home/{username}&lt;username&gt;&lt;username&gt;/opencv/lib/&lt;br /&gt;
&lt;br /&gt;
&lt;/username&gt;&lt;/username&gt;&lt;/span&gt;If you are using the eclipse IDE and getting the same error then to fix it you need to open the Run configurations dialogue box which is located in the run menu, select the environment tab and add a new variable named &lt;span style="font-weight: bold;"&gt;LD_LIBRARY_PATH&lt;/span&gt; with value as described above.&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0764579371&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/5NDdLl_t5jI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/734878286747106611/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/06/opencv-shared-libraries-error.html#comment-form" title="13 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/734878286747106611?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/734878286747106611?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/5NDdLl_t5jI/opencv-shared-libraries-error.html" title="OpenCV shared libraries error" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>13</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/06/opencv-shared-libraries-error.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C0UFSX8zeip7ImA9WxJQEk0.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-2568584611006825042</id><published>2009-05-24T11:56:00.000-07:00</published><updated>2009-05-24T14:40:18.182-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-24T14:40:18.182-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="change default path of command prompt" /><title>Change default path of command prompt in windows</title><content type="html">I wont suggest you to change the default path, But I will give you smart solution to do it. only thing you will have to do is to run a simple command and it will go to the location where you wanted to go. Do the following to accomplish this&lt;br /&gt;&lt;br /&gt;open the default path in windows explorer&lt;br /&gt;open notepad and write cd &lt;new&gt;&lt;br /&gt;save this file named somename.bat and as all files (NOT TXT).&lt;br /&gt;then whenever you open command prompt write this somename you given and you will be at your desired location.&lt;/new&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/llr0IkHRwSk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/2568584611006825042/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/05/change-default-path-of-command-prompt.html#comment-form" title="8 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/2568584611006825042?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/2568584611006825042?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/llr0IkHRwSk/change-default-path-of-command-prompt.html" title="Change default path of command prompt in windows" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>8</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/05/change-default-path-of-command-prompt.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkYDSXc6eSp7ImA9WxJSGE4.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-7902730206473393420</id><published>2009-05-08T19:47:00.000-07:00</published><updated>2009-05-08T20:02:58.911-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-08T20:02:58.911-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="installation problem" /><category scheme="http://www.blogger.com/atom/ns#" term="detecting devices" /><category scheme="http://www.blogger.com/atom/ns#" term="gmail voice and video chat" /><title>Gmail voice and video chat installation problem</title><content type="html">if you have problem in installing gmail voice and video chat program it stucks in detecting devices... then you just start "run" in windows OS and type in "%USERPROFILE%\Local Settings\Application Data\Google\Google Talk Plugin" press enter you will see a window opens up. In this window just delete the file "googletalkplugin_port" and re open gmail.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/mZ1bJ1QFWLs" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/7902730206473393420/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/05/gmail-voice-and-video-chat-installation.html#comment-form" title="44 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/7902730206473393420?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/7902730206473393420?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/mZ1bJ1QFWLs/gmail-voice-and-video-chat-installation.html" title="Gmail voice and video chat installation problem" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>44</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/05/gmail-voice-and-video-chat-installation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIHRn0-fSp7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-422129276427056950</id><published>2009-03-22T23:36:00.000-07:00</published><updated>2010-03-23T02:45:37.355-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:45:37.355-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dell laptop format" /><category scheme="http://www.blogger.com/atom/ns#" term="dell factory image restore" /><category scheme="http://www.blogger.com/atom/ns#" term="factory.wim" /><title>How to restore dell factory image when PC restore does not work?</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B002PY7OKI&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;Here I will give you instructions as to how you can reformat your dell laptop hard disk and restore the factory image ( the hard disk contents with which your laptop came when you bought it). You will need your vista dvd for this.&lt;br /&gt;
&lt;br /&gt;
I will be assuming that C: is your Operating system partition and D: is your recovery partition.&lt;br /&gt;
&lt;br /&gt;
1. Boot the computer using your vista dvd.&lt;br /&gt;
2. Select Repair. Then select command line.&lt;br /&gt;
3. Goto your recovery drive and then to the tools folder by typing following on the command prompt :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;d:&lt;/span&gt;&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;cd tools&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
4. Then type this on the command prompt :&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;imagex /apply d:\dell\image\factory.wim 1 c:\&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
5. This will start the recovery process which will complete itself in 10-15 minutes.&lt;br /&gt;
6. Type &lt;span style="font-weight: bold;"&gt;exit&lt;/span&gt; on the command prompt.&lt;br /&gt;
7. Reboot your computer from your hard disk.&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/9HE7--56U4o" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/422129276427056950/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/03/how-to-restore-dell-factory-image-when.html#comment-form" title="294 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/422129276427056950?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/422129276427056950?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/9HE7--56U4o/how-to-restore-dell-factory-image-when.html" title="How to restore dell factory image when PC restore does not work?" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>294</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/03/how-to-restore-dell-factory-image-when.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUIMR3Y6fip7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-8923991578589584091</id><published>2009-03-21T22:51:00.000-07:00</published><updated>2010-03-23T02:46:26.816-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:46:26.816-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="dvd burn" /><category scheme="http://www.blogger.com/atom/ns#" term="dvd player" /><title>How to burn videos to play on a dvd player?</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B001IBHUU8&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;Older dvd players cannot play data dvd's , only newer divx compatible players can play them.&lt;br /&gt;
So if you wish to play them on such a dvd player, you would have to first convert the files to a dvd format.&lt;br /&gt;
There are many softwares which do both the conversion and burning for you. If you are using windows vista, you can use windows dvd maker.&lt;br /&gt;
Otherwise Total Video converter is a very good option.&lt;br /&gt;
But beware that the conversion process takes a lot of time ( say an hour for a 2 hour video or may be even more)&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/gmmCLVWY7Qc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/8923991578589584091/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/03/how-to-burn-videos-to-play-on-dvd.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/8923991578589584091?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/8923991578589584091?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/gmmCLVWY7Qc/how-to-burn-videos-to-play-on-dvd.html" title="How to burn videos to play on a dvd player?" /><author><name>Saurabh Goyal</name><uri>http://www.blogger.com/profile/15028994267049906576</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="16" height="16" src="http://img2.blogblog.com/img/b16-rounded.gif" /></author><thr:total>0</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/03/how-to-burn-videos-to-play-on-dvd.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUEHRnY9cSp7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-1112194947697493991</id><published>2009-03-18T02:36:00.000-07:00</published><updated>2010-03-23T02:47:17.869-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:47:17.869-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="cumulative distribution function." /><category scheme="http://www.blogger.com/atom/ns#" term="gaussian distribution" /><category scheme="http://www.blogger.com/atom/ns#" term="normal distribution generation" /><category scheme="http://www.blogger.com/atom/ns#" term="c" /><category scheme="http://www.blogger.com/atom/ns#" term="randomly generate" /><title>Generate numbers in Gaussian (normal) Distribution  in C</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=0486466280&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;C doesn't have direct function to generate numbers which follow Gaussian Distribution. Here is how one an do this. We can use the cumulative distribution function of the Normal Distribution to generate the required. The code below illustrates how to generate a point between -3 to +3 with resolution of .005 and which follows the standard Normal Distribution. The code can accordingly be changed for other normal distribution and other range. step size multiplied by the no of points/2 in CDF array gives the range.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#include "stdio.h"&lt;stdio.h&gt; // change accordingly&lt;br /&gt;
#include "stdlib.h"&lt;math.h&gt;&lt;br /&gt;
#include "math.h"&lt;stdlib.h&gt;&lt;br /&gt;
&lt;br /&gt;
double CDF[1202];//gloabal array which contains the CDF of the normal distribution&lt;br /&gt;
&lt;br /&gt;
double generateAWGN(){&lt;br /&gt;
double temp;&lt;br /&gt;
int i=0,j=0;&lt;br /&gt;
temp = CDF[1]+(CDF[1201]-CDF[1])*rand()/RAND_MAX;//uniformly distributed temp&lt;br /&gt;
if(temp&amp;gt;.5)&lt;br /&gt;
{&lt;br /&gt;
for(i=602;i&amp;lt;1202;i++){&amp;gt;=temp){&lt;br /&gt;
return (i-601)*.005;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
for(j=600;j&amp;gt;0;j--){&lt;br /&gt;
if(CDF[j]&amp;lt;=temp) return (j-601)*.005; } } }    int main(int argc, char *argv[]) { int i=0; double step = .005,tmp,avg,pns; double past_tmp = .399, extra,a; CDF[601]=.5;//mean has CDF .5 for(i=1;i&amp;lt;=600;i++) { tmp = .399*step*exp(-((step*i)*(step*i))/2);//value at step*i of pdf extra = (past_tmp-tmp)*step*.5; past_tmp = tmp; CDF[601+i] = CDF[601+i-1]+tmp+extra; CDF[601-i] = CDF[601-i+1]-tmp-extra; } //printf("%f and %f \n",CDF[1201],CDF[1]); printf("the elements which follow gaussina distribution\n"); for(i=0;i&amp;lt;1000;i++) { pns = generateAWGN(); printf("%f\n",pns); avg = pns/1000; } printf("average of the elements = %f",avg); }&lt;/stdlib.h&gt;&lt;/math.h&gt;&lt;/stdio.h&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/DcVqfEtrxEw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/1112194947697493991/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/03/generate-numbers-in-gaussian-normal.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/1112194947697493991?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/1112194947697493991?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/DcVqfEtrxEw/generate-numbers-in-gaussian-normal.html" title="Generate numbers in Gaussian (normal) Distribution  in C" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/03/generate-numbers-in-gaussian-normal.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkABQHY8fCp7ImA9WxVWF0w.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-6299096965283997428</id><published>2009-02-26T22:57:00.000-08:00</published><updated>2009-02-26T23:12:31.874-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-26T23:12:31.874-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="speedup vista" /><category scheme="http://www.blogger.com/atom/ns#" term="vista slow" /><title>Vista runs very slow</title><content type="html">If your windows vista runs very slow I mean it takes time to open even my computer and other folders. then you can do the following things ---&lt;br /&gt;&lt;br /&gt;1) make sure that there are less files in the folder if there are many then you pack them in folder.&lt;br /&gt;2) you should have some space free in the hard disk 10% at least.&lt;br /&gt;3) run de-fragmentor as it helps hard disk run faster.&lt;br /&gt;4) one trick to make explorer run faster is that you set the priority of explorer process to high &lt;a href="http://smsoftdev-solutions.blogspot.com/2009/02/firefox-starts-very-slowly.html"&gt;click here&lt;/a&gt; to know how to do that.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/Covn2XutqDM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/6299096965283997428/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/02/vista-runs-very-slow.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/6299096965283997428?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/6299096965283997428?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/Covn2XutqDM/vista-runs-very-slow.html" title="Vista runs very slow" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/02/vista-runs-very-slow.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkMDRHs5fSp7ImA9WxVWEUQ.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-5440237883154329091</id><published>2009-02-20T21:27:00.000-08:00</published><updated>2009-02-20T21:34:35.525-08:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-02-20T21:34:35.525-08:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="firefox starts slowly" /><category scheme="http://www.blogger.com/atom/ns#" term="speedup firefox" /><category scheme="http://www.blogger.com/atom/ns#" term="firefox tweaks" /><category scheme="http://www.blogger.com/atom/ns#" term="speed up a program" /><title>Firefox starts very slowly</title><content type="html">Mozilla firefox takes so much of time to start. here is a easy solution.&lt;br /&gt;1. start firefox&lt;br /&gt;2. start task manager&lt;br /&gt;3. go to process and&lt;br /&gt;4. then to firefox process in the processes tab.&lt;br /&gt;5. right click and set the pririty to high.&lt;br /&gt;6. and then close the firefox and start it again you will see the difference.&lt;br /&gt;&lt;br /&gt; only problem is you have to do it every time you start your computer.&lt;br /&gt;you can do this to any other program as well.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/bx4IkXSCnU0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/5440237883154329091/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/02/firefox-starts-very-slowly.html#comment-form" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/5440237883154329091?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/5440237883154329091?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/bx4IkXSCnU0/firefox-starts-very-slowly.html" title="Firefox starts very slowly" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/02/firefox-starts-very-slowly.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUAHRHkzeip7ImA9WxBaE04.&quot;"><id>tag:blogger.com,1999:blog-1839870468145408669.post-4914501847719125001</id><published>2009-02-04T09:50:00.000-08:00</published><updated>2010-03-23T02:48:55.782-07:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-23T02:48:55.782-07:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="windows 7" /><category scheme="http://www.blogger.com/atom/ns#" term="vmware tools" /><title>How to manually install vmware tools in guest windows operating system</title><content type="html">&lt;iframe align="left" frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="http://rcm.amazon.com/e/cm?t=solutions079-20&amp;amp;o=1&amp;amp;p=8&amp;amp;l=bpl&amp;amp;asins=B000RZCSA8&amp;amp;fc1=000000&amp;amp;IS2=1&amp;amp;lt1=_blank&amp;amp;m=amazon&amp;amp;lc1=0000FF&amp;amp;bc1=000000&amp;amp;bg1=FFFFFF&amp;amp;f=ifr" style="align: left; height: 245px; padding-right: 10px; padding-top: 5px; width: 131px;"&gt;&lt;/iframe&gt;If you can not install tools directly go to installation directory of the vmware and find windows.iso file and mount this in guest operating system and install the tools.&lt;img src="http://feeds.feedburner.com/~r/blogspot/KxdBp/~4/zR-xjfiVcHg" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://smsoftdev-solutions.blogspot.com/feeds/4914501847719125001/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://smsoftdev-solutions.blogspot.com/2009/02/how-to-manually-install-vmware-tools-in.html#comment-form" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/4914501847719125001?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/1839870468145408669/posts/default/4914501847719125001?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/blogspot/KxdBp/~3/zR-xjfiVcHg/how-to-manually-install-vmware-tools-in.html" title="How to manually install vmware tools in guest windows operating system" /><author><name>Manish Kasat</name><uri>http://www.blogger.com/profile/10339284368427121887</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="24" src="http://3.bp.blogspot.com/_mooVRaO8xN4/SVPLDgszbCI/AAAAAAAAAB0/yrXD3r5gVek/S220/Image039.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://smsoftdev-solutions.blogspot.com/2009/02/how-to-manually-install-vmware-tools-in.html</feedburner:origLink></entry></feed>
