# The Naked Scientists Forum

### Author Topic: Is it possible to correct a distorted image and learn its proportions?  (Read 2637 times)

#### Supercryptid

• Hero Member
• Posts: 606
##### Is it possible to correct a distorted image and learn its proportions?
« on: 03/10/2012 02:08:29 »
I'm trying to figure out if there is some way to use geometry, trigonometry, etc. to "flatten" a particular image I am interested in. I don't know what angle the computer screen is at relative to the camera in the photos, but I figure the rectangles on the screen in the images must have corner angles at ninety degrees each.

I actually have two angles of the image:

Can anyone help?

#### CliffordK

• Neilep Level Member
• Posts: 6321
• Thanked: 3 times
• Site Moderator
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #1 on: 03/10/2012 04:13:37 »
If only I could remember a little drafting from High School...  No, not CAD, we had pencils & triangles.

Anyway, it is handy to have boxes around your parts.

If you connect the "parallel" lines in the boxes, you should arrive at a horizontal and a vertical vanishing point.  I presume all the parallel lines would actually hit the same two vanishing points.

All you need to do is to make the non parallel lines parallel.  And, of course, correct the right angles to right angles.

With any luck, your right view and left views will come out the same.
« Last Edit: 03/10/2012 04:18:44 by CliffordK »

#### RD

• Neilep Level Member
• Posts: 8129
• Thanked: 53 times
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #2 on: 03/10/2012 11:55:38 »
I did this using GIMP, but by eye so I wouldn't bet your life it's accurate* ...

YouTube tutorial on perspective correction in GIMP ...

[* The camera lens has added some radial distortion which I haven't attempted to remove ].
« Last Edit: 03/10/2012 12:29:18 by RD »

#### Supercryptid

• Hero Member
• Posts: 606
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #3 on: 04/10/2012 05:06:49 »
Many thanks, RD!

Unfortunately, this has only raised more questions for me than answers...

I'm attempting to measure the leading edge sweep on an aircraft wing and the values that your corrected images have is less than 45 degrees. Based on what I've seen of it, I'm almost certain that it's more than 45 degrees (going by my eyes). If you could correct one more perspective image (the top view of the airplane in the image), RD, I would be very grateful. That would help a lot. If not, I suppose I can try it myself:

#### CliffordK

• Neilep Level Member
• Posts: 6321
• Thanked: 3 times
• Site Moderator
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #4 on: 04/10/2012 07:22:43 »
Gimp is a free program:

http://www.gimp.org/

It is primarily a Linux program, but there should be both Windows and Linux versions available.  It is very powerful with some tools, but, a little cumbersome with other aspects.

Two things became obvious as I tried to rotate the object using Gimp.
• One looses the X-Y scaling (at least with Gimp).  So, one really needs some kind of proportional X-Y scale to make it come out right.
• Gimp (and probably no program) can not truly do a 3-D projection to 2-D transformation.  Potentially one can come close with the scale, but the 3D details may obscure the 2-D layout
Assuming the two initial photos are of the same monitor/image, and are to a true scale, then one could potentially merge the two images.  Then determine the true aspect ratio of the Dell monitor.  By setting the proper aspect ratio of the monitor, one might be able to recover the true aspect ratio for the image.

Of course, pixels may not be square, so it may depend on how well calibrated the initial image was.

#### CliffordK

• Neilep Level Member
• Posts: 6321
• Thanked: 3 times
• Site Moderator
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #5 on: 04/10/2012 08:42:02 »
Is the leading edge of the wingtip at a right angle?
That might be enough to calibrate your X-Y scale.

It is quite possible that both the leading and trailing edge of the wings are at 45° angles.

#### RD

• Neilep Level Member
• Posts: 8129
• Thanked: 53 times
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #6 on: 04/10/2012 12:43:37 »
... one really needs some kind of proportional X-Y scale to make it come out right ...

If the dotted lines running horizontally and vertically have the same number of dots-per-unit-length, (effectively rulers), then they could be used to ensure the aspect ratio was correct ...

« Last Edit: 04/10/2012 12:55:38 by RD »

#### Supercryptid

• Hero Member
• Posts: 606
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #7 on: 04/10/2012 16:42:22 »
Many thanks, RD! =)

#### RD

• Neilep Level Member
• Posts: 8129
• Thanked: 53 times
##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #8 on: 05/10/2012 11:17:50 »
The repeated 45 degree angles could be an anti-radar measure rather than an aerodynamic thing: to minimise the amount of any radar beam reflected from the wing back to the source.

#### The Naked Scientists Forum

##### Re: Is it possible to correct a distorted image and learn its proportions?
« Reply #8 on: 05/10/2012 11:17:50 »