Matlab - How to mask a 3-D image using a binary image -
i have image red, green, blue channel , binary version of image.
what want concatenate 2 images binary image works mask normal image.
i want select pixels color image 1 in binary.
i know should work cat
, or repmat
, since i'm pretty new matlab can't figure out how this, after reading docs of functions.
if have 3-d image i
, binary mask m
, can mask irrelevant bits 0 either multiplying image mask:
i = bsxfun(@times, i, m);
or logical indexing:
i(~mask(:, :, ones(1, size(i, 3)))) = 0;
Comments
Post a Comment