About opencv-working with images

i am not getting the image as the output after running the code . Imshow and imread functions of opencv does give me the image as the output. i am getting the error that image data can not be converted to float.
please check this link
https://ide.codingblocks.com/s/97961.
these are the following errors which are coming while running this code.
in
----> 1 plt.imshow(img)

c:\python\python37\lib\site-packages\matplotlib\pyplot.py in imshow(X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin, extent, shape, filternorm, filterrad, imlim, resample, url, data, **kwargs)
2675 filternorm=filternorm, filterrad=filterrad, imlim=imlim,
2676 resample=resample, url=url, **({“data”: data} if data is not
-> 2677 None else {}), **kwargs)
2678 sci(__ret)
2679 return __ret

c:\python\python37\lib\site-packages\matplotlib_init_.py in inner(ax, data, *args, **kwargs)
1587 def inner(ax, *args, data=None, **kwargs):
1588 if data is None:
-> 1589 return func(ax, *map(sanitize_sequence, args), **kwargs)
1590
1591 bound = new_sig.bind(ax, *args, **kwargs)

c:\python\python37\lib\site-packages\matplotlib\cbook\deprecation.py in wrapper(*args, **kwargs)
367 f"%(removal)s. If any parameter follows {name!r}, they "
368 f"should be pass as keyword, not positionally.")
–> 369 return func(*args, **kwargs)
370
371 return wrapper

c:\python\python37\lib\site-packages\matplotlib\cbook\deprecation.py in wrapper(*args, **kwargs)
367 f"%(removal)s. If any parameter follows {name!r}, they "
368 f"should be pass as keyword, not positionally.")
–> 369 return func(*args, **kwargs)
370
371 return wrapper

c:\python\python37\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)
5658 resample=resample, **kwargs)
5659
-> 5660 im.set_data(X)
5661 im.set_alpha(alpha)
5662 if im.get_clip_path() is None:

c:\python\python37\lib\site-packages\matplotlib\image.py in set_data(self, A)
676 not np.can_cast(self._A.dtype, float, “same_kind”)):
677 raise TypeError("Image data of dtype {} cannot be converted to "
–> 678 “float”.format(self._A.dtype))
679
680 if not (self._A.ndim == 2

TypeError: Image data of dtype object cannot be converted to float

final error is image data can not be converted to the float

hi @agarwalp
plz convert the image into int by casting or dtype before feeding image to imshow