Calibration measures moves right on thin negatives, and sizes frames from the film's height #35

Merged
eliott merged 2 commits from fix/calibration-on-thin-negatives into main 2026-11-20 16:28:00 +01:00
Owner

On a thin negative, calibration could measure the film's move at half its real length: it then saved about 0.74 px a motor step instead of 0.51, and looked for frames wider than the picture (1148 px in a 1024 px live view), so no frame was found. Calibration now measures the move right on thin negatives, and sizes frames from the film's height in the picture.

How it works

  • measure_shift compares the two live-view profiles by correlation over the columns they share, only at shifts where they share at least half. The plain sum of products it used before favoured small shifts and read 71 px for a move of 142 on a thin negative.
  • Frame and gap widths come from the film's height whenever it is measured, not only when it agrees with the motor's scale. When the two are more than 10% apart, the calibration is still saved, and a warning in the log says so (film slipped, or the pressure frame's window isn't as tall as a frame).
  • The Python reference (reference/film_scanner/detect.py) and the shift figure in docs/frame-detection.md follow.
  • Version bumped to 0.6.1.

Tested

  • cargo test: 298 passed, including a regression test on four live-view profiles recorded from a thin negative on the real scanner (src/testing/thin-negative-profiles.txt).
  • pnpm build in site/: passes.

Not tested

  • A full calibration and scan after the fix, run here on the scanner. The maintainer ran the scanner; an issue seen there turned out to be the camera's settings, not this change.
  • Windows and macOS.

Changes in behaviour

  • When the film's height and the motor's scale disagree by more than 10%, frames are now looked for at the width the height gives (before: the motor's), and the log shows a warning.
  • A calibration saved on a thin negative with an earlier version may have the wrong scale: calibrate again.
On a thin negative, calibration could measure the film's move at half its real length: it then saved about 0.74 px a motor step instead of 0.51, and looked for frames wider than the picture (1148 px in a 1024 px live view), so no frame was found. Calibration now measures the move right on thin negatives, and sizes frames from the film's height in the picture. ## How it works - `measure_shift` compares the two live-view profiles by correlation over the columns they share, only at shifts where they share at least half. The plain sum of products it used before favoured small shifts and read 71 px for a move of 142 on a thin negative. - Frame and gap widths come from the film's height whenever it is measured, not only when it agrees with the motor's scale. When the two are more than 10% apart, the calibration is still saved, and a warning in the log says so (film slipped, or the pressure frame's window isn't as tall as a frame). - The Python reference (`reference/film_scanner/detect.py`) and the shift figure in `docs/frame-detection.md` follow. - Version bumped to 0.6.1. ## Tested - `cargo test`: 298 passed, including a regression test on four live-view profiles recorded from a thin negative on the real scanner (`src/testing/thin-negative-profiles.txt`). - `pnpm build` in `site/`: passes. ## Not tested - A full calibration and scan after the fix, run here on the scanner. The maintainer ran the scanner; an issue seen there turned out to be the camera's settings, not this change. - Windows and macOS. ## Changes in behaviour - When the film's height and the motor's scale disagree by more than 10%, frames are now looked for at the width the height gives (before: the motor's), and the log shows a warning. - A calibration saved on a thin negative with an earlier version may have the wrong scale: calibrate again.
- measure_shift compares the two profiles by correlation over the columns they share, at lags
  sharing at least half: the plain sum of products favoured small lags, and on a thin negative
  read 71 px for a move of 142 (calibration then said 0.74 px a step for 0.51, and frames
  1148 px wide in a 1024 px picture). Regression test on four real live-view profiles.
- Frame and gap widths come from the film's height whenever it is measured; when the motor's
  scale is more than 10% off, the calibration is saved with a warning in the log.
- The Python reference and the docs' shift figure follow.
chore(release): 0.6.1
All checks were successful
website / build (pull_request) Successful in 43s
b89665cd44
eliott merged commit 7d7dc271ac into main 2026-11-20 16:28:00 +01:00
eliott deleted branch fix/calibration-on-thin-negatives 2026-11-20 16:28:00 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
RollNote/rollscan!35
No description provided.