I have a segmented image i want to process only the larger segment. so i want to make the remaining pixels as zero. Please help me how i can do it.
No products are associated with this question.
Use regionprops to get the areas then get them all in an array so you can determine the largest.
measurements = regionprops(labeledImage, 'Area'); allAreas = [measurements.Area]; [sortedAreas sortIndexes] = sort(allAreas); % Then mask your image or create a new one from the largest blob.