https://github.com/pinto0309/simple_fisheye_calibrator
Simple GUI-based correction of fisheye images. The correction parameters specified on the screen can be diverted to opencv's fisheye correction parameters. Supports execution via Docker.
https://github.com/pinto0309/simple_fisheye_calibrator
calibration camera computer-vision cvui docker fisheye gui numpy opencv pillow python
Last synced: about 1 year ago
JSON representation
Simple GUI-based correction of fisheye images. The correction parameters specified on the screen can be diverted to opencv's fisheye correction parameters. Supports execution via Docker.
- Host: GitHub
- URL: https://github.com/pinto0309/simple_fisheye_calibrator
- Owner: PINTO0309
- License: mit
- Created: 2021-06-09T15:26:47.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-12T01:37:16.000Z (about 5 years ago)
- Last Synced: 2025-05-01T02:52:08.528Z (about 1 year ago)
- Topics: calibration, camera, computer-vision, cvui, docker, fisheye, gui, numpy, opencv, pillow, python
- Language: Python
- Homepage:
- Size: 9.48 MB
- Stars: 27
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# simple_fisheye_calibrator
Simple GUI-based correction of fisheye images. The correction parameters specified on the screen can be diverted to opencv's fisheye correction parameters. Supports execution via Docker.
[](https://pypistats.org/packages/simple_fisheye_calibrator)  [](https://pypi.org/project/simple_fisheye_calibrator/)


- Fisheye image before calibration


- (Sample) Fisheye image after calibration

- (Sample) USB Camera: video0 realtime calibration

## 1. Install
### 1-1. Launching with Docker (with USB Camera / HostPC GUI, Docker Image size: 1.4GB)
- simple_capture
```bash
xhost +local: && \
docker run -it --rm \
-v `pwd`:/home/user/workdir \
-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \
--device /dev/video0:/dev/video0:mwr \
--net=host \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e DISPLAY=$DISPLAY \
--privileged \
pinto0309/simple_fisheye_calibrator:0.0.11 \
/bin/bash -c 'sudo simple_capture'
# 1. Capture one test image from the USB camera with "c" on the keyboard
# 2. Exit the capture application with "q" on the keyboard
```
- simple_fisheye_calibrator
```bash
# Still image
xhost +local: && \
docker run -it --rm \
-v `pwd`:/home/user/workdir \
-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \
--device /dev/video0:/dev/video0:mwr \
--net=host \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e DISPLAY=$DISPLAY \
--privileged \
pinto0309/simple_fisheye_calibrator:0.0.11 \
simple_fisheye_calibrator --file_path fisheye_test.jpg
```
or
```bash
# USB Camera: video0
xhost +local: && \
docker run -it --rm \
-v `pwd`:/home/user/workdir \
-v /tmp/.X11-unix/:/tmp/.X11-unix:rw \
--device /dev/video0:/dev/video0:mwr \
--net=host \
-e XDG_RUNTIME_DIR=$XDG_RUNTIME_DIR \
-e DISPLAY=$DISPLAY \
--privileged \
pinto0309/simple_fisheye_calibrator:0.0.11 \
/bin/bash -c 'sudo simple_fisheye_calibrator --file_path 0'
```
### 1-2. Installation on the host PC
```bash
$ pip3 install -U simple_fisheye_calibrator
```
## 2. Usage
```bash
$ simple_capture
# 1. Capture one test image from the USB camera with "c" on the keyboard
# 2. Exit the capture application with "q" on the keyboard
# Still image
$ simple_fisheye_calibrator --file_path xxx.jpg
# USB Camera: video0
$ simple_fisheye_calibrator --file_path 0
```
or
```bash
$ sudo pip3 install cvui Pillow opencv_python numpy --upgrade
$ git clone https://github.com/PINTO0309/simple_fisheye_calibrator.git && \
cd simple_fisheye_calibrator
$ python3 simple_fisheye_calibrator/simple_capture.py
# 1. Capture one test image from the USB camera with "c" on the keyboard
# 2. Exit the capture application with "q" on the keyboard
# USB Camera: video0
$ python3 simple_fisheye_calibrator/simple_fisheye_calibrator.py --file_path 0
```
## 3. Parameter
```
usage:
simple_fisheye_calibrator.py \
[-h] \
[--file_path FILE_PATH] \
[--window_size_width WINDOW_SIZE_WIDTH] \
[--window_size_height WINDOW_SIZE_HEIGHT]
optional arguments:
-h, --help
show this help message and exit
--file_path FILE_PATH
File path of the still image (e.g. xxx.jpg) or device number of the camera (e.g. 0)
--window_size_width WINDOW_SIZE_WIDTH
Default window size width
--window_size_height WINDOW_SIZE_HEIGHT
Default window size height
```