A cli tool for image registration using opencv (gocv) feature detection + homography.
imagealign -i ./img/lenna_skewed.jpg -r ./img/lenna.jpg -o ./fixed.png
The most minimal usage of imagealign
requires three parameters:
- the input (skewed image to align)
- the reference (image to align with)
- the output path
imagealign
should support all image mimetypes that opencv supports (but has only been tested with png/jpg):
- Windows bitmap (bmp)
- JPEG (jpeg, jpg, jpe)
- JPEG 2000 (jp2)
- TIFF files (tiff, tif)
- Portable network graphics (png)
- ...and more
Param | Type | Description |
---|---|---|
-i or --input | string | Path to the input image |
-r or --reference | string | Path to the reference image |
-o or --output | string | Path to write the output image to |
-p or --percent | float | Optional percentage of matches to use from opencv feature detection (defaults to 0.7) |
-m or --mask | string | Optional mask path to use for feature detection on the input image |
First ensure opencv is installed (contrib needed for testing). A detailed installation process can be found in the gocv repo.
imagealign
was made using go v1.21, previous versions are untested.
// clone repo
$ git clone https://github.com/Cartermel/imagealign.git --depth 1
$ cd imagealign
$ go install
(reference images located in the ./img directory)
Input | Output |