“System error: new style getargs format but argument is not a tuple” when using cv2.blur

前端 未结 2 641
一个人的身影
一个人的身影 2020-12-17 08:06

I am just trying to apply a filter to an image using cv2, the opencv python bindings. Here is what my code look like:

im = cv2.imread(\'./test_imgs/zzzyj.jpg         


        
2条回答
  •  失恋的感觉
    2020-12-17 08:32

    For cv2.blur, you need to give ksize as a tuple of two elements , like (2,2). But for medianBlur, ksize = 3 is sufficient. It will deduct a square kernel from it.

    So make code like this :

    im = cv2.imread('./test_imgs/zzzyj.jpg')
    cv2.imshow('Image', cv2.blur(im, (3,3)))
    cv2.waitKey(0)
    cv2.destroyAllWindows()
    

    Hope it will work!!!

提交回复
热议问题