opencv, Geometric Transformations of Images
hi i sezai, while working on OpenCV today. I get a mistake in one subject. "Geometric Transformations of Images" OpenCV version 3.1.0 codes this way.
import cv2
img = cv2.imread('sudoku.png')
rows,cols,ch = img.shape
pts1 = np.float32([[56,65],[368,52],[28,387],[389,390]])
pts2 = np.float32([[0,0],[300,0],[0,300],[300,300]])
M = cv2.getPerspectiveTransform(pts1,pts2)
dst = cv2.warpPerspective(img,M,(300,300))
plt.subplot(121),plt.imshow(img),plt.title('Input')
plt.subplot(122),plt.imshow(dst),plt.title('Output')
plt.show()
I received the error :
Traceback (most recent call last): File "yeni.py", line 13, in <module> plt.subplot(121),plt.imshow(img),plt.title('Input') NameError: name 'plt' is not defined