### Install Perspectra from source Source: https://github.com/ad-si/perspectra/blob/main/readme.md Steps to clone the repository and install the package from source. ```sh git clone https://github.com/ad-si/Perspectra cd Perspectra make install ``` -------------------------------- ### Install Perspectra via uv Source: https://github.com/ad-si/perspectra/blob/main/readme.md Recommended method for installing the package using uv. ```sh uv tool install perspectra ``` -------------------------------- ### Perspectra CLI help Source: https://github.com/ad-si/perspectra/blob/main/readme.md Displays the available subcommands and options for the perspectra command. ```txt usage: perspectra [-h] [--debug] {binarize,correct,corners,renumber-pages} ... options: -h, --help show this help message and exit --debug Render debugging view subcommands: subcommands to handle files and correct photos {binarize,correct,corners,renumber-pages} additional help binarize Binarize image correct Pespectively correct and crop photos of documents. corners Returns the corners of the document in the image as [top-left, top-right, bottom-right, bottom-left] renumber-pages Renames the images in a directory according to their page numbers. The assumed layout is `cover -> odd pages -> even pages reversed` ``` -------------------------------- ### Generate images from video (TODO) Source: https://github.com/ad-si/perspectra/blob/main/readme.md Planned command for direct image generation from video using PySceneDetect. ```fish docker run \ --rm \ --volume (pwd):/video \ handflucht/pyscenedetect \ --input /video/page-turning.mp4 \ --downscale-factor 2 \ --detector content \ --threshold 3 \ --min-scene-length 80 \ --save-images ``` -------------------------------- ### Camera settings configuration Source: https://github.com/ad-si/perspectra/blob/main/readme.md Recommended camera settings for document photography to ensure readability and sharpness. ```yaml # Rule of thumb is the inverse of your focal length, # but motion blur is pretty much the worst for readable documents, # therefore use at least half of it and never less than 1/50. shutter: 1/50 - 1/200 s # The whole document must be sharp even if you photograph it from an angle. # Therefore at least 8 f. aperture: 8-12 f # Noise is less bad than motion blur => relative high ISO # Should be the last thing you set: # As high as necessary as low as possible iso: 800-6400 ``` -------------------------------- ### Run scene detection in shell Source: https://github.com/ad-si/perspectra/blob/main/readme.md Execute the scenedetect command inside the container to save images from a video. ```bash cd /video scenedetect \ --input page-turning.mp4 \ --downscale-factor 2 \ --detector content \ --threshold 3 \ --min-scene-length 80 \ --save-images ``` -------------------------------- ### Generate PySceneDetect stats Source: https://github.com/ad-si/perspectra/blob/main/readme.md Run the PySceneDetect docker container to generate a statistics file for a video. ```fish docker run \ --rm \ --volume (pwd):/video \ handflucht/pyscenedetect --input /video/page-turning.mp4 \ --downscale-factor 2 \ --detector content \ --statsfile page-turning-stats.csv ``` -------------------------------- ### Launch PySceneDetect interactive shell Source: https://github.com/ad-si/perspectra/blob/main/readme.md Launch the PySceneDetect container in interactive mode to run commands manually. ```sh docker run \ --interactive \ --tty \ --volume=(pwd):/video \ --entrypoint=bash \ handflucht/pyscenedetect ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.