Most people, when they notice that their architectural photographs contain buildings that are apparently not vertical, turn to software to correct the perspective.
To illustrate this, here is a building taken with a Canon RF16 16mm lens, with no changes other than resizing.
It is an attractive building from the Jugendstil period, but the picture shows it learning unacceptably backwards, with the top apparently narrower than the base. This is because the camera is pointing upwards at an angle (Note that the vertical centre of the photo is at the level of the second balcony, rather than at the height of the photographer -- 6ft from the ground). The reasons for this are that the street is too narrow to allow me to move any further back, and I have no access to the upper floors of the building behind me, which would allow me to level the camera, while still pointing it at the second balcony
This is what happens when I click on Perspective in DXO PhotoLab 6:
The sides are now more or less parallel; but in achieving this the bottoms of the sides of the building have been moved inwards, and the resultant black triangles need to be cropped away, after which we are left with this:
The resullt is not very good, because I had to leave a black triangle at the bottom right in order to include the right hand edge of the building. Clearly a wider angle lens is required. This would leave more "spare image" on the edges to be cropped away after "fixing" the perspective. It should, however, be noted that moving pixels around in this way can easily have an effect on the clarity of the photo.
I had a go with a wider lens, this time a Laowa 12mm, standing in pretty much the same spot. Here is the result out of the camera:
With perspective correction:
Cropped:
The result is a little more natural, and I might make a few adjustments; but finally I prefer this view, taken at an angle with the 15mm lens:
In sum, a situation in which a lack of space in the street makes a satisfactory photo, with right angles where they should be, pretty impossible by means of software correction.
This is an extreme case, and a really good photo can probably only be taken from an upper floor of the building on my side of the street. (Even so, it is probably a lost cause because the view of the umbrella awnings would be from above!)
I used PhotoLab for this demonstration because this is what I have, but other software, like Photoshop, would give the same result.
There are cameras, like the Leica Q3, that can do the perspective correction in the camera, but they also have to crop the view.
David