Skip to main content

Finding HSV bounding values for tracking/masking an object.

Project description

hsvpicker

Finding HSV bounding values for tracking/masking an object

How to find HSV bounding values to track or mask an object?.

This is the most common question as stated in opencv documentation. By using the hsvpicker we get a hsv bounding values by simply calling a function.

Overview:

We can get lower and upper bounding hsv values by clicking the left button of a mouse on an image for which object we want to track or mask.

Usage:

Getting it:

To download hsvpicker, either fork this github repo or simply use Pypi via pip.

    $ pip install hsvpicker

Using it:

STEP 1: import hsvpicker package
from hsvpicker.hsv import HSV
STEP 2: Create an object
bound = HSV('pass the image url')
STEP 3: Getting a HSV value
bound.get_value()

Image will display here, you will choose color by simply double clicking the mouse's left button on an image and then it finds hsv values of the respected color .(i.e The color which we want to track or mask). PRESS q to quit the window.

STEP 4 : Getting a bounding values
lower_bound,upper_bound = bound.get_boundings(h = 20,s = 50,v = 60)

You can fine tune color boundings by using h,s and v. Default values of h,s, and v are 20,50,60 respectively. This function returns numpy.ndarray.

Project details


Release history Release notifications

This version

4.0

Download files

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

Files for hsvpicker, version 4.0
Filename, size File type Python version Upload date Hashes
Filename, size hsvpicker-4.0.tar.gz (2.9 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page