本文整理汇总了Python中cv2.CV_8UC1属性的典型用法代码示例。如果您正苦于以下问题:Python cv2.CV_8UC1属性的具体用法?Python cv2.CV_8UC1怎么用?Python cv2.CV_8UC1使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cv2
的用法示例。
在下文中一共展示了cv2.CV_8UC1属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: process_output
# 需要导入模块: import cv2 [as 别名]
# 或者: from cv2 import CV_8UC1 [as 别名]
def process_output(self, disparity):
cv8uc = cv2.normalize(disparity, None, alpha=0, beta=255, norm_type=cv2.NORM_MINMAX, dtype=cv2.CV_8UC1)
if self.args.preview:
cv2.imshow("disparity", cv8uc)
cv2.waitKey(0)
cv2.imwrite(os.path.join(self.args.folder, self.args.output), cv8uc)
示例2: applyKirschFilter
# 需要导入模块: import cv2 [as 别名]
# 或者: from cv2 import CV_8UC1 [as 别名]
def applyKirschFilter(self):
gray = self.curImg
if gray.ndim > 2:
raise Exception("illegal argument: input must be a single channel image (gray)")
kernelG1 = np.array([[ 5, 5, 5],
[-3, 0, -3],
[-3, -3, -3]], dtype=np.float32)
kernelG2 = np.array([[ 5, 5, -3],
[ 5, 0, -3],
[-3, -3, -3]], dtype=np.float32)
kernelG3 = np.array([[ 5, -3, -3],
[ 5, 0, -3],
[ 5, -3, -3]], dtype=np.float32)
kernelG4 = np.array([[-3, -3, -3],
[ 5, 0, -3],
[ 5, 5, -3]], dtype=np.float32)
kernelG5 = np.array([[-3, -3, -3],
[-3, 0, -3],
[ 5, 5, 5]], dtype=np.float32)
kernelG6 = np.array([[-3, -3, -3],
[-3, 0, 5],
[-3, 5, 5]], dtype=np.float32)
kernelG7 = np.array([[-3, -3, 5],
[-3, 0, 5],
[-3, -3, 5]], dtype=np.float32)
kernelG8 = np.array([[-3, 5, 5],
[-3, 0, 5],
[-3, -3, -3]], dtype=np.float32)
g1 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG1), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
g2 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG2), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
g3 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG3), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
g4 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG4), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
g5 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG5), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
g6 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG6), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
g7 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG7), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
g8 = cv2.normalize(cv2.filter2D(gray, cv2.CV_32F, kernelG8), None, 0, 255, cv2.NORM_MINMAX, cv2.CV_8UC1)
magn = cv2.max(g1, cv2.max(g2, cv2.max(g3, cv2.max(g4, cv2.max(g5, cv2.max(g6, cv2.max(g7, g8)))))))
self.curImg = magn
开发者ID:ebdulrasheed,项目名称:Diabetic-Retinopathy-Feature-Extraction-using-Fundus-Images,代码行数:41,代码来源:BloodVessels.py
示例3: float_img_to_display
# 需要导入模块: import cv2 [as 别名]
# 或者: from cv2 import CV_8UC1 [as 别名]
def float_img_to_display(_img):
img = _img
max_value = 1000
rows, cols = img.shape
for i in range(rows):
for j in range(cols):
if (img[i, j] > max_value):
img[i, j] = max_value
dist1 = cv2.convertScaleAbs(img)
dist2 = cv2.normalize(dist1, None, 255, 0, cv2.NORM_MINMAX, cv2.CV_8UC1)
return dist1
# return dist2