Pixel extraction and Reclassify

3 views (last 30 days)
I had segmented image and want to detect of these pixels by extracting all pixels that do not have the same label in their 3×3 neighborhood (N_ns), and then re-classify of these extracted pixels using local information in a 5×5 neighborhood (N_rl). What can I do? Thanks..

Accepted Answer

Image Analyst
Image Analyst on 12 Mar 2015
labelsYouWantToKeep = [3,5,9]; % Whatever blob numbers you want.
% Get a new labeled image with only those blobs in it.
newLabeledImage = ismember(originalLabeledImage, labelsYouWantToKeep);
imshow(newLabeledImage, []); % Display it.
% Remeasure with only those blobs in the image.
newMeasurements = regionprops(newLabeledImage);
  4 Comments
dian_pratama
dian_pratama on 17 Mar 2015
How about N_ns and N_rl? Can I apply that in matlab? I think before, #3 is 3x3 neighborhood, #5 is 5x5 neighborhood, and #9 is image size. LOL..
Image Analyst
Image Analyst on 17 Mar 2015
Explain more of what you want to do, especially about what you want to do with blobs based on what is in their "neighborhood". Say blob #15 and blob #27 have their centroids or perimeters within 9 pixels of each other - now what????

Sign in to comment.

More Answers (0)

Categories

Find more on Image Processing Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!