Groups > Corel > Corel PhotoPaint 12 > Re: Removing perspective/parallax from images -- How?




Removing perspective/parallax from images -- How?

Removing perspective/parallax from images -- How?
Mon, 09 Jul 2007 11:44:38 -040
Is there an accurate way to "square up" an image taken from an angle?

As an example: I have a photo taken of a rectangular sign, from below and a bit

from the side.  I would like to modify it so that the image of the sign is a 
true rectangle.  I know that I can use distort mode to do this 
by-guess-and-by-gosh, but isn't there any way to set up guide lines, or draw a 
rectangular outline, and have the image snap to it?  Doing it by hand, and by 
eye, involves multiple tries, each one a refinement (it is to be hoped) of the 
previous one.  All in all frustrating and time consuming.

Cyril N. Alberga
Post Reply
Re: Removing perspective/parallax from images -- How?
Mon, 09 Jul 2007 21:11:11 -060
On Mon, 09 Jul 2007 11:44:38 -0400, "Cyril N. Alberga"
<calberga@bellatlantic.net> wrote:

>
>Is there an accurate way to "square up" an image taken from an
angle?
>
>As an example: I have a photo taken of a rectangular sign, from below and a
bit 
>from the side.  I would like to modify it so that the image of the sign is a

>true rectangle.  I know that I can use distort mode to do this 
>by-guess-and-by-gosh, but isn't there any way to set up guide lines, or draw
a 
>rectangular outline, and have the image snap to it?  Doing it by hand, and
by 
>eye, involves multiple tries, each one a refinement (it is to be hoped) of
the 
>previous one.  All in all frustrating and time consuming.
>

If you are just talking about perspective I'm sure it would not be
very difficult to make a script/macro to do it.  Given the xy
coordinates of the corners it's just 3D trigonometry to work out the
proportions.  Don't ask me, that's long forgotten maths!

I would do it by making a rectangular mask the size you think is in
the right proportions as a guide.  This should be easy to do based on
the sign image.  Create an object of the sign, click on the object
until you get the outward facing arrows then drag each corner to the
relevant corner of the mask.  Fine tweak by dragging the corners.
I've got fairly good results with this.  Exact proportions are not
normally critical; getting it looking rectangular is.

Lens distortions are more difficult - best to use a telephoto from as
far away as possible, head-on, to flatten.  To add to Gareth's list I
would add payware Paint Shop Pro and Power Retouche which have lens
correction filters.

Starman*
Post Reply
Re: Removing perspective/parallax from images -- How?
Mon, 9 Jul 2007 21:19:39 +0100
Hi Cyril,

This is something I have to do all the time, since I often photograph my own 
paintings. It is can be difficult to get the camera absolutely perpendicular 
to the canvas, especially when working at speed.

It sounds as if you are going through the same procedures I have done 
myself. The greatest difficulty is to know what should be the correct aspect 
ratio of the corrected canvas (or sign in your case). For this I like to get 
as far away from the sign as possible, and take the photo with the zoom lens 
at maximum setting. This gives a rough and ready way to guess/estimate the 
proportions. Next I make an image, say in pure red, in the correct 
proportion, introduce the close-up of the sign as a new object and distort 
as you suggest.

A much easier way to do this is to move into Picture Window Pro. There, as 
long as you can fix the proportion of the final image, the warp tool does 
exactly what you ask for. http://www.dl-c.com/  It seems extravagant to buy 
a single programme for just this one thing, but PWP also has a handy lens 
distortion correction tool, as well as some other correction tools 
unavailable elsewhere. Maybe someone could suggest a free download for this 
warping, but I have not seen one.

The best method I found when attempting panoramas with 
http://www.ptgui.com/. It might be worth downloading the free trial to see 
this in action. In the Editor you can move a panorama *or a single image* 
from side to side, up and down, and rotate . This is just like moving a card 
in your hand to an infinite number positions in three dimensions. If means 
your image is always in true perspective. When all corners are rectangles 
you know the proportion is correct. A tremendous tool!

You may still be left with lens distortion. PTgui allows you to correct this 
too, though the easiest way I have found so far is to treat the sign as a 
panorama and leave PTgui to automatically correct the lens distortion as is 
aligns and blends the images. Magic!

This all depends on your budget of course.

Regards

Gareth





"Cyril N. Alberga" <calberga@bellatlantic.net> wrote in message

