__author__ = 'administrator'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
import numpy as np import cv2 mri_img = np.load( 'mri_img.npy' ) # normalization mri_max = np.amax(mri_img) mri_min = np.amin(mri_img) mri_img = ((mri_img - mri_min) / (mri_max - mri_min)) * 255 mri_img = mri_img.astype( 'uint8' ) r, c, h = mri_img.shape for k in range (h): temp = mri_img[:,:,k] clahe = cv2.createclahe(cliplimit = 2.0 , tilegridsize = ( 8 , 8 )) img = clahe. apply (temp) cv2.imshow( 'mri' , np.concatenate([temp,img], 1 )) cv2.waitkey( 0 ) |
均衡化前、后对比效果
以上这篇python cv2 图像自适应灰度直方图均衡化处理方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持服务器之家。
原文链接:https://blog.csdn.net/yangyangyang20092010/article/details/70705189