WATERMARKING

Christopher Roger Mangundjaja S2178403E

I. USAGE

The program is a java application. To run it type java Watermarking.

The program only works for small host image, I haven't tested the limit. The program also still has a number of non vital bugs.

The program has two menus : File and Operations.
Under File there are three selections:

1. Open Mask Image : Use this to load and display the mask image.
2. Open Host Image : Use this to load and display the host image.
3. Save Watermarked Image : Use this to save the already watermarked image (do not forget to include the file extensions(jpg,png)).

Under Operations :

1. Visible Watermark Image :

Use this to create the Visible Watermark on the host image. After you select this a dialog box will pop out. Here you have to fill the alpha value and the top left coordinates of the mask image.

2. Create On The Fly Logo :

Use this to create on the fly logo. After filling the Id,Date,etc click the create logo button to create the logo. This will enable the logo as the mask image and you can then do Visible Watermarking on the mask image by selecting the Visible Watermark Image selection directly(but the host image must be loaded first).

3. Do corellation between Images :

Select this option if you wanted to verify the presence of the Visible watermark. The Corellation process takes some time. After it is finished the program should printed out the x and y coordinates of the mask and the first average and the second average in the command line and the peak should be visible. I have tested this using the rmitmaskg.png and TEST.jpg and it worked.

Screenshot1
Visible watermark

II. SOURCE CODE

Classes

A. Watermarking.java

This is the main class that calls the other clasess. This class extends the JFrame and also holds the menu file and operations.

B. Watermarkpanel.java

This class is the panel that holds all the images and also the class that holds the method for doing the operations. The Methods in this class:

1. void loadhost (String s)

This method is used to load the host image.

2. void loadmask (String s)

This method is used to load the mask image.

3. void setalpha()

This method creates a new options dialog for VWM and called the VWM function that does the VWM operations.

4. void procvwm()

This method does the VWM operations. First it will extract the images into arrays based on their rgba values. Then it finds the max and min rgb values and applied the VWM formula with the alpha value from the user. Then put everything back to the new VWM images.

5. void correl()

This method will do the corellation operations. First it extract all the images to arrays according to the rgba values. Do Laplacian edge detection to the images.Create a new kernel mask from the edge detected mask, rotate it 180 degrees applied it to the edge detected VWM image. Then it searches the peak value coordinates, do 11X11 average pixels with and without the center pixel.Scale the image to zoom in. Output the peak coordinates and the first and second average to commandline.

6. void savematermark (String s)

This method is used to save the VWM image to disk.

C. Logo.java

This class handles the creation of on the fly logo. It displays the Logo to be filled.

This class has one method that is getLogo(Component cmp, Container cont). This method receives the container and the component to be changed into an image and save it to disk. The reason I created this method with public access is because at that time I am not sure whether to allow other classes to use this method as well, so I decided to make it a public method.

D. Alphadg.java

This is just a class that produced the dialog box for the user to input the VWM options such as the x,y coordinates of the mask and the alpha value.

IV. FUNCTIONALITY

1. Visble Watermark Image

Screenshot1
Visible watermark

As you can see from the screenshot, the program lets the user to input the alpha value and the mask cooridinates and then proceed with the Watermarking operations.

2. On The Fly Logo

Screenshot1
On The Fly Logo1

Screenshot1
On The Fly Logo2

First the user creates the Logo, then do the Watermark.

3. Corellation Between Images(VWM)

Screenshot1
Corellation1

Screenshot1
Corellation2

The corellation operations. The reult is the peak with the corrdinates and the 11x11 average with and without the center pixel being displayed.

5. IO Operations

The program opens,load,display images from the disk and save images to disk.

V. REFERENCES

WPDM Lecture notes and Tutorial notes.