separating the larger area from the image

조회 수: 1 (최근 30일)
amogha
amogha 2014년 10월 21일
답변: Image Analyst 2014년 10월 21일
I have done labeling and getting how to proceed to next, please let me know how to separate the area
values greater than 6000(threshold) and get a image of it. allAreas =
Columns 1 through 13
6722 61 66 18 1504 10 422 52 4 6 4 22 65
Columns 14 through 26
233 48 2 127 6 61 24 182 2 10 24 37 10
Columns 27 through 39
59 22 17 4 5 2946 8 25 6 13 18 11 86
Columns 40 through 52
2 9 12 2 9 12 4 118 17 1547 27 5 61
Columns 53 through 65
93 2 6 2 6 14 10 9 27 6 11 10 2
Columns 66 through 78
2 6 414 69 48 29 88 186 5 14 13 110 6
Columns 79 through 91
4 66 36 2 2 718 7 36 13 8 61 10 15
Columns 92 through 104
9 117 2 3 30 15 21 274 17 8 2 13 13
Columns 105 through 115
9 2 10 2 6 3 6 3 7 8 4

채택된 답변

Image Analyst
Image Analyst 2014년 10월 21일
See my Image Segmentation Tutorial where I demonstrate just that. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 Here's a snippet:
% Now I'll demonstrate how to select certain blobs based using the ismember function.
% Let's say that we wanted to find only those blobs
% with an intensity between 150 and 220 and an area less than 2000 pixels.
% This would give us the three brightest dimes (the smaller coin type).
allBlobIntensities = [blobMeasurements.MeanIntensity];
allBlobAreas = [blobMeasurements.Area];
% Get a list of the blobs that meet our criteria and we need to keep.
allowableIntensityIndexes = (allBlobIntensities > 150) & (allBlobIntensities < 220);
allowableAreaIndexes = allBlobAreas < 2000; % Take the small objects.
keeperIndexes = find(allowableIntensityIndexes & allowableAreaIndexes);
% Extract only those blobs that meet our criteria, and
% eliminate those blobs that don't meet our criteria.
% Note how we use ismember() to do this.
keeperBlobsImage = ismember(labeledImage, keeperIndexes);
% Re-label with only the keeper blobs kept.
labeledDimeImage = bwlabel(keeperBlobsImage, 8); % Label each blob so we can make measurements of it

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Image Data Workflows에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by