how to dilate the gray scale image and threshold value only on ROI?
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (1)
BV
el 10 de Abr. de 2013
0 votos
8 comentarios
Image Analyst
el 10 de Abr. de 2013
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
el 14 de Abr. de 2013
Image Analyst
el 14 de Abr. de 2013
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
el 14 de Abr. de 2013
Susan
el 15 de Abr. de 2013
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
el 17 de Abr. de 2013
Susan
el 29 de Mayo de 2013
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.
Categorías
Más información sobre Image Segmentation en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!