08-24-2011 10:39 AM
Hi guys,
Is there a way of comparing 2 JPG files and determine if tey are different?
Solved! Go to Solution.
08-29-2011 10:32 PM
Hello,
As I understand it there is an option within CVI that allows customers to compare the text of source files against one another using the edit » Diff command. Other than that, there is an active X call to the CVI_AppDiffTextFiles function, which also compares the contents of different text files. I am currently unaware as to the ability to compare .jpg contents. I will check my resources to verify that this is true and get back with you shortly.
08-30-2011 07:57 AM
Thanks Shawn, I think someone said something in the forum but in LabView. Let me know if you come across something.
Regards,
Javier
08-30-2011 08:15 AM - edited 08-30-2011 08:16 AM
Hello again,
I looked into this further this morning. If you open the LabWindows CVI Help, and search for "jpg". You get a handful of results. You will want to click on the article titled, "Using Bitmap Objects". The Bitmap is a two-dimensional grid of pixels that represents an image, and a bitmap can be created from multiple image types (including .jgp). You will want to create a bitmap for each .jpg file and programmatically trace through each value within the grid, subtracting each bitmap value from its corresponding value and storing the result into a new result array. Then just check the new bitmap where the results of the subtraction are stored for any non-zero values to determine if the files match and to what degree.
Try that and let me know how it goes!
08-30-2011 08:24 AM
Sounds good, I will get back to you.
Regards,
Javier