• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Similarity in images

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
i need to add a functionality to my application which has graphs. What exactly i have to do is i need to check the graphs for their similarity (images can be of different sizes), so how similar are the graphs. Definetely i have to check the pixels here. Can anyone give a help pointer as to which Java classes and methods should i use?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The first step would be deciding what features go to make up "similarity".

I suspect you are going to end up doing a LOT of custom programming to extract the features from the graphs by examining pixels.

If all the graphs are generated by your own program it would be a LOT easier to figure out similarity by working with the data that generates the graphs.

Bill
 
Gupta Nitin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How accurate will the result be if i use PixelGrabber to get an array of pixels and then compare them? Please tell me the API method of doing it... how to handle images in Java..any help Looking at Java APIs isn't helping much
 
Rancher
Posts: 43028
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What William is saying is that there is no API for this, and there is also no commonly agreed defnition of what constitutes image similarity.

Unless there is something about your graphs that would allow similarity to be meaningfully defined in graphical terms, it would be a lot simpler to look at the underlying data and compare similarity in numerical terms. The correlation coefficient is one such measure.
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pixel comparison is just not going to be much use, how would you compensate for scaling, color changes, image orientation, pie chart versus bar chart etc etc.

Do a google search for "image feature extraction java" - when I just did this I hit all sorts of interesting but generally very complicated stuff.

Bill
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are some neat products in this area. One company I read about catalogs known child porn images for the government and can recognize copies even fairly heavily edited in email, newsgroups, websites, etc. Big Brother is watching, but nice humans don't have to look at every bit of filth going by.
 
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You might be interested in learning about the (classic computer science) Edit Distance problem. This problem describes the difference between two universes of discourse where each is a monomorphic list with elements bounded by the equality relation.

e.g. in Haskell/Type Theory
Eq a => [a] -> [a]

Rough equivalent in Java:
Given interface EqualityRelation<A>{boolean isEqual(A a1, A a2);}
the method has a signature of:
<A extends EqualityRelation<A>> ed(List<A> xs, List<A> ys)
// not java.util.List of course

An image is exactly this (a list) and the description of your problem is exactly that of the edit distance problem, though, there might be algorithms that specialise further in your area that I am ignoring.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic