将一个图像叠加在另一个图像上会产生蓝色框而不是图像 - MATLAB [英] Overlaying one image on another gives blue boxes instead of image - MATLAB

查看:509
本文介绍了将一个图像叠加在另一个图像上会产生蓝色框而不是图像 - MATLAB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在MATLAB中将一个图像叠加在另一个图像上。

I am trying to overlay one image on top of another in MATLAB.

我检查了在MATLAB中叠加两个图像
获得答案。但问题是叠加的图像在原始图像上显示为蓝色框,而不是实际图像。

I checked out Superimpose two images in MATLAB for an answer. But the issue is that the overlayed images are being shown as blue boxes on the original image, instead of the actual image.

此处显示的输出错误 http://imgur.com/R1QZh32

代码I我正在使用

    a = 0.2;
    tform = affine2d([1 0 0; a 1 0; 0 0 1]);
    B = imwarp(z,tform, 'FillValues',255);
    B = ~B;
    figure; imshow(B);
    h = imagesc([X1 X2], [Y1 Y2], B);
    set(h, 'AlphaData', 1);

正常 imshow(B)显示我正确的图像,但重叠部分给我的问题。

The normal imshow(B) shows me the correct image but the overlaying part is giving me the problem.

我已经尝试更改 AlphaData 的值但是这似乎不起作用。

I have tried changing the value of AlphaData but that doesn't seem to be working.

推荐答案

看看功能 imshowpair ,属性 Blend

你也可以试试这个:

figure;
h = imshow(FirstImage);
set(h,'AlphaData',0.2);

hold on;
imshow(SecondImage);    
hold off;

这篇关于将一个图像叠加在另一个图像上会产生蓝色框而不是图像 - MATLAB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