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!