import numpy as np
import matplotlib.pyplot as plt
files = ### 100 portrait photos
imgs = [ plt.imread(f_i) for f_i in files ] # We read all file compositions into imgs
data = np.array(imgs) # Turn everything into np.array format
mean_imgs = np.mean(data, axis= 0) # Takes the mean of the entire data set
plt.imshow(mean_imgs) # imgs_mean = array of floats
結果:imshow()で浮動小数点配列を使用すると、なぜカラーノイズマップが得られますか?しかし、uint8を使用すると、私は必要な画像を取得できますか?
plt.imshow(mean_imgs.astype(np.uint8)) # Cast mean_imgs into type uint
これはとにかく私が)(すべての浮動小数点数を持つ配列を関数imshowの違いを理解しようとしています、コンピュータビジョンの質問の、おそらくもっとあるとuint8型の配列これら2つの操作の間にバックエンドで何が起こったのかを親切に説明することができますか?
写真の変数ミックスを無視してください。それらを異なるタイプの同じ変数と考えるだけです。