Image Comparison

Asked by KBaheti

Sir i want image comparison algorithm used by sikuli Can i get it?

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Lance Jensen (lance-ti) said :
#1

They are using IBMs open Cv code so you can get that package on the IBM website.

Otherwise if you are looking to see how they are using the open CV code you can download their java.jar file and unzip it to read the source code by decompiling it. That said I think they make the source available so that is not even necessary.

Lastly if your question is how are the matches found it seems like normalized template matching is being used. You can look that up on the net. The mask convoluted with itself should yield 1. Anything less than perfect should yield some fraction of that value. It seems they are using a threshold value of .7 to use as the default. This must have been found to be a good snap and forget ratio. If you are interested in learning, lookup template matching.

Hope this helps. Normally they are pretty fast to respond but I am not sure this is the type of question that the developers want to answer as it may be taken in a less than positive light.

I hope this helps,
Lance Jensen

Revision history for this message
KBaheti (kbaheti) said :
#2

What i want to do is ....

JAVA
1. Take query image that user want to match in database
2. Then compare image with images in database
3. If found then give percentage match
4. if not found then add it to database

I dont want to do image comparison and all that things so i need some inbuilt thing that might be
dll, jar, etc
Can you please help me?

Revision history for this message
Lance Jensen (lance-ti) said :
#3

I have helped you.

I already told you they have a .jar file on this site for using sikuli. If you want to use sikuli then read their documentation and at least gain some understanding what you are doing and ask specific targeted questions to their team. All you will have to do is import it to your project and implement the pattern matches based on what methods they have avalible. If their code is clean it should be less than a week without any documentation.

Otherwise read up on template matching. It is easy to do. You should be able to write a template matching program with Java Advanced Imaging in less than a week. That allows you to tweek your matches and gain fine control.

If you can't do either of those two things than you are not up to the task you are setting out to accomplish. Instead you should focus on leaning more about the applications field you want to work in. It will pay off in the long run.

I will make one more comment. you are going to have to determine for your self what the percentage match should be that qualifies as a new image and that will be a function of your application.

It should be noted that Sikuli may not be a good solution for building an image database. The reason why is that it is focused on providing a solution to a 2d problem space for a UI environment. But your application is building a knowledge base. For example, if you are building a database of animal pictures then you probably want to know what class it is tiger, dog, wale, ect. In addition, you may not want too many pictures of the same thing such as 1,000,000 tiger pictures. You could have the same picture but with different color encoding, scale, or rotation yield a close to .01 match.

As I said. I have helped as much as I can on work time. I hope you find this useful. If not, I am sorry I could not help you more.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#4

fully agreed.

this is a double of question https://answers.launchpad.net/sikuli/+question/126272.

again:

If you really want to use the java internals of the Sikuli classes, you have to scan the source:
http://bazaar.launchpad.net/%7Esikuli-dev/sikuli/0.10/files/head%3A/sikuli-script/src/main/java/edu/mit/csail/uid/

before that you can get an overview with:
http://sikuli.org/doc/java/

Revision history for this message
KBaheti (kbaheti) said :
#5

Thanks RaiMan, that solved my question.