Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 2088

opencv, Geometric Transformations of Images

$
0
0
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 plt.subplot(121),plt.imshow(img),plt.title('Input') NameError: name 'plt' is not defined

Viewing all articles
Browse latest Browse all 2088

Trending Articles