Automatic reposition of mask on image
Show older comments
Hello,
I'm beginner in digital image processing. I am working on application that requires automatic image masking. With image masking, I mean that I have to extract from the image not important areas with previously defined mask. I explain this by showing you image bellow:

As you can see in the image above, I used 'mask' in the shape of the star (red curved star shape), to extract only star from the image and get the resulting image that has only star on it. I simply did this by creating mask using matlab's roipoly() function, save created mask to HD, then multiply created mask with original image to 'mask' other features that are not star.
My problem is that I have to handle masking if star changes its position a little bit. For example star can move for 100px to the right. In this case the predefined mask (red star shaped) is not laying completely perfect on the star and masking is not correct. The problem I show you on the image below:

I ask you guys, if anybody can help me to handle the problem? I thought of some king of 'pattern matching' based on predefined object's shape, but I could not handle it. If the 'black star' is moved a little bit, the mask ('red star') should be also moved to mask the black star perfectly.
Thanks all for answers!
Accepted Answer
More Answers (0)
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!