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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 11 of 11

Thread: image comparsion

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default image comparsion

    hello
    i am student and working on my final project which is related to image comparison and semantic image searching.i started image comparison on the bases of RGB but it is not a good technique when image is in different size or in different format.
    i want to know which techniques can i use to get more efficiency in it and also for semantic image searching .


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: image comparsion

    What are you trying to compare between the two images? You say 'search', are you trying to search an image for something? Color, feature, sub-image? What does your algorithm currently compare?

  3. #3
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: image comparsion

    1 have to complete 2 task.1st to compare images and 2nd to show user other images which are related to user given image.
    I m not finding any specific feature from image, just trying to show how similar two or more images on the base of color and feature.I m beginner in image processing so I started on the base of color.My algo is simple it gets the RGB value of every pixel from the images and then store separately in 2 arrays then compare them.if 2 images pixels values are totally similar then it show 100% otherwise show the percentage according to similar pixels.
    My algo is going well for images of same size,, greysacle and also it giving efficient result if one image position is different(rotated,flip).

    "Problem" is when both images are in different sizes or different format, it gives wrong result due to different pixels value.
    Plz Tell me a better technique which can resolve my problem and also it compare on the base of features.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: image comparsion

    store separately in 2 arrays then compare them
    Can you describe what is in the arrays and how they are compared?
    Can you give an example?

    .if 2 images pixels values are totally similar
    What are the values here? What does totally similiar mean?
    Can you give an example?
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: image comparsion

    values are actually the combination of RGB code of some pixel like -1186128 (B=176 R= 237 G= 230)
    I use 2 array and initialized size of array according to the size(height*width) of images then store RGB values according to pixels position.like pixel value on position (0,0) store in array index zero and so on.
    After storing values of both images in different array,i simply used for loop to compare both arrays values.
    totally similar mean both arrays are equal.

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: image comparsion

    Are you saying that the content of the arrays is an exact duplication of the RGB values of the image?
    There is no processing or summing done to colors contained in the image.
    I don't see how that would allow the program to do more than say that the two images were identical or not.
    If you don't understand my answer, don't ignore it, ask a question.

  7. #7
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: image comparsion

    yes content of the arrays is an exact duplication of the RGB values of the image.
    I don't understand what you want to say. I know my technique is not good but it is giving right result to some extent.

  8. #8
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: image comparsion

    If the array is an exact duplicate of the image, what analysis of the contents of the array is done?
    What does the program do other than say all the pixels of two images are the same?
    If you don't understand my answer, don't ignore it, ask a question.

  9. #9
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: image comparsion

    You are asking too much complicated question ,May be i am not giving you clear concept of my algo.
    if all the pixel are not same then it just tell the number of similar pixels in both images.

  10. #10
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: image comparsion

    Just a wild guess, but I suppose you could resize both images to a significantly smaller equal size using an averaging algorithm, and then go pixel by pixel getting the Manhattan distance (look it up) between each pixel, and then get the sum of the squares of these distances and add them up.

  11. The Following User Says Thank You to curmudgeon For This Useful Post:

    larbie (January 15th, 2013)

  12. #11
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: image comparsion

    okk sir i will try to apply this..
    Can you tell me which technique is good for semantic image searching using java??

Similar Threads

  1. How can i store time in a variable for comparsion?
    By steven_bishop in forum Java Theory & Questions
    Replies: 3
    Last Post: December 2nd, 2012, 01:45 PM
  2. Image Doesn't Display with Qualified Image Path????
    By swaginator in forum What's Wrong With My Code?
    Replies: 5
    Last Post: March 31st, 2012, 12:29 AM
  3. Create image Jpeg from an object of Image class.
    By Ramandeep in forum File I/O & Other I/O Streams
    Replies: 2
    Last Post: December 31st, 2011, 11:34 PM
  4. Replies: 2
    Last Post: February 14th, 2011, 05:36 PM