1

分割された RGB 値を持ついくつかの画像をインポートしたいのですが、一部の画像では機能し、他の一部の画像では、出力はピクセルの RGB に対して 1 つの値しか与えません。

コードが機能する画像は次のとおりです。

if os.path.isfile(location1):  
    image = imageio.imread(location1)
print("Type : ", type(image[0][0]))
## Type : imageio.core.util.Image
input : image
output: Image([[[167, 126,  94],
        [210, 184, 147],
        [245, 234, 188],
        ...,

そして、これはコードが機能しない画像です。

if os.path.isfile(location2):  
    image = imageio.imread(location2)
print("TYpe : ", type(image[0][0]))
## TYpe : <class 'numpy.uint8'>
input: image
output: Image([[81, 78, 74, ..., 72, 71, 69],
      [74, 71, 67, ..., 70, 70, 68],
      [61, 58, 55, ..., 65, 65, 64],
   ...,

(私は助けていただければ幸いです)

4

1 に答える 1