# Can we use a binary mask to embed a watermark in the roi?

2 views (last 30 days)
as825 on 4 Nov 2013
Commented: Walter Roberson on 7 Nov 2013
Inorder to embed a watermark in roi of an image, can we create a mask and on obtaining it can we embed it.

Walter Roberson on 4 Nov 2013
Let I, R, W be binary. Then consider
I or (R and W)
Image Analyst on 7 Nov 2013
I don't know what abstract form is. I'm envisioning either a list of x,y coordinates, or a logical image. In my work, either ROI or mask could be either form. ROIs are often simple shapes (boxes, circles) that are sometimes manually specified, though they don't have to be (they can have weird shapes). Masks can also be that, or they could be automatically generated irregularly shaped things, like you might get from thresholding. I don't think there's any general hard and fast definition but some people may have their own definitions. So I still don't know what akila means by "into the roi without mask".
Walter Roberson on 7 Nov 2013
For example specifying a center and a radius of a circle is an abstraction compared to specifying on a pixel-by-pixel basis whether the pixel is in the ROI or not. But ultimately for any given pixel there must be a decision procedure to decide whether it is in the ROI or not, but that decision procedure does not have to be in the form of a logical matrix.

Image Analyst on 5 Nov 2013
See my demo, attached below.
Image Analyst on 7 Nov 2013
Use poly2mask() to turn those coordinates into a binary image.
binaryImage = poly2mask(x, y, rows, columns);
Then use the code I gave you above.
outputImage(binaryImage) = inputImage(binaryImage);
Walter Roberson on 7 Nov 2013
The non-mask way of doing it would be to use inpoly() on a vectorized approximation of the outline of the circle.

### Categories

Find more on Watermarking 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!