<?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: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;DkcGQ385cCp7ImA9WhRaFE0.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521</id><updated>2012-02-16T14:53:42.128Z</updated><category term="octree" /><category term="image matching" /><category term="Number plate extraction" /><category term="Pseudo Inverse calculation" /><category term="computer graphics" /><category term="Dull" /><category term="GFD" /><category term="Fourier Descriptor" /><category term="Sachin" /><category term="OBB" /><category term="vector maths" /><category term="reflected vector" /><category term="State estimation" /><category term="board game c#" /><category term="Tracking" /><category term="collision" /><category term="triangle" /><category term="phase-only correlation" /><category term="Active shape model" /><category term="computer vision" /><category term="Water painting filter" /><category term="Face detection" /><category term="MD2 animation" /><category term="3d rendering engine. HOM" /><category term="Kalman" /><category term="motion segmentation" /><category term="meanshift." /><category term="point triangle intersection test" /><category term="Eigen Vector" /><category term="edge processing" /><category term="image processing" /><category term="Principal component analysis" /><category term="ANPR" /><category term="gomuku narabe" /><category term="DFT" /><category term="PCA" /><title>Mathematics for Computer Graphics</title><subtitle type="html" /><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://cgmath.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default?start-index=26&amp;max-results=25&amp;redirect=false&amp;v=2" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>26</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/MathematicsForComputerGraphics" /><feedburner:info uri="mathematicsforcomputergraphics" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;D04HQX0-fyp7ImA9WhRUFE0.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-2943969737973223865</id><published>2012-01-23T15:10:00.000Z</published><updated>2012-01-24T11:52:10.357Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-24T11:52:10.357Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Fourier Descriptor" /><category scheme="http://www.blogger.com/atom/ns#" term="image matching" /><category scheme="http://www.blogger.com/atom/ns#" term="GFD" /><title>GFD(Generalized Fourier Descriptor), Part 1</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/fvInyFrYcjYflets-pfFOwT-En4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fvInyFrYcjYflets-pfFOwT-En4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/fvInyFrYcjYflets-pfFOwT-En4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/fvInyFrYcjYflets-pfFOwT-En4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;it is interesting.. GFD is a rotation invariant. In GFD the orginal image is transformed to polar cordinate system. This provides the rotation invariant ability. I will explain how this happens. When we map normal image in cartesian coodinate system to polar coordinates, a rotation in&amp;nbsp;Cartesian&amp;nbsp;coordinate will cause translation/shifting in polar system. Remeber in polar system r, and theta are the axis. So when you rotate original image, R remain same so in effect the coresponding image is shifted(to left/right according to the direction of rotation) in polar system.&lt;br /&gt;
&lt;br /&gt;
Still you may be wondering even if that is the case, why Fourier transform output remains same ? because we are operating on different data.For each rotation , the image is shifted in polar coordinate system.&lt;br /&gt;
If you thought like that, you are thinking.. Good.&lt;br /&gt;
&lt;br /&gt;
I will explain the answer to the above puzzle.&lt;br /&gt;
&lt;br /&gt;
&lt;img alt="X_k = \sum_{n=0}^{N-1} x_n \cdot e^{-i 2 \pi \frac{k}{N} n}." src="http://upload.wikimedia.org/wikipedia/en/math/d/5/4/d546ba719f01a0419c5bbf84e8f9c495.png" /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you&amp;nbsp;remember&amp;nbsp;one&amp;nbsp;dimensional&amp;nbsp;Fourier&amp;nbsp;transform you can see that we are finding the dot product of our Image data with a number of Cos,Sin vectors (N diamensional, same as image size). The sin and cos are orthonormal , so the magnitude remains same. Please read my previous post&amp;nbsp;&lt;a href="http://cgmath.blogspot.com/2011/12/image-recognition-using-phase-only.html"&gt;http://cgmath.blogspot.com/2011/12/image-recognition-using-phase-only.html&lt;/a&gt;&amp;nbsp;to get an&amp;nbsp;intuitive grasp on DFT.&lt;br /&gt;
&lt;br /&gt;
that is&lt;br /&gt;
&lt;br /&gt;
Magnitude Of DFT[ {1,2,3,4,5,6}] is equal to Magnitude of DFT[ {4,5,6,1,2,3}]&lt;br /&gt;
&lt;br /&gt;
Magnitude is Sqrt( i*i + j*j ) of the complex number.&lt;br /&gt;
&lt;br /&gt;
Thus we get rotation&amp;nbsp;in-variance. Now the next thing is Fourier descriptor. I will post about that after some days. It is simple( Really ? )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-2943969737973223865?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/DZQMllH4iB0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/2943969737973223865/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=2943969737973223865" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/2943969737973223865?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/2943969737973223865?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/DZQMllH4iB0/gfdgeneralized-fourier-descriptor-part.html" title="GFD(Generalized Fourier Descriptor), Part 1" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2012/01/gfdgeneralized-fourier-descriptor-part.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAHRnc4cSp7ImA9WhRVEU4.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-6886041075699681321</id><published>2012-01-09T19:17:00.001Z</published><updated>2012-01-09T19:18:57.939Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2012-01-09T19:18:57.939Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Fourier Descriptor" /><category scheme="http://www.blogger.com/atom/ns#" term="MD2 animation" /><category scheme="http://www.blogger.com/atom/ns#" term="Dull" /><title>Just started with generalized Fourier Descriptor</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/3eeU6rzSkOLVbAfk8kdVlE-oAEk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3eeU6rzSkOLVbAfk8kdVlE-oAEk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/3eeU6rzSkOLVbAfk8kdVlE-oAEk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/3eeU6rzSkOLVbAfk8kdVlE-oAEk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I started working on a new algorithm for image search. This is based on Fourier descriptor. Image is first converted in to a corresponding polar representation.This representation allows to get complete rotation&amp;nbsp;in-variance. This is Because a rotation in&amp;nbsp;Cartesian&amp;nbsp;plane corresponds to a angle shifts in polar domain. So the DFT remains same. This is a simple and great idea.&lt;br /&gt;
&lt;br /&gt;
I also started working on my Engine to add MD2 animation support. The image processing things takes too much thinking time also sometimes makes me dull. Thats why i started this to feed my interests.MD2 animation is simple to implement also to understand. Bone animation is difficult to understand if you are a beginner/intermediate in computer graphics. You may be wondering about which format should be used like that.. I had a looked that before some years. But at that time i didn't got time to implement it. Now sadly i am not remembering much.I should have implemented it that time.&lt;br /&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-6886041075699681321?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/sVBL5yy6xIM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/6886041075699681321/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=6886041075699681321" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/6886041075699681321?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/6886041075699681321?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/sVBL5yy6xIM/i-started-working-on-new-algorithm-for.html" title="Just started with generalized Fourier Descriptor" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2012/01/i-started-working-on-new-algorithm-for.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkIEQHw_fCp7ImA9WhRQGE0.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-6953414644236637138</id><published>2011-12-13T17:56:00.005Z</published><updated>2011-12-13T18:21:41.244Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-12-13T18:21:41.244Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="image matching" /><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="DFT" /><category scheme="http://www.blogger.com/atom/ns#" term="phase-only correlation" /><title>Image recognition using phase-only correlation</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/tt-syumPBWTsWpbFeTUoduV_iKA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tt-syumPBWTsWpbFeTUoduV_iKA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/tt-syumPBWTsWpbFeTUoduV_iKA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/tt-syumPBWTsWpbFeTUoduV_iKA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;
I have been working on image matching program which based on frequency analysis.Phase correlation principle is used here.&lt;br /&gt;
&lt;br /&gt;
The concept is like this&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;Get different frequency information from image using DFT&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Do phase correlation of source and templates frequencies (got from source and template images, both are n-dimensional)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;After phase only correlation do inverse&amp;nbsp;Fourier&amp;nbsp;and find the peaks in the real part. that peaks shows the matching positions.&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&gt;
To really understand how this works , you need to know how DFT works. Not just that magic equation.&lt;br /&gt;
How it could transform the signal(here image) to freqency data ?infact we can make an intutive represenation of DFT equation in mind. Here it is in without any formulas.&lt;br /&gt;
&lt;br /&gt;
You need to know the vector projetion operation first. If you don't know that my humble opinion is you better learn some basic vector maths right now. (vectors are everywhere.. Beware!!).&lt;br /&gt;
In DFT we have an image, which can be represented as an N-Dimensional vector.Then we take the dot product of this N-dimensional vector with an another N-Dimensional vector , lets call it 'Sin'&amp;nbsp;vector, we also take dot product with an another vector, lets call it 'Cos' vector&lt;br /&gt;
&lt;br /&gt;
that is (ImageN . Sin) + i (ImageN . Cos ) &amp;nbsp; &amp;nbsp;: "&lt;i&gt;. is Dot product between vectors "&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
(Dot product is actually gives the distance in terms of vector, you can conceive it as projecting the image data to n-dimensional sine and cosine vectors which gives the real and&amp;nbsp;imaginary&amp;nbsp;parts). We do this operation for a number of&amp;nbsp;frequencies, so the Sin,Cos Vectors changes giving different n-dimensional vectors.That's how you get the output N complex numbers (Now look refer the original DFT equation)&lt;br /&gt;
So what we just said is, we project(DOT) the image data to a number of vectors which are obtained from different sin,cos signals. Another point worth to remember &amp;nbsp;is Sin and Cos vectors are always ortho&amp;nbsp;normal&amp;nbsp;).&amp;nbsp;I hopes i just wrote enough theory for DFT so that you can understand it intutively.Visualization is very important.&lt;br /&gt;
&lt;br /&gt;
So back to matching thing., we do DFT of source and template image( both are same size, template can be padded with zero ). &amp;nbsp;After this apply phase correlation using equation&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; (a+ib)(p+iq)* / (| (a+ib)(p+iq)* | )&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;i&gt;(a+ib): &amp;nbsp;complex number got from source DFT (so for NxN dimensional image , there will be N*N complex numbers,represented as 2D array NxN.)&lt;/i&gt;&lt;/li&gt;
&lt;li&gt;&lt;i&gt;(p+iq): complex number got from template DFT, (p+iq)* is conjugate operation.&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;br /&gt;
What this equation does is it gives high values for signals where where peaks and bottoms correctly&lt;br /&gt;
aligns each other.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now we do inverse DFT on the phase only correlated datas, and apply some threshold on the real part inorder to get the peaks which indicates the matched positions&lt;br /&gt;
&lt;br /&gt;
Images from my tests.&lt;br /&gt;
&lt;br /&gt;
Original image (after edge detection)&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-yFYMD1Z-nS8/TuePDORFVdI/AAAAAAAAAU4/MOxZU8FGxXI/s1600/o2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-yFYMD1Z-nS8/TuePDORFVdI/AAAAAAAAAU4/MOxZU8FGxXI/s1600/o2.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Template image (template image size must be same as source, so pad remaining area with zeros)&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-OZi48OEV110/TuePMZ3Ca1I/AAAAAAAAAVA/_2vpGqCQT9c/s1600/t2.bmp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-OZi48OEV110/TuePMZ3Ca1I/AAAAAAAAAVA/_2vpGqCQT9c/s1600/t2.bmp" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Result after phase only Correlation, see the peaks, You can see some invalid peaks also there (that is another story). I did this with mathematics. With 'mathematica' or 'matlab'&amp;nbsp;implementation&amp;nbsp;is easy. But i had to spend months to really understand the theory.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-SXx5HLxNwRQ/TueQDFa6ujI/AAAAAAAAAVI/XSxST7EdCcA/s1600/result.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="450" src="http://4.bp.blogspot.com/-SXx5HLxNwRQ/TueQDFa6ujI/AAAAAAAAAVI/XSxST7EdCcA/s400/result.png" width="545" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This method has advantage of being small invariant to smaller rotation and scale. But drawback is it needs higher time for processing due to DFT.This algorithm&amp;nbsp;doesn't&amp;nbsp;consider any shape information for matching, so this can give false results when too much edges present in source image.&lt;br /&gt;
&lt;br /&gt;
That's all for now,this was a quick post. Good Luck with your projects.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-6953414644236637138?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/sNO_rOlv2BY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/6953414644236637138/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=6953414644236637138" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/6953414644236637138?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/6953414644236637138?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/sNO_rOlv2BY/image-recognition-using-phase-only.html" title="Image recognition using phase-only correlation" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-yFYMD1Z-nS8/TuePDORFVdI/AAAAAAAAAU4/MOxZU8FGxXI/s72-c/o2.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2011/12/image-recognition-using-phase-only.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkcHQn08fyp7ImA9WhZaEU0.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-7965845275829870897</id><published>2011-06-26T17:04:00.001Z</published><updated>2011-06-26T17:07:13.377Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-06-26T17:07:13.377Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="board game c#" /><category scheme="http://www.blogger.com/atom/ns#" term="gomuku narabe" /><title>A Board game within 3 hours</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/J7OUOQpbyMdMMc0UQw6nCzRI0FY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J7OUOQpbyMdMMc0UQw6nCzRI0FY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/J7OUOQpbyMdMMc0UQw6nCzRI0FY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/J7OUOQpbyMdMMc0UQw6nCzRI0FY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;Yes, I made a board game within 3 hours. I don't know what made me to code it. May be after playing some board games in mobile, I wished to create my own, especially those crystals graphics. I learnt to create some nice looking glass buttons with Gimp, it is just silly task but it is fun.&lt;br /&gt;
&lt;br /&gt;
See game image shown below(the red text&amp;nbsp;indicates&amp;nbsp;the connected cells count to it), the game idea is like whoever first able to make 5 coins in a line(vertical,horizontal or&amp;nbsp;diagonal) will win the game.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://1.bp.blogspot.com/-1-cC0fg0ozc/Tgdkp046S4I/AAAAAAAAASA/y3NZcZxemT0/s1600/board+game.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-1-cC0fg0ozc/Tgdkp046S4I/AAAAAAAAASA/y3NZcZxemT0/s320/board+game.png" width="310" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;I coded the AI for this small game, it was fun and so easy, just count the number of opponent(player1) connected coins and calculate&amp;nbsp;probability&amp;nbsp;for each empty cell.&amp;nbsp;Next is to calculate the probability of player2's connected cell, based on these determined the cell where the computer must put the coin. It works!!, Can be made better by adding some other ideas too(like&amp;nbsp;considering&amp;nbsp;the distance , so that if same probability comes it will choose the cell which is more connected).&amp;nbsp;&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;[if you need source code mail me.]&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-7965845275829870897?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/G7ddkG9miFY" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/7965845275829870897/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=7965845275829870897" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7965845275829870897?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7965845275829870897?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/G7ddkG9miFY/yes-i-made-board-game-within-3-hours.html" title="A Board game within 3 hours" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-1-cC0fg0ozc/Tgdkp046S4I/AAAAAAAAASA/y3NZcZxemT0/s72-c/board+game.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2011/06/yes-i-made-board-game-within-3-hours.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUYBSH05fSp7ImA9WhZWEU4.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-4658591086318050512</id><published>2011-05-11T18:04:00.001Z</published><updated>2011-05-11T18:05:59.325Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-05-11T18:05:59.325Z</app:edited><title>Shape Context Matching</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7ApGfd_HMG-i63Ls-DVj2_mweDg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7ApGfd_HMG-i63Ls-DVj2_mweDg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7ApGfd_HMG-i63Ls-DVj2_mweDg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7ApGfd_HMG-i63Ls-DVj2_mweDg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I recently completed my shape context image matching project without much success :(.if you don't know about shape contexts , check out this link &lt;a href="http://www.eecs.berkeley.edu/Research/Projects/CS/vision/shape/sc_digits.html"&gt;SC&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The shape context can be created easily, For matching operation a bipartite based graph matching algorithm can be used. It can be done using Hungarian algorithm with complexity is less than the brute force method( O(n^2) ).&lt;div&gt;But after implementing Hungarian algorithm i am not able to find enough match point pairs between shapes. The problem with Hungarian method is that it can't give you the answer in fixed amount of time. It tries to optimize, sometimes never ending optimizations.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;Still I believe it can be corrected(using a different approch to SC creation) , I need to work more. Not getting enough time.&lt;br /&gt;&lt;br /&gt;A nice lecture about Hungarian Algorithm can be found at &lt;a href="http://www.youtube.com/watch?v=BUGIhEecipE"&gt;here&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-4658591086318050512?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/SmAq8MiwNw8" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/4658591086318050512/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=4658591086318050512" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4658591086318050512?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4658591086318050512?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/SmAq8MiwNw8/shape-context-matching.html" title="Shape Context Matching" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2011/05/shape-context-matching.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEAHRnszeSp7ImA9Wx9UFkw.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-3333657679759334340</id><published>2011-02-13T17:03:00.001Z</published><updated>2011-02-13T17:05:37.581Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2011-02-13T17:05:37.581Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Principal component analysis" /><category scheme="http://www.blogger.com/atom/ns#" term="Face detection" /><category scheme="http://www.blogger.com/atom/ns#" term="Eigen Vector" /><category scheme="http://www.blogger.com/atom/ns#" term="PCA" /><title>Face Detection using PCA.</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/g577mLk3FjDgwxB1cAYqgZdRBt0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g577mLk3FjDgwxB1cAYqgZdRBt0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/g577mLk3FjDgwxB1cAYqgZdRBt0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/g577mLk3FjDgwxB1cAYqgZdRBt0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I have been working on my image processing library to support face detection. I started with basic method PCA ( Principal component analysis). Basically you need to have a set of images(20-50) with different lighting conditions etc. The next step is to create&amp;nbsp;covariance&amp;nbsp;matrix out of it and find the eigen vector. Then simply project the the image you need to check in to Eigen vectors and find the distance between them.Do some thresholding to classify it.One important thing is you don't have to take all eigen vectors,may be its better to sort (descending&amp;nbsp;) based on Eigen value and take only first 'N' vectors.&lt;br /&gt;
&lt;br /&gt;
See the video&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-6dce57107c70e285" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v2.nonxt1.googlevideo.com/videoplayback?id%3D6dce57107c70e285%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D4185EA45A142687798E3B45E41265A97766F027C.2A3392BAC6C14198DBB7796E7A9EDFC08AF07D23%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D6dce57107c70e285%26offsetms%3D5000%26itag%3Dw160%26sigh%3DqWkMhPQSvCSZ3hKgsh8cGaIZ39g&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="320" height="266" bgcolor="#FFFFFF"
flashvars="flvurl=http://v2.nonxt1.googlevideo.com/videoplayback?id%3D6dce57107c70e285%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D4185EA45A142687798E3B45E41265A97766F027C.2A3392BAC6C14198DBB7796E7A9EDFC08AF07D23%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D6dce57107c70e285%26offsetms%3D5000%26itag%3Dw160%26sigh%3DqWkMhPQSvCSZ3hKgsh8cGaIZ39g&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: left;"&gt;The difficult part in PCA may be to find the eigne vectors , QA algorithm seems a good choice.&amp;nbsp;The current problem with running time.It takes almost 1 second to process 200X201 image. Roughly O(n^3) complexity. I am plan to implement it in CUDA,so that it can be used for real time detection.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-3333657679759334340?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/N7tAaoim-44" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/3333657679759334340/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=3333657679759334340" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/3333657679759334340?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/3333657679759334340?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/N7tAaoim-44/face-detection-using-pca.html" title="Face Detection using PCA." /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2011/02/face-detection-using-pca.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEABRXs9eyp7ImA9Wx9RFEo.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-4374800540458097887</id><published>2010-12-14T15:36:00.001Z</published><updated>2010-12-16T05:19:14.563Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-12-16T05:19:14.563Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Number plate extraction" /><category scheme="http://www.blogger.com/atom/ns#" term="ANPR" /><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><title>Number Plate region extraction</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RCnwU14f_WA8pFu7VI4CBsRvHyg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RCnwU14f_WA8pFu7VI4CBsRvHyg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RCnwU14f_WA8pFu7VI4CBsRvHyg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RCnwU14f_WA8pFu7VI4CBsRvHyg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;After a long break I started writing about my image processing studies.This time KD came with a project to extract number plate region from an image. The advantage of my method over other methods are the following.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;1. fast processing&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;2. It can give you multiple regions in image if more than one number plate present&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;3. It can handle image rotation up to a certain degree( +- 35 ) .I used Eigen vectors.&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;4. No third party libraries like openCV or aforge ( yes some times i like to reinvent the wheels again )&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"&gt;See the video to see the project in action.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;object width="448" height="350" class="BLOG_video_class" id="BLOG_video-fd172f4afc12538e" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v23.nonxt6.googlevideo.com/videoplayback?id%3Dfd172f4afc12538e%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D10B0F81FE1A7F94545F09062B32CEBE70A5A975E.21D487B81666561EA84A67DFFFCCA9DC9C1749CA%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dfd172f4afc12538e%26offsetms%3D5000%26itag%3Dw160%26sigh%3DJM15z5TczU-3k3QHz-Zre35zUVY&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="448" height="350" bgcolor="#FFFFFF"
flashvars="flvurl=http://v23.nonxt6.googlevideo.com/videoplayback?id%3Dfd172f4afc12538e%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D10B0F81FE1A7F94545F09062B32CEBE70A5A975E.21D487B81666561EA84A67DFFFCCA9DC9C1749CA%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dfd172f4afc12538e%26offsetms%3D5000%26itag%3Dw160%26sigh%3DJM15z5TczU-3k3QHz-Zre35zUVY&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;br /&gt;
&lt;/div&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; line-height: 13px;"&gt;Although the number plate extraction parts works pretty good , I don't have a good OCR module. So i am having troubles to&amp;nbsp;&lt;/span&gt;&lt;span class="Apple-style-span" style="font-family: arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 13px;"&gt;extract numbers from image. I tried using a simple&amp;nbsp;back propagation&amp;nbsp;neural network, its quality of&amp;nbsp;recognition&amp;nbsp;is not that great.Now i am trying to develop a rotation,scale invariant &amp;nbsp;recognizer. It may take another 9 or eight months to do that. But if it works i think that would be a great&amp;nbsp;achievement&lt;span class="Apple-style-span" style="font-size: x-small;"&gt;.&lt;/span&gt; I will try to post more updates here..&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: arial, sans-serif;"&gt;&lt;span class="Apple-style-span" style="line-height: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; line-height: 13px;"&gt;If you know any good optical character&amp;nbsp;recognition&amp;nbsp;library, please let me know.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: x-small; line-height: 13px;"&gt;&lt;br /&gt;
&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-4374800540458097887?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/p3er-ZbMuxw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/4374800540458097887/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=4374800540458097887" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4374800540458097887?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4374800540458097887?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/p3er-ZbMuxw/number-plate-region-extraction.html" title="Number Plate region extraction" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2010/12/number-plate-region-extraction.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUUDSHc7fip7ImA9WxFVE04.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-4633232048016607895</id><published>2010-06-12T09:49:00.006Z</published><updated>2010-06-12T10:07:59.906Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-06-12T10:07:59.906Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="reflected vector" /><category scheme="http://www.blogger.com/atom/ns#" term="vector maths" /><title>Calculating the reflected ray/vector</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/VjOLLEghzHCnLEfsUJWP7HyHryY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VjOLLEghzHCnLEfsUJWP7HyHryY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/VjOLLEghzHCnLEfsUJWP7HyHryY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/VjOLLEghzHCnLEfsUJWP7HyHryY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;In computer graphics applications its often needed to calculate the reflection ray for example if you are writing a ray tracer, a shader for some advanced lighting , or environment mapping etc.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;/p&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;If you are writing shaders , there are standard library function to do that . In cg shading language there is a function reflect(also its more efficient than writing our own).&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;In this post rather than just giving the vector formula for reflection ray , i am trying to explain the simple mathematics behind that.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;See the following image, I is the original ray, and R is the reflected ray which we need to found.&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;N is the normal of the incident plane. P is the line perpendicular from normal to both rays. it is obvious that at both ends the length of P will be same.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;a href="http://2.bp.blogspot.com/_smgpuy6lnCg/TBNYxOrs2_I/AAAAAAAAAPU/lJX57_wqCBA/s1600/reflect-724599.bmp"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;img src="http://2.bp.blogspot.com/_smgpuy6lnCg/TBNYxOrs2_I/AAAAAAAAAPU/lJX57_wqCBA/s320/reflect-724599.bmp" border="0" alt="" id="BLOGGER_PHOTO_ID_5481822774218251250" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Dot product between two unit vectors gives the cosine of the angle between them. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;So using this idea we can find  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;R =  DotProduct[ I, N ]  * N + P .    ---&gt; Eq(1)&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;We don't know P now. But I + P = N * DotProduct[ I,N].&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;So by rearranging P = N * DotProduct[ I,N] - I. Substituting the value of P now in equation(1) gives the final equation. &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;Here it is the final equation  &lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:medium;"&gt;R = 2 * N * ( DotProduct[ I,N] )  -  I&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class="mobile-photo"&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class="WordSection1"&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-4633232048016607895?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/R0cLB8cc4ik" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/4633232048016607895/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=4633232048016607895" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4633232048016607895?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4633232048016607895?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/R0cLB8cc4ik/reflect.html" title="Calculating the reflected ray/vector" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_smgpuy6lnCg/TBNYxOrs2_I/AAAAAAAAAPU/lJX57_wqCBA/s72-c/reflect-724599.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2010/06/reflect.html</feedburner:origLink></entry><entry gd:etag="W/&quot;Dk4FSXo7eCp7ImA9WxBbF0g.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-7007013567204301196</id><published>2010-03-16T06:19:00.009Z</published><updated>2010-03-16T15:55:18.400Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-16T15:55:18.400Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="meanshift." /><category scheme="http://www.blogger.com/atom/ns#" term="Water painting filter" /><category scheme="http://www.blogger.com/atom/ns#" term="Sachin" /><title>Color Image Segmentation using Meanshift Algorithm</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/NBuffSYDU2xz7kkh6mowWbvEb-E/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NBuffSYDU2xz7kkh6mowWbvEb-E/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/NBuffSYDU2xz7kkh6mowWbvEb-E/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/NBuffSYDU2xz7kkh6mowWbvEb-E/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="text-align: left;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The meanshift method can be used to segment color image. &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;In this method image pixels is treated as points in color space.In each iteration&lt;/span&gt; &lt;span class="Apple-style-span"  style="font-family:arial;"&gt;the meanshift vector is calculated for points which are inside the kernel radius.After that the the old kernel location is changed to meanshift vector's position. Color is also updated. This process continues untill both converge.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Original Image&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;img src="http://4.bp.blogspot.com/_smgpuy6lnCg/S5-oW933mTI/AAAAAAAAANE/K2HIThUuy1c/s400/sachin.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 294px; height: 400px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5449259186661071154" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Meanshift Filterd Image&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;img src="http://2.bp.blogspot.com/_smgpuy6lnCg/S5-oXVi3AGI/AAAAAAAAANM/vO8UF03ko1I/s400/Untitled.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5449259193015402594" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 391px; " /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;As the iteration count increases , the same color segment which has same type of colors will  get merged together. You can see the effect of meanshift filter on sachin's photo.Its like water painting (not exactly,there are other filters for that. )&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-7007013567204301196?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/7GFmP6Vejps" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/7007013567204301196/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=7007013567204301196" title="17 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7007013567204301196?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7007013567204301196?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/7GFmP6Vejps/color-image-segmentation-using.html" title="Color Image Segmentation using Meanshift Algorithm" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_smgpuy6lnCg/S5-oW933mTI/AAAAAAAAANE/K2HIThUuy1c/s72-c/sachin.jpg" height="72" width="72" /><thr:total>17</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2010/03/color-image-segmentation-using.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0EBR3c9fSp7ImA9WxBbE0o.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-2975239715382622402</id><published>2010-03-11T17:06:00.007Z</published><updated>2010-03-12T06:34:16.965Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-12T06:34:16.965Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="computer graphics" /><category scheme="http://www.blogger.com/atom/ns#" term="triangle" /><category scheme="http://www.blogger.com/atom/ns#" term="point triangle intersection test" /><category scheme="http://www.blogger.com/atom/ns#" term="collision" /><title>How to check a Point inside a Triangle</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sL4cWHZK5ffhh9mcTOMIDSBNb4Q/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sL4cWHZK5ffhh9mcTOMIDSBNb4Q/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sL4cWHZK5ffhh9mcTOMIDSBNb4Q/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sL4cWHZK5ffhh9mcTOMIDSBNb4Q/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;When i started to learn vector mathematics , i had found many methods to determine whether a point is inside a triangle or not.Easy method is not the fastest. This type of calculations are very important for making a fast graphics library.&lt;br /&gt;Following are the methods which i remember now.&lt;br /&gt;1. Using Cross Products&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;    Take cross product between each triangle edge and the point to check. If the direction of cross      product result is for the three edges that point is inside the triangle , otherwise not&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;2. Using the angle between the vectors made by point and triangle coordinates.If the sum of angle is 360 the point is inside , otherwise not.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;img src="http://3.bp.blogspot.com/_smgpuy6lnCg/S5km_yas7uI/AAAAAAAAALM/4OZPD-ToUAU/s400/angle.jpg" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 163px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5447428101588709090" /&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;3. Using Point and Plane test.See the figure. You need to know plane equation to understand it.&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style=" ;font-family:Georgia, serif;"&gt;&lt;img src="http://1.bp.blogspot.com/_smgpuy6lnCg/S5ksSo3TgmI/AAAAAAAAALc/xKjOibwQo-g/s400/plane.jpg" border="0" alt="" id="BLOGGER_PHOTO_ID_5447433922999976546" style="display: block; margin-top: 0px; margin-right: auto; margin-bottom: 10px; margin-left: auto; text-align: center; cursor: pointer; width: 400px; height: 138px; " /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;4. Using Bary centric Coordinates&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;     This is the fastest of above. It involves checking the point in Bary centric coordinates system.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-2975239715382622402?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/8d31nTB0SsE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/2975239715382622402/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=2975239715382622402" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/2975239715382622402?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/2975239715382622402?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/8d31nTB0SsE/how-to-check-point-inside-triangle.html" title="How to check a Point inside a Triangle" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_smgpuy6lnCg/S5km_yas7uI/AAAAAAAAALM/4OZPD-ToUAU/s72-c/angle.jpg" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2010/03/how-to-check-point-inside-triangle.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEIDSX85fyp7ImA9WxFSFUo.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-7431757453900849384</id><published>2010-02-19T06:52:00.007Z</published><updated>2010-04-18T07:42:58.127Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-04-18T07:42:58.127Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="edge processing" /><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><category scheme="http://www.blogger.com/atom/ns#" term="motion segmentation" /><title>Real time motion segmentation</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/CEcMjDN7pqUqVBd1JFIX6u5VY2s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CEcMjDN7pqUqVBd1JFIX6u5VY2s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/CEcMjDN7pqUqVBd1JFIX6u5VY2s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/CEcMjDN7pqUqVBd1JFIX6u5VY2s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Motion segmentation is one of the greatest challenges in computer vision. Accurate real time segmentation is difficult to achieve with ordinary camera. Using 3D camera we will get much better approximation .but 3D camera is costly.&lt;br /&gt;&lt;br /&gt;i had done edge based motion detection , now i just did chain method of clustering on the edges to group the edges in to different groups. Its not accurate yet. with ordinary 2d camera it is difficult to cluster objects due to the perspective effect. But it can give better results if we could place the camera in somewhat higher position compared the the objects.&lt;br /&gt;&lt;br /&gt;see the videos here.. ( edges in a group have same colors )&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-7c5d04a9c373d9f8" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v19.nonxt5.googlevideo.com/videoplayback?id%3D7c5d04a9c373d9f8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7373E7FDC8C6E4ED441E14774DCCADA959060E7D.1291877A1CEFB1292F54A2F0897F8033A301EBAA%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D7c5d04a9c373d9f8%26offsetms%3D5000%26itag%3Dw160%26sigh%3DPwQ-oTkdtaFBE1cd_nv_WyyqrSo&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="320" height="266" bgcolor="#FFFFFF"
flashvars="flvurl=http://v19.nonxt5.googlevideo.com/videoplayback?id%3D7c5d04a9c373d9f8%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7373E7FDC8C6E4ED441E14774DCCADA959060E7D.1291877A1CEFB1292F54A2F0897F8033A301EBAA%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D7c5d04a9c373d9f8%26offsetms%3D5000%26itag%3Dw160%26sigh%3DPwQ-oTkdtaFBE1cd_nv_WyyqrSo&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-e76eea472756f98a" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v1.nonxt7.googlevideo.com/videoplayback?id%3De76eea472756f98a%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D12866808B5DD27D0D9A328A7C94C9579A3DF4BCE.172EB93D8D1775D022376DCFB6097C07A4DE6EC9%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3De76eea472756f98a%26offsetms%3D5000%26itag%3Dw160%26sigh%3DvhMins-OiaY_d7f5T6-xLhAxbEo&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="320" height="266" bgcolor="#FFFFFF"
flashvars="flvurl=http://v1.nonxt7.googlevideo.com/videoplayback?id%3De76eea472756f98a%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D12866808B5DD27D0D9A328A7C94C9579A3DF4BCE.172EB93D8D1775D022376DCFB6097C07A4DE6EC9%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3De76eea472756f98a%26offsetms%3D5000%26itag%3Dw160%26sigh%3DvhMins-OiaY_d7f5T6-xLhAxbEo&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Updated motion segmentation , see the results in video below. I need to remove the noisy segments. Noise segments are created due to the illumination changes. Hopes it can be done with some pixel modeling schemes.  &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-82e850d36c747e90" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v14.nonxt8.googlevideo.com/videoplayback?id%3D82e850d36c747e90%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D5D91805956F6E61A9F4519A21A820CF2EC0094C6.59927E401F0224E10E732D21A3DAD48E48BF9AC8%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D82e850d36c747e90%26offsetms%3D5000%26itag%3Dw160%26sigh%3DasuDoOMoa8fUaVAvlHTWynwYlfw&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="320" height="266" bgcolor="#FFFFFF"
flashvars="flvurl=http://v14.nonxt8.googlevideo.com/videoplayback?id%3D82e850d36c747e90%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D5D91805956F6E61A9F4519A21A820CF2EC0094C6.59927E401F0224E10E732D21A3DAD48E48BF9AC8%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D82e850d36c747e90%26offsetms%3D5000%26itag%3Dw160%26sigh%3DasuDoOMoa8fUaVAvlHTWynwYlfw&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-7431757453900849384?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/BJISsQVoPZM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/7431757453900849384/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=7431757453900849384" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7431757453900849384?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7431757453900849384?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/BJISsQVoPZM/real-time-motion-segmentation.html" title="Real time motion segmentation" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2010/02/real-time-motion-segmentation.html</feedburner:origLink><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~5/kQNF7Ew9fXc/video-play.mp4" length="0" type="video/mp4" /><feedburner:origEnclosureLink>http://www.blogger.com/video-play.mp4?contentId=82e850d36c747e90&amp;type=video%2Fmp4</feedburner:origEnclosureLink></entry><entry gd:etag="W/&quot;C0QDSH04eSp7ImA9WxBWEUU.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-1591300748340164049</id><published>2010-02-03T07:07:00.000Z</published><updated>2010-02-03T07:16:19.331Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-02-03T07:16:19.331Z</app:edited><title>Boundary Approximation</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/b8LhK6RXIjMS81BUL1nMtUK5t0s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b8LhK6RXIjMS81BUL1nMtUK5t0s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/b8LhK6RXIjMS81BUL1nMtUK5t0s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/b8LhK6RXIjMS81BUL1nMtUK5t0s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;I have been playing with snakes( aka active contours )  for a quite long time.&lt;br /&gt;Basic snake is not able to detect boundary correctly. But it is very fast. &lt;br /&gt;&lt;br /&gt;I tried to extend the gradient vector field of the image using Laplace equation. it works. But it takes a few seconds to generate the vector field.. :( , now i am thinking about using distance transform to generate the vector field. &lt;br /&gt;&lt;br /&gt;See the video below to see snake in action.&lt;br /&gt;&lt;br /&gt; &lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-18b58c499ad2f718" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v20.nonxt8.googlevideo.com/videoplayback?id%3D18b58c499ad2f718%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7D47B1BFC79E92EE95E6B8480FBBC53DB49E4C91.64FD148792481003B4B2D966C7CE7E520302FD5B%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D18b58c499ad2f718%26offsetms%3D5000%26itag%3Dw160%26sigh%3DcfpqhZehDDBXK6gGncWGV96V0go&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="320" height="266" bgcolor="#FFFFFF"
flashvars="flvurl=http://v20.nonxt8.googlevideo.com/videoplayback?id%3D18b58c499ad2f718%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D7D47B1BFC79E92EE95E6B8480FBBC53DB49E4C91.64FD148792481003B4B2D966C7CE7E520302FD5B%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D18b58c499ad2f718%26offsetms%3D5000%26itag%3Dw160%26sigh%3DcfpqhZehDDBXK6gGncWGV96V0go&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-1591300748340164049?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/u_BI4he7zXE" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/1591300748340164049/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=1591300748340164049" title="3 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/1591300748340164049?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/1591300748340164049?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/u_BI4he7zXE/boundary-approximation.html" title="Boundary Approximation" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>3</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2010/02/boundary-approximation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkYARn8yfyp7ImA9WxNaGUw.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-7232121194042409103</id><published>2009-12-04T05:15:00.001Z</published><updated>2009-12-04T07:02:27.197Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-12-04T07:02:27.197Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Active shape model" /><category scheme="http://www.blogger.com/atom/ns#" term="Tracking" /><category scheme="http://www.blogger.com/atom/ns#" term="image processing" /><title>Tracking using Active shape models</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oAbYwpMjmrwAyek4I8sEgaPFlEE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oAbYwpMjmrwAyek4I8sEgaPFlEE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oAbYwpMjmrwAyek4I8sEgaPFlEE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oAbYwpMjmrwAyek4I8sEgaPFlEE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;A few months back i had done a program which uses active shape models for tracking objects. Following video shows the result of it. Still I need to work on it to make it suitable for commercial use( but i don't have time :( , i need to study some other things related to gender classification )  , but the first looks very much promising to me. &lt;/span&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-c455977bfd3ee38e" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v5.nonxt2.googlevideo.com/videoplayback?id%3Dc455977bfd3ee38e%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D67944E58682AF5DC6007ED8EED97D7A763175F87.19DB7F5BCC24501ECAD94163F051BD6D97437D5E%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc455977bfd3ee38e%26offsetms%3D5000%26itag%3Dw160%26sigh%3DA8RfKa5T0sATbZHyb-eXjFie080&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="320" height="266" bgcolor="#FFFFFF"
flashvars="flvurl=http://v5.nonxt2.googlevideo.com/videoplayback?id%3Dc455977bfd3ee38e%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D67944E58682AF5DC6007ED8EED97D7A763175F87.19DB7F5BCC24501ECAD94163F051BD6D97437D5E%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3Dc455977bfd3ee38e%26offsetms%3D5000%26itag%3Dw160%26sigh%3DA8RfKa5T0sATbZHyb-eXjFie080&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-7232121194042409103?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/tG57I8JK8VQ" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/7232121194042409103/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=7232121194042409103" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7232121194042409103?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/7232121194042409103?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/tG57I8JK8VQ/tracking-using-active-shape-models.html" title="Tracking using Active shape models" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/12/tracking-using-active-shape-models.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CU8ARHw7fCp7ImA9WxNaE0w.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-8196522279090892166</id><published>2009-10-09T08:06:00.001Z</published><updated>2009-11-27T09:24:05.204Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-11-27T09:24:05.204Z</app:edited><title>Ray - Circle intersection test.</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/P-2ykNTbjr7AAVsAXKrRtALaU_I/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P-2ykNTbjr7AAVsAXKrRtALaU_I/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/P-2ykNTbjr7AAVsAXKrRtALaU_I/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/P-2ykNTbjr7AAVsAXKrRtALaU_I/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style=" ;font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;If you are writing a game or any computer graphics applications you may want to check for intersections like triangle-triangle, triangle-ray, sphere-ray-sphere-sphere,Box-Triangle etc...There exists different algorithms for finding this.. Separating Axis theorem (SAT) seems to be a good option.   &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Following code written in c++ find intersection between a circle and line ( or ray-circle ). it will return true if there is intersection.Other function parameters are described in next lines.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;vOrginCircle : center of the circle , r is the radius , vtLineStart:  Line start point, vtLineEnd    : Line end point, outIp : intersecting point..&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;As you can see it is easy to extend this method for finding ray-sphere intersection. just add a 'z' coordinate :)&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;bool IntersectLineCircle(vector vOrginCircle, double r,vector  vtLineStart, vector vtLineEnd, vector&amp;amp; outIp)&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;{&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;vector vOrginNew =  vOrginCircle - vtLineStart; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;vector vtRay = (vtLineEnd  - vtLineStart).normalize();&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double b = vOrginNew.x* vtRay.x + vtRay.y * vOrginNew.y;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double c = r*r - ( vOrginNew.Norm2() );&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double a = vtRay.Norm2(); // Norm2() is x*x + y*y&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double diva = 1.0F/a;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;// Negative doesn't have square root.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;if( (b*b + a * c )  &lt;= 0 ) return false;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double b4ac = sqrt( (b*b + a * c ) );&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double l1 = (b - b4ac) * diva;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double l2 = (b + b4ac) * diva;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;// we need the closest intersection point.. so find smaller l.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;// To get the other end , just change the comparison operator.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;double l = l1 &lt;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;// find the intersecting point&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;outIp = (vtRay * l) + vtLineStart;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;return true;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="color:#3333FF;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-8196522279090892166?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/XEEc5Z_lYeM" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/8196522279090892166/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=8196522279090892166" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/8196522279090892166?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/8196522279090892166?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/XEEc5Z_lYeM/ray-circle-intersection-test.html" title="Ray - Circle intersection test." /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/10/ray-circle-intersection-test.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0IDQH0yeyp7ImA9WxJREkU.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-5776794644663107613</id><published>2009-05-08T04:40:00.000Z</published><updated>2009-05-14T07:19:31.393Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-14T07:19:31.393Z</app:edited><title /><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/jK9pkQVQ5DwilNuSrGBso0yVawM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jK9pkQVQ5DwilNuSrGBso0yVawM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/jK9pkQVQ5DwilNuSrGBso0yVawM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/jK9pkQVQ5DwilNuSrGBso0yVawM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;Figure below shows the city renderd with my graphics engine. It has around 4000000 triangles.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Still selection is very fast. You can see a red trianlge on some building which is  the selected one using mouse.I used Octree + Ray checking for selection.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span" style="color: rgb(0, 0, 238); text-decoration: underline;"&gt;&lt;img src="http://1.bp.blogspot.com/_smgpuy6lnCg/SgvF8x08yCI/AAAAAAAAAFI/q4qXSx31jEQ/s400/world.JPG" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 289px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5335575831508731938" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-5776794644663107613?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/r4Jb0aoNQRw" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/5776794644663107613/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=5776794644663107613" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5776794644663107613?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5776794644663107613?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/r4Jb0aoNQRw/figure-below-shows-city-renderd-with-my.html" title="" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_smgpuy6lnCg/SgvF8x08yCI/AAAAAAAAAFI/q4qXSx31jEQ/s72-c/world.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/05/figure-below-shows-city-renderd-with-my.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkECRHg8eip7ImA9WxJTGE8.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-8501950794318625985</id><published>2009-04-24T04:28:00.001Z</published><updated>2009-04-27T09:31:05.672Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-04-27T09:31:05.672Z</app:edited><title>2X2 Matrix inversion.</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Nn7vkDkjtfMHFynhs1h3yhjA02s/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Nn7vkDkjtfMHFynhs1h3yhjA02s/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Nn7vkDkjtfMHFynhs1h3yhjA02s/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Nn7vkDkjtfMHFynhs1h3yhjA02s/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Sometimes it is needed to find the inverse of a simple 2x2 matrix. For this there is a simple method exitst , we don't have to apply any gauss jordan method or crammers etc.&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;The Matrix A = &lt;/span&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;[  a00   a01  ]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:'courier new';"&gt;               [  a10   a11  ]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;then the inverse is        1          [  a11      -a01 ] &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;                                  ---   x    [                     ]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;                                 | A |       [ -a10      a00   ]&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;| A | is determinent of matrix A which is a00 * a11 - a10 * a01&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-8501950794318625985?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/eTN3Cb14T1E" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/8501950794318625985/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=8501950794318625985" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/8501950794318625985?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/8501950794318625985?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/eTN3Cb14T1E/2x2-matrix-inversion.html" title="2X2 Matrix inversion." /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>2</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/04/2x2-matrix-inversion.html</feedburner:origLink></entry><entry gd:etag="W/&quot;D0AHRH4zeCp7ImA9WxJREkU.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-4847070360629165190</id><published>2009-04-20T06:18:00.001Z</published><updated>2009-05-14T07:22:15.080Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-05-14T07:22:15.080Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Kalman" /><category scheme="http://www.blogger.com/atom/ns#" term="Tracking" /><category scheme="http://www.blogger.com/atom/ns#" term="State estimation" /><title>State estimation using Kalman filter</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/0iS50lbwt81YFpf_sXIEW_7ryg0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0iS50lbwt81YFpf_sXIEW_7ryg0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/0iS50lbwt81YFpf_sXIEW_7ryg0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/0iS50lbwt81YFpf_sXIEW_7ryg0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Kalman filter helps to find the correct state of a linear system , provided the approximate state of the system at time 't'. It has wide application in the following fields  Aerospace,computer vision, signal processing etc.&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Let 'St' be the state variable at time t  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;St1 = A * St0 + V  , &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;         V is the random noise with mean = 0 &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;         A is the gain Matrix of the system.  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Let Mt be the measurment variable. Measurment is the approxiamte state at time t. Kalman filter can predict the correct state from this measurment( also depending on other params etc  ).&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Mt1 = H * St1 + W&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;          H is the gain Matrix.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;          W is the random noise with mean = 0.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;The interseting thing is usually Mt1 is known at time t1 and we want to find the st1 which is the correcte state at time t1 from this Mt1. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"   style=" ;font-family:arial;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Kalman filter uses kalman gain to compute the state St. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="  ;font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;St = St + Kt*( Mt - H*St ) , Kt is the gain matrix. and the new St is calculatd using the kalman gain Kt.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;The noise is represented in this system using a covariace matrix. Let P represent the noise of function V ( system noise )  and R represent the noise during measurment. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;I am omitting the detailed derivation of equations here. The final equation and steps are shown below.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;At time 't' do the follwing to estimate the correct state St.&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"   style=" ;font-family:arial;font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="  ;font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;Update the state vector and measurment covariance matrix.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;St = A * St&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;P =  A * P * Transpose[P]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;find the kalman gain for this.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;K = A*P0*Transpose[H]* Inverse[  ( H*P0*Transpose[H] + R) ] &lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;Mt = &lt;/span&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;Do measurment here and assign to Mt.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;Calcualte the estimated state St.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;St = St + K* ( Mt - H*St );&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="font-style: italic;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;Finally update the state updation covariance matrix P&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span" style="color: rgb(51, 51, 153);"&gt;P = P - K*(H*P ) &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Repeat these steps for each measurment.Following figure shows the result. &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" ;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The  measurment data 'Mt' , which is affected by noise.and rectified data St which is the output of Kalman filter and it gives us better prediction of the state.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"   style=" ;font-family:arial;font-size:48px;"&gt;&lt;img src="http://1.bp.blogspot.com/_smgpuy6lnCg/SgvGM-Dob3I/AAAAAAAAAFQ/grXPdHGIsLc/s400/kalest.bmp" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 241px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5335576109669445490" /&gt;&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;img src="http://2.bp.blogspot.com/_smgpuy6lnCg/SewvE-fwFMI/AAAAAAAAAEw/TSO_9IOrcjA/s400/Copy+of+kalman.bmp" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 396px; height: 244px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5326684221814609090" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-4847070360629165190?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/hETMbOyq9tc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/4847070360629165190/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=4847070360629165190" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4847070360629165190?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4847070360629165190?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/hETMbOyq9tc/state-estimation-using-kalman-filter.html" title="State estimation using Kalman filter" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_smgpuy6lnCg/SgvGM-Dob3I/AAAAAAAAAFQ/grXPdHGIsLc/s72-c/kalest.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/04/state-estimation-using-kalman-filter.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DE8AQ3c-fyp7ImA9WxVbE04.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-4361841676448762210</id><published>2009-03-29T14:09:00.000Z</published><updated>2009-03-29T14:27:22.957Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-29T14:27:22.957Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Tracking" /><category scheme="http://www.blogger.com/atom/ns#" term="meanshift." /><category scheme="http://www.blogger.com/atom/ns#" term="computer vision" /><title>Tracking results using meanshift and bhattacharya distance minimization technique.</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/1dpKgrPQsR9vbs3YI9Ub_FTgIhM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1dpKgrPQsR9vbs3YI9Ub_FTgIhM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/1dpKgrPQsR9vbs3YI9Ub_FTgIhM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/1dpKgrPQsR9vbs3YI9Ub_FTgIhM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In my last post I had said about mean shift algorithm . I  implemented tacking in video frames usiung meanshift algorithm and bhattacharya distance minimaization techniques( ask me if you need more details) . See the video below. ( Video resolution is poor.Please bear with me ).&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In my opinion meanshift tracking is not so good,But still it can be useful on some occasions , where you don't want to know the shape of tracking object. It doesn't know anything about the shape of the object.There are other methods exists which are working in shape space and uses the edge detection for shape trasnformation. I have implemented one part of it, need to study some probabilistic modeling for completeing it.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;object width="320" height="266" class="BLOG_video_class" id="BLOG_video-16dff2a68115aab4" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"&gt;&lt;param name="movie" value="http://www.youtube.com/get_player"&gt;
&lt;param name="bgcolor" value="#FFFFFF"&gt;
&lt;param name="allowfullscreen" value="true"&gt;
&lt;param name="flashvars" value="flvurl=http://v3.nonxt5.googlevideo.com/videoplayback?id%3D16dff2a68115aab4%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6B7A2219DE96C47090049EF570F3587B95603801.23F0A9B8BD5D07EBDAD8833E578600A3796B71E3%26key%3Dck1&amp;amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D16dff2a68115aab4%26offsetms%3D5000%26itag%3Dw160%26sigh%3DWneyMhVdG0v_zX-WWrGpdQp2BCU&amp;amp;autoplay=0&amp;amp;ps=blogger"&gt;
&lt;embed src="http://www.youtube.com/get_player" type="application/x-shockwave-flash"
width="320" height="266" bgcolor="#FFFFFF"
flashvars="flvurl=http://v3.nonxt5.googlevideo.com/videoplayback?id%3D16dff2a68115aab4%26itag%3D5%26app%3Dblogger%26ip%3D0.0.0.0%26ipbits%3D0%26expire%3D1331554994%26sparams%3Did,itag,ip,ipbits,expire%26signature%3D6B7A2219DE96C47090049EF570F3587B95603801.23F0A9B8BD5D07EBDAD8833E578600A3796B71E3%26key%3Dck1&amp;iurl=http://video.google.com/ThumbnailServer2?app%3Dblogger%26contentid%3D16dff2a68115aab4%26offsetms%3D5000%26itag%3Dw160%26sigh%3DWneyMhVdG0v_zX-WWrGpdQp2BCU&amp;autoplay=0&amp;ps=blogger"
allowFullScreen="true" /&gt;&lt;/object&gt;
&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-4361841676448762210?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/Lr2eMjWJYnc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/4361841676448762210/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=4361841676448762210" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4361841676448762210?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/4361841676448762210?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/Lr2eMjWJYnc/in-my-last-post-i-had-said-about-mean.html" title="Tracking results using meanshift and bhattacharya distance minimization technique." /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/03/in-my-last-post-i-had-said-about-mean.html</feedburner:origLink><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="enclosure" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~5/1v40arRnRKk/video-play.mp4" length="0" type="video/mp4" /><feedburner:origEnclosureLink>http://www.blogger.com/video-play.mp4?contentId=16dff2a68115aab4&amp;type=video%2Fmp4</feedburner:origEnclosureLink></entry><entry gd:etag="W/&quot;CUECSHw-fCp7ImA9WxVUF0U.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-1310128294717581555</id><published>2009-03-19T13:44:00.001Z</published><updated>2009-03-23T04:47:49.254Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-23T04:47:49.254Z</app:edited><title>Gradient vector calculation for non parametric data</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/bBDh5fYJRGG8lIs_A9awaP35T6w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bBDh5fYJRGG8lIs_A9awaP35T6w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/bBDh5fYJRGG8lIs_A9awaP35T6w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/bBDh5fYJRGG8lIs_A9awaP35T6w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Gradient vector points to the nearst position where a high rate of change can b e seen.&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt; Normally for a function it is obtained by applying the partial detivative operator. For example if we could represent the temperature inside a room by a function ( with parameter hight or time any conceiveing things )  , we could find the the gradient vector by applying partial derivative operator on that function. Using this technique we can go to the position where the temperature is highest than the current position.  We just need to simply go along the direction of gradient vector.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Okay .. Things are simple when we can paramterize things. Practically parametrization of physical things is not easy. In such situation we can find the gradient density vector using kernal density gradiant estimator.  In the follwing figure illustrates this mathematic technique. You can see that the circle is moved from it orginal position to the densest region (where more points present) .  I calculated gradient vector and moved the circle through that direction , thus finally the circle reached at the densest region . &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Used &lt;span class="Apple-style-span" style="color: rgb(204, 51, 0); "&gt;Epanechnikov Kernel &lt;/span&gt;for density estimation.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p:colorscheme colors="#ffffff,#000000,#808080,#000000,#bbe0e3,#333399,#009999,#99cc00"&gt;  &lt;/p:colorscheme&gt;&lt;div&gt;&lt;img src="http://3.bp.blogspot.com/_smgpuy6lnCg/ScNcxniH0WI/AAAAAAAAAEU/mM7aqET-Kyc/s400/mean+shift.bmp" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 400px; height: 355px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5315193992722764130" /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-1310128294717581555?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/tsro1NfDdO4" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/1310128294717581555/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=1310128294717581555" title="2 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/1310128294717581555?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/1310128294717581555?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/tsro1NfDdO4/gradient-vector-calculation-for-non.html" title="Gradient vector calculation for non parametric data" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_smgpuy6lnCg/ScNcxniH0WI/AAAAAAAAAEU/mM7aqET-Kyc/s72-c/mean+shift.bmp" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/03/gradient-vector-calculation-for-non.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08CQH07eyp7ImA9WxVVEUs.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-1674452791358548280</id><published>2009-03-04T09:53:00.001Z</published><updated>2009-03-04T10:17:41.303Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2009-03-04T10:17:41.303Z</app:edited><title>Arc ball rotation using Quaternion</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/9C2dzw-osa49JbDRAjAirqJyzv8/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9C2dzw-osa49JbDRAjAirqJyzv8/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/9C2dzw-osa49JbDRAjAirqJyzv8/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/9C2dzw-osa49JbDRAjAirqJyzv8/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;Some times we need to rotate the scene for a better view. Rather than providing separate slider ball control or similar mechanisam to rotate around X,Y,Z axis it is better to do rotation with mouse and it will give a intutive feel to user. &lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This is not a complex task. With some simple mathematical calculation we can achieve this. A unit Quaternion can represent any arbitary a 3D orientation. Quaternions are nothing but 4Diamensional complex number. Visualizing quaternion is difficult when compared to affine matrices.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Rotation Using Quaternion&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;When user clicks on the scene we will get the points in window coordinates. we need to convert it into the correct world coordinates. If you are familar with opengl you can use gluUnProject API for this.  Otherwise you can simply mul&lt;/div&gt;&lt;div&gt;tiply with corresponding matrices to get this.&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So When user dragging the mouse  we will get  two points in world space ( since dragging is not a continus operation on computer unlike the physical draging process). We can generate a axis from this two points ( vectors ) by taking the cross product between them. The angle of rotation is nothing but arc cosine of dot prodcut of first and second vector.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://1.bp.blogspot.com/_smgpuy6lnCg/Sa5VGo3WDwI/AAAAAAAAAEE/qwdE_GCN8cQ/s400/sample.bmp" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 185px; height: 180px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5309274583253520130" /&gt;&lt;/div&gt;&lt;div&gt;Now we can create a quaternion which represents the rotation around that axis.&lt;/div&gt;&lt;div&gt;Following code ilustrates this process. I used my Quaternion &amp;amp; vector classes to simplify the process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Math3D::vector&lt;double&gt; vtFrom;&lt;/double&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Math3D::vector&lt;double&gt; vtTo;&lt;/double&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;gluUnProject(m_PrePoint.x,m_PrePoint.y,0,fModeView,fProjection,iViewPort,&amp;amp;vtFrom.x,&amp;amp;vtFrom.y,&amp;amp;vtFrom.z);   &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style=" "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;gluUnProject(point.x,point.y,0,fModeView,fProjection,iViewPort,&amp;amp;vtTo.x,&amp;amp;vtTo.y,&amp;amp;vtTo.z);&lt;/span&gt;&lt;/span&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;    &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;vtFrom.y = -vtFrom.y;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;vtTo.y = -vtTo.y;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;vtFrom.normalize(); &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;vtTo.normalize();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Math3D::vector&lt;double&gt; vAxis = vtFrom.Cross(  vtTo );&lt;/double&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;vAxis.normalize(); &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;float fTheta  = acos(vtFrom.Dot(vtTo));&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span" style=" white-space: normal; "&gt;&lt;span class="Apple-style-span" style=" "&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Math3D::Quaternion&lt;/span&gt;&lt;double&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt; qTmp;&lt;/span&gt;&lt;/double&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;qTmp.FromAxisAngle( vAxis, fTheta *2 );&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;qTmp.Normalize();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;// multiply the current quaternion with the new one.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;m_Quat *= qTmp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;m_PrePoint = point;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-tab-span" style="white-space:pre"&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;// normalise it. &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;m_Quat.Normalize();&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:13px;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-size:small;"&gt;Now the scene can be rotated with quaternion  m_Quat and the scene will be rotated according the mouse movement made by the user.&lt;/span&gt;&lt;/div&gt;&lt;div&gt; &lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-1674452791358548280?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/OV8upcVxRxc" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/1674452791358548280/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=1674452791358548280" title="7 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/1674452791358548280?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/1674452791358548280?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/OV8upcVxRxc/arc-ball-rotation-using-quaternion.html" title="Arc ball rotation using Quaternion" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_smgpuy6lnCg/Sa5VGo3WDwI/AAAAAAAAAEE/qwdE_GCN8cQ/s72-c/sample.bmp" height="72" width="72" /><thr:total>7</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/03/arc-ball-rotation-using-quaternion.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEQAQno8fip7ImA9WxBbGEw.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-2230194677475695100</id><published>2009-03-03T05:19:00.001Z</published><updated>2010-03-17T08:59:03.476Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-17T08:59:03.476Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Pseudo Inverse calculation" /><title>Pseudo Inverse calculation</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/eDqBvXUGHg9vl_TYYpTjUF0XD5U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eDqBvXUGHg9vl_TYYpTjUF0XD5U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/eDqBvXUGHg9vl_TYYpTjUF0XD5U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/eDqBvXUGHg9vl_TYYpTjUF0XD5U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Pseudo inverse matrix helps to get a satisfactory solution to linear equation which don't have any exact solution. This technique is used for  curve fitting . &lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The pseudo inverse can be calculated like this . If A is the matrix&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;    The pseudo inverse is this : &lt;span class="Apple-style-span" style="font-weight: bold;"&gt;Inverse[Transpose[a] * A ] * Transpose[A] &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Normal inverse exists only for square matrix. So we can call this pseudo inverse as a general matrix inverse method. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Consider the following linear equations&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;5X1 + 4 X2 = 9&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;3X1 + 2X2 =  5&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; X1  + x2    =  3&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Actually this set of equations doesn't have any exact solution. &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;span class="Apple-style-span" style="font-weight: bold;"&gt;A              X              R &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;5 4            x1            9&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;3 2   *       x2       =    5 &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;1  1                            3&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;Clearly we can't calculate the normal inverse of A because it is not square matrix.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;The pseudoinverse of A is &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;-.5        1.5         -1.0&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;.833   -1.833    1.333&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;So [Pseudoinverse]* [R] give the values for X1 and X2, which is the nearst solution for the equations.&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span"  style="font-family:arial;"&gt; &lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-2230194677475695100?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/sKiFLKypkkI" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/2230194677475695100/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=2230194677475695100" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/2230194677475695100?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/2230194677475695100?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/sKiFLKypkkI/pseudo-inverse-calculation.html" title="Pseudo Inverse calculation" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/03/pseudo-inverse-calculation.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DEUNRXw6eyp7ImA9WxBbGEw.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-5664867717651543273</id><published>2009-01-23T11:43:00.001Z</published><updated>2010-03-17T08:58:14.213Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2010-03-17T08:58:14.213Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Eigen Vector" /><category scheme="http://www.blogger.com/atom/ns#" term="OBB" /><title>Eigen Vector</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cM1watlXyTWp0T-5ZgRO_MU84vs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cM1watlXyTWp0T-5ZgRO_MU84vs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cM1watlXyTWp0T-5ZgRO_MU84vs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cM1watlXyTWp0T-5ZgRO_MU84vs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-family:arial;"&gt;Today i just created one application to demonstrate the use of eigen vectors.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;It is only for 2 diamensional things. B&lt;/span&gt;&lt;span style="font-family:arial;"&gt;eacuse in 3D calculating eigen vector is a complex process ( It depends), involving linear equation solving , and cubic equations' root finding.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;You canse see the eigen axis can be used for finding the OBB( oriented bounding boxes) for a set of points. This has significance inmportant in Computer graphics.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;One more interesting thing is eigen vector of a rotaion matrix is actually its axis of rotation (similar to curl of a vector field , but curl calculation is easier).&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p align="center"&gt;&lt;a href="http://4.bp.blogspot.com/_smgpuy6lnCg/SXmu4naK0bI/AAAAAAAAAD0/zROqBEoI9jw/s1600-h/eigen.bmp"&gt;&lt;img style="WIDTH: 458px; HEIGHT: 353px; CURSOR: hand" id="BLOGGER_PHOTO_ID_5294455124625379762" border="0" alt="" src="http://4.bp.blogspot.com/_smgpuy6lnCg/SXmu4naK0bI/AAAAAAAAAD0/zROqBEoI9jw/s400/eigen.bmp" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-5664867717651543273?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/lLK1b4LmDNk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/5664867717651543273/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=5664867717651543273" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5664867717651543273?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5664867717651543273?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/lLK1b4LmDNk/eigen-vector.html" title="Eigen Vector" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_smgpuy6lnCg/SXmu4naK0bI/AAAAAAAAAD0/zROqBEoI9jw/s72-c/eigen.bmp" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2009/01/eigen-vector.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CEMDSHo4cSp7ImA9WxRbEU8.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-5283647890092366717</id><published>2008-12-01T08:31:00.000Z</published><updated>2008-12-01T09:07:59.439Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-12-01T09:07:59.439Z</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="3d rendering engine. HOM" /><category scheme="http://www.blogger.com/atom/ns#" term="octree" /><title>Accelerated 3D rendering.</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/uC3Fux6-b3KztLYWN6QQpZW_Meg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uC3Fux6-b3KztLYWN6QQpZW_Meg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/uC3Fux6-b3KztLYWN6QQpZW_Meg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/uC3Fux6-b3KztLYWN6QQpZW_Meg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;Following screen shots are from my rendering engine. It uses octree and occluion culling to accelerate the rendering process. It took almost 1 month to complete. Still some optimaization works are pending like use SIMD instructions etc.&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;img src="http://4.bp.blogspot.com/_smgpuy6lnCg/STOmJbhhH6I/AAAAAAAAADE/S4TRYXQpXIk/s400/1.bmp" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 550px; height: 390px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5274742269518356386" /&gt;&lt;/div&gt;&lt;div&gt;In first image you can see some buildings(of course the building are not realistic, but it doesn't matter )  and the camera is placed near a wall &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: left;"&gt; When we move camera a little downwards , the camera got occluded totaly by that wall . This cause to cull a lot of polygons in the scene. The second image shows that scene (scene is a bit zoomed out to get a clear picture). Also you can see the frame rate in title bar(for the second image it is 360). &lt;span class="Apple-style-span" style="color: rgb(204, 0, 0);"&gt;Frame rate is increased by a great amount.&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;img src="http://3.bp.blogspot.com/_smgpuy6lnCg/STOh1MpJzmI/AAAAAAAAAC8/yorF1BaPaHY/s400/2.bmp" style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 550px; height: 390px;" border="0" alt="" id="BLOGGER_PHOTO_ID_5274737523879956066" /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;div style="text-align: left;"&gt;Now I have plan to write a tool for manually selecting occluder polygons for a scene. &lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style="text-align: center;"&gt;&lt;br /&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-5283647890092366717?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/DU64QozKXEk" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/5283647890092366717/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=5283647890092366717" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5283647890092366717?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5283647890092366717?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/DU64QozKXEk/accelerated-3d-rendering.html" title="Accelerated 3D rendering." /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/_smgpuy6lnCg/STOmJbhhH6I/AAAAAAAAADE/S4TRYXQpXIk/s72-c/1.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2008/12/accelerated-3d-rendering.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkECSHw4eSp7ImA9WxRVEkQ.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-5876211897862032934</id><published>2008-11-07T12:06:00.000Z</published><updated>2008-11-10T05:24:29.231Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-10T05:24:29.231Z</app:edited><title>Projecting vectors</title><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/sLoruXZaaoO67GLF1ZVrwHzfYio/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sLoruXZaaoO67GLF1ZVrwHzfYio/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/sLoruXZaaoO67GLF1ZVrwHzfYio/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/sLoruXZaaoO67GLF1ZVrwHzfYio/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;Sometimes we need to project one vector over another. See the picture below , we can see a vector u. Now we need to project this u on to x axis, .&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5266894919843968466" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 177px; CURSOR: hand; HEIGHT: 151px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_smgpuy6lnCg/SRfFBj6b9dI/AAAAAAAAACs/2juzj_h1ejo/s400/vector+projection.bmp" border="0" /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;This can be done with this equation  :&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;    p = x * u . (x / Norm[x] ) . p is the result&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:Trebuchet MS;"&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;"&gt;"." means Dot product. What that equation means is we need to normalize x first ( in general to which we are projecting u vector ) and find the dot product between u and normalized x , and mulitply our x(destingation ) vector by this scalar value. Now we will get the result. &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-5876211897862032934?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/Hk2sNtg_3o0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/5876211897862032934/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=5876211897862032934" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5876211897862032934?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5876211897862032934?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/Hk2sNtg_3o0/projecting-vectors.html" title="Projecting vectors" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_smgpuy6lnCg/SRfFBj6b9dI/AAAAAAAAACs/2juzj_h1ejo/s72-c/vector+projection.bmp" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2008/11/projecting-vectors.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DkQNQH4_cCp7ImA9WxRWF0o.&quot;"><id>tag:blogger.com,1999:blog-3996848416074637521.post-5340030135273949832</id><published>2008-11-04T04:30:00.000Z</published><updated>2008-11-04T04:53:11.048Z</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2008-11-04T04:53:11.048Z</app:edited><title /><content type="html">
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/UDdSqZI4OhKomgoTA2rz8m25fis/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UDdSqZI4OhKomgoTA2rz8m25fis/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/UDdSqZI4OhKomgoTA2rz8m25fis/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/UDdSqZI4OhKomgoTA2rz8m25fis/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:arial;"&gt;&lt;strong&gt;Finding rotation axis of a rotation matrix.&lt;/strong&gt; &lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;color:#000000;"&gt;A rotation matrix can be represented as &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:trebuchet ms;color:#000000;"&gt;x1 x2 x3&lt;br /&gt;y1 y2 y3&lt;br /&gt;z1 z2 z3&lt;br /&gt;&lt;br /&gt;Where (x1, y1, z1) are the first vector (x2, y2, z2), (x3, y3, z3) are the second and third vectors.&lt;br /&gt;Note this matrix is column major oriented.&lt;br /&gt;&lt;br /&gt;When you multiply this matrix by an arbitrary vector in space you will get the rotated vector coordinates.&lt;br /&gt;&lt;br /&gt;In some situations it is important to know the axis of rotation. Here I am going to present one method to get the rotation axis from rotation matrix.&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;&lt;br /&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;Consider this matrix which represents a rotation around axis ( 0.7017,0.7017,0 ) , this actually a vector in x-y plane rotated by 45 degree, Like this&lt;/span&gt;&lt;br /&gt;&lt;img id="BLOGGER_PHOTO_ID_5264656586091677026" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 213px; CURSOR: hand; HEIGHT: 140px; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_smgpuy6lnCg/SQ_RRY5qRWI/AAAAAAAAACM/tp6RBdFYn2c/s400/vector.JPG" border="0" /&gt;&lt;/span&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;The rotation matrix for rotating around this vector by 45 degree is shown below (which I calculated using quaternion)&lt;br /&gt;&lt;br /&gt;0.8536 0.146 0.500&lt;br /&gt;0.1460 0.850 -0.500&lt;br /&gt;-0.500 0.500 0.707&lt;br /&gt;&lt;br /&gt;When we multiply a arbitrary vector (x,y,z) by this matrix we gets the vector function F as below&lt;br /&gt;&lt;br /&gt;(X 0.8536 + y 0.146 + z 0.5) i + ( x 0.146 + y 0.85 – z 0.5 ) j + ( -x 0.5 + y 0.5 + y 0.707 ) k&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color:#000000;"&gt;&lt;span style="font-family:lucida grande;"&gt;&lt;span style="font-family:trebuchet ms;"&gt;I,j,k are the base vectors.&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;"&gt;Taking curl of this vector function F, we get the axis of rotation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:trebuchet ms;color:#000000;"&gt;I calculated the curl of that function and it is (1,-1, 0). After normalizing this vector we can see the result as (.707,-.707, 0),. Earlier we had created the rotation matrix to rotate around the axis ( .707,.707,0). Our answer curl is in the opposite direction of (.707,.707,0) , but it is still correct.&lt;br /&gt;&lt;br /&gt;Only problem is with the direction of rotation that is clockwise or anti clock wise..&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3996848416074637521-5340030135273949832?l=cgmath.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/MathematicsForComputerGraphics/~4/uuqyhOjBXs0" height="1" width="1"/&gt;</content><link rel="replies" type="application/atom+xml" href="http://cgmath.blogspot.com/feeds/5340030135273949832/comments/default" title="Post Comments" /><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=3996848416074637521&amp;postID=5340030135273949832" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5340030135273949832?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/3996848416074637521/posts/default/5340030135273949832?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/MathematicsForComputerGraphics/~3/uuqyhOjBXs0/finding-rotation-axis-of-rotation.html" title="" /><author><name>krishnadevan k</name><uri>https://profiles.google.com/104316880981417262262</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="32" height="32" src="//lh4.googleusercontent.com/-9pF2AGRqo44/AAAAAAAAAAI/AAAAAAAAAAA/ylmTRe9K_X0/s512-c/photo.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/_smgpuy6lnCg/SQ_RRY5qRWI/AAAAAAAAACM/tp6RBdFYn2c/s72-c/vector.JPG" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://cgmath.blogspot.com/2008/11/finding-rotation-axis-of-rotation.html</feedburner:origLink></entry></feed>

