It is currently Fri Apr 19, 2024 3:06 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to correct tilt shift lens to "normal" lens
PostPosted: Fri Sep 14, 2018 4:09 pm  (#1) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
Hi, this is my first post on this forum. :coolthup

I have a picture that is probably taken with a tilt shift lens. The lines of the building are horribly straight. The result is not nice.
I want to change this to a "normal"-looking foto with obviously curved lines.
I am not allowed to include a picture here because this is my first post.
Anyhow, the perspective tool does not do the job. I need a "anti shift lens tool".
Hopefully I will be able to include a picture in my next post.
:paint


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Fri Sep 14, 2018 4:22 pm  (#2) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
Ah, here it is :yes
Image

Now I changed the foto to this:
Image

It's quite nice and natural looking, but as you can see in the red oval, the square tower is elongated.
So I need a tool to overcome this.
Any ideas?


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Fri Sep 14, 2018 6:48 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
It's not "elongated". You have distorted the whole picture by applying some kind of vertical shear on the left side. Take a horizontal ruler and check whats is at the same level on the left side and the right side of the original picture, then to the same on the "corrected picture".

You can apply the inverse shear, but you'll likely get the initial picture. Your picture is fine, why further correct it?

_________________
Image


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 1:16 am  (#4) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
The tower should have a square base. But now it has a rectangle base.

Also, this building is stretched horizontaly:
Image

This must be due to the original foto being taken with a tilt shift lens. It can not be corrected with the perspective tool. The right side of the corrected picture looks good, but the more to the left the more the foto is stretched.

I may indeed have the horizon not right but that's not the problem and can be corrected easily.


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 2:32 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Mar 28, 2016
Posts: 312
Location: Netherlands
Welcome Nutello,

I see you also posted this question on a Dutch GIMP forum (I'm not a user/poster there):

http://www.dutchgimpers.nl/index.php?topic=2874.0

Better explanation then user "denzjos" gives there, I can't give.

(edit: but I think also that the vanishing lines will scale with manupilating the corners of the image, as you said on the Dutch forum. A nice free and open source program to work with this is:"LibreCAD" . Then it is easy to draw the vanishing lines precise. Now we can test. Seeing is believing :) . The problem is: how to manipulate the corners of the image to get a proper "three point perspective" image again, to get the inverse of the tilt shift.)

If you want to proper change the perspective of something like this, you must know a lot of perspective.

Maybe it is possible with software as "HUGIN" as "denzjos" already wrote to you.

But then still it must be a change with the same original camera position. You can not change the camera position, because then you had to go back in time and ask the photographer to change the position. ;)

If you want another camera position, you have to model this in 3d (Blender of course). Then you can simulate another position. It is called "camera mapping", Blender Guru explains it here:

www.youtube.com Video from : www.youtube.com


Your "problem" is even more complicated:

Quote:
I have a picture that is probably taken with a tilt shift lens. The lines of the building are horribly straight. The result is not nice.


With the tilt shift, the image is now "two point perspective". When something is in "two point perspective", it has not the information of a "three point perspective". With some "difficult" use of "descriptive geometry"(link is German Wikipedia, because there is better explanation), it is sometimes possible to get some more information. But then you must know a ratio of something rectangular on a perspective plane.

(edit2: the problem is to find a nice third vanishing point for the lines that are now vertical and parallel. But also we need to find the principal point of the image to have the ratios look correct within this "three point perspective". Then we can find the third vanishing point. See:
https://www.handprint.com/HP/WCL/perspect4.html
So we must first find this "principal point". Then we can draw a line perpendicular to the "horizon" and through the principal point. On this line your "third vanishing point" must be chosen, so here is some freedom as long as you will keep a proper perspective triangle.
)

Is the big tower square? Maybe then it is possible to find the camera position. I would like to help you to find this position, but then a image with a bigger resolution would be helpful. Do you have this image in bigger resolution?

Another thing here is that one vanishing point is very clear, but the other vanishing point is more difficult to find, because you can only retrieve that information from the right side of the tower.

So again; this isn't easy. :bigthup I wish you succes.


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 6:58 am  (#6) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
I am not allowed to post external links until I have 5 posts.


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 6:58 am  (#7) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
Thank you for your advice Iarga.
I'll read that descriptive geometry story as soon as possible.
Here is the full size foto.


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 7:51 am  (#8) 
Offline
GimpChat Member
User avatar

Joined: Mar 28, 2016
Posts: 312
Location: Netherlands
@Nutello,

That's very nice. Now I have a puzzle to solve :keybdtype . It will take some time. I hope I can find time this week. I will show you what is possible and what isn't possible, if you want the ratios as natural as possible. For me it is important to see the bricks, so I can draw perspective lines. With the original scan, I can, thank you.

But remember: the camera position can't change. If this is made with a tilt shift camera, than an "untilted-unshifted" image could also look strange. I think it isn't possible to find the real original tilt. Did the camera "looked" down or up? How much?

I made 3d models from this kind of images. Therefore I had to know the camera position and view angle and some information about a ratio of a rectangle. But this is something I never tried. So I have to think about how to show this in an easy to understand way. I hope I can find old reference images that are not tilt-shift "corrected".


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 7:56 am  (#9) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
One problem I have with this image is that it looks over-corrected, with the camera slightly pointing downwards. It is also possible that the camera wasn't exactly horizontal and that this was fixed by turning the print paper slightly: the bell tower looks larger at the top and some of its verticals aren't really so (for instance, the right side of the vents).

This said, your image has stretched things horizontally. The question is not how to fix things, but how to avoid the problem in the first place.

What transform(s) did you apply exactly?

_________________
Image


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 2:33 pm  (#10) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
ofnuts wrote:
What transform(s) did you apply exactly?

What I did was:
1. use the perspective tool
Image
2. crop
3. retouch the sky in the right upper corner

iarga wrote:
I hope I can find old reference images that are not tilt-shift "corrected".

I have quite some. I could email those to you.

I believe these doors are still the same. I could measure them. Most of the rest of the building collapsed in Worldwar II.
Image

Edit: Denzjos on the Dutch forum pointed out that Darktable has a shift lens correction.
I used Darktable to make this, not perfect but better than the previous correction.
I also think I have the horizon horizontal now.
Image


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sat Sep 15, 2018 5:09 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
Only a scale operation will keep all the ratios.

_________________
Image


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sun Sep 16, 2018 6:00 am  (#12) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
My guess is that a perspectivistic operation keeps the ratios as well?

I found out that the image I made with Darktable can be reproduced by Gimp's perspective tool.
So the algorithm's are the same :gaah


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sun Sep 16, 2018 3:44 pm  (#13) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
Nutello wrote:
My guess is that a perspectivistic operation keeps the ratios as well?

I found out that the image I made with Darktable can be reproduced by Gimp's perspective tool.
So the algorithm's are the same :gaah


Wrong guess... The perspective doesn't keep the aspect ratios. Try applying it to a square grid. The only things that it keeps (and this is more important) is the straight lines: for instance, a diagonal in the grid remains straight... even though it then goes across non-square tiles.

_________________
Image


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sun Sep 16, 2018 4:29 pm  (#14) 
Offline
GimpChat Member
User avatar

Joined: Mar 28, 2016
Posts: 312
Location: Netherlands
Nutello,

I did some work. But it isn't solved yet..

First, with LibreCAD I found the principal point for this image:

Image

I assume the tower had a square circumference.
The principal point (view point) isn't in the center of your image. So your image is cropped or made with a tilt shift camera or it is tilted in the photo-lab. Maybe a combination of those. But for editing it makes no difference.

here is the image with expanded canvas (no other editing). Now you can see de difference between the center of the image ( blue lines) and the principal point ( yellow lines crossing, the "horizontal" yellow line is the horizon) So the viewpoint/ principal point is almost in the center of the left door/entrance:

Image

The (expanded canvas) image can now be used well for a perspective match, for example in Blender. When modeling the tower, it will now be square shaped, because of the expanded canvas and therefore new center:

Image
Image
Image

(with expanded canvas) Field of view is: 81° / Focal length 18.74mm.

Question: Is the new church tower build on the same place as the old tower? Or is the new tower more to the front?

We can now start thinking about "untilt" and "unshift". When we "untilt", we will make a three points perspective from a two points perspective (complicated). But I want in the new three point perspective image the church tower also have a square outline. In other words: The new three points perspective image must be properly edited and give the same ratios when using this new image in Blender or Sketchup. Maybe other people have good ideas here too? To be continued......


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sun Sep 16, 2018 5:48 pm  (#15) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
Iarga, that is some serious scientific work you do!!

I have a question: in my opinion, when looking to the horizon from a low viewpoint, I look via a horizontal line.
This way, the yellow line can not be the horizon because if it were, the building in the background wouldn't be horizontal.
Image
Looking at the background building, the horizon should be where one of the lines a, b, c and d is perpendicular to the red line (the vertical). So the horizon should be close to where the blue line is.

The new tower is indeed not on the same spot as the old one. It moved some 8 meters or so streetwards.
Thanks for your work :bigthup


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Sun Sep 16, 2018 7:14 pm  (#16) 
Offline
GimpChat Member
User avatar

Joined: Mar 28, 2016
Posts: 312
Location: Netherlands
Nutello,

You are right. Good observation. The perspective lines from those houses don't match de perspective lines from the tower, otherwise that perspective lines would converge to the same horizon.

Logic: two horizons can't be, so the original image has some "warp". Maybe manipulated with ancient photo techniques in darkroom?

The big part of the church, on the right side of the image, has also different perspective lines (not same as tower), but that lines do converge to the same horizon as from the tower.

Maybe that part was a little bit rotated relative to the tower (about 1°-2°)? Because when the perspective lines meet on another place on the horizon, the plane from those perspective lines is not parallel to the plane from the other perspective lines.


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Mon Sep 17, 2018 12:41 am  (#17) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
iarga wrote:
We can now start thinking about "untilt" and "unshift". When we "untilt", we will make a three points perspective from a two points perspective (complicated). But I want in the new three point perspective image the church tower also have a square outline. In other words: The new three points perspective image must be properly edited and give the same ratios when using this new image in Blender or Sketchup. Maybe other people have good ideas here too? To be continued......

AFAIK, and according to Wikepedia the "tilt" in photography doesn't change the perspective, it lets you define a plane of focus which isn't parallel to the film/sensor. In the case at hand, given the depth of field (the wheelbarrow on the left is also in focus) there is likely no tilt at all. The "shift" does not change the perspective either, it is more a way to select the adequate part of the lens projection. This is the same (except for the resulting pixel count) as shooting with a wide angle lens on a strictly horizontal camera (so that you get the whole building without convergent verticals) and then cropping the relevant part.

What would have happened in that shot is that it was taken with a small/medium format (slightly pointing up, so with converging verticals), and then, in the enlarger, copied over a sheet of paper that was slightly sloping to correct this.

_________________
Image


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Mon Sep 17, 2018 3:36 am  (#18) 
Offline
GimpChat Member
User avatar

Joined: Mar 28, 2016
Posts: 312
Location: Netherlands
Nutello,

You are totally right here. You take me on the right track. Thank you. There are no different horizons. I'm doing the whole procedure again. "Your" horizon is the right one. :bigthup

Also Ofnuts tells something important here: tilt and shift don't change perspective.

I will look at the image now as if it is a one point perspective. The nice thing is:

The image is not in a strange way manipulated.

But now the different rotation of the church in relation to the street will be the thing I'm going to investigate. To be continued.... ;)


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Mon Sep 17, 2018 6:36 am  (#19) 
Offline
GimpChat Member

Joined: Sep 14, 2018
Posts: 19
Location: Nederland
ofnuts wrote:
This is the same as shooting with a wide angle lens on a strictly horizontal camera (so that you get the whole building without convergent verticals) and then cropping the relevant part.

I don't think so. Shifting makes convergent lines parallel, which is not the case with that wide angle lens.


Top
 Post subject: Re: How to correct tilt shift lens to "normal" lens
PostPosted: Mon Sep 17, 2018 7:45 am  (#20) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4736
Nutello wrote:
ofnuts wrote:
This is the same as shooting with a wide angle lens on a strictly horizontal camera (so that you get the whole building without convergent verticals) and then cropping the relevant part.

I don't think so. Shifting makes convergent lines parallel, which is not the case with that wide angle lens.

What make the lines parallel is that the plane of your sensor is vertical (which means that the axis of your lens is horizontal, not point up or down). With a wide angle, you scan shoot strictly horizontally and crop out the bottom half. With a shift lens you just don't need to throw away half the pixels (nice schema in the Wikipedia article, next to "Perspective-control lenses").

You can experiment with you smartphone camera. Put a sheet of paper on a flat horizontal surface. Take a shot, trying to keep the edges of the paper parallel to the edge of the screen. When this happens you phone is exactly horizontal.

_________________
Image


Top
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Path copy rotate shift plus + Path copy rotate shift walk Play

79

No new posts Attachment(s) Please Help, I Cannot get the correct value using the color picker.

4

No new posts Gimp - correct one to download for a 32-bit laptop

1

No new posts Attachment(s) Trouble printing the correct size

6

No new posts Attachment(s) Shift-Click lines to curve.

9



* Login  



Powered by phpBB3 © phpBB Group