How to fix the Background Image scale in a overlay image
4 ビュー (過去 30 日間)
古いコメントを表示
%# some image I = im2double( imread('peppers.png') );
%# I create here a random mask (gaussian centered in middle of image) [r,c,~] = size(I); [X Y] = meshgrid(1:r,1:c); Z = mvnpdf([X(:) Y(:)], [r c]./2, diag(15.*[r c])); Z = (Z-min(Z(:)))./range(Z(:)); Z = reshape(Z',[c r])';
%# show image and mask separately subplot(121), imshow(I) subplot(122), imshow(Z)
%# show overlayed images figure, imshow(I), hold on hImg = imshow(Z); set(hImg, 'AlphaData', 0.6);
The result image shows that the background rgb image is different from the original image Can you fix the original scale? I don't want the black area to have any effect.
1 件のコメント
Rik
2017 年 4 月 20 日
Select your code and click on the {}Code button.
Have you tried the suggestion on StackOverflow of using h=imshow(I); set(h, 'AlphaData',Z)?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で 영상의 산술 연산 についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!