https://github.com/zecat/cardscan
Extract black bordered frame in an image, adjust perspective, crop and rotate.
https://github.com/zecat/cardscan
card image-processing opencv-python perspective-transformation scanner sheet
Last synced: over 1 year ago
JSON representation
Extract black bordered frame in an image, adjust perspective, crop and rotate.
- Host: GitHub
- URL: https://github.com/zecat/cardscan
- Owner: Zecat
- Created: 2023-09-07T09:38:04.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-20T09:01:29.000Z (over 2 years ago)
- Last Synced: 2025-01-22T22:45:15.788Z (over 1 year ago)
- Topics: card, image-processing, opencv-python, perspective-transformation, scanner, sheet
- Language: Python
- Homepage:
- Size: 315 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cardscan
OpenCV python pipeline to extract black bordered frame in an image. Post process the image, find and filter contours, fix the perspective, crop and rotate. No machine learning involved.
> Experimental stage project

## Install
``` python
pip install cardscan
```
## Usage
``` python
import cv2
from cardscan import scan
img = cv2.imread('path_to_your_image.jpg')
img_result_array = scan(img)
```
More examples [here](examples/)
## Dev
install poetry
``` sh
pip install poetry
```
install dependencies
``` sh
# cd at the project root
poetry install
```
run one of the pipeline visualization app
``` sh
poetry run python -m examples.cam_draw_pip
poetry run python -m examples.cam_use_pipeline
poetry run python -m examples.cam_visual_pipeline
poetry run python -m examples.cam_visual_contours
poetry run python -m examples.cam_simple
poetry run python -m examples.from_file
```