drop histo.py

This commit is contained in:
Fam Zheng 2025-04-25 08:29:54 +01:00
parent 8fcad15744
commit 0b9035d5d4
2 changed files with 0 additions and 17 deletions

View File

@ -4,7 +4,6 @@ django-cors-headers
django-tastypie django-tastypie
django<5 django<5
gunicorn gunicorn
matplotlib==3.5.1
opencv-contrib-python==4.5.5.62 opencv-contrib-python==4.5.5.62
opencv-python==4.5.5.62 opencv-python==4.5.5.62
oss2 oss2

View File

@ -1,16 +0,0 @@
import cv2
import sys
import numpy as np
import matplotlib.pyplot as plt
# 读取图像
print(sys.argv[1])
image = cv2.imread(sys.argv[1], cv2.IMREAD_COLOR)
# 计算直方图
hist = cv2.calcHist([image], [0], None, [256], [0, 256])
# 显示直方图
plt.plot(hist)
plt.xlim([0, 256])
plt.show()