Skip to content

Commit 2fdb6f2

Browse files
authored
Create blog38-01.py
1 parent 42834b0 commit 2fdb6f2

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- coding: utf-8 -*-
2+
# By:Eastmount CSDN 2021-03-12
3+
import cv2
4+
import numpy as np
5+
import matplotlib.pyplot as plt
6+
7+
#读取图片
8+
img = cv2.imread('test.png')
9+
10+
#灰度转换
11+
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
12+
13+
#直方图均衡化处理
14+
result = cv2.equalizeHist(gray)
15+
16+
#显示图像
17+
cv2.imshow("Input", gray)
18+
cv2.imshow("Result", result)
19+
cv2.waitKey(0)
20+
cv2.destroyAllWindows()
21+

0 commit comments

Comments
 (0)