You can compare two images using imagemagick.
You can download imagemagick from here. Version must be greater than 6.0. (like ImageMagick-6.4.3-Q16). Suppose you install in "C:\Program Files " folder then you can run command from this location C:\Program Files\ImageMagick-6.4.3-Q16>
After successfully installation you can use this below command
C:\Program Files\ImageMagick-6.4.3-Q16>compare -metric AE 5001.MAIN.jpg 5002.MAIN.jpg difference.jpg
if it returns value 0 means both images are same.
Even you can use -verbose attribute with this command to get more output.
C:\Program Files\ImageMagick-6.4.3-Q16>compare -verbose -metric AE 5001.MAIN.jpg 5002.MAIN.jpg difference.jpg
You can check this command with two different images, two same images.
There are some more command
C:\Program Files\ImageMagick-6.4.3-Q16> compare -compose src rose.jpg reconstruct.jpg difference.png
C:\Program Files\ImageMagick-6.4.3-Q16> compare -verbose -metric mae rose.jpg reconstruct.jpg difference.png
C:\Program Files\ImageMagick-6.4.3-Q16> compare -channel red -metric PSNR rose.jpg reconstruct.jpg difference.png
You can get more info from these link
http://www.imagemagick.org/script/compare.php
http://www.imagemagick.org/Usage/compare/
Tuesday, June 9, 2009
Subscribe to:
Post Comments (Atom)
How can I use this command using java. Actually I want image comparion using java code. This is my project requirement. Need your help.
ReplyDeleteI use this imagemgaick tools with java and got it workes fine. Thanks to give such useful information is very easy way.
ReplyDeleteThanks.
How did you use this command in Java. Is that possible to use in web based application and where to have the ImageMagick-6.5.3-7.i386.rpm in that case and how to call in jsp or servlet?
ReplyDeleteHi Raf,
ReplyDeleteYes, you can use ImageMagick command in java and servlet very easily. Please visit my this blog (http://binodjava.blogspot.com/2009/05/how-to-use-runtimegetruntimeexec-how-to.html) for how to use any command in java. In that blog, instead of
command.add("cmd.exe");
command.add("/c");
command.add("copy");
command.add(sourceFile);
command.add(destFile);
You have to use
command.add("C:\\Program Files\\ImageMagick-6.4.3-Q16\\compare.exe");
command.add("-metric AE ");
command.add(" 5001.MAIN.jpg ");
command.add(" 5002.MAIN.jpg ");
command.add(" difference.jpg");
Try yourself, if not work I will give complete code on how to compare image in java using imageMagick.
Regards,
Binod Suman
http://binodsuman.blogspot.com
can u please send me the java code to compare
ReplyDeleteHi Binod,
ReplyDeleteI tried to create a code to execute convert command to annotate the image with some text and compress it but, the destination file does not get created, can you please provide me your mail id, so, i can send you my code, as i am not able to copy it to this comment. Please help.
hey if possible can u pls send me the code at ayushi.gupta2@gmail.com
ReplyDeleteThanks Binod.. I tried it but was unsuccessful van you plz give me the code.
ReplyDeletevishwesh.bharati@gmail.com
Hi Binod,please could you send me the code for image comparisons using imagemagick and java. I need it urgently for a project. I have done some work with JAI, but i have problems using it for texture analysis. I would like to try your method. Thanks a mill
ReplyDeleteemail - dammyversion1@yahoo.com
Hi Binod..
ReplyDeletenice article and blog. Well can you send me the code for image comparisons using imagemagic and java? I am trying out various ways to do this. This is one way i wish to try.
Thanks in advance.
email id - gogo93@gmail.com
Hi Binod,
ReplyDeleteNice blog, After reading this blog am able to compare two images in command line. Actually i want to use this command in java.
If possible can u send me the code at srajtest@gmail.com
Thanks
Hi Binod, could you please send me the java code for image comparisons using imagemagick.
ReplyDeleteI learnt how to compare images in commandline from your blog. but i wanted to implement it in java for my project.
my id: srajtest@gmail.com
Hi Binod,
ReplyDeleteI learnt how to compare images in commandline from your blog. but i got to implement it in java for my project.Could you please send me the java code for image comparisons using imagemagick.
Thanks in advance...
ma id: sanju_p89@yahoo.co.in
hi.. i want java code to compare two images for my project..will you help
ReplyDeletesir,
ReplyDeletewe are doing project on iris recognition in mobile phones by usins sony ericcson emulator.
for that we need a java program about comparing images if both the images are same then the phone should unlock.
plz help us
thank u
Hi Binod,
ReplyDeletei need code to compare two images can u plz help me with the code.. will u plz send it to swati_kulakarni@rediffmail.com plzzz...
Hi binod, i need the java code so i can use it in a project.
ReplyDeletesend to me at sayed.abdelgleel@lognlabs.com
thanks,
Sayed
i need the java code to compare two images..can u pls help..pls mail it to me at aarthild@gmail.com
ReplyDeletethanks
hi binod,
ReplyDeletewe need the image comparisson jave code for our project pls send the code to rgopikrishnan91@gmail.com
thanks in advance
hey i used it. but i need it to implement in java.. can u please provide ur favour to me. my mail.id is prakukns@gmail.com
ReplyDeleteBinod, if you call native windows commands from a Java program, it sort of defeats the point of using Java, doesn't it ? Java programs should be compatible with any operating system, not just windows.
ReplyDeletewe need the image comparisson jave code for our project pls send the code to s.shyamprasath@gmail.com
ReplyDeletewe need the image comparison jave code for our project pls send the code to prankypuneet@gmail.com
ReplyDeleteas early as possible.
Thanks
:-)
need the image comparisson jave code for our project pls send the code to 334143@gmail.com
ReplyDeleteThnx in advance
halo i need the image comparision code in java i ve got code but its working if its true but not for different images and one more thing is the path i need to describe from where that image has to come i want automatically to uploat that image
ReplyDeletereply to Sonalikarwa27@gmail.com........... please sir make sure to help me with the need
i need the image comparision jave code for our project pls send the code to sonal2706@gmail.com
ReplyDeletethanks in advance..:-)
hi binod i need the code for comparision of two images using java and image magick can u please mail me that to m.santhosh2003@gmail.com
ReplyDeleteIs it possible to find percentage of similarities between two images using this software??please reply me.Thanks in advance.
ReplyDeleteHi all,
ReplyDeleteEven i need the code to do image compare in Java.Please the code.Thanks.Sumitsingh09@gmail.com
Regards,
Sumit