Ask Your Question

Revision history [back]

cv2.imshow is working with a jpg file but not with an array

HI, I am using python and try to use cv2.impshow :

img = cv2.imread('messi5.jpg',0) cv2.imshow('image',im[index]) cv2.waitKey(0) cv2.destroyAllWindows()

and it is working fine.

But when I try to replace img with a array of 96*96 with each elements have value between 0 to 255, then it display be a gray box.

If I try to use matplotlib, it is then nicely displayed. How could I display my array with cv2.imshow ?

Thank you for your help in advance,

Sébastien

cv2.imshow is working with a jpg file but not with an array

HI, I am using python and try to use cv2.impshow :

img = cv2.imread('messi5.jpg',0) cv2.imshow('image',im[index]) cv2.waitKey(0) cv2.destroyAllWindows()

and it is working fine.

But when I try to replace img with a array of 96*96 with each elements have value between 0 to 255, then it display be a gray box.

If I try to use matplotlib, it is then nicely displayed. How could I display my array with cv2.imshow ?

Thank you for your help in advance,

Sébastien

cv2.imshow is working with a jpg file but not with an array

HI, I am using python and try to use cv2.impshow :

img = cv2.imread('messi5.jpg',0) cv2.imshow('image',im[index]) cv2.waitKey(0) cv2.destroyAllWindows()

and it is working fine.

But when I try to replace img with a array of 96*96 with each elements have value between 0 to 255, then it display be a gray box.

If I try to use matplotlib, it is then nicely displayed. How could I display my array with cv2.imshow ?

Thank you for your help in advance,

Sébastien