As you can see in this image, the horizon and the vertical line of the lamp post are not perpendicular to each other. What causes this type of perspective error?
This will happen if the optical axis is not perfectly parallel to the ground, and the vertical object (in this case, the lamppost) is not centered in the image.
A rectilinear projection exhibits a type of distortion which is especially apparent for very short focal lengths. Even a slight tilting of the optical axis--in this case, upward--causes parallel vertical lines to appear to converge. This is the same phenomenon as taking a photograph of a tall skyscraper from the ground; if the camera is tilted upward, the sides of the building will appear to converge even though they are in fact parallel.
What would be odd is if there were a second lamppost on the left-hand side of the image that was tilted in the same direction, exactly parallel to rather than toward the right-hand lamppost, since that cannot be explained by the optics of the lens. One would conclude in such a case that the lampposts are not actually perpendicular to the horizon.
Yes, there are a variety of tools to correct this perspective, but the exact method depends on what type of software one is using. For example, in Photoshop, you would use the Transform tool. A more sophisticated approach would be to use a panoramic stitching program. You would manually choose control points indicating which lines are supposed to be precisely vertical or horizontal, and the program will determine how to adjust the image accordingly.