Ask Your Question
0

How to store CV_16UC1 image on hard disk?

asked 2020-08-24 06:01:38 -0600

DS0293 gravatar image

Hi,

Could someone please let me know how can I store CV_16UC1 image using opencv? Is there a function which can be used? One way is, covert the image to CV_8UC1 and store it on hard disk using cv::imwrite() function. But doing that will result in loss of information. Hence, I do not want to convert the image.

In my case, I have depth image available from kinect v2 and I want to store it on hard disk.

Thank you!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2020-08-24 06:06:41 -0600

berak gravatar image

updated 2020-08-24 06:07:50 -0600

you can store is as .png (which supports 16bit images):

Mat u16 = ...
imwrite("some.png", u16);

and later read back:

Mat u16 = imread("some.png", IMREAD_ANYDEPTH);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2020-08-24 06:01:38 -0600

Seen: 864 times

Last updated: Aug 24 '20