Metadata-Version: 2.1
Name: cardscan
Version: 0.4.0
Summary: OpenCV python pipeline to finds black bordered frame in an image. Fix the perspective, crop and rotate.
License: MIT
Author: Félix JULLIEN
Author-email: jullienfelix@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: numpy (>=1.25.2,<2.0.0)
Requires-Dist: opencv-python (>=4.8.0.76,<5.0.0.0)
Description-Content-Type: text/markdown

# 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

![cardscan output example](examples/cardscan_example.png)

## 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
```


