Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.79k stars 316 forks source link

Update Documentation for Perspective Tool #6241

Open Lawrence37 opened 3 years ago

Lawrence37 commented 3 years ago

Because I am the author of the camera-based perspective correction, I am providing some key information about this tool so that someone who is qualified can write easy-to-understand documentation and update the lens and geometry section of RawPedia.

Simple vs. camera-based

Simple is the perspective tool prior to 5.9. It is there to provide compatibility with older processing profiles and provide a simple interface.

Camera-based correction considers the image's field of view and offset from the optical center to produce a physically correct perspective correction.

Adjusters

The adjusters are divided into 3 sections according to their purpose.

Correction

Use these to define your image's attributes and correct perspective distortion.

Focal length: Set this to the lens's physical focal length in millimeters. Automatically set from the image metadata if present. Crop factor: Set this to the image's crop factor (the camera crop factor and any additional cropping such as digital zoom). Automatically set from the image metadata if present. This tool really only needs to know the field of view, so the Focal length and Crop factor are for convenience. You can use any equivalent combination of focal length and crop factor. For example, if you only know the 35mm equivalent focal length, use that for Focal length and set Crop factor to 1. Horizontal/Vertical shift: Use these to shift the image until the resulting image's center lines up with the optical center. This is usually not necessary unless you've used the shift function of a tilt-shift lens or are editing an image that has already been post-processed with an off-center crop. Units are in percent of the image width/height. Rotation: Corrects rotation around the optical axis. This is different from the Rotate module because it is applied after the shift (They are effectively the same if Horizontal/Vertical shift are 0). Units are degrees. Horizontal/Vertical: Corrects perspective distortion due to the camera's yaw and pitch relative to the subject. Units are degrees.

Post-correction adjustment

These are used AFTER correcting all perspective distortion.

Horizontal/Vertical Shift: Use these to re-center the image to your liking. Units are percent of the image width/height. Rotation: Rotation that is applied after correction. Units are degrees.

Recovery

These ADD perspective distortion. If no post-correction adjustments are made and only one of horizontal or vertical corrections are made, these can have the same effect as reducing the strength of the horizontal/vertical correction.

An example use-case is making pictures of buildings look more natural. After applying both horizontal and vertical correction, you get unnatural results when reducing the strength of the vertical correction. Instead, use Vertical Recovery.

Automatic

Taken from ART, which in turn was taken from darktable, automatic correction finds likely parallel lines in the image and corrects the perspective automatically. The camera data (focal length, crop factor, and shifts) must be properly set for this to work correctly. There are 3 automatic options:

Control lines

Automatic line detection may not always work properly. In this case, you can manually draw the control lines. There are two types of lines: horizontal and vertical.

Drawing lines

Start by clicking either the perspective correction button on the editor's top toolbar, or clicking the Control lines's Edit button.

Add a new line by holding the ctrl key and clicking. The line will start and end where you clicked. If instead you don't let go of the mouse button, you can drag one of the endpoints and place it where you want. The type of line is automatically set according to the orientation of the line.

Fine-tune the line by click-and-dragging the endpoints or the line itself. Change the line type by clicking the icon in the middle of the line.

Delete a line by right-clicking on it. Delete all lines by clicking the Delete all button.

Exit the line editing mode by doing any of the following: click the perspective correction button, click the Edit button, click the Apply button, right-click the image, or use another on-image tool (graduated filter, local adjustments, straighten, etc.).

Apply

In editing mode, click the Control lines's Apply button or the perspective correction button on the top toolbar to apply correction using the control lines. There are three correction options which behave the same as the automatic options. The correction option is determined by the number of each type of line you have. For vertical correction, you need at least two vertical lines and at most one horizontal line. Horizontal correction is similar. For vertical and horizontal correction, you need at least two of each type of line.

rebio commented 3 years ago

I would volunteer for that. First I got an account on https://discuss.pixls.us/ and went through the annoying bot training, Then I sent a PM to @Thanatomanic with a reuest for a RawPedia Account.

When I came back like 15 minutes later the account was blocked? Deleted? And "New registrations are not allowed from your IP address." Well then... -_-

Thanatomanic commented 3 years ago

Hi @rebio I saw your pm, but it's up to @Beep6581 to give you RawPedia access. I do not have those rights. Not sure why your ip would be blocked...

Beep6581 commented 3 years ago

Great, @Lawrence37 ! I'll add this to RawPedia.

Beep6581 commented 3 years ago

I restructured the Lens/Geometry page and added the new information from @Lawrence37 http://rawpedia.rawtherapee.com/Lens/Geometry

Screenshots and icons can be added later.

Before I close the issue, @Lawrence37 what is the purpose/function of the "Method" combo? http://rawpedia.rawtherapee.com/Lens/Geometry#Method

Lawrence37 commented 3 years ago

@Beep6581 "Method" was introduced by @heckflosse and is explained in #5588.