Info
此问题已关闭。 请重新打开它进行编辑或回答。
Specific image intensity for further processing.
1 次查看(过去 30 天)
显示 更早的评论
How do i select a specific intensity of an image? For example i would like to process only the intensity of 150 on grayscale image.
0 个评论
回答(2 个)
Image Analyst
2014-7-25
What does "process" mean? It's trivial to find a "map" - a binary image - that says where the pixels with value 150 are.
binaryImage = grayImage == 150;
But what you do after that depends on what you want to do. If you just want a 1D list of pixel values, you can do
pixelValues = grayImage(binaryImage); % Of course they will all equal 150.
If you want the sum of the pixels (the count), do
totalArea = sum(binaryImage(:));
If you want the perimeter, Solidity, Equivalent circular Diameter, or something like that, you'll have to do
labeledImage = bwlabel(binaryImage);
measurementsStructure = regionprops(labeledImage, grayImage, 'all');
You can pass in specific measurements instead of 'all' if you know what they are.
See the Image Segmentation Tutorial in my File Exchange for a better discussion and demo. http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
4 个评论
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!