Skip to main content

bilde

(B)uffer (I)maging (L)ibrary, (D)irty and (E)xtendable

Python extention (pybilde)

Use in python:

Label Connected Components of a torch tensor

import pybilde
import torch
from matplotlib import pyplot as plt
bw_img = (torch.rand(1000, 1000) > .8).to(torch.uint8)
l_img, n_components = pybilde.label_connected_components(bw_img)
plt.imshow(l_img, cmap='nipy_spectral'))
plt.show()

Install from sdist

  • You will need a C++17 compiler
  • Probably a Unix environment (eg ubuntu 24.04)
  • If pytorch is installed in the current enironment, the module will build the ptbilde submodule otherwise, only the numpy submodule (npbilde) will be built.
pip install bilde

Building binaries:

  • Install build dependencies
pip install cibuildwheel
  • Build bdist without a CI
CIBW_BUILD="cp313t-manylinux_x86_64 cp313t-manylinux_x86_64 cp312-manylinux_x86_64 cp311-manylinux_x86_64 cp310-manylinux_x86_64 cp39-manylinux_x86_64 cp38-manylinux_x86_64 cp37-manylinux_x86_64 cp36-manylinux_x86_64" CIBW_BEFORE_BUILD="yum install -y boost-devel" cibuildwheel --platform linux --output-dir wheelhouse
CIBW_SKIP="pp310-manylinux_i686 pp39-manylinux_i686 pp38-manylinux_i686 pp37-manylinux_i686 pp36-manylinux_i686 pp310-manylinux_x86_64  pp39-manylinux_x86_64 pp38-manylinux_x86_64  pp37-manylinux_x86_64 pp36-manylinux_x86_64" CIBW_BEFORE_BUILD="yum install -y boost-devel" cibuildwheel --platform linux --output-dir wheelhouse

C++ library

A library for writing procedural computer vision code in C++

  • Header only No linking complications! Just copy it in your source tree.

  • High C++ template use

  • Define algorithms once, use them directly on several back-ends. With a mechanism based on implicit template instantiation, an algorithm is defined as a single function, and will seemlesly run several image containers such as cv::Mat, IplImage, octave arrays, numpy arrays.

Python module

LBP feature extraction

import pybilde
import skimage
img = skimage.data.coins()
histogram = pybilde.lbp_features(img, 8, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12])

Connected compoent labeling

import pybilde
import skimage
img = skimage.data.coins()
cc_img, nb_components = pybilde.label_connected_components(img>.5)

Demos:

  • SRS-LBP feature extractor:

Cross compiling for win32 (static build) and running in debian based linux.

Install dependencies:

sudo apt-get install autoconf automake autopoint bash bison bzip2 flex gettext git g++ gperf intltool libffi-dev libgdk-pixbuf2.0-dev libtool-bin libltdl-dev libssl-dev libxml-parser-perl make openssl p7zip-full patch perl pkg-config python ruby scons sed unzip wget xz-utils g++-multilib libc6-dev-i386
export MXE_ROOT="$HOME/tools/mxe"
mkdir -p "$HOME/tools"
cd "$HOME/tools"
git clone https://github.com/mxe/mxe.git
cd mxe
make opencv boost

Compile:

./compile_static_mxe.sh ./src/lbpFeatures2.cc /tmp/lbp_features2.exe

Get help:

wine /tmp/lbp_features2.exe

Run:

wine /tmp/lbp_features2.exe -i ./sample_data/PICT2466.png > /tmp/features.csv

Compiling in ubuntu:

sudo apt-get install libopencv-dev libhighgui-dev libprotobuf-dev libwebp-dev #  depending on your system you might need other packages
cd src
make lbpFeatures2

Metadata

Release files for bilde 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bilde 0.2.4
File Size Uploaded Provenance
bilde-0.2.4.tar.gz 65.2 kB Without provenance Details

Release files / bilde-0.2.4.tar.gz

Download URL bilde-0.2.4.tar.gz
Size 65.2 kB
Tags Source
SHA-256 checksum
How to use checksums
bd87d6400771709a75c94582d71c35b5c23f1627e434bab287eb5f567b4c4494
BLAKE2b-256 checksum
How to use checksums
e62269d201b3050b6c0b411d2e60fe74e943af02cf1d5d26b2529ea6233ad4f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.11

Security for bilde 0.2.4

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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page