Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: image compare

  1. #1
    Junior Member ana0429's Avatar
    Join Date
    Mar 2012
    My Mood
    Thanked 0 Times in 0 Posts

    Default image compare

    hi i am new here and started to study java programming (almost a week now).
    I have project that is called image comparison.
    This is the problem description.
    1.Program will convert image (jpg) to RGB values and send this values to csv file.
    2.program will identify the differences of the test image compare to the original image.
    -- Compare Red average ,Green Average and Blue average of original image to test image
    this what it looks like. Hope you can help me regarding on this..see attached

  2. #2
    Forum VIP
    Join Date
    Jun 2011
    My Mood
    Thanked 89 Times in 74 Posts
    Blog Entries

    Default Re: image compare

    Wow! One week into java and you are already taking on Image Manipulation. This is a pretty intense topic so make sure you can walk before you run.

    I wrote a tutorial on Image Processing. The theory section may be helpful. Basically, you will be loading each of the images as a BufferedImage and then iterated through the pixels, constructing two, two dimensional arrays that hold the RGB value of each pixel. Then you need to write a method that compares the two arrays and looks for differences (nested for loops) and returning the results (a two dimensional array of booleans would work). This is the easy part. There are two hard parts. The first is highlighting the differences. You could construct a another image using the first image and the results of the comparison that draws the different pixels yellow for example. The other hard part is trying to identify movement or scaling differences. For example, if you crop the second image by 1 pixel at the top, this algorithm would falsely identify ALL pixels as being altered.

    Like I said, image processing is a pretty complex topic so make sure you have the fundamentals down pat before you tackle this assignment.

Similar Threads

  1. Compare 2 XML iles
    By deep in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: October 9th, 2011, 10:17 AM
  2. Compare method
    By Evelina in forum What's Wrong With My Code?
    Replies: 9
    Last Post: October 16th, 2010, 02:07 PM
  3. Trying to somehow Compare Generics
    By Omega_ryan in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 14th, 2010, 12:58 PM
  4. how to compare two set values
    By humdinger in forum Collections and Generics
    Replies: 1
    Last Post: March 13th, 2010, 10:46 AM
  5. String + Compare // Might be too easy for ya
    By Jangan in forum Java Theory & Questions
    Replies: 1
    Last Post: October 18th, 2009, 05:40 PM