Profile of image in grey scales
Show older comments
Good afternoon, I would really appreciate if you could help me with a particular issue related with image analysis. I have a set of images in grey scales. From the images I require to get an edge of the profile. I have tried different commands to get the profile or edge of the flow. Using canny and imerode and imdilate commands the best that I got is as shown in the image. However I need to get an edge of the whole profile as with the red line in image attached.
Any suggestions
Thanks a lot in advance
Best regards,
The script for this part is:
threshold = graythresh(MyImage); bw = im2bw(MyImage,threshold); se = strel('disk',2); bw = imclose(bw,se); BWsdil = imdilate(bw, se); BWsdil = bwperim(BWsdil); BWoutline=edge(BWsdil, 'canny',0,1);
Segout = MyImage; Segout(BWoutline) = 255;
figure(1), imshow(Segout)

Answers (2)
Image Analyst
on 23 Apr 2013
You don't need edge detection at all. Just threshold and go along column by column using find() to find the top row. Something like (untested)
binaryImage = grayImage > 50; % Adjust the value to eliminate dark background.
binaryImage = bwareaopen(binaryImage, 200); % Get rid of blobs smaller than 200
imshow(binaryImage);
[rows columns] = size(binaryImage);
topRows = rows * ones(rows, columns, 'int32'); % Initialize
for col = 1 : columns
topRows(col) = find(binaryImage(:, col), 1, 'first');
end
4 Comments
Image Analyst
on 23 Apr 2013
Edited: Image Analyst
on 23 Apr 2013
Referring to your "Answer" below (which should have been a comment here)...
Why do you have 3 blobs? Aren't you after the top most surface? If you want them as three separate blobs, then just use
boundaries = bwboundaries(binaryImage);
And you should not lose all your data by getting rid of blobs smaller than 200 pixels.
Please post the original grayscale image with no canny and no red outlines.
600Seat
on 24 Apr 2013
600Seat
on 24 Apr 2013
600Seat
on 24 Apr 2013
600Seat
on 23 Apr 2013
0 votes
Categories
Find more on Object Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!