Judul: Berbagi Info Seputar Drawing Histogram in OpenCV-Python Full Update Terbaru
link: Drawing Histogram in OpenCV-Python
Artikel Terbaru Drawing Histogram in OpenCV-Python Update Terlengkap 2017
Hi Friends,
Do you want to draw a histogram for an image as below?
See the histogram for above image for RGB channels.
The code:
You can see the same code written using numpy functions on histogram here : Drawing histogram in OpenCV- Python.
Don't forget to send your comments, doubts etc.
With Regards,
Abid Rahman K.
Do you want to draw a histogram for an image as below?
See the histogram for above image for RGB channels.
The code:
import cv2
import numpy as np
img = cv2.imread('zzzyj.jpg')
h = np.zeros((300,256,3))
bins = np.arange(256).reshape(256,1)
color = [ (255,0,0),(0,255,0),(0,0,255) ]
for ch, col in enumerate(color):
hist_item = cv2.calcHist([img],[ch],None,[256],[0,256])
cv2.normalize(hist_item,hist_item,0,255,cv2.NORM_MINMAX)
hist=np.int32(np.around(hist_item))
pts = np.column_stack((bins,hist))
cv2.polylines(h,[pts],False,col)
h=np.flipud(h)
cv2.imshow('colorhist',h)
cv2.waitKey(0)
You can see the same code written using numpy functions on histogram here : Drawing histogram in OpenCV- Python.
Don't forget to send your comments, doubts etc.
With Regards,
Abid Rahman K.
Itulah sedikit Artikel Drawing Histogram in OpenCV-Python terbaru dari kami
Semoga artikel Drawing Histogram in OpenCV-Python yang saya posting kali ini, bisa memberi informasi untuk anda semua yang menyukai Fiber Android. jangan lupa baca juga artikel-artikel lain dari kami.
Terima kasih Anda baru saja membaca Artikel Tentang Drawing Histogram in OpenCV-Python