0
私は、このコマンドでlab
にRGB画像を変換:rgbからlabに変換した後、matplotlibで問題が発生していますか?
im_lab=skimage.color.rgb2lab(im, illuminant='D65', observer='2')
をしかし、私はセグメントに私のアルゴリズムに送信し、その後matplotlib.pyplot
を通じて示していたら、私は次のエラーが発生します(それは長いエラーですが、この最後の部分):
/home/xxx/anaconda2/envs/lda-nv/lib/python2.7/site-packages/matplotlib/cm.pyc in to_rgba(self, x, alpha, bytes, norm)
255 if xx.dtype.kind == 'f':
256 if norm and xx.max() > 1 or xx.min() < 0:
--> 257 raise ValueError("Floating point image RGB values "
258 "must be in the 0..1 range.")
259 if bytes:
ValueError: Floating point image RGB values must be in the 0..1 range.
<matplotlib.figure.Figure at 0x7f14e4dfa990>
このmatplotlibのを呼び出しているコードの一部:
# displaying the result
fig = plt.figure()
a = fig.add_subplot(1, 2, 1)
plt.imshow(in_image)
a.set_title('Original Image')
a = fig.add_subplot(1, 2, 2)
print(output.shape)
plt.imshow(skimage.color.lab2rgb(output,illuminant='D65', observer='2'))
a.set_title('Segmented Image')
plt.show()
誰かが私に何が原因なのかを教えてもらえますか?どのように解決できますか?
おかげ
あなたを助けプロットする前に、RGB(A)に戻ってそれを変換する場合は、上記のリンクをチェック働いているようだのようです...それがpyplotが期待しているものです。 – grovina
私はskimageで変換しましたが、私はまだエラーが発生しているので、ここに投稿しました。あなたのコメントをありがとう –
'lab2rgb'の形、min、max、dtypeの出力を投稿できますか? – grovina