Home
← Gradient

Gradient

Calibration and cropping

  • 95%crop success
  • 0.2sinference
Two cameras on a truss mount imaging a scanner bed marked with AprilTags
Two cameras on the truss, the scanner bed as the reference frame.

This is a calibration system I designed to align two Sony A7R IV cameras to the scanner reference frame. A homography transformation generates a matrix between the scanner and camera images, and sets the AprilTag constellation in place at that time. Any movement after that is corrected via AprilTag pose.

Checkerboard target viewed through the calibration tool
The checkerboard used for calibrating lens intrinsics.

This ended up being the backend to a more complex system: the classical vision cropper. I used a cv2 CLAHE to emphasize edges, then ran Hough lines at different settings and kept the top K highest-signal lines. I paired edges on parallelness and aspect ratio and picked the ones that formed the most perfect rectangle possible. That got me 95% accurate crops, until another engineer surpassed it with an extremely good segmentation model.

Screen showing detected line overlays on a card
Me analyzing line outputs to figure out why it wasn't working.

I also wrote a container to control the cameras, with gphoto2 as the backend. It ran a state machine per camera and surfaced an API for the machine to acquire images.

← Back to Gradient