本文整理匯總了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