The image reading and writing OpenCV

opencv default data type is uchar image read a byte.

The use OpenCV imwrite function may uchar 8 uint6_t 16-bit data bit and stored in jpg or png image.

CV_32F data can be saved as PFM, TIFF, OpenEXR and Radiance HDR format

https://blog.csdn.net/mars_xiaolei/article/details/62233900

 

imwrite level definition data may be compressed, void imwrite (string filename, Mat src, compression_params)

Vector <int> compression_params;
compression_params.push_back (CV_IMWRITE_PNG_COMPRESSION);
compression_params.push_back (0); // default compression is uncompressed png 1.

 

Read depth image

imread(string filename, int flag);

The default data type is read uchar, 3 channel, flag is 1 (IMREAD_COLOR).

To read grayscale (single, UCHAR type), the flag can be set to 0 (IMREAD_GRAYSCALE)

For CV_16U data types need to specify arbitrary depth data is read, the flag is 2 (IMREAD_ANYDEPTH), or the three-channel case (all the same value for each channel).

We need to isolate a single channel with a split.

Guess you like

Origin www.cnblogs.com/2Bthebest1/p/11275638.html