0
我有以下錯誤,當我使用boxFilter函數功能:如何正確使用cv.boxFilter()在python
SystemError: new style getargs format but argument is not a tuple
下面是代碼sniplet:
//After downloading image from url, I process it as follows
imgcv = cv2.cvtColor(np.asarray(im), cv.CV_RGB2YCrCb)
#Get the channel 0
imgcv1 = cv2.split(imgcv)[0]
cv2.boxFilter(imgcv1, 1, 7, data, (1,1), 0, cv2.BORDER_DEFAULT)
報告說,參數不是一個元組。如何使它成爲元組?我試圖搜索很多,但沒有有用的結果。我是openCV和python的初學者。 這裏是過濾器的定義:
cv2.boxFilter(src, ddepth, ksize[, dst[, anchor[, normalize[, borderType]]]]) → dst
Parameters:
src – Source image.
dst – Destination image of the same size and type as src .
ksize – Smoothing kernel size.
anchor – Anchor point. The default value Point(-1,-1) means that the anchor is at the kernel center.
normalize – Flag specifying whether the kernel is normalized by its area or not.
borderType – Border mode used to extrapolate pixels outside of the image.
在此先感謝。