我正在处理我的python脚本
当我尝试使用方法cv2.getGaussianKernel()
import numpy as np
import cv2
g_kernel =cv2.getGaussianKernel((300, 300), 8.0, ktype= cv2.CV_32F)
img = cv2.imread('LR_intermediate_.jpg')
filtered_img = cv2.filter2D(img, cv2.CV_8UC3, g_kernel)
h, w = g_kernel.shape[:2]
g_kernel = cv2.resize(g_kernel, (3*w, 3*h), interpolation=cv2.INTER_CUBIC)
cv2.imshow('gabor kernel (resized)', g_kernel)
cv2.waitKey(0)
cv2.destroyAllWindows()
我收到此错误:
追踪(最近一次通话): 文件“C:/Users/Mohammed/PycharmProjects/GaborFilter/Gaborscript.py”,行 3,在 g_kernel = cv2.getGaussianKernel((300,300),8.0,ktype = cv2.CV_32F) TypeError:需要一个整数
愿任何人知道如何解决这个问题吗?