{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "auto-reload", "metadata": {}, "outputs": [], "source": [ "%load_ext autoreload\n", "%autoreload 2" ] }, { "cell_type": "markdown", "id": "title", "metadata": {}, "source": [ "# Calibration method comparison\n", "\n", "In this notebook, we compare three calibration approaches on the same dataset:\n", "1. **Raw cv2.calibrateCamera** — vanilla OpenCV with all 14 distortion coefficients, no target warp or outlier filtering\n", "2. **Lensboy OpenCV full 14** — `OpenCVConfig` with all 14 distortion coefficients\n", "3. **Lensboy spline 40x30** — `PinholeSplinedConfig(num_knots_x=40, num_knots_y=30)`" ] }, { "cell_type": "code", "execution_count": 2, "id": "imports", "metadata": {}, "outputs": [], "source": [ "from pathlib import Path\n", "import cv2\n", "import numpy as np\n", "from typing import cast\n", "import imageio.v3 as iio\n", "import mediapy\n", "\n", "import lensboy as lb" ] }, { "cell_type": "markdown", "id": "load-data-md", "metadata": {}, "source": [ "## Load dataset\n", "This is the same image set used in the quickstart notebook - it's from a camera with a wide-angle lens." ] }, { "cell_type": "code", "execution_count": 3, "id": "a7dffcf6", "metadata": {}, "outputs": [ { "data": { "text/html": [ "