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

cv2.imshow 64f?

$
0
0
So I'm just playing around right now with opencv3 and I'm wondering why cv2.imshow renders differently than matplotlib.imshow The code is stupid basic:
import cv2
from matplotlib import pyplot as plt

img = cv2.imread('test1.jpg',cv2.IMREAD_GRAYSCALE)

cv2.imshow('original',img)
sobely = cv2.Sobel(img,cv2.CV_64F,0,1,ksize=17)


cv2.imshow('sobely',sobely)

plt.imshow(sobely, cmap = 'gray', interpolation = 'bicubic')
plt.xticks([]), plt.yticks([])  # to hide tick values on X and Y axis
plt.show()

cv2.waitKey(0)
cv2.destroyAllWindows()

But the result is this: http://i.imgur.com/o9JpY6u.png Where the sobel "image" is significantly different. I'm guessing its because its a float64 data type that results for the sobel array but how come imshow isn't able to render it properly then?

Viewing all articles
Browse latest Browse all 2088

Trending Articles