Matlab下imwrite,Uint16的深度图像

本文介绍了在Matlab环境下,如何使用imwrite函数将图像保存为Uint16格式。当输入数组为uint16类且格式支持16位数据时,imwrite会直接输出。如果输入数组是double类型,imwrite会将其按0-1范围自动缩放为8位数据。若要保存为Uint16,需先将double类型转换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Matlab下imwrite,Uint16的深度图像

1. 在Matlab命令窗口输入命令:

help imwrite

会有如下解释:

  • If the input array is of class uint16 and the format supports 16-bit data (JPEG, PNG, and TIFF), imwrite outputs the data as 16-bit values. If the format does not support 16-bit values, imwrite issues an error. Several formats, such as JPEG and PNG, support a parameter that lets you specify the bitdepth of the output data.

  • If the input array is of class double, and the image is a grayscale or RGB color image, imwrite assumes the dynamic range is [0,1] and automatically scales the data by 255 before writing it to the file as 8-bit values.

2. 如果你要保存成uint16的图像的矩阵数据是非uint16的类型:

则必须先将double类型转换为uint

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值