news:469105fc_3@cnews...
>
> Is there an accurate way to "square up" an image taken from an
angle?
>
> As an example: I have a photo taken of a rectangular sign, from below and 
> a bit from the side.  I would like to modify it so that the image of the 
> sign is a true rectangle.  I know that I can use distort mode to do this 
> by-guess-and-by-gosh, but isn't there any way to set up guide lines, or 
> draw a rectangular outline, and have the image snap to it?  Doing it by 
> hand, and by eye, involves multiple tries, each one a refinement (it is to

> be hoped) of the previous one.  All in all frustrating and time consuming.
>
> Cyril N. Alberga
> 


Post Reply
Re: Removing perspective/parallax from images -- How?
Mon, 09 Jul 2007 21:39:56 -040
Dear Gareth,

Thank you for the extensive reply.  I don't have very many such cases, so I 
guess I'll solder on doing it my hand.  I did find that using the mask tool to 
draw a rectangle gave something to shoot for, as the mask isn't changed by the 
distortion tool.  As to the aspect ratio, I (again) go mostly by the seat of my

pants.

Again, thank you for the insight into ramifications of the problem which hadn't

occurred to me!

Yours,
    Cyril

Gareth Hawker wrote:
> Hi Cyril,
> 
> This is something I have to do all the time, since I often photograph my
own 
> paintings. It is can be difficult to get the camera absolutely
perpendicular 
> to the canvas, especially when working at speed.
> 
> It sounds as if you are going through the same procedures I have done 
> myself. The greatest difficulty is to know what should be the correct
aspect 
> ratio of the corrected canvas (or sign in your case). For this I like to
get 
> as far away from the sign as possible, and take the photo with the zoom
lens 
> at maximum setting. This gives a rough and ready way to guess/estimate the

> proportions. Next I make an image, say in pure red, in the correct 
> proportion, introduce the close-up of the sign as a new object and distort

> as you suggest.
> 
> A much easier way to do this is to move into Picture Window Pro. There, as

> long as you can fix the proportion of the final image, the warp tool does 
> exactly what you ask for. http://www.dl-c.com/  It seems extravagant to buy

> a single programme for just this one thing, but PWP also has a handy lens 
> distortion correction tool, as well as some other correction tools 
> unavailable elsewhere. Maybe someone could suggest a free download for this

> warping, but I have not seen one.
> 
> The best method I found when attempting panoramas with 
> http://www.ptgui.com/. It might be worth downloading the free trial to see

> this in action. In the Editor you can move a panorama *or a single image* 
> from side to side, up and down, and rotate . This is just like moving a
card 
> in your hand to an infinite number positions in three dimensions. If means

> your image is always in true perspective. When all corners are rectangles 
> you know the proportion is correct. A tremendous tool!
> 
> You may still be left with lens distortion. PTgui allows you to correct
this 
> too, though the easiest way I have found so far is to treat the sign as a 
> panorama and leave PTgui to automatically correct the lens distortion as is

> aligns and blends the images. Magic!
> 
> This all depends on your budget of course.
> 
> Regards
> 
> Gareth
> 
> 
> 
> 
> 
> "Cyril N. Alberga" <calberga@bellatlantic.net> wrote in
message 
> news:469105fc_3@cnews...
>> Is there an accurate way to "square up" an image taken from
an angle?
>>
>> As an example: I have a photo taken of a rectangular sign, from below
and 
>> a bit from the side.  I would like to modify it so that the image of
the 
>> sign is a true rectangle.  I know that I can use distort mode to do
this 
>> by-guess-and-by-gosh, but isn't there any way to set up guide lines, or

>> draw a rectangular outline, and have the image snap to it?  Doing it by

>> hand, and by eye, involves multiple tries, each one a refinement (it is
to 
>> be hoped) of the previous one.  All in all frustrating and time
consuming.
>>
>> Cyril N. Alberga
>>
> 
> 
> 
Post Reply
Re: Removing perspective/parallax from images -- How?
Tue, 10 Jul 2007 09:04:02 +010
Hi Cyril,

> I guess I'll solder on doing it my hand.

I think you and Starman are both thinking along the same lines as I was when 
using PP.

Here is a more detailed description of my approach:

1. Open image showing the sign.

2. Crop so sign fills the image area.

3. Create object from background.

4. Create New Object.

5. Image> Paper size. Increase height and width by, say, about 50%, to give 
yourself a decent working area.

6. Make a rectangle mask so its height or width matches the image of the 
sign. Adjust to the aspect ratio you judge to be correct.

7. Fill with a strong colour, e.g. Pure Red.

8. Move object with sign to the top of the pile.

9. Set transparency to about 50%.

10. It is now easy to see what you are aiming for with the Distort mode, and 
you can get the right proportions relatively simply, although there is still 
a certain amount of trial and error.

11. Reset transparency to 100%.

12. Flatten (combine objects with background) and crop.

HTH

Regards

Gareth 


Post Reply
about | contact