Graph calibration: four-point homography
← Curve Digitizer: digitize curves from old datasheets
3. Image display, zoom, pan and coordinates
Opening an image
File → Open image… offers PNG, JPG/JPEG and TIF/TIFF files. The image is loaded into memory and its absolute path and pixel dimensions are recorded in the project.
If the current project is marked as modified, the program asks whether it should be saved before a new image replaces it.
Automatic fit
After loading, the image is automatically fitted to the available Canvas. View → Fit image to window or the F key repeats this operation at any time.
Zoom
The mouse wheel zooms around the pointer position, keeping the same source-image pixel under the cursor. This makes it easier to approach a curve without losing the area of interest.
The internal display scale is limited to approximately 0.01× through 50×. Each wheel step applies a factor of about 1.15.
Pan
Pan by dragging with either:
- the middle mouse button; or
- the right mouse button.
Zoom and pan affect only the Canvas view. They do not alter the scientific project data, digitized points or source image and are not part of undo/redo history.
Visible-area rendering
The Canvas crops and resizes only the visible part of the source image. This reduces rendering work during zoom and pan and is particularly useful when the GUI is displayed through X11 forwarding.
Pixel coordinates
When the pointer is over the image, the status bar displays values such as:
Pixel X,Y: 742.318, 518.206
These are source-image coordinates, not Tk window coordinates. Zooming and panning therefore do not change the pixel coordinate associated with a location in the image.
Calibrated coordinates
After valid calibration, the status bar also shows physical values, for example:
Pixel X,Y: 742.318, 518.206
Plate Voltage: 201.4 V
Plate Current: 30.2 mA
Mode: add
Click precision
Manual click coordinates are stored as floating-point source-image positions. They do not have to be rounded to integer pixels. The optional snap algorithm, on the other hand, chooses an integer pixel from the grayscale image.
Practical advice
Use Fit to orient yourself, then zoom until the plotted line thickness is clearly visible before acquiring or correcting points. Very high zoom does not create additional information; it only makes it easier to place the cursor relative to the existing pixels.
4. Four-point calibration and homography
Purpose
Calibration converts source-image pixel coordinates into the physical values shown on the graph axes. Curve Digitizer uses four plot-area corners and a projective transformation, or homography.
This is more robust than a simple independent X/Y scale when an old scan is slightly rotated or has moderate perspective distortion.
The four points
Select the corners of the graph’s data rectangle, not the physical page corners:
- bottom-left;
- bottom-right;
- top-left;
- top-right.
The Canvas displays these calibration points as cyan BL, BR, TL and TR markers.
Axis configuration
In the Calibration tab, each axis has:
- Name;
- Unit;
- Min;
- Max;
- Scale:
linearorlog.
Press Apply axis settings after making changes. Existing digitized points are recalculated using the new axis configuration while their stored pixels remain unchanged.
Linear axes
value = minimum + t × (maximum - minimum)
Logarithmic axes
log10(value) =
log10(minimum)
+ t × [log10(maximum) - log10(minimum)]
A logarithmic axis requires strictly positive limits. For example, 1 Hz…1 MHz is valid; 0…1 MHz is not.
Projective transform
The four selected corners are mapped to normalized coordinates:
bottom-left → (0, 0)
bottom-right → (1, 0)
top-left → (0, 1)
top-right → (1, 1)
The homography computes:
u = (h11·x + h12·y + h13) / (h31·x + h32·y + 1)
v = (h21·x + h22·y + h23) / (h31·x + h32·y + 1)
x,y are source-image pixels and u,v are normalized graph coordinates. The selected linear or logarithmic axis mapping then converts them into physical X and Y values.
Recommended sequence
- Enter axis names, units, limits and scales.
- Press Apply axis settings.
- Zoom into the bottom-left data-area corner.
- Press 1. Capture bottom-left and click the point.
- Repeat for bottom-right, top-left and top-right.
- Inspect the calibration status.
- Verify one or more known grid intersections.
Clear calibration
Clear calibration removes the four calibration points. Curve-series points are not deleted: their source pixels remain stored, while calibrated values become unavailable until a new valid calibration is established.
5. Calibration verification and accuracy
Why verification matters
A mathematically valid homography does not prove that the operator clicked the corners accurately or that the scan is perfectly projective. After calibration, verify known grid intersections whenever possible.
Verify calibration
- Complete the four-point calibration.
- Optionally enter Expected X and Expected Y.
- Press Verify calibration: click point.
- Click a known grid intersection.
The program displays the selected pixel and calculated X/Y values. If expected values were entered, it also reports:
ΔX = calculated X - expected X
ΔY = calculated Y - expected Y
Example
Expected X: 200
Expected Y: 30
A result could look like:
Pixel: 742.318, 518.206
Calculated X: 200.7 V
Calculated Y: 29.8 mA
ΔX: 0.7 V
ΔY: -0.2 mA
Corner RMS residual
After the fourth corner, the panel shows Corner RMS residual. Because exactly four point correspondences define the homography, this residual normally approaches floating-point zero. It should not be treated as a direct measure of real accuracy across the whole scan.
Matrix condition
Matrix condition is the condition number of the linear system used to solve the homography. Very large values may indicate an unfavorable or nearly degenerate point geometry. It is a numerical diagnostic, not an error expressed in volts, amperes or other graph units.
Best practical verification
Check several known grid intersections distributed across the data rectangle: near the center, on both left and right sides, and in both lower and upper regions. Spatially systematic errors may indicate a non-projective page deformation such as paper curvature or local scan distortion.
Improving calibration
- click plot-area corners, not text or tick-label endpoints;
- zoom before clicking;
- use clearly defined grid intersections;
- repeat the four corners when one is ambiguous;
- note that local snap is applied to curve points, not to the four calibration corners.
Model limitation
A single homography corrects planar projective distortion such as rotation and moderate perspective. It cannot correct arbitrary local warping. A strongly curved or distorted page should ideally be re-rendered or rescanned before digitization while keeping the archival original separate.