1

I am doing complement of an image using open-cv python, while writing the image, open-cv is not writing the header information in the complemented image. my image data are in TIFF format.

i am doing like this...

import cv2 img = cv2.imread("image.tiff", -1) for i in xrange(0, len(img)): for j in xrange(0, len(i)): img[i][j] = 65535-img[i][j] cv2.imwrite("complemented.tif", img) 
5

1 Answer 1

0

As described in this link, Each TIFF file begins with a image file header which points to one or more image file directories, which contain the image data and image information., header information is required for multi-image TIFF.

Multi-image TIFF is not supported in OpenCV as @Haris mentioned in the comments.

Since, multi-image TIFF is not supported, it is most likely that header information is not read using imread and thus cannot be written using imwrite.

Sign up to request clarification or add additional context in comments.

1 Comment

Then what are the other options ??. I want to do the complement a .tif image file.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.