您好我在imshowpair
功能中使用后试图保存/显示图像。以下代码不起作用。有谁知道我怎么能达到我的目的?
final = imshowpair(img1, img2, 'montage');
imshow(final); // -> not working
imwrite(final,'path.....'); // -> also not working
答案 0 :(得分:0)
以下是您需要做的事情,能够以imshowpair
显示图片的方式保存图片:
I = imread('peppers.png'); % Dummy image.
I2 = imfilter(I, ones(3,3)); % Dummy image 2.
imshowpair(I, I2, 'montage');
I3 = [I, I2]; % This line makes a montage out of the two images.
imshow(I3) % This is effectively what imshowpair displays.
imwrite(I3, 'myfile.png'); % Save I3 to a file.