Info
This question is closed. Reopen it to edit or answer.
restore more than pixel values
1 view (last 30 days)
Show older comments
how i can count and restore more than pixel values
0 Comments
Answers (1)
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
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);
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!