how to dilate the gray scale image and threshold value only on ROI?
古いコメントを表示
I have a gray scale image that has several objects in it. can anyone tell me how to apply threshold only to one object( which is my ROI) in the image?
採用された回答
その他の回答 (1 件)
BV
2013 年 4 月 10 日
0 投票
8 件のコメント
Image Analyst
2013 年 4 月 10 日
This should have been a comment to Susan's answer, not an answer in itself. Where did you upload your image to? (Try http://snag.gy for an easy way.) You can mask an image like this:
% Mask the image.
maskedImage = bsxfun(@times, grayImage, cast(mask,class(grayImage)));
BV
2013 年 4 月 14 日
Image Analyst
2013 年 4 月 14 日
Mask out the circle - that looks fixed. Then try to threshold for dark things and do some clean up. Might have to call bwareaopen() to get rid of small junk.
BV
2013 年 4 月 14 日
Susan
2013 年 4 月 15 日
After masking and possibly after dilating and eroding with the diamond of radius 12 structuring element, I'd suggest doing marker-controlled watershed segmentation. The following link will take you to a help document about it. http://www.mathworks.com/help/images/examples/marker-controlled-watershed-segmentation.html I tried the algorithm on your image and it looks like it could work well with some modifications. After watershed segmentation you could subtract off the two largest areas it finds (using regionprops to find the largest areas), as they would correspond to the black mask background and the remaining image background. Then, you could create a bone-only mask from the remaining watershed regions found.
The only other thing I could suggest to find the bone most accurately is to define an initial contour with roipoly or roipolyold instead of using imellipse, and doing segmentation with active contours. The basic Kass snake works well as long as the initial contour is relatively close the object of interest. To account for motion in the images over time, you could find the average image and select the initial contour on that. Then, have the contour actually deform on the individual images.
BV
2013 年 4 月 17 日
Susan
2013 年 5 月 29 日
I know it's been a while, but just wanted to check in and see if you found something that would work for tracking the bone and the noise object? I'm curious, as I may need to do some sort of object tracking down the line for the projects I work on.
カテゴリ
ヘルプ センター および File Exchange で Image Segmentation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!