From 98239664f6d47e95c051f837fa996b80ce4244a3 Mon Sep 17 00:00:00 2001 From: Suleyman TURKMEN Date: Sun, 17 Apr 2016 00:37:28 +0300 Subject: [PATCH] fix for writing 16-bit jpeg2000 --- modules/imgcodecs/src/grfmt_jpeg2000.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgcodecs/src/grfmt_jpeg2000.cpp b/modules/imgcodecs/src/grfmt_jpeg2000.cpp index e499c58b89..24aa457686 100644 --- a/modules/imgcodecs/src/grfmt_jpeg2000.cpp +++ b/modules/imgcodecs/src/grfmt_jpeg2000.cpp @@ -525,7 +525,7 @@ bool Jpeg2KEncoder::writeComponent16u( void *__img, const Mat& _img ) for( int y = 0; y < h; y++ ) { - const uchar* data = _img.ptr(y); + const ushort* data = _img.ptr(y); for( int i = 0; i < ncmpts; i++ ) { for( int x = 0; x < w; x++)