イメージ シーケンスがあり、特定のフレームでスクリプトを実行しようとしています。このフレームに切り替えて、配列に変換する必要があります。ただし、フレームがインスタンスであるため、できません<TiffImagePlugin.TiffImageFile image mode=I;16 size=512x512 at 0x104A0C998>
。このインスタンスを配列に変換するにはどうすればよいですか? 既に numpy.array を使用していますが、機能しません。ありがとうございました!
prot=Image.open("F23BN.tif")
for frame in ImageSequence.Iterator(dna):
if frame==16:
frame.convert('L')
print frame.mode, frame.format #I checked the format and it is still in the Instance format