Clear Filters
Clear Filters

How can I track the interface of image?

7 views (last 30 days)
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.

Accepted Answer

Image Analyst
Image Analyst on 23 May 2016
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 Comments
Parham Babakhani Dehkordi
Parham Babakhani Dehkordi on 24 May 2016
I have another question.Imagine that I have a video. frequency is 50frames/s. from this video (named as A), we can extract 3128 frames. how can I extract these frames with the name 00001image-00002image....00010image...00100image...01000image and so on up to the last image which is 03128image . I want this photos in this subsequent way.

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!