PyBoof is Python wrapper for the computer vision library BoofCV. Since this is a Java library you will need to have java and javac installed. The former is the Java compiler. In the future the requirement for javac will be removed since a pre-compiled version of the Java code will be made available and automatically downloaded. Installing the Java JDK is platform specific, so a quick search online should tell you how to do it.
To start using the library simply install the latest stable version using pip
pip3 install pyboof
Examples
Examples are included with the source code. You can obtain them by either checkout the source code, as described above, or browsing github here. If you don't check out the source code you won't have example data and not all of the examples will work.
To run any of the examples simply invoke python on the script
- cd PyBoof/examples
- python example_blur_image.py
Code for applying a Gaussian and mean spatial filter to an image and displays the results.
import numpy as np
import pyboof as pb
original = pb.load_single_band('../data/example/outdoors01.jpg', np.uint8)
gaussian = original.createSameShape() # useful function which creates a new image of the
mean = original.createSameShape() # same type and shape as the original
# Apply different types of blur to the image
pb.blur_gaussian(original, gaussian, radius=3)
pb.blur_mean(original, mean, radius=3)
# display the results in a single window as a list
image_list = [(original, "original"), (gaussian, "gaussian"), (mean, "mean")]
pb.swing.show_list(image_list, title="Outputs")
input("Press any key to exit")
Installing From Source
One advantage for checking out the source code and installing from source is that you also get all the example code and the example datasets.
git clone --recursive https://github.com/lessthanoptimal/PyBoof.git
If you forgot --recursive then you can checkout the data directory with the following command.
git submodule update --init --recursive
After you have the source code on your local machine you can install it and its dependencies with the following commands:
- cd PyBoof
- python3 -m venv venv
- source venv/bin/activate
- pip3 install -r requirements.txt
- ./setup.py build
- ./setup.py install
Yes you do need to do the build first. This will automatically build the Java jar and put it into the correct place. Creating a virtual environment isn't required but recommended as you can only do so much damage with it.
Supported Platforms
The code has been developed and tested on Ubuntu Linux 20.04. Should work on any other Linux variant. Might work on Mac OS and a slim chance of working on Windows.
Dependencies
PyBoof depends on the following python packages. They should be automatically installed
- py4j
- numpy
- transforms3d
- opencv (optional and for IO only)
Optional
- opencv_python (for IO only)
Metadata
Release files for PyBoof 0.43.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| PyBoof-0.43.1.tar.gz | 22.5 MB | Without provenance | Details for PyBoof-0.43.1.tar.gz |
Release files / PyBoof-0.43.1.tar.gz
| Download URL | PyBoof-0.43.1.tar.gz |
|---|---|
| Size | 22.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9e4742882cf97acb604c9e10357bd909c1ab4e030b557cf86bc75af5e6a0fdf
|
|
BLAKE2b-256 checksum How to use checksums |
07740715289421bde8dc86c18a698eeed19a319a7a778c6843493ea7e481c9ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.30.0 CPython/3.8.10
|
Security for PyBoof 0.43.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.