What is the problem in line 5? I copied directly from a book but getting this error:
py edge.py
Traceback (most recent call last):
File "edge.py", line 5, in <module>
rows,cols = img.shape
ValueError: too many values to unpack (expected 2)
Code:
import cv2
img = cv2.imread('489.jpg')
rows, cols = img.shape
sobel_horizontal = cv2.Sobel(img,cv2.CV_64F,1,0,ksize=5)
cv2.imshow('Input image', img)
cv2.waitKey()