How to fix the Background Image scale in a overlay image
4 views (last 30 days)
Show older comments
%# 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 Comment
Rik
on 20 Apr 2017
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)?
Answers (0)
See Also
Categories
Find more on 영상의 산술 연산 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!