Info

This question is closed. Reopen it to edit or answer.

restore more than pixel values

1 view (last 30 days)
yasser labeeb
yasser labeeb on 23 Oct 2014
Closed: MATLAB Answer Bot on 20 Aug 2021
how i can count and restore more than pixel values

Answers (1)

Image Analyst
Image Analyst on 23 Oct 2014
Describe exactly what the "more" is that you're referring to. And define what "restore" means to you.
Other than that about all we can say is "Use the Image Processing Toolbox."
  3 Comments
Image Analyst
Image Analyst on 23 Oct 2014
yasser, run my Image Segmentation Tutorial: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 It goes into all that. In short, if binaryImage is your segmented image, you do
logicalImage = bwlabel(binaryImage);
% Measure areas and perimeters
measurements = regionprops(logicalImage, 'Area', 'Perimeter');
allAreas = [measurements.Area];
allPerimeters = [measurements.Perimeter];
% Sort the areas
[sortedAreas, sortIndexes] = sort(allAreas);
% Sort other arrays the same way.
sortedPerimeters = allPerimeters(sortIndexes);
sortedCircularities = circularities(sortIndexes);
% Calculate how round (circular) the regions are.
circularities = allPerimeters .^ 2 / (4*pi*allAreas);
% Filter to get those where the circularity is less than 3
roundObjects = circularities < 3; % or whatever.
sortedAreas= sortedAreas(roundObjects);
sortedPerimeters = sortedPerimeters(roundObjects);
Image Analyst
Image Analyst on 25 Oct 2014
Yasser, did this work for you or not???

Community Treasure Hunt

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

Start Hunting!