Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Vision features of generalistic use

Project description

UIB - V Features


UIB - V Features provide a set of useful features. With three types of features: morphological, texture and color. All the features can be used with mask or with the contours. Every feature is a numerical value that used in ML can improve their results.

The morphological features are all grouped in one iterator, so you can calculate all the features inside a loop easily.

The library use mask and contours. Masks are two value image, where the object has a value diferent than the rest of the image. A contour is a 2D vector of points that define a contour. To calculate a contour normally is used the OpenCV function.


Install the library is very simple with pip

pip install uib-vfeatures

List of features


All this features are in the iterator
  • Solidity
  • Convex hull perimeter
  • Convex hull area
  • Bounding box area
  • Rectangularity
  • Minor radius
  • Maximum radius
  • Feret
  • Breadh
  • Circularity
  • Roundness
  • Feret Angle
  • Eccenctricity
  • Center
  • Sphericity
  • Aspect Ratio
  • Area equivalent diameter
  • Perimeter equivalent diameter
  • Equivalent elipse area
  • Compactness
  • Area
  • Convexity
  • Shape
  • Perimeter


  • Mean of the LAB channels
  • Mean of the RGB channels
  • Mean of the HSV channels
  • Standard deviation of the LAB channels
  • Standard deviation of the RGB channels
  • Standard deviation of the HSV channels


The texture features depends on the parameter of a unique function. The first two parameter define the texture, with the distance and the angle of the texture. The third defines the feature to extract and the last one is a grey-scale image.

Texture features

  • Contrast
  • Dissimilarity
  • Homogeneity
  • ASN
  • Energy
  • Correlation


We're going to use our library with a mask image .

from uib_vfeatures.masks import Masks
from uib_vfeatures import Features_mask as ftrs
import cv2

First of all we read the image from a file, then we try our features with visualizations. We only have three features with visualization: the bounding box area, the eccentricity and the solidity.

mask = cv2.imread("mask.jpg")

Masks.bounding_box_area(mask, True)

Masks.eccentricity(mask, True)
Masks.solidity(mask, True)


You can use an iterator and implement every morpholical feature.

features = {}

for key, func in features.items():
    features[key] = func(mask)

As a result we had a dicctionary of the form {'Feature_name': value}

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for uib-vfeatures, version 0.6.1
Filename, size File type Python version Upload date Hashes
Filename, size uib_vfeatures-0.6.1.tar.gz (9.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page