Skip to main content

Save the document in real world as the file using webcam.

Project description

cam2file

Save the document in real world as the file using webcam.

Installation

% python -m pip install cam2file

Usage

  • Import package
import cam2file as c2f
  • Capture paper
from cam2file import handle_image

path = './result.png'
handle_image(path) # Image will be saved on the path
  • Get the paper frame in the code
from cam2file import capturePaper
import cv2

res = capturePaper() # Return frame of paper image
cv2.imshow('Result', res)
cv2.waitKey()
cv2.destroyAllWindows()

When you call capturePaper(), The webcam will be activated as below:

exampleimg

If the paper is detected, Yellow border indicates it. Press a then it will be captured. The result is transformed as A4 size, so it can be distorted if you capture paper which size is not A4.

capturePaper('x')
capturePaper(ok_key='x') # same as above

If you want to change the confirm key, pass a character as an argument ok_key.

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cam2file-0.0.1.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

cam2file-0.0.1-py3-none-any.whl (4.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page