How to fix the Background Image scale in a overlay image
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
%# 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 commentaire
Rik
le 20 Avr 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)?
Réponses (0)
Voir également
Catégories
En savoir plus sur 영상의 산술 연산 dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!