Ask Your Question
1

Writing jpeg 2000 images with 16 bit

asked 2016-04-15 13:53:50 -0500

fijoy gravatar image

updated 2017-08-23 05:54:35 -0500

Hi all,

I know there has been a post about OpenCV's issue with writing jp2 images with 16 bit depth, but I'm posting this here in case there has been a workaround since the last post. All I did was to read a 16-bit png image and write it back in jp2 format. Here's the code:

Mat readMat = imread("pnggrad16rgb.png", IMREAD_UNCHANGED);
imwrite(string("pnggrad16rgb.jp2"), readMat);

The image pnggrad16rgb.png was downloaded from here:

http://www.fnordware.com/superpng/sam...

The resulting pnggrad16rgb.jp2 image is just a completely black image of the same size as the original image (I viewed it in Gimp 2.8).

Has there been a workaround to this issue?

Thanks, Fijoy

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2016-04-16 18:01:34 -0500

I made a Pull Request to solve the problem.

edit flag offensive delete link more
1

answered 2017-08-23 05:44:58 -0500

ttn gravatar image

It is fixed.

See https://github.com/opencv/opencv/pull...

sturkmnen reported that in http://answers.opencv.org/question/22...

/Torben.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2016-04-15 13:53:50 -0500

Seen: 789 times

Last updated: Aug 23 '17