Skip to main content

This model calculates the histogram of a given matrix fast.

Project description


This model calculates the histogram of a given matrix fast.


import cv2
import numpy as np
from imhist import imhist, imcdf
import matplotlib.pyplot as plt

img = cv2.imread('assets/Plane.jpg')
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
v = hsv[:, :, 2].copy()

v_hist = imhist(v)

plt.plot(np.arange(256), v_hist, 'b', label='Histogram')
plt.ylabel('Number of Occurrences')


This is a sample image:
Sample Image
Histogram of the sample image:
Histogram of the Sample Image

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 imhist, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size imhist-0.0.1-py3-none-any.whl (2.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size imhist-0.0.1.tar.gz (2.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring 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