pass the correct rgb->gray coefficients to PNG decoder, to match cvtColor's.

This commit is contained in:
Vadim Pisarevsky 2010-11-24 19:50:52 +00:00
parent d6686240d5
commit beee6f2f70

View File

@ -230,7 +230,7 @@ bool PngDecoder::readData( Mat& img )
else if( color )
png_set_gray_to_rgb( png_ptr ); // Gray->RGB
else
png_set_rgb_to_gray( png_ptr, 1, -1, -1 ); // RGB->Gray
png_set_rgb_to_gray( png_ptr, 1, 0.299, 0.587 ); // RGB->Gray
png_read_update_info( png_ptr, info_ptr );