Skip to main content

imhist

This model calculates the histogram, PMF and CMD of a given image fast.

Installation

Run the following to install:

pip install imhist

Usage

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)
v_pmf = imhist(v, PMF=True)
v_cdf = imcdf(v)

plt.figure(num=1)
plt.plot(np.arange(256), v_hist, 'b', label='Histogram')
plt.ylabel('Number of Occurrences')
plt.xlabel('Brightness')
plt.grid(which="both")
plt.legend()
plt.show()

Output

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

Metadata

Release files for imhist 0.0.4

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

Source distribution (sdist)

Source distribution for imhist 0.0.4
File Size Uploaded
imhist-0.0.4.tar.gz 176.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for imhist 0.0.4
File Interpreter ABI Platform
imhist-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 179.2 kB

Release files / imhist-0.0.4.tar.gz

Download URL imhist-0.0.4.tar.gz
Size 176.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0b92218bde95780e60fb5030d48b82d7cda57c3275397f4a070f166df6a77412
BLAKE2b-256 checksum
How to use checksums
049c2a4f04aab4e18cdd6251ee0c040ea2b5229cc3c47ad9b8e2a3891eb213d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.2

Release files / imhist-0.0.4-py3-none-any.whl

Download URL imhist-0.0.4-py3-none-any.whl
Size 2.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
01179e7db8d135bf60576a1e2a51c663cc781fa693d25ae8362d248686312e6a
BLAKE2b-256 checksum
How to use checksums
7977fa41252751afeaff464bc4315ef2f057c7dec2aee2c158c497171f952b45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.2

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 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