Generic Lossless Visible Watermarking—A              New Approach                    Submitted by              Manideep [R...
BONAFIDE CERTIFICATECertified that this project report “TITLE” is the bonafide work of “XXXX (7777777),ZZZZZZZZZZZZ (00000...
Completion Certificate
ABSTRACT
Abstract         A method for generic visible watermarking with a capability of losslessimage recovery is proposed. The me...
INTRODUCTION
Introduction       The advance of computer technologies and the proliferation of the Internet havemade reproduction and di...
watermarking techniques have been proposed in the past. The most common approach isto compress a portion of the original h...
AIM AND SCOPE OF    PROJECT
1.1 PURPOSE OF THE SYSTEM       In this project, we describe the proposed approach to lossless reversible visiblewatermark...
1.3 OBJECTIVES AND SUCCESS CRITERIA       In this paper, a new method for reversible visible watermarking with lossless im...
SYSTEM ANALYSIS
2.1 Existing system       Embedding of watermarks, either visible or invisible, degrade the quality of the hostmedia in ge...
2.3 Proposed System:       In this project, a new method for lossless visible watermarking is proposed by usingappropriate...
PROBLEMFORMULATION
3.1 HARDWARE REQUIREMENTS:        Processor          : Intel Pentium IV Processor        Ram                : 512MB.      ...
3.3 SOFTWARE AND TECHNOLOGIES DESCRIPTION:3.3 Java               Java is an object-oriented programming language developed...
3.3.2 JDBC API:            JDBC is a set of java API for executing SQL statements. This API consists of a set ofclasses an...
3.3.3 Functionality of JDBC API       The JDBC API supports three-tier model for database access. In the three-tier model,...
JDBC – ODBC Bridge DriverThe JDBC-ODBC Bridge plus ODBC driver       Sun Microsystems provides a driver to access ODBC dat...
3.3.5 Features of JAVAPlatform – IndependentChanges and upgrades in operating systems, processors and system resources wil...
SecureSince java supports applets which are programs that are transferred through internet, there mayarise a security thre...
Event HandlingEvent handling is how programs respond to external events, such as the user pressing a mousebutton. Swing pr...
component of Oracle Forms. We can build, generate and run an Oracle Forms application fromthe builder.                    ...
SYSTEM DESIGN
4.1 SYSTEM ARCHITECTURE:
4.2USECASE DIAGRAM
4.3Class Diagram:                    METHODS                    Getcontentpane()                    Setvisible()          ...
4.4 Dataflow Diagram:
MODULES
Reversible One-to-One Compound Mapping:Press Image Module           In this project, we are going to use two images to the...
SYSTEM TESTING
PROCESS:It provides a way to check the functionality of components, sub assemblies, assemblies and/or afinished product it...
7.2 INTEGRATION TESTING:Software integration testing is the incremental integration testing of two or more integratedsoftw...
IMPLEMENTATION
Implementation process:       Implementation is the stage of the project when the theoretical design is turned out into aw...
CONCLUSION
In this project, a new method for reversible visible watermarking with lossless imagerecovery capability has been proposed...
APPENDICES
9 .APPENDIX 1: SCREEN SHOTS:SCREEN SHOT 1:
SCREEN SHOT 2
SCREEN SHOT 3
SCREEN SHOT 4
SCREEN SHOT 5
CREEN SHOT 6
SCREEN SHOT 7
SCREEN SHOT 8
SCREEN SHOT 9
SCREEN SHOT 10
SCREEN SHOT 11
SCREEN SHOT 12
APPENDIX 2: Coding/////////////////////////////////////////////// MainFrame.java//////////////////////////////////////////...
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);setTitle("Generic Lossless Visible Watermarking—A New ...
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)         .addGroup(layout.createSequentialGroup()    ...
new MainFrame().setVisible(true);          }        });    }    // Variables declaration - do not modify//GEN-BEGIN:variab...
import java.awt.geom.AffineTransform;import java.awt.image.AffineTransformOp;import java.awt.image.BufferedImage;import ja...
jButton2 = new javax.swing.JButton();    jButton3 = new javax.swing.JButton();         jButton4 = new javax.swing.JButton(...
jDialog1.setTitle("Image Viewer");                                    javax.swing.GroupLayout   jDialog1Layout   =    newj...
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);setTitle("Input Window");jLabel1.setText("Press Image"...
jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14));jLabel4.setText("Enter the Inputs to Watermark");jButton2.setText("Cho...
jButton5.setText("Choose File");     jButton5.addActionListener(new java.awt.event.ActionListener() {       public void ac...
.addGap(30, 30, 30))                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.create...
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)          .addGroup(layout.createSequential...
.addComponent(jButton6)))            .addGap(303, 303, 303))          .addGroup(layout.createSequentialGroup()            ...
.addComponent(jLabel1)            .addGap(40, 40, 40)            .addComponent(jLabel2)            .addGap(42, 42, 42)    ...
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)                                          ...
.addGap(4, 4, 4)))         .addGap(10, 10, 10)         .addComponent(jLabel7)         .addPreferredGap(javax.swing.LayoutS...
pressText(jTextField2.getText(), jTextField5.getText(), "", 36, Color.white, 80, 0,0, 0.3f);                resize(jTextFi...
}//GEN-LAST:event_jButton2ActionPerformed        private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//G...
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed    // TODO...
label.setLocation(29, 37);                                 panel.add(label);                          JFrame frame = new J...
// setBorderPainted(false);        setBorder(null);        setText(null);        setSize(icon.getImage().getWidth(null), i...
int wideth_biao = src_biao.getWidth(null);                        int height_biao = src_biao.getHeight(null);        g.set...
BufferedImage         image    =   new      BufferedImage(width,   height,BufferedImage.TYPE_INT_RGB);                    ...
Image itemp = bi.getScaledInstance(width, height, bi.SCALE_SMOOTH);                      if ((bi.getHeight() > height) || ...
g.drawImage(itemp, (width - itemp.getWidth(null)) / 2, 0,itemp.getWidth(null), itemp.getHeight(null), Color.white, null); ...
*/public static void main(String args[]) {    java.awt.EventQueue.invokeLater(new Runnable() {      public void run() {   ...
private javax.swing.JLabel jLabel7;    private javax.swing.JTextField jTextField1;    private javax.swing.JTextField jText...
* always regenerated by the Form Editor.  */              //   <editor-fold   defaultstate="collapsed"   desc="Generated  ...
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.createSequentialGroup()                .addGap(34, 34, 34)    ...
//jLabel1.setIcon(new ImageIcon(name));    }    public static void main(String args[]) {        java.awt.EventQueue.invoke...
Bibliography
1) F. A. P. Petitcolas, R. J. Anderson, and M. G. Kuhn, “Informationhiding—A survey,” Proc. IEEE, vol. 87, no. 7, pp. 1062...
Generic lossless visible watermarking—a
Upcoming SlideShare
Loading in...5
×

Generic lossless visible watermarking—a

2,678

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,678
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
155
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Generic lossless visible watermarking—a

  1. 1. Generic Lossless Visible Watermarking—A New Approach Submitted by Manideep [Reg. Nos] C.DuraiVenkatesh[Reg. Nos] Govarthanan[Reg. Nos]in the partial fulfillment for the award of the degree of BACHELOR OF ENGINEERING in Department Name Here XXXXXXX COLLEGE OF ENGINEERING ANNA UNIVERSITY CHENNAI 600 025 APRIL 2010
  2. 2. BONAFIDE CERTIFICATECertified that this project report “TITLE” is the bonafide work of “XXXX (7777777),ZZZZZZZZZZZZ (0000000000)” who carried out the project work under my supervision.SIGNATURE SIGNATUREHEAD OF THE DEPARTMENT SUPERVISORSubmitted for the examination held on……………………………..INTERNAL EXAMINER EXTERNAL EXAMINER
  3. 3. Completion Certificate
  4. 4. ABSTRACT
  5. 5. Abstract A method for generic visible watermarking with a capability of losslessimage recovery is proposed. The method is based on the use of deterministic one-to-one compound mappings of image pixel values for overlaying a variety ofvisible watermarks of arbitrary sizes on cover images. The compound mappingsare proved to be reversible, which allows for lossless recovery of original imagesfrom watermarked images. The mappings may be adjusted to yield pixel values close to those ofdesired visible watermarks. Different types of visible watermarks, includingopaque monochrome and translucent full color ones, are embedded as applicationsof the proposed generic approach. A two-fold monotonically increasing compoundmapping is created and proved to yield more distinctive visible watermarks in thewatermarked image. Security protection measures by parameter and mappingrandomizations have also been proposed to deter attackers from illicit imagerecoveries. Experimental results demonstrating the effectiveness of the proposedapproach are also included.
  6. 6. INTRODUCTION
  7. 7. Introduction The advance of computer technologies and the proliferation of the Internet havemade reproduction and distribution of digital information easier than ever before.Copyright protection of intellectual properties has, therefore, become an important topic.One way for copyright protection is digital watermarking, which mean embedding ofcertain specific information about the copyright holder (company logos, ownershipdescriptions, etc.) into the media to be protected. Digital watermarking methods for images are usually categorized into two types:invisible and visible. The first type aims to embed copyright information imperceptiblyinto host media such that in cases of copyright infringements, the hidden information canbe retrieved to identify the ownership of the protected host. It is important for thewatermarked image to be resistant to common image operations to ensure that the hiddeninformation is still retrievable after such alterations. Methods of the second type, on theother hand, yield visible watermarks which are generally clearly visible after commonimage operations are applied. In addition, visible watermarks convey ownership information directly on themedia and can deter attempts of copyright violations. Embedding of watermarks, eithervisible or invisible, degrade the quality of the host media in general. A group oftechniques, named reversible watermarking, allow legitimate users to remove theembedded watermark and restore the original content as needed. However, not allreversible watermarking techniques guarantee lossless image recovery, which means thatthe recovered image is identical to the original, pixel by pixel. Lossless recovery isimportant in many applications where serious concerns about image quality arise. Someexamples include forensics, medical image analysis, historical art imaging, or militaryapplications. Compared with their invisible counterparts, there are relatively fewmentions of lossless visible watermarking in the literature. Several lossless invisible
  8. 8. watermarking techniques have been proposed in the past. The most common approach isto compress a portion of the original host and then embed the compressed data togetherwith the intended payload into the host. Another approach is to superimpose the spread-spectrum signal of the payload on the host so that the signal is detectable and removable. A third approach is to manipulate a group of pixels as a unit to embed a bit ofinformation .Although one may use lossless invisible techniques to embed removablevisible watermarks, the low embedding capacities of these techniques hinder thepossibility of implanting large-sized visible watermarks into host media. As to losslessvisible watermarking, the most common approach is to embed a monochrome watermarkusing deterministic and reversible mappings of pixel values or DCT coefficients in thewatermark region. Another approach is to rotate consecutive watermark pixels to embeda visible watermark. One advantage of these approaches is that watermarks of arbitrarysizes can be embedded into any host image. However, only binary visible watermarks canbe embedded using these approaches, which is too restrictive since most company logosare colorful. In this paper, a new method for lossless visible watermarking is proposed byusing appropriate compound mappings that allow mapped values to be controllable. The mappings are proved to be reversible for lossless recovery of the originalimage. The approach is generic, leading to the possibility of embedding different types ofvisible watermarks into cover images. Two applications of the proposed method aredemonstrated, where opaque monochrome watermarks and no uniformly translucent full-color ones are respectively embedded into color images. More specific compoundmappings are also created and proved to be able to yield visually more distinctive visiblewatermarks in the watermarked image. To the best knowledge of the authors, this is thefirst method ever proposed for embedding removable translucent full-color watermarkswhich provide better advertising effects than traditional monochrome ones.
  9. 9. AIM AND SCOPE OF PROJECT
  10. 10. 1.1 PURPOSE OF THE SYSTEM In this project, we describe the proposed approach to lossless reversible visiblewatermarking, based on which appropriate one-to-one compound mappings can be designed forembedding different types of visible watermarks into images. The original image can berecovered losslessly from a resulting watermarked image by using the corresponding reversemappings.1.2 SCOPE OF THE SYSTEM In this paper, a new method for lossless visible watermarking is proposed by usingappropriate compound mappings that allow mapped values to be controllable. The mappings areproved to be reversible for lossless recovery of the original image. The approach is generic,leading to the possibility of embedding different types of visible watermarks into cover images.Two applications of the proposed method are demonstrated, where opaque monochromewatermarks and no uniformly translucent full-color ones are respectively embedded into colorimages. More specific compound mappings are also created and proved to be able to yieldvisually more distinctive visible watermarks in the watermarked image. To the best knowledgeof the authors, this is the first method ever proposed for embedding removable translucent full-color watermarks which provide better advertising effects than traditional monochrome ones.
  11. 11. 1.3 OBJECTIVES AND SUCCESS CRITERIA In this paper, a new method for reversible visible watermarking with lossless imagerecovery capability has been proposed. The method uses one-to-one compound mappings thatcan map image pixel values to those of the desired visible watermarks. Relevant lemmas andtheorems are described and proved to demonstrate the reversibility of the compound mappingsfor lossless reversible visible watermarking. The compound mappings allow different types ofvisible watermarks to be embedded, and two applications have been described for embeddingopaque monochrome watermarks as well as translucent full-color ones. A translucent watermarkis clearly visible and visually appealing, thus more appropriate than traditional transparent binarywatermarks in terms of advertising effect and copyright declaration. The two-fold monotonicallyincreasing property of compound mappings was defined and an implementation proposed thatcan provably allow mapped values to always be close to the desired watermark if color estimatesare accurate. Also described are parameter randomization and mapping randomizationtechniques, which can prevent illicit recoveries of original images without correct input keys.Experimental results have demonstrated the feasibility of the proposed method and theeffectiveness of the proposed security protection measures.
  12. 12. SYSTEM ANALYSIS
  13. 13. 2.1 Existing system Embedding of watermarks, either visible or invisible, degrade the quality of the hostmedia in general. A group of techniques, named reversible watermarking, allow legitimate usersto remove the embedded watermark and restore the original content as needed. However, not allreversible watermarking techniques guarantee lossless image recovery, which means that therecovered image is identical to the original, pixel by pixel. Lossless recovery is important inmany applications where serious concerns about image quality arise. Some examples includeforensics, medical image analysis, historical art imaging, or military applications. Comparedwith their invisible counterparts, there are relatively few mentions of lossless visiblewatermarking in the literature. Several lossless invisible watermarking techniques have beenproposed in the past. The most common approach is to compress a portion of the original hostand then embed the compressed data together with the intended payload into the host. Anotherapproach is to superimpose the spread-spectrum signal of the payload on the host so that thesignal is detectable and removable. A third approach is to manipulate a group of pixels as a unitto embed a bit of information. Although one may use lossless invisible techniques to embedremovable visible watermarks, the low embedding capacities of these techniques hinder thepossibility of implanting large-sized visible watermarks into host media. As to lossless visiblewatermarking, the most common approach is to embed a monochrome watermark usingdeterministic and reversible mappings of pixel values or DCT coefficients in the watermarkregion. Another approach is to rotate consecutive watermark pixels to embed a visiblewatermark. One advantage of these approaches is that watermarks of arbitrary sizes can beembedded into any host image. However, only binary visible watermarks can be embedded usingthese approaches, which is too restrictive since most company logos are colorful.
  14. 14. 2.3 Proposed System: In this project, a new method for lossless visible watermarking is proposed by usingappropriate compound mappings that allow mapped values to be controllable. The mappings areproved to be reversible for lossless recovery of the original image. The approach is generic,leading to the possibility of embedding different types of visible watermarks into cover images.Two applications of the proposed method are demonstrated, where opaque monochromewatermarks and nonuniformly translucent full-color ones are respectively embedded into colorimages. More specific compound mappings are also created and proved to be able to yieldvisually more distinctive visible watermarks in the watermarked image. To the best knowledgeof the authors, this is the first method ever proposed for embedding removable translucent full-color watermarks which provide better advertising effects than traditional monochrome ones.
  15. 15. PROBLEMFORMULATION
  16. 16. 3.1 HARDWARE REQUIREMENTS: Processor : Intel Pentium IV Processor Ram : 512MB. Hard Disk : 40 GB. Compact Disk : 650 MB. Input device : Standard Keyboard and Mouse. Output device : VGA and High Resolution Monitor.3.2 SOFTWARE REQUIREMENTS: Operating System : Windows XP. Techniques : JDK 1.6 Front End : Java Back End : Ms-Access
  17. 17. 3.3 SOFTWARE AND TECHNOLOGIES DESCRIPTION:3.3 Java Java is an object-oriented programming language developed by SunMicrosystems, Inc. It is modeled after C++, and was designed to be small, simple, and portableacross platforms and operating systems at the source level and at the binary level. Java programs,which include applets and applications, can therefore run on any machine that has the JavaVirtual Machine, JVM, installed.3.3.1 Advantages of Java Java has significant advantages over other languages and environments that make itsuitable for just about any programming task.The advantages of Java are as follows:  Java is easy to learn.  Java was designed to be easy to use and is therefore easy to write, compile, debug, and learn than other programming languages.  Java is object-oriented.  This allows you to create modular programs and reusable code.  Java is platform-independent. One of the most significant advantages of Java is its ability to move easily from onecomputer system to another. The ability to run the same program on many different systems iscrucial to World Wide Web software, and Java succeeds at this by being platform-independent atboth the source and binary levels. Because of Javas robustness, ease of use, cross-platform capabilities and securityfeatures, it has become a language of choice for providing worldwide Internet solutions.
  18. 18. 3.3.2 JDBC API: JDBC is a set of java API for executing SQL statements. This API consists of a set ofclasses and interfaces to enable programmers to write pure Java Database applications. JavaDatabase Connectivity (JDBC) provides a database-programming API for Java programs. JavaSoft created the JDBC-ODBC bridge driver that translates the JDBC API to the ODBC API. It isused with ODBC drivers. The JDBC API is a java API for accessing virtually any kind of tabular data. JDBC standsfor “Java Database Connectivity”. The JDBC API consists of a set of classes and interfaceswritten in the java programming language that provides a standard API for tool/databasedevelopers and makes it possible to write industrial strength database applications using an all-java API. The JDBC API makes it easy to send SQL statements to relational database systems andsupports all dialects of SQL. But the JDBC 2.0 goes beyond SQL, also making it possible tointeract with other kinds of data sources, such as files containing tabular data. The value of theJDBC API is that an application can access virtually any data source and run on any platformwith a java virtual machine. In other words, with the JDBC API, it isn’t necessary to write oneprogram to access a Sybase database, another program to access on Oracle database, anotherprogram to access an IBM DB2 database and so on. One can write a single program using theJDBC API and the program will be able to send SQL or other statements to the appropriate datasource. And, with an application written in the java programming language, one doesn’t have toworry about writing different applications to run on different platforms. The combination of the Java platform and the JDBC API lets a programmer write onceand run anywhere, anytime.
  19. 19. 3.3.3 Functionality of JDBC API The JDBC API supports three-tier model for database access. In the three-tier model,commands are sent to a “middle tier” of services, which then sends the commands to the datasource. The data source processes the commands and sends the results back to the middle tier,which then sends them to the user. JDBC URLs allow driver writers to encode all necessary connection information withinthem. This makes it possible, for example, for an applet that wants to talk to a given database toopen the database connection without requiring the user to do any system administration chores. JDBC URLs allow a level of indirection. This means that the JDBC URL may refer to alogical host or database name that is dynamically translated to the actual name by a networknaming system. This allows system administrators to avoid specifying particular hosts as part ofthe JDBC name. There are a number of different network name services such as DNS, NIS andDCE and there is no restriction about which ones can be used.3.3.4 Different Types of Driver Managers: Jdbc driver manager is used to connect java application to the correct JDBC driver. JDBCdriver test suite is used to ensure that the installed JDBC driver is JDBC Compliant. There arefour different types of JDBC drivers. They are as follows:  The JDBC-ODBC Bridge plus ODBC driver  Native-API partly-Java driver  JDBC-Net pure Java driver  Native-protocol pure Java driver
  20. 20. JDBC – ODBC Bridge DriverThe JDBC-ODBC Bridge plus ODBC driver Sun Microsystems provides a driver to access ODBC data sources from JDBC. Thisdriver is called the JDBC-ODBC Bridge. The JDBC ODBC Bridge plus ODBC driver is a JavaSoft Bridge product that provides JDBC access via ODBC drivers. Figure 7.1 JDBC Driver ManagerResultSet A Result Set is a Java object that contains the results of executing an SQL query. In otherwords, it contains the rows that satisfy the conditions of the query. The data stored in a ResultSet object is retrieved through a set of get methods that allow access to the various columns ofthe current row. The ResultSet.next method is used to move to the next row of the Result Set.
  21. 21. 3.3.5 Features of JAVAPlatform – IndependentChanges and upgrades in operating systems, processors and system resources will not force anychange in java programs. This is the reason why Java has become a popular language forprogramming on Internet.PortableJava ensures portability in two ways. First, java compiler generates bytecode instructions thatcan be implemented on any machine. Secondly, the size of the primitive data types are machineindependent.Object orientedJava is a true objected oriented language. Almost everything in java is an object. All programcode and data must reside within objects and classes. Java comes with an extensive set of classesarranged in packages, that we can use in out programs by inheritance. The object model in javais simple and easy to extend.DistributedJava is designed as a distributed language for creating applications on networks. It has theability to share both date and programs.DynamicJava is a dynamic language. Java is capable of dynamically linking new class, libraries, methodsand objects.
  22. 22. SecureSince java supports applets which are programs that are transferred through internet, there mayarise a security threat. But java overcomes this problem by confining the applets to the runtimepackage or JVM and thus it prevents infections and malicious contents.RobustJava is said to be robust in two ways Java allocates and deallocates its dynamic memory on itsown. Java provides exception.MultithreadedJava supports a multithreaded program which allows you to write programs that do many thingssimultaneously. This is used in interactive network programs.InterpretedThe bytecode is interpreted by JVM. Even though interpreted, Java provides high performance.The byte code generated by the Java compiler for translating to native machine code with highperformance but the Just In Time (JIT) compiler in java.3.3.6 JAVA componentsSwingSwing is a set of classes that provides more powerful and flexible components that are possiblewith AWT and hence we adapted swing. In addition to normal components such as buttons,check box, labels swing includes tabbed panes, scroll panes, trees and tables. It provides extrafacilities than the normal AWT components.Layout managerContainers use layout managers to determine the size and position of the components theycontain. Borders affect the layout of swing GUIs by making swing components larger. You canalso use invisible components to affect layout.
  23. 23. Event HandlingEvent handling is how programs respond to external events, such as the user pressing a mousebutton. Swing program performs all their painting and event handling in the event-dispatchingthread.ThreadsIf you do something to a visible component that might depend on or affect its state, then youneed to do it from the event-dispatching thread. This isn’t an issue for many simple programs,which generally refer to components only in event-handling code. However, other programs needto use the invoke later method to execute component-related calls in the event-dispatchingthread.J FRAME:Like AWT’s frame class, the J Frame class can generate events when things happen to thewindow, such as the window being closed, activated, iconified or opened. These events can besent to a window Listener if one is registered with the frame.J File Chooser:It provides a simple mechanism for the user to choose a file. Here it points the users defaultdirectory.PL/SQLPL/SQL is an extension of SQL.PL/SQL block can contain any number of SQL statementsintegrated with flow of control statements. Thus PL/SQL combines the data manipulating powerof SQL with data processing power of procedural languages.FormsThis is a graphical tool used for generating and executing Forms based applications. A formbasically comprises blocks and fields. Multiple tables can be accessed over a single form, basedon the application with the help of transaction commands. Oracle Forms Builder is the design
  24. 24. component of Oracle Forms. We can build, generate and run an Oracle Forms application fromthe builder. JAVA ENVIRONMENT Figure 1
  25. 25. SYSTEM DESIGN
  26. 26. 4.1 SYSTEM ARCHITECTURE:
  27. 27. 4.2USECASE DIAGRAM
  28. 28. 4.3Class Diagram: METHODS Getcontentpane() Setvisible() Add Actionlistener SWING Objects JFrame JPanel New JFrame() JButton New JPanel() JLabel New JButton() JTextfield New JLabel() JScrollbar New JTextfield() New JScrollbar() JDBC Driver Connection Execute Query
  29. 29. 4.4 Dataflow Diagram:
  30. 30. MODULES
  31. 31. Reversible One-to-One Compound Mapping:Press Image Module In this project, we are going to use two images to thewatermark procedure. Copyright protection applications investigated is done in thismodule by converting numerical values into pixel values.Lossless Visible Watermarking Scheme:Press Text Module We will now derive the proposed generic lossless visiblewatermarking scheme in the form of a class of one-to-one compoundmappings, which can be used to embed a variety of visible watermarksinto images. The embedding is reversible, that is, the watermark can beremoved to recover the original image lossless.Security Considerations:Resize Module We do not want an attacker to be able to do the same. We proposesome security protection measures against illicit recoveries of originalimages.
  32. 32. SYSTEM TESTING
  33. 33. PROCESS:It provides a way to check the functionality of components, sub assemblies, assemblies and/or afinished product it is the process of exercising software with the intent of ensuring that theSoftware system meets its requirements and user expectations and does not fail in anunacceptable manner.There are various types of test. Each test type addresses a specific testing requirement.Functional testing is centered on the following items:Valid Input : Two Images, one Text.Invalid Input : Instead of images if you give text file.Functions : Watermarking procedure.Output : Watermarked image.7.1 UNIT TESTING:Unit testing is usually conducted as part of a combined code and unit test phase of the softwarelifecycle, although it is not uncommon for coding and unit testing to be conducted as two distinctphases.Test strategy and approachField testing will be performed manually and functional tests will be written in detail.Test objectives: All field entries had been tested with multiple values.Whether the message packet had been spoofed or not, checking by the capturing the packet ineach level of network.
  34. 34. 7.2 INTEGRATION TESTING:Software integration testing is the incremental integration testing of two or more integratedsoftware components on a single platform to produce failures caused by interface defects. Herethe each and every module had been tested individually. Once finish the unit wise testing the allmodules will added and build together and check with different parameter.Test Results: All the test cases mentioned above passed successfully. No defects encountered.7.3 ACCEPTANCE TESTING:User Acceptance Testing is a critical phase of any project and requires significant participationby the end user. It also ensures that the system meets the functional requirements.Test Results: All the test cases mentioned above passed successfully. No defects encountered.
  35. 35. IMPLEMENTATION
  36. 36. Implementation process: Implementation is the stage of the project when the theoretical design is turned out into aworking system. Thus it can be considered to be the most critical stage in achieving a successfulnew system and in giving the user, confidence that the new system will work and be effective. The implementation stage involves careful planning, investigation of the existing systemand it’s constraints on implementation, designing of methods to achieve changeover andevaluation of changeover methods. Implementation is the process of converting a new system design into operation. It is thephase that focuses on user training, site preparation and file conversion for installing a candidatesystem. The important factor that should be considered here is that the conversion should notdisrupt the functioning of the organization. The implementation can be preceded through Socket in java but it will be considered asone to all communication .For proactive broadcasting we need dynamic linking. So java will bemore suitable for platform independence and networking concepts. For maintaining routeinformation we go for MS-Access as database back end.
  37. 37. CONCLUSION
  38. 38. In this project, a new method for reversible visible watermarking with lossless imagerecovery capability has been proposed. The method uses one-to-one compound mappings thatcan map image pixel values to those of the desired visible watermarks. Relevant lemmas andtheorems are described and proved to demonstrate the reversibility of the compound mappingsfor lossless reversible visible watermarking. The compound mappings allow different types ofvisible watermarks to be embedded, and two applications have been described for embeddingopaque monochrome watermarks as well as translucent full-color ones. A translucent watermarkis clearly visible and visually appealing, thus more appropriate than traditional transparent binarywatermarks in terms of advertising effect and copyright declaration. The two-fold monotonicallyincreasing property of compound mappings was defined and an implementation proposed thatcan provably allow mapped values to always be close to the desired watermark if color estimatesare accurate. Also described are parameter randomization and mapping randomizationtechniques, which can prevent illicit recoveries of original images without correct input keys.Experimental results have demonstrated the feasibility of the proposed method and theeffectiveness of the proposed security protection measures.
  39. 39. APPENDICES
  40. 40. 9 .APPENDIX 1: SCREEN SHOTS:SCREEN SHOT 1:
  41. 41. SCREEN SHOT 2
  42. 42. SCREEN SHOT 3
  43. 43. SCREEN SHOT 4
  44. 44. SCREEN SHOT 5
  45. 45. CREEN SHOT 6
  46. 46. SCREEN SHOT 7
  47. 47. SCREEN SHOT 8
  48. 48. SCREEN SHOT 9
  49. 49. SCREEN SHOT 10
  50. 50. SCREEN SHOT 11
  51. 51. SCREEN SHOT 12
  52. 52. APPENDIX 2: Coding/////////////////////////////////////////////// MainFrame.java////////////////////////////////////////////////////////public class MainFrame extends javax.swing.JFrame{ /** Creates new form MainFrame */ public MainFrame() { initComponents();} /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the Form Editor. */ //<editor-folddefaultstate="collapsed" desc="Generated Code"> //GEN-BEGIN:initComponentsprivate void initComponents(){ jButton1 = new javax.swing.JButton();
  53. 53. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);setTitle("Generic Lossless Visible Watermarking—A New Approach");jButton1.setText("Start Watermarking");jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } });javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());getContentPane().setLayout(layout);layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(148, 148, 148) .addComponent(jButton1) .addContainerGap(167, Short.MAX_VALUE)));layout.setVerticalGroup(
  54. 54. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(122, 122, 122) .addComponent(jButton1) .addContainerGap(155, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: new InputWindow().show(); }//GEN-LAST:event_jButton1ActionPerformed /** * @param args the command line arguments */ public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() {
  55. 55. new MainFrame().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; // End of variables declaration//GEN-END:variables}///////////////////////////////////////Input Window.java////////////////////////////////////////////////////////import javax.swing.JOptionPane;import java.awt.AlphaComposite;import java.awt.Color;import java.awt.Font;import java.awt.Graphics2D;import java.awt.Image;
  56. 56. import java.awt.geom.AffineTransform;import java.awt.image.AffineTransformOp;import java.awt.image.BufferedImage;import java.io.File;import java.io.IOException;import javax.swing.*;import javax.imageio.ImageIO;public class InputWindow extends javax.swing.JFrame { public InputWindow() { initComponents(); jLabel7.setVisible(false); } private void initComponents() { jDialog1 = new javax.swing.JDialog(); jButton1 = new javax.swing.JButton();
  57. 57. jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jButton4 = new javax.swing.JButton();jButton5 = new javax.swing.JButton(); jButton6 = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel7 = new javax.swing.JLabel();jTextField1 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField();jTextField3 = new javax.swing.JTextField(); jTextField4 = new javax.swing.JTextField(); jTextField5 = new javax.swing.JTextField();
  58. 58. jDialog1.setTitle("Image Viewer"); javax.swing.GroupLayout jDialog1Layout = newjavax.swing.GroupLayout(jDialog1.getContentPane()); jDialog1.getContentPane().setLayout(jDialog1Layout); jDialog1Layout.setHorizontalGroup( jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jDialog1Layout.createSequentialGroup() .addGap(43, 43, 43) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 298,javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(59, Short.MAX_VALUE)) ); jDialog1Layout.setVerticalGroup( jDialog1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,jDialog1Layout.createSequentialGroup() .addContainerGap(35, Short.MAX_VALUE) .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 254,javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap()) );
  59. 59. setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);setTitle("Input Window");jLabel1.setText("Press Image");jLabel2.setText("Press Text");jLabel3.setText("Resize");jButton1.setText("Watermark");jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); }}); jButton6.setText("Lossless");jButton6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton6ActionPerformed(evt); }});
  60. 60. jLabel4.setFont(new java.awt.Font("Tahoma", 1, 14));jLabel4.setText("Enter the Inputs to Watermark");jButton2.setText("Choose File");jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); }});jButton3.setText("Choose File");jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); }});jButton4.setText("Choose File");jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); }});
  61. 61. jButton5.setText("Choose File"); jButton5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton5ActionPerformed(evt); } }); jLabel7.setFont(new java.awt.Font("Tahoma", 3, 14)); jLabel7.setForeground(new java.awt.Color(255, 0, 0)); jLabel7.setText("LossLess Visible Watermarking Output"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(24, 24, 24) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(49, 49, 49) .addComponent(jLabel4)
  62. 62. .addGap(30, 30, 30)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1) .addComponent(jLabel2) .addComponent(jLabel3)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 31,Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(jTextField3) .addComponent(jTextField2) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE,112, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jButton2) .addComponent(jButton3)) .addGap(0, 0, 0)))
  63. 63. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(29, 29, 29) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jTextField4,javax.swing.GroupLayout.PREFERRED_SIZE, 110,javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton4)) .addGroup(layout.createSequentialGroup() .addComponent(jTextField5,javax.swing.GroupLayout.PREFERRED_SIZE, 110,javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jButton5)))) .addGroup(layout.createSequentialGroup() .addGap(38, 38, 38) .addComponent(jButton1)
  64. 64. .addComponent(jButton6))) .addGap(303, 303, 303)) .addGroup(layout.createSequentialGroup() .addGap(271, 271, 271) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 474,javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(80, Short.MAX_VALUE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.createSequentialGroup() .addContainerGap(413, Short.MAX_VALUE) .addComponent(jLabel7) .addGap(257, 257, 257)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(22, 22, 22) .addComponent(jLabel4) .addGap(34, 34, 34) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(8, 8, 8)
  65. 65. .addComponent(jLabel1) .addGap(40, 40, 40) .addComponent(jLabel2) .addGap(42, 42, 42) .addComponent(jLabel3)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField1,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton2)) .addGap(40, 40, 40) .addComponent(jTextField2,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(60, 60, 60)
  66. 66. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField5,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton5))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField4,javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton4)) .addGap(60, 60, 60)))) .addGap(42, 42, 42) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE,javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jButton3) .addComponent(jButton1) .addComponent(jButton6))
  67. 67. .addGap(4, 4, 4))) .addGap(10, 10, 10) .addComponent(jLabel7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 366,javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(100, 100, 100)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed // TODO add your handling code here: JOptionPane.showMessageDialog(null, "You are about to watermark"); /* pressImage("G:imgtestsy.jpg", "G:imgtesttest1.jpg", 0, 0, 0.5f); pressText("bonton", "G:imgtesttest1.jpg", "", 36, Color.white, 80, 0, 0, 0.3f); resize("G:imgtesttest1.jpg", 500, 500, true);*/ pressImage(jTextField1.getText(), jTextField4.getText(), 0, 0, 0.5f);
  68. 68. pressText(jTextField2.getText(), jTextField5.getText(), "", 36, Color.white, 80, 0,0, 0.3f); resize(jTextField3.getText(), 500, 500, true); JOptionPane.showMessageDialog(null, "1 second..."); JOptionPane.showMessageDialog(null, "Watermarking Done. Please view the imagesinside the specified folder"); jLabel7.setVisible(true); String s=jTextField3.getText(); jLabel6.setIcon(new ImageIcon(s)); }//GEN-LAST:event_jButton1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed // TODO add your handling code here: JFileChooser chooser = new JFileChooser(); chooser.setSize(400, 300); chooser.showOpenDialog(this); File file=chooser.getSelectedFile(); jTextField1.setText(file.getAbsolutePath());
  69. 69. }//GEN-LAST:event_jButton2ActionPerformed private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed // TODO add your handling code here: JFileChooser chooser = new JFileChooser(); chooser.setSize(400, 300); chooser.showOpenDialog(this); File file=chooser.getSelectedFile(); jTextField4.setText(file.getAbsolutePath()); }//GEN-LAST:event_jButton4ActionPerformed private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed // TODO add your handling code here: JFileChooser chooser = new JFileChooser(); chooser.setSize(400, 300); chooser.showOpenDialog(this); File file=chooser.getSelectedFile(); jTextField5.setText(file.getAbsolutePath()); }//GEN-LAST:event_jButton5ActionPerformed
  70. 70. private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed // TODO add your handling code here: JFileChooser chooser = new JFileChooser(); chooser.setSize(400, 300); chooser.showOpenDialog(this); File file=chooser.getSelectedFile(); jTextField3.setText(file.getAbsolutePath()); //jLabel5.setIcon(new ImageIcon(s)); // jDialog1.setVisible(true); }//GEN-LAST:event_jButton3ActionPerformed private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) { JPanel panel = new JPanel(); String pic = "D:/Generic Lossless Visible Watermarking—A NewApproach/new src/JavaApplication6/src/watermark image/image backup/Lighthouse.jpg"; ImageLabel label = new ImageLabel(new ImageIcon(pic));
  71. 71. label.setLocation(29, 37); panel.add(label); JFrame frame = new JFrame(); frame.getContentPane().add(panel); frame.pack(); frame.setVisible(true);}class ImageLabel extends JLabel { public ImageLabel(String img) { this(new ImageIcon(img)); } public ImageLabel(ImageIcon icon) { setIcon(icon); // setMargin(new Insets(0,0,0,0)); setIconTextGap(0);
  72. 72. // setBorderPainted(false); setBorder(null); setText(null); setSize(icon.getImage().getWidth(null), icon.getImage().getHeight(null)); }} public final static void pressImage(String pressImg, String targetImg, int x, int y, float alpha) { try { File img = new File(targetImg); Image src = ImageIO.read(img); int wideth = src.getWidth(null); int height = src.getHeight(null); BufferedImage image = new BufferedImage(wideth, height,BufferedImage.TYPE_INT_RGB); Graphics2D g = image.createGraphics(); g.drawImage(src, 0, 0, wideth, height, null); Image src_biao = ImageIO.read(new File(pressImg));
  73. 73. int wideth_biao = src_biao.getWidth(null); int height_biao = src_biao.getHeight(null); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, alpha)); g.drawImage(src_biao, (wideth - wideth_biao) / 2, (height - height_biao) /2, wideth_biao, height_biao, null); g.dispose(); ImageIO.write((BufferedImage) image, "jpg", img); } catch (Exception e) { e.printStackTrace(); } } public static void pressText(String pressText, String targetImg, String fontName, intfontStyle, Color color, int fontSize, int x, int y, float alpha) { try { File img = new File(targetImg); Image src = ImageIO.read(img); int width = src.getWidth(null); int height = src.getHeight(null);
  74. 74. BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB); Graphics2D g = image.createGraphics(); g.drawImage(src, 0, 0, width, height, null); g.setColor(color); g.setFont(new Font(fontName, fontStyle, fontSize)); g.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_ATOP, alpha)); g.drawString(pressText, (width - (getLength(pressText) * fontSize)) / 2 +x, (height - fontSize) / 2 + y); g.dispose(); ImageIO.write((BufferedImage) image, "jpg", img); } catch (Exception e) { e.printStackTrace(); } } public static void resize(String filePath, int height, int width, boolean bb) { try { double ratio = 0.0; File f = new File(filePath); BufferedImage bi = ImageIO.read(f);
  75. 75. Image itemp = bi.getScaledInstance(width, height, bi.SCALE_SMOOTH); if ((bi.getHeight() > height) || (bi.getWidth() > width)) { if (bi.getHeight() > bi.getWidth()) { ratio = (new Integer(height)).doubleValue() /bi.getHeight(); } else { ratio = (new Integer(width)).doubleValue() / bi.getWidth(); } AffineTransformOp op = newAffineTransformOp(AffineTransform.getScaleInstance(ratio, ratio), null); itemp = op.filter(bi, null); } if (bb) { BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB); Graphics2D g = image.createGraphics(); g.setColor(Color.white); g.fillRect(0, 0, width, height); if (width == itemp.getWidth(null)) g.drawImage(itemp, 0, (height - itemp.getHeight(null)) / 2,itemp.getWidth(null), itemp.getHeight(null), Color.white, null); else
  76. 76. g.drawImage(itemp, (width - itemp.getWidth(null)) / 2, 0,itemp.getWidth(null), itemp.getHeight(null), Color.white, null); g.dispose(); itemp = image; } ImageIO.write((BufferedImage) itemp, "jpg", f); } catch (IOException e) { e.printStackTrace(); } } public static int getLength(String text) { int length = 0; for (int i = 0; i < text.length(); i++) { if (new String(text.charAt(i) + "").getBytes().length > 1) { length += 2; } else { length += 1; } } return length / 2; } /** * @param args the command line arguments
  77. 77. */public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new InputWindow().setVisible(true); } });}// Variables declaration - do not modify//GEN-BEGIN:variablesprivate javax.swing.JButton jButton1;private javax.swing.JButton jButton2;private javax.swing.JButton jButton3;private javax.swing.JButton jButton4;private javax.swing.JButton jButton5; private javax.swing.JButton jButton6;private javax.swing.JDialog jDialog1;private javax.swing.JLabel jLabel1;private javax.swing.JLabel jLabel2;private javax.swing.JLabel jLabel3;private javax.swing.JLabel jLabel4;private javax.swing.JLabel jLabel5;private javax.swing.JLabel jLabel6;
  78. 78. private javax.swing.JLabel jLabel7; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField3; private javax.swing.JTextField jTextField4; private javax.swing.JTextField jTextField5; // End of variables declaration//GEN-END:variables}//////////////////////////////////Image Viewer.java//////////////////////////////////////////////////////////////public class ImageViewer extends javax.swing.JFrame { /** Creates new form ImageViewer */ public ImageViewer() { initComponents(); } /** This method is called from within the constructor to * initialize the form. * WARNING: Do NOT modify this code. The content of this method is
  79. 79. * always regenerated by the Form Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel1 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Image Viewer"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 338,javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(52, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
  80. 80. .addGroup(javax.swing.GroupLayout.Alignment.TRAILING,layout.createSequentialGroup() .addGap(34, 34, 34) .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 255,Short.MAX_VALUE) .addContainerGap()) ); pack(); }// </editor-fold>//GEN-END:initComponents /** * @param args the command line arguments */ public void view() {// String name = chooser.getSelectedFile().getName(); // InputWindow iw=new InputWindow();
  81. 81. //jLabel1.setIcon(new ImageIcon(name)); } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new ImageViewer().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel jLabel1; // End of variables declaration//GEN-END:variables}
  82. 82. Bibliography
  83. 83. 1) F. A. P. Petitcolas, R. J. Anderson, and M. G. Kuhn, “Informationhiding—A survey,” Proc. IEEE, vol. 87, no. 7, pp. 1062–1078, Jul.1999.2) N. F. Johnson, Z. Duric, and S. Jajodia, Information Hiding.Steganography and Watermarking—Attacks and Countermeasures.Boston,MA: Kluwer, 2001.3) I. J. Cox, J. Kilian, F. T. Leighton, and T. Shamoon, “Secure spreadspectrum watermarking for multimedia,” IEEE Trans. Image Process.,vol. 6, no. 12, pp. 1673–1687, Jun. 1997.4) M. S. Kankanhalli, Rajmohan, and K. R. Ramakrishnan, “Adaptivevisible watermarking of images,” in Proc. IEEE Int. Conf. MultimediaComputing and Systems, 1999, vol. 1, pp. 568–573.5)Y. Hu and S.Kwong,“Wavelet domain adaptive visiblewatermarking,”Electron. Lett., vol. 37, no. 20, pp. 1219–1220, Sep. 2001.

×