Can I load a multi-frame TIFF through OpenCV?

前端 未结 5 1353
春和景丽
春和景丽 2021-02-14 18:35

Anyone know if OpenCV is capable of loading a multi-frame TIFF stack? I\'m using OpenCV 2.2.0 with python 2.6.

5条回答
  •  遥遥无期
    2021-02-14 19:20

    You can load multi-frame tiff files in OpenCV using file read function called imreadmulti. Here is the example

     ret, images = cv2.imreadmulti('.tiff', [], cv2.IMREAD_ANYCOLOR)
    

    Images will be a list of frames in the tiff file. Suppose you want to see 2nd image, you can access as

    img = images[1] # note 0 based indexing
    

提交回复
热议问题