title: Type error: Image data of dtype object cannot be converted to float
body: <p>Hello I have been trying to import an image from desktop to the jupyter notebook using opencv. I am getting the following error message at the end <strong>Image data of dtype object cannot be converted to float</strong> . My code is as follows:</p>
  <pre><code>import cv2 as cv
  import matplotlib.pyplot as plt
  im = cv.imread(&quot;dog.jpg&quot;)
  im_1 = cv.cvtColor(im,cv.COLOR_BGR2RGB)
  </code></pre>
  <blockquote>
  <p>error                                     Traceback (most recent call
  last)  in 
  ----&gt; 1 im_1 = cv.cvtColor(im,cv.COLOR_BGR2RGB)</p>
  <p>error: OpenCV(4.5.3)
  C:\Users\runneradmin\AppData\Local\Temp\pip-req-build-_xlv4eex\opencv\modules\imgproc\src\color.cpp:182:
  error: (-215:Assertion failed) !_src.empty() in function
  'cv::cvtColor'</p>
  </blockquote>
  <pre><code> plt.imshow(im)
  </code></pre>
  <blockquote>
  <p>~\Anaconda3\lib\site-packages\matplotlib\pyplot.py in imshow(X, cmap,
  norm, aspect, interpolation, alpha, vmin, vmax, origin, extent,
  filternorm, filterrad, resample, url, data, **kwargs)    2907<br />
  filternorm=filternorm, filterrad=filterrad, resample=resample,    2908
  url=url, **({&quot;data&quot;: data} if data is not None else {}),
  -&gt; 2909         **kwargs)    2910     sci(__ret)    2911     return __ret</p>
  <p>~\Anaconda3\lib\site-packages\matplotlib_<em>init</em>_.py in inner(ax,
  data, *args, **kwargs)    1359     def inner(ax, *args, data=None,
  **kwargs):    1360         if data is None:
  -&gt; 1361             return func(ax, *map(sanitize_sequence, args), **kwargs)    1362     1363         bound = new_sig.bind(ax, *args, **kwargs)</p>
  <p>~\Anaconda3\lib\site-packages\matplotlib\axes_axes.py in imshow(self,
  X, cmap, norm, aspect, interpolation, alpha, vmin, vmax, origin,
  extent, filternorm, filterrad, resample, url, **kwargs)    5607<br />
  resample=resample, **kwargs)    5608
  -&gt; 5609         im.set_data(X)    5610         im.set_alpha(alpha)    5611         if im.get_clip_path() is None:</p>
  <p>~\Anaconda3\lib\site-packages\matplotlib\image.py in set_data(self, A)
  699                 not np.can_cast(self._A.dtype, float, &quot;same_kind&quot;)):
  700             raise TypeError(&quot;Image data of dtype {} cannot be converted to &quot;
  --&gt; 701                             &quot;float&quot;.format(self._A.dtype))
  702
  703         if self._A.ndim == 3 and self._A.shape[-1] == 1:</p>
  <p>TypeError: Image data of dtype object cannot be converted to float</p>
  </blockquote>
  <p>Please if someone could help. Thanks in advance</p>