MATLAB Answers

0

how to mask certain regions when using superpixel

Asked by Sule Tekkesinoglu on 11 Sep 2019
Latest activity Commented on by Sule Tekkesinoglu on 12 Sep 2019
Hi,
When we are using superpixel, how can we only keep the certain region based on the superpixel index and mask the rest of the image?
Thanks.

  0 Comments

Sign in to comment.

1 Answer

Answer by darova
on 11 Sep 2019
 Accepted Answer

Try this simple example
clc,clear
A = imread('image.png');
[L,NumLabels] = superpixels(A,N);
ix = find(L == 1); % find first superpixel
L1 = L*0;
L1(ix) = 1;
subplot(121)
imshow(A)
subplot(122)
imshow(L1)
Accept the asnwer if it helped

  1 Comment

Sign in to comment.