Fisheye de-warping and rectilinear perspective correction tool for doorbell and wide-angle cameras.
unRing transforms curved, distorted fisheye images into natural, straight-line rectilinear views using spherical Three.js projection in the browser and OpenCV mathematical remapping in Python.
- Dual Editions:
- Web Application: Interactive Three.js WebGL viewport with real-time slider feedback, 3-point alignment lines, auto-FOV optimization, drag-to-look, and client-side PNG sequence export.
- Python Edition (
py_unring): Command-line interface (unring_cli.py) and PyQt6 desktop application (unring_gui.py) powered by OpenCV and NumPy.
- Image & Image-Sequence Support: Accepts single photos or numbered image sequences (
.jpg,.png,.webp,.gif,.bmp,.tiff). - Lens Calibration: Full control over Source FOV, Virtual Zoom (Camera FOV), Tilt, Pitch, and Roll.
- 3-Point Straightening Tool & Auto-Optimization: Place curved reference lines along curved structures (doorframes, pillars, walls) to calculate deviation and automatically optimize the Source FOV.
- Settings Import & Export: Save calibration profiles to JSON files and reload them across sessions.
- Lossless PNG Export: Export individual high-resolution stills or batch-export numbered image sequences (
unring-0001.png,unring-0002.png, etc.).
The web application runs locally in any modern desktop browser supporting WebGL (with software rendering fallback).
- Node.js (version 18 or newer recommended)
npm(packaged with Node.js)
- Clone or download the repository:
git clone https://github.com/NetherlandsForensicInstitute/unRing.git cd unRing - Install dependencies:
npm install
- Start the local development server:
npm run dev
- Open the displayed local URL (typically
http://localhost:5173) in your web browser.
To build optimized static assets:
npm run build
npm run previewThe Python edition provides both a PyQt6 GUI and a scriptable CLI for batch de-warping.
- Python 3.10 or newer
pip
- Navigate to the project root and create a virtual environment:
cd unRing python -m venv .venv - Activate the virtual environment:
- Windows (Command Prompt / PowerShell):
.venv\Scripts\activate
- macOS / Linux:
source .venv/bin/activate
- Windows (Command Prompt / PowerShell):
- Install required packages:
pip install -r py_unring/requirements.txt
- Single Image: Drag and drop any image file (
.jpg,.jpeg,.png,.webp,.gif,.bmp,.tiff) onto the viewport, or click Open File in the top navigation bar. - Image Sequence: Drag and drop multiple numbered frames together, or click Open File and select multiple files. unRing automatically sorts frames using natural numeric ordering.
- Pan / Tilt / Pitch: Left-click and drag anywhere on the main viewport to reorient the camera view.
- Zoom: Scroll your mouse wheel up or down over the viewport to zoom in or out.
- Touch: Drag on touch-enabled screens to pan the view.
Located in the right sidebar:
- Image & EXIF Information (
iicon): Positioned at the top right above Source FOV. Displays image resolution, format, file size, aspect ratio, and extracted camera/lens EXIF parameters (Make, Model, Lens, Focal Length, 35mm equivalent, Sensor Dimensions). If lens metadata is present, it automatically calculates the Source FOV and applies it to the parameters. - Source FOV: Sets the field-of-view of the input fisheye or camera lens (adjustable from 10° up to 240°, automatically populated from EXIF when available).
- Virtual Zoom (FOV): Controls the perspective zoom of the corrected view (20° to 120°).
- Tilt: Horizontal camera rotation angle (-45° to +45°).
- Pitch: Vertical camera elevation angle (-45° to +45°).
- Roll: Rotational horizon leveling angle (-45° to +45°).
- Step (
-/+) & Reset (↶): Every slider includes fine-stepping buttons and a reset icon to restore default values.
- In the sidebar under Overlay Tools, click Add 3-Point Line.
- Click three points on the viewport along a physical feature that should be straight (e.g., a vertical doorframe, pillar, or brick line).
- The overlay displays the curvature deviation percentage:
- Green line with
Straight: within 1% straightness tolerance. - Orange line with deviation percentage: indicates residual lens distortion.
- Green line with
- Add 2 or more reference lines across different regions of the frame.
- Click Optimize Source FOV to automatically solve for the lens field-of-view that minimizes curvature across all lines.
- Use the transport bar at the bottom of the viewport:
- Play / Pause: Click
▶/⏸or press the Spacebar. - Seek Bar: Drag the slider to jump between frames.
- Frame Indicator: Displays current frame number and total count.
- Play / Pause: Click
- Export Image (PNG): Click to download a corrected, full-resolution PNG of the active frame.
- Export Image Sequence: Click to batch-render and download numbered PNGs (
unring-0001.png,unring-0002.png, etc.) for every frame in the sequence. - Export Settings: Saves your current calibration settings (FOV, Zoom, Tilt, Pitch, Roll) as a
.jsonfile. - Import Settings: Click in the header to restore a saved
.jsonprofile.
Launch the PyQt6 interface:
python py_unring/unring_gui.py- Open files using the Open Image(s) button.
- Adjust sliders in real time for FOV, Zoom, Tilt, Pitch, and Balance.
- Click Export Image or Export Sequence to save results.
Process images or sequences non-interactively:
# Correct a single image
python -m py_unring.unring_cli path/to/frame.jpg -o corrected.png --fov 180
# Correct an image directory / sequence
python -m py_unring.unring_cli path/to/frames/ -o path/to/output_dir/ --fov 175 --balance 0.0
# Preview the first frame correction in an OpenCV window
python -m py_unring.unring_cli path/to/frame.jpg --preview --fov 180CLI options:
input: One or more image file paths or a directory of images.-o,--output: Output file path (single image) or output folder (sequence).--fov: Lens field of view in degrees (default:180.0).--balance: Border balance between0.0(cropped, no black borders) and1.0(full uncropped frame).--preview: Display a side-by-side comparison window before exiting.
Press ? or H in the web application (or click Help & Shortcuts in the top navigation bar) to open the interactive help dialog.
| Shortcut / Action | Description |
|---|---|
| Space | Play / Pause sequence playback |
| ? or H | Open / Close the Help & Shortcuts modal |
| Esc | Close Help modal / Cancel 3-Point Line placement / Deselect tool |
Left Click + Drag |
Pan camera orientation (Tilt & Pitch) |
Mouse Wheel |
Zoom in / Zoom out (Virtual Zoom FOV) |
Drag Line Handles |
Reposition 3-point calibration markers |
There are no rights that can be claimed about the output.
All processed output, images, sequences, and visual corrections produced by unRing are for illustrative purposes only.
The software applies optical projection models and mathematical remapping algorithms. Results are approximations intended for visualization and should not be treated as certified or forensic evidence. The software is provided "as is", without warranty of any kind, express or implied.
All output is for illustrative purposes only. Refer to the Disclaimer above.