How can I track the interface of image?
1 次查看(过去 30 天)
显示 更早的评论
Hi everyone. I have 75 binary frames. each frame has a size of Height=301 and width=1483. I attached you the first frame for your record. What I want is that I want to know the average height from the bottom of image to the interface where white pixel exist.let's say that I pick up 5 arbitrary points, as shown in the attached file and take an average of the height from these five points. This procedure must be repeated for all 75 frames. The idea is that we should track all white pixel in the domain from bottom to top of column. If there is white point then we store it, so that we can identify the interface of each image. any help would be appreciated.
0 个评论
采纳的回答
Image Analyst
2016-5-23
It depends. Do you want to go to the bottom of the little particles? Or just the big one. If you're interested in just the big one, use bwareafilt(binaryImage, 1) to extract just the biggest blob. If you want to get a smooth envelope that sort of goes between the large and small blobs, use activecontour (demo attached). If you want to just go to the bottom of any blob, then just process columns one at a time
[rows, columns] = size(binaryImage);
bottomRows = zeros(1, columns);
for col = 1 : columns
thisColumn = binaryImage(:, col);
botCol = find(thisColumn, 1, 'last');
if ~isempty(botCol)
% There is at least one white pixel in this column.
bottomRows(col) = botCol;
end
end
% Now find mean
theSum = sum(bottomRows);
numCols = sum(bottomRows ~= 0);
meanBottomRow = theSum / numCols;
5 个评论
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!