Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support saving 32FC1 as tiff image, fix issue 7762 #7956

Closed
wants to merge 1 commit into from

Conversation

jasjuang
Copy link
Contributor

@jasjuang jasjuang commented Jan 3, 2017

fix issue #7762

@alalek
Copy link
Member

alalek commented Jan 3, 2017

img.convertTo(img8U, CV_8UC1);

Implicit unexpected data loss in encoders must be avoided.

IMHO, isFormatSupported should be extended to support channels information too (possible problems related to ABI should be workarounded).

@alalek alalek mentioned this pull request Jan 11, 2017
@vpisarev
Copy link
Contributor

it may be also confusing, because some people assume that floating-point images have value range [0, 1], i.e. 0 is black and 1 is white, not [0, 255]. So, this patch cannot be accepted in the current form

@jasjuang
Copy link
Contributor Author

@vpisarev OpenCV is able to save CV_32FC1 mat into pngs and jpgs as if it's CV_8UC1, and this is verified by reading it back with imread. I am not sure how OpenCV handles it, but couldn't we apply the same process to tiffs?

@vpisarev
Copy link
Contributor

vpisarev commented Feb 7, 2017

We decided not to put such implicit conversion into OpenCV. Please, call Mat::convertTo() prior to imwrite().

@vpisarev vpisarev closed this Feb 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants