Skip to main content

Bio-Inspired Texture Descriptor

Project description

BiT

BiT is a novel approach capable of quantifying a complex system of diverse patterns through species diversity and richness, and taxonomic distinctiveness. It considers an image as a species ecosystem and computes species diversity and richness measures, and taxonomic indices to describe the texture. BiT takes advantage of ecological patterns' invariance characteristics to build a permutation, rotation, and translation invariant descriptor. Experiments on different datasets have shown that BiT texture descriptor has advantages over several texture descriptors and deep methods.

More details can be found in our paper available at https://arxiv.org/abs/2102.06997

Installation

Run the following to install:

pip install Bitdesc

Developing BiT

To install BiT, along with the tools you need to develop and run tests, run the following in your virtualenv:

$ pip install -e .[dev]

How to use BiT

After the installation, the library should be used following the example underneath:

import ClassBit
path = './resources/test.png'
bit = ClassBit.BiT(path, bfeat=True, tfeat=True, unsharpfilter=False, crimminsfilter=False, normalization=False)
features = bit.features()

The class BiT accepts the following parameters:

path: the path to the image file
bfeat= biodiversity indices (True, False). It returns 28 features (7 for R, 7 for G, 7 for B, and 7 for RGB)  
tfeat= taxonomic indices (True, False) It returns 28 features (7 for R, 7 for G, 7 for B, and 7 for RGB)
unsharpfilter= applies UnsharpMask onto R, G, B channels (True, False) 
crimminsfilter= applies crimmins filter onto RGB - original image - (True, False) 
normalization= normalize the array (divide the array by its algebraic norm)

Not that at least one type of features should be true, that is, (bfeat=False, tfeat=True) or (bfeat=True, tfeat=False) or (bfeat=True, tfeat=True). It may be recommended to not normalize should you use need to standardize the dataset before training.

BiT features regardless of channels splitting

In case you would like to extract features regardless of channels splitting, please consider the following example:

import Taxonomic as taxo
import Biodiversity as bio
# OR
from Bit import taxonomy, biodiversity, bio_taxo
import cv2
def main() :
    path = 'test.png'
    img = cv2.imread(path)
    img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)  
    # biodiversity returns an array of 7 values - biodiversity indices only   
    bio = biodiversity(img) #bio = bio(img)
    print(bio)    
    # taxonomy returns an array of 7 values - taxonomic indices only
    taxo = taxonomy(img) #taxo = taxonomy(img)
    print(taxo)
    # bio_taxo returns an array of 14 values - concatenation of biodiversity and taxonomic indices 
    bio_tax = bio_taxo(img)
    print(bio_tax)

if __name__ == "__main__" :
    main()

Contributors

Steve Ataky & Alessandro Koerich

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

Bitdesc-0.1.4.tar.gz (11.7 MB view details)

Uploaded Source

File details

Details for the file Bitdesc-0.1.4.tar.gz.

File metadata

  • Download URL: Bitdesc-0.1.4.tar.gz
  • Upload date:
  • Size: 11.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.3

File hashes

Hashes for Bitdesc-0.1.4.tar.gz
Algorithm Hash digest
SHA256 a590eae88c76c8b51517279c0ffb9499c856b6a2c927679e13a869dec5038537
MD5 3891464545bd92fa57e194637998c5c0
BLAKE2b-256 b723c935f999ec4a3febe46a2bb4d8b2f4498102b5f2d737a46a2479adb85be5

See more details on using hashes here.

Supported by

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