Skip to content

imwrite: multi-image tiff from python #18525

@paroj

Description

@paroj
System information (version)
  • OpenCV => 4.4
  • Operating System / Platform => Linux
  • Compiler => GCC
Detailed description

imwrite supports writing multi-page tiffs by checking whether InputArray is a MatVector

std::vector<Mat> img_vec;
if (_img.isMatVector() || _img.isUMatVector())
_img.getMatVector(img_vec);

However, on python it can never be done as the binding generator does not try creating vector_Mat for InputArray - just Mat and UMat.

Steps to reproduce
import cv2

img = cv2.imread("doc/opencv-logo.png")
cv2.imwrite("multi.tiff", [img, img, img])
Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions