<br><br><div class="gmail_quote">On Sat, Jan 8, 2011 at 12:24 PM, Narendra Sisodiya <span dir="ltr"><<a href="mailto:narendra@narendrasisodiya.com">narendra@narendrasisodiya.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I want your guidance in following problem.<br><div class="gmail_quote"><div class="gmail_quote"><br>I have a Rectangle with a known height and width. (aspect ration is fixed) It has a plane surface. Something like cardboard. Or Rectangle Drawn on wall.<br>
I am now taking image of this rectangle from webcam.<br>After taking image of this rectangle from webcam, rectangle occupy small area on image and that is in a form of quadrilateral inside image. I can calculate the XY location of Rectangle from image , So I have Following Matrix<br>
<br>Co-ordinate on image -> Actual real world co-ordinate<br>_______________________________________<br>X1 Y1 -> 0 , 0<br>X2 Y2 -> width, 0<br>X3 Y3 -> 0, height<br>
X4 Y4 -> width, height<br>________________________________________<br><br>width and height of rectangle is known because I can measure this real object<br>X1 Y1 to X4 Y4 are 4 co-ordinate of this object in image. Because it is a projective transformation, this will be in a shaped of quadrilateral.<br>
<br><br>Now I want to know a matrix operation or any formula, by which I can convert a given X Y of image into corresponding co-ordinate on rectangle.<br>I think, this is known as homography. seeing on web, i can find complex description and formulas which i am unable to understand.<br clear="all">
<br>May you give me exact formula for how to do it.<br><br>Thanks !<br></div></div><br>
</blockquote></div><br><br>Also - This code will be useful - I am unable to understand it fully - But i guess , this is doing exactly what i want.<br> <a href="http://wiiwhiteboard.cvs.sourceforge.net/viewvc/wiiwhiteboard/source/linux/perspective.py?view=markup">http://wiiwhiteboard.cvs.sourceforge.net/viewvc/wiiwhiteboard/source/linux/perspective.py?view=markup</a> <br>