import cv2
import numpy as np
import matplotlib.pyplot as plt
FileName = r"D:\cycFeng\Data\2021-11-30\02Guass.mp4"
cap = cv2.VideoCapture(FileName) # 原视频位置
while (True):
ret, frame = cap.read()
if not ret: #or count >= EndNum:
print('not res , not image')
break
gray = cv2.cvtColor(frame,cv2.COLOR_RGB2GRAY)
index = len(np.where(gray == 255)[0])
print(index)
img2 = cv2.resize(frame, (int(w / 2), int(h / 2)))
cv2.imshow('a',img2)
cv2.waitKey(1)
# 直方图
plt.hist(gray.flatten() , 256)
plt.show()
plt.close('all')
cap.release()
图像直方图 python
最新推荐文章于 2023-08-18 11:56:58 发布
4002

被折叠的 条评论
为什么被折叠?



