RIO iteratively to create mask

4 vues (au cours des 30 derniers jours)
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar le 28 Déc 2021
clc;clear;close all
im=imread("coloredChips.png");
imshow(im);
for i=1:6
h(i)=drawcircle;
end
for i=1:6
mask.a(i)=h(i).createMask;
end
im1=inpaintCoherent(im,mask,"SmoothingFactor",0.5);
figure;imshow(im1)
  5 commentaires
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar le 28 Déc 2021
i want save masks and use or | operation to eliminate from orginal image
Rik
Rik le 28 Déc 2021
If you start with an array with only true, I don't see why using | wouldn't work. I don't see why you would need numbered variables.
I'm on mobile, so I can't run your code to test it. Is it returning an object instead of a binary image?

Connectez-vous pour commenter.

Réponse acceptée

DGM
DGM le 28 Déc 2021
Modifié(e) : DGM le 28 Déc 2021
This is a start
im = imread("coloredChips.png");
numROI = 6;
% create ROI objects and adjust them
imshow(im);
for k = 1:numROI
h(k) = drawcircle;
end
% wait until the user is done
input('Press enter when done adjusting ROI objects');
% build mask
mask = false(size(im,1),size(im,2));
for k = 1:numROI
mask = mask | createMask(h(k));
end
inpaintedimage = inpaintCoherent(im,mask,"SmoothingFactor",0.5);
%figure;
imshow(inpaintedimage)
  1 commentaire
Amir Azadeh Ranjbar
Amir Azadeh Ranjbar le 29 Déc 2021
% Thank you very much for your help

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Author Block Masks dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by