matlab 三维图 改比例,如何使用Matlab重新缩放灰度三维图像(x,y,z)的亮度范围...

对于申请imadjust为集2D取整数值考虑灰度图像的,这招可能会奏效

a = imread('pout.tif');

a = imresize(a,[256 256]); %// re-sizing to match image b's dimension

b = imread('cameraman.tif');

Im = cat(3,a,b);

%//where a,b are separate grayscale images of same dimensions

%// if you have the images separately you could edit this line to

%// Im = cat(2,a,b);

%// and also avoid the next step

%// reshaping into a 2D matrix to apply imadjust

Im = reshape(Im,size(Im,1),[]);

out = imadjust(Im); %// applying imadjust

%// finally reshaping back to its original shape

out = reshape(out,size(a,1),size(a,2),[]);

检查:

x = out(:,:,1);

y = out(:,:,2);

正如你可以从工作区中看到图像,第一个图像(变量x)未重新缩放至0-255,因为其先前范围(变量a)未接近0点。

工作区:

220a65df58d96bcb04a3fabe9cae7917.png

编辑:你可以这样做,因为这样的一个步骤:(因为对方的回答暗示)

%// reshaping to single column using colon operator and then using imadjust

%// then reshaping it back

out = reshape(imadjust(Image3D(:)),size(Image3D));

编辑2:

正如你在I2形象电池阵列,试试这个:

I2D = cat(2,I2{:})

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值