You can just get the max of the labeled image, then use ismember() to pull out the region you want
numRegions = max(labeledImage(:))
regionYouWant = 3;
extractedRegion = ismember(labeledImage, regionYouWant);
Of course you can also get the number of regions from bwlabel() or bwconncomp() when you created the labeled image from the binary image:
[labeledImage, numRegions] = bwlabel(binaryImage);
It will be the same as taking the max of the labeled image.
Best Answer