https://github.com/unclechu/crop-detector
Utility that finds cropped image coordinates inside original image
https://github.com/unclechu/crop-detector
crop-image haskell
Last synced: 3 months ago
JSON representation
Utility that finds cropped image coordinates inside original image
- Host: GitHub
- URL: https://github.com/unclechu/crop-detector
- Owner: unclechu
- License: gpl-3.0
- Created: 2016-04-01T10:30:45.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-03T14:48:53.000Z (almost 10 years ago)
- Last Synced: 2024-12-27T22:24:43.869Z (about 1 year ago)
- Topics: crop-image, haskell
- Language: Haskell
- Size: 25.4 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
crop-detector
=============
Utility that finds cropped image coordinates inside original image.
Work in progress...
Usage
-----
```bash
crop-detector DIFF_THRESHOLD ORIGINAL_IMAGE CROPPED_IMAGE
```
Where:
- MODE
- `every-pixel` -
for check every pixel for diff limit
(faster than `average` but needs higher diff threshold);
- `average` -
for check average value of whole crop-size chunk at position on
original image (very slow but better for JPEG artifacts,
recommended to use this mode with `-parallel` suffix);
- Every mode has `perfect-` prefix, by default this app stops when
found first match, but with `perfect-` prefix it checks all
possible coordinates and choose best match, in many cases a lot
slower but gets you some guarantees, possible modes with this prefix:
- `perfect-every-pixel`
- `perfect-average`
- DIFF_THRESHOLD - Max percent of allowed difference (for JPEG artifacts);
- ORIGINAL_IMAGE - Path to whole image;
- CROPPED_IMAGE - Path to image that is cropped part of ORIGINAL_IMAGE.
Example cmd:
```bash
crop-detector every-pixel 20 ~/Pictures/original.jpg ~/Pictures/cropped.jpg
```
Example output: `137 260 201 181`
It's: `x y width height` of cropped image.
Author
------
Viacheslav Lotsmanov
License
-------
[GPLv3](./LICENSE)