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:
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)
| File | Size | Uploaded | |
|---|---|---|---|
| imhist-0.0.4.tar.gz | 176.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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
|