Тёмный

OpenCV Python Histogram Equalization and CLAHE 

Kevin Wood | Robotics & AI
Подписаться 7 тыс.
Просмотров 2,6 тыс.
50% 1

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 6   
@kevinwoodrobotics
@kevinwoodrobotics Год назад
Code and Doc: kevinwoodrobotics.com/product/opencv-python-histogram-equalization-and-clahe/ OpenCV Python Playlist Code and Doc: kevinwoodrobotics.com/product/opencv-python-tutorials-full-playlist/
@d_antisocial00
@d_antisocial00 8 месяцев назад
💕💕👩🏻‍💻
@colourftw
@colourftw Год назад
I like the intro!
@kevinwoodrobotics
@kevinwoodrobotics Год назад
Thanks
@muhammadamarussalam6500
@muhammadamarussalam6500 Год назад
can i get the code?
@kevinwoodrobotics
@kevinwoodrobotics Год назад
import cv2 as cv import numpy as np import matplotlib.pyplot as plt import os def histogramEqual(): root = os.getcwd() imgPath = os.path.join(root,'demoImages\\badQuality.jpg') img = cv.imread(imgPath,cv.IMREAD_GRAYSCALE) hist = cv.calcHist([img],[0],None,[256],[0,256]) cdf = hist.cumsum() cdfNorm = cdf * float(hist.max()) / cdf.max() plt.figure() plt.subplot(231) plt.imshow(img,cmap='gray') plt.subplot(234) plt.plot(hist) plt.plot(cdfNorm,color='b') plt.xlabel('pixel intesity') plt.ylabel('# of pixels') equImg = cv.equalizeHist(img) equhist = cv.calcHist([equImg],[0],None,[256],[0,256]) equcdf = equhist.cumsum() equcdfNorm = equcdf * float(equhist.max()) / equcdf.max() plt.subplot(232) plt.imshow(equImg,cmap='gray') plt.subplot(235) plt.plot(equhist) plt.plot(equcdfNorm,color='b') plt.xlabel('pixel intesity') plt.ylabel('# of pixels') claheObj = cv.createCLAHE(clipLimit=5,tileGridSize=(8,8)) claheImg = claheObj.apply(img) clahehist = cv.calcHist([claheImg],[0],None,[256],[0,256]) clahecdf = clahehist.cumsum() clahecdfNorm = clahecdf * float(clahehist.max()) / clahecdf.max() plt.subplot(233) plt.imshow(claheImg,cmap='gray') plt.subplot(236) plt.plot(clahehist) plt.plot(clahecdfNorm,color='b') plt.xlabel('pixel intesity') plt.ylabel('# of pixels') plt.show() if __name__ == '__main__': histogramEqual()
Далее
OpenCV Python 2D Histogram
9:08
Просмотров 419
113 - Histogram equalization and CLAHE
17:03
Просмотров 36 тыс.
Going back to the moon isn't just about cost
17:03
Просмотров 8 тыс.