필터 지우기
필터 지우기

How to find difference in mask within a for loop?

조회 수: 2 (최근 30일)
Ram KARSH
Ram KARSH 2015년 3월 14일
편집: Geoff Hayes 2015년 3월 14일
I have a code. How i will find difference mask(k)-mask(k-1)?
[xgrid, ygrid] = meshgrid(1:size(img,2), 1:size(img,1));
for i = 1 : length(rk) % BUG found
% mask = ((xgrid - x).^2 + (ygrid - y).^2) <= rk(i).^2;
if (i == 1)
% Create the mask for first radius value
mask = ((xgrid - x).^2 + (ygrid - y).^2) <= rk(i).^2;
imshow(mask); % Debugging point
title ('For first radius');
tempVar = img(mask);
% Putting the value in the matrix
tempV(1:size(tempVar,1),i) = tempVar ;
else
mask2 = ((xgrid - x).^2 + (ygrid - y).^2) <= rk(i).^2;
figure; imshow(mask2); % Debugging point
title ('New Mask');
% Insert mask subtraction here
tempMaskSub = logical(mask2 - mask);
figure;imshow(tempMaskSub);
title ('Difference');
end
end

답변 (0개)

카테고리

Help CenterFile Exchange에서 Author Block Masks에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by