Aout opencv with images

TypeError Traceback (most recent call last)
in ()
----> 1 plt.imshow(img)

E:\software\Anaconda3\lib\site-packages\matplotlib\pyplot.py in imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, hold, data, **kwargs)
3208 filternorm=filternorm, filterrad=filterrad,
3209 imlim=imlim, resample=resample, url=url, data=data,
-> 3210 **kwargs)
3211 finally:
3212 ax._hold = washold

E:\software\Anaconda3\lib\site-packages\matplotlib_init_.py in inner(ax, *args, **kwargs)
1865 “the Matplotlib list!)” % (label_namer, func.name),
1866 RuntimeWarning, stacklevel=2)
-> 1867 return func(ax, *args, **kwargs)
1868
1869 inner.doc = _add_data_doc(inner.doc,

E:\software\Anaconda3\lib\site-packages\matplotlib\axes_axes.py in imshow(self, X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, **kwargs)
5499 resample=resample, **kwargs)
5500
-> 5501 im.set_data(X)
5502 im.set_alpha(alpha)
5503 if im.get_clip_path() is None:

E:\software\Anaconda3\lib\site-packages\matplotlib\image.py in set_data(self, A)
648 if (self._A.dtype != np.uint8 and
649 not np.can_cast(self._A.dtype, float, “same_kind”)):
–> 650 raise TypeError(“Image data cannot be converted to float”)
651
652 if not (self._A.ndim == 2

TypeError: Image data cannot be converted to float

problem in running the code

Hello @agarwalp. Kindly provide a link to your code.

Thanks :slight_smile: