How to save images with same resolution when using set() function?

1 回表示 (過去 30 日間)
Aj_ti
Aj_ti 2016 年 9 月 21 日
コメント済み: Walter Roberson 2016 年 9 月 21 日
According to code below, both of my inputs are size 250X250. But the code fail to get me output of same size as inputs.
E = rgb2gray(imread('nofill.png'));
imshow(E, 'InitialMag', 'fit')
I = rgb2gray(imread('black.png'));
imshow(I, 'InitialMag', 'fit')
imshow(E, 'InitialMag', 'fit')
% Make a truecolor all-green image.
green = cat(3, zeros(size(E)),ones(size(E)), zeros(size(E)));
hold on;
h = imshow(green);
hold off
% Use our influence map as the
% AlphaData for the solid green image.
set(h, 'AlphaData', I)
imwrite(
% print('test','-dpng')
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 9 月 21 日
Your imwrite() appears to have gotten corrupted in the posting.

サインインしてコメントする。

回答 (0 件)

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by