https://github.com/cuupa/perspective-corrector
A simple document perspective corretion
https://github.com/cuupa/perspective-corrector
image-processing opencv python3
Last synced: about 2 months ago
JSON representation
A simple document perspective corretion
- Host: GitHub
- URL: https://github.com/cuupa/perspective-corrector
- Owner: Cuupa
- License: mit
- Created: 2020-07-06T13:28:29.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-22T13:59:41.000Z (over 4 years ago)
- Last Synced: 2025-06-24T08:01:50.954Z (about 1 year ago)
- Topics: image-processing, opencv, python3
- Language: Python
- Homepage:
- Size: 25.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# perspective_corrector
Perspective correction of documents with OpenCV.
Listens per default at port 5000
## Arguments
-port [portnumber]
## Provides
[GET/POST] /api/status
[POST] /api/image/transform
## Usage
### Spring Rest
final byte[] payload = readFile();
RestTemplate upload = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.set("Content-Type", "multipart/form-data");
headers.set("Accept", "*/*");
MultiValueMap fileMap = new LinkedMultiValueMap<>();
ContentDisposition contentDisposition = ContentDisposition.builder("form-data")
.name("key")
.filename("perspective.png")
.build();
fileMap.add("Content-Disposition", contentDisposition.toString());
fileMap.add("Content-Type", "image/jpeg");
HttpEntity entity = new HttpEntity<>(payload, fileMap);
MultiValueMap body = new LinkedMultiValueMap<>();
body.add("file", entity);
HttpEntity> requestData = new HttpEntity<>(body, headers);
ResponseEntity responseEntity = upload.postForEntity("http://127.0.0.1:5000/api/image/transform", requestData, byte[].class);