I have a greyscale image (I), and would like to apply different filters to different regions of that image in matlab (R2015b) (random and irregular shaped regions). I have a binarized version of what I would like the first filter applied to (attached). I'm not sure the best way to make a mask...I can load this binary image and use bwconncomp to locate connected components and define them as single vectors which won't work with poly2mask. Any suggestions for A. how to get a mask out of this binary image and B. how to use this mask to apply a filter to that part of the greyscale image?
Thanks in advance!
MASK=imread('/Users/bk/Desktop/FIJI_image/mask4.tif');
BACK=imcomplement(MASK);
I=imread('/Users/bk/Desktop/FIJI_image/Orig.tif');
I(~MASK)=0;
SE=ones(13,13);
A=stdfilt(I, SE);
minZ=min(min(A));
maxZ=max(max(A));
Low_High=[minZ maxZ];
var5=255/maxZ;
B=uint8(A*var5);
C=(imadjust(B,stretchlim(B),[]));
imtool(C);