Skip to main content

BTF Extractor

PyPI version GitHub version Python Versions Code style: black

Extract UBO BTF archive format(UBO2003, ATRIUM, UBO2014).

This repository uses zeroeffects/btf's btf.hh (MIT License).

Extract to ndarray compatible with openCV(BGR, channels-last).

Install

pip install btf-extractor

This package uses the Cython. To install this package, a C++ and OpenMP build environment is required.

Build is tested on

Example

>>> from btf_extractor import Ubo2003, AtriumHdr, Ubo2014

>>> btf = Ubo2003("UBO_CORDUROY256.zip")
>>> angles_list = list(btf.angles_set)
>>> print(angles_list[0])
(0, 0, 0, 0)
>>> image = btf.angles_to_image(*angles_list[0])
>>> print(image.shape)
(256, 256, 3)
>>> print(image.dtype)
uint8

>>> btf = AtriumHdr("CEILING_HDR.zip")
>>> angles_list = list(btf.angles_set)
>>> print(angles_list[0])
(0, 0, 0, 0)
>>> image = btf.angles_to_image(*angles_list[0])
>>> print(image.shape)
(256, 256, 3)
>>> print(image.dtype)
float32

>>> btf = Ubo2014("carpet01_resampled_W400xH400_L151xV151.btf")
>>> print(btf.img_shape)
(400, 400, 3)
>>> angles_list = list(btf.angles_set)
>>> print(angles_list[0])
(60.0, 270.0, 60.0, 135.0)
>>> image = btf.angles_to_image(*angles_list[0])
>>> print(image.shape)
(400, 400, 3)
>>> print(image.dtype)
float32

Supported Datasets

UBO2003

6561 images, 256x256 resolution, 81 view and 81 light directions.

ubo2003

Mirko Sattler, Ralf Sarlette and Reinhard Klein "Efficient and Realistic Visualization of Cloth", EGSR 2003.

ATRIUM (non-HDR and HDR)

6561 images, 800x800 resolution, 81 view and 81 light directions.

atrium

UBO2014

22,801 images, 512x512(400x400) resolution, 151 view and 151 light directions.

ubo2014

Michael Weinmann, Juergen Gall and Reinhard Klein. "Material Classification based on Training Data Synthesized Using a BTF Database", accepted at ECCV 2014.

Release files for btf-extractor 1.7.0

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

Source distribution (sdist)

Source distribution for btf-extractor 1.7.0
File Size Uploaded
btf_extractor-1.7.0.tar.gz 16.7 kB Details

Release files / btf_extractor-1.7.0.tar.gz

Download URL btf_extractor-1.7.0.tar.gz
Size 16.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5d2107344395e82280c384f6bfc8dcd5466f9a25d8a2b9e1cf00afb39af0b38d
BLAKE2b-256 checksum
How to use checksums
77d500f1a2151a63a6fc16a5cbdd1715d95f67ce1f442ccfde2b93d4e1b5c4ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.8 CPython/3.9.7 Darwin/21.1.0

Release history Release notifications | RSS feed

This release

1.7.0 This release

1 release file

1.6.0

5 release files

1.5.0

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.3

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

3 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

4 release files

1.0.0

4 release files

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