How to use Mask the Source image in vision.AlphaBlender?

13 vues (au cours des 30 derniers jours)
SUSHIRDEEP NARAYANA
SUSHIRDEEP NARAYANA le 14 Mar 2015
Commenté : cui,xingxing le 17 Sep 2022
I tried using this as suggested in Mathworks help but its showing error. Halphablender=vision.AlphaBlender('MaskSource','Input port','Mask','BinaryMask','LocationSource', 'Input port'); Its displaying The MaskSource property is not relevant in this configuration of the System object. Can someone please help me with this problem

Réponse acceptée

Clive Fox
Clive Fox le 2 Nov 2016
Modifié(e) : Walter Roberson le 22 Juin 2017
I had the same issue but MAthwork Tech gave the answer below:
Thank you for contacting MathWorks Technical Support.
The issue you are facing is because to use the variable 'mask', it has to be defined previously. Executing the following commands demonstrates the role of the mask parameter:
>> % load images
>> I1 = im2single(imread('blobs.png'));
>> I2 = im2single(imread('circles.png'));
>> % plot original images
>> figure
>> subplot(1,2,1);
>> imshow(I1);
>> subplot(1,2,2);
>> imshow(I2);
>> % full mask
>> halphablend = vision.AlphaBlender('Operation', 'Binary mask', 'MaskSource', 'Input port');
>> mask = ones(size(I2));
>> J1 = step(halphablend, I1, I2, mask);
>> % upper left corner of the mask is set to 0s
>> mask(1:end/2,1:end/2) = 0;
>> J2 = step(halphablend, I1, I2, mask);
>> % plot
>> figure;
>> imshow(J1);
>> figure;
>> imshow(J2);
  2 commentaires
Clay Swackhamer
Clay Swackhamer le 21 Juin 2017
Great thanks.
cui,xingxing
cui,xingxing le 17 Sep 2022
The above example program should be integrated into the official documentation, however the official documentation for the vision.AlphaBlender function example is too sketchy and should be replaced.

Connectez-vous pour commenter.

Plus de réponses (1)

Muhammad Danish
Muhammad Danish le 8 Jan 2019
Still showing error known as
Error using AlphaBlender/step
The Mask input must be a vector or a matrix.

Community Treasure Hunt

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

Start Hunting!

Translated by