Iklan1

Friday, July 26, 2019

TIPS : Scikit-image error Viewer requires Qtwarn

Berikut adalah error warning yang muncul pada saat kita ingin menampilkan gambar dari scikit-image :

UserWarning: Viewer requires Qtwarn('Viewer requires Qt')

Langkah menampilkan Image atau gambar dari scikit-image :
1. Install PyQt yang sesuai dengan Scikit-image-nya
D:\tesF>pip install PyQt5
Collecting PyQt5
  Using cached https://files.pythonhosted.org/packages/c9/e3/302602473ad0997d9a86b69324350bcfd13ac137ffa76806d6f58bda1e1d/PyQt5-5.13.0-5.13.0-cp35.cp36.cp37.cp38-none-win32.whl
Collecting PyQt5_sip<13,>=4.19.14 (from PyQt5)
  Downloading https://files.pythonhosted.org/packages/38/10/4ee0be6337eddcdf9070659b314416c66b73198505d61995684ff5538e69/PyQt5_sip-4.19.18-cp37-none-win32.whl (44kB)
     |████████████████████████████████| 51kB 1.7MB/s
Installing collected packages: PyQt5-sip, PyQt5
Successfully installed PyQt5-5.13.0 PyQt5-sip-4.19.18

2. tes dengan sample program ini
from skimage import data
from skimage.viewer import ImageViewer

image = data.coins()
viewer = ImageViewer(image)
viewer.show()

HASIL :

Akan muncul gambar coin tersebut.


Akan menampilkan gambar dan histogram :

from skimage import data
from skimage.exposure import histogram
from skimage.viewer import ImageViewer
from skimage.viewer.plugins.lineprofile import LineProfile
image = data.coins()
viewer = ImageViewer(image)
viewer += LineProfile(viewer)
overlay, data = viewer.show()[0]

No comments:

Post a Comment