I have a binary image with an ROI defined using imfreehand function; and I want to remove object touching the ROI border. imclearborder is a great function to remove border objects but it works for rectangular ROI. What is the less-costly method to do this? I tried using the freehand ROI border and "bwconncomp" function but it requires multiple loops which is costly for a big image.
MATLAB: Clearing border components from an imfreehand ROI
bwconncompimage processingImage Processing Toolboximclearborderimfreehandroi
Best Answer