I am partly new to opencv and image processing. I tried this code that I found on pyimagesearch.com . I resized the image to a height of 500 pixels to do edge detection and find outlines.
r = 500.0 / image.shape[1]
dim = (500,int(image.shape[0] * r))
image = cv2.resize(image,dim,interpolation = cv2.INTER_AREA)
ratio = image.shape[0] /500.0
Again, I multiply the processed image with the ratio (so the changes are made wrt of the original image)
warped = four_point_transform(orig,screenCnt.reshape(4,2)*ratio)
r = 500.0 / warped.shape[1]
dim = (500,int(warped.shape[0] * r))
warped = cv2.resize(warped,dim,interpolation = cv2.INTER_AREA)
cv2.imshow("Perspective Transform",warped)
After that, the results that I get are somewhat similar to Image . Only part of the image is visible, and I cannot see the rest of the image. Please help me. Thanks!
source
share