Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Correction of Perspective Distortion
Date: Wed, 30 Jan 2008 23:13:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 47
Message-ID: <fnr09v$4ca$1@fred.mathworks.com>
References: <fnpft6$lod$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1201734783 4490 172.30.248.38 (30 Jan 2008 23:13:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 30 Jan 2008 23:13:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:448427


"OkinawaDolphin " <OkinawaDolphin@Hotmail.com> wrote in message 
<fnpft6$lod$1@fred.mathworks.com>...
> I have to analyze images that are distorted because the 
> optical axis is not perpendicular to the plane being 
> imaged. Therefore, lines that are parallel in the real 
> world are not parallel in the image and rectangular objects 
> appear as parallelograms. How can I correct for this?
> 
> Is the any Matlab function that calculates the images that 
> would have been taken perpendicular to the plane to be 
> imaged?
-------------
  There are two kinds of image "distortion" that you might have in mind here.  
You could be thinking of a draftsman-like image as viewed from an infinite 
distance above a plane.  Then a parallel projection onto a tilted plane would 
be a simple stretching along the direction orthogonal to the intersection of 
the two planes.  Rectangles would change to parallelograms and parallel lines 
would always remain parallel.  This is not usually what is referred to as a 
"perspective distortion".

  Or you might be talking about a projection from a fixed perspective point 
above one plane onto a tilted plane.  In that case parallel lines in the one 
plane do not, in general, translate to parallel lines in the other, and rectangles 
become quadrilaterals which are not, in general, parallelograms.  (Think of 
parallel train rails and railroad ties seeming to converge to an infinitely 
distant point.)

  Which do you have in mind?  If you have this second circumstance in mind, 
there are five different parameters that enter into the situation.  First, there is 
the position in the first plane at the base of an orthogonal line (optical axis) 
from the given perspective point, which takes two parameters.  Next, is the 
distance above the plane to that perspective point, a third parameter.  The 
fourth and fifth parameters are the direction and amount of tilt to the second 
plane relative to the first one.

  It isn't clear to me just how you would go about determining all these 
necessary parameters before carrying out the kind of correction you are 
seeking.  It is quite possible to give a transformation which could make the 
necessary correction that you ask for, once these five parameters are known.  
As I recall from some work I did a very long time ago, the equations involved 
are simple rational functions.  However, (perhaps out of laziness,) I am 
reluctant to go to the trouble of again working it all out without having some 
kind of assurance that you have devised a method for finding the necessary 
five parameters.

Roger Stafford