Obtain trimap of the image

4 次查看(过去 30 天)
Nataliya
Nataliya 2015-2-8
Most image matting algorithms need image and trimap of the image as input. My question is how to get the trimap of the image? Is their any matlab command for that or any code... Please help. Thanks
  3 个评论
Nataliya
Nataliya 2015-2-8
I can use canny edge detector code to create the mask. But please guide how to get the trimap out of it
Erik S.
Erik S. 2015-2-8
Which function are you using for image matting?

请先登录,再进行评论。

回答(1 个)

Image Analyst
Image Analyst 2015-2-8
编辑:Image Analyst 2015-2-8
I've never heard of that term before. I had to look it up and found this: "trimap--a pre-segmented image consisting of three regions of foreground (what you want to cut out), background and unknown. Partial opacity values are then computed only for pixels inside the unknown region."
Normally people just call that the segmentation, segmented image, or classified image. Anyway, as I would hope that you realize. That TOTALLY depends on your image and what you consider to be foreground and background. So the algorithm to produce the "trimap" of course will vary also. But you forgot to attach your image and I can't answer any more until you do. Usually people give us an image to look at if they want image processing advice - it only makes sense. Use the green and brown picture icon, when you fix your post, to insert an image.
In the meantime, several methods are shown in my File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by