LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing 2 jpeg using Labwindows

Solved!
Go to solution

Hi guys,

 

Is there a way of comparing 2 JPG files and determine if tey are different?

0 Kudos
Message 1 of 5
(3,363 Views)

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.

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments
0 Kudos
Message 2 of 5
(3,334 Views)

Thanks Shawn, I think someone said something in the forum but in LabView. Let me know if you come across something.

 

Regards,

Javier

0 Kudos
Message 3 of 5
(3,329 Views)
Solution
Accepted by topic author JHernan

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!

Regards,

Shawn S. | NIC
Instrument Driver/IVI PSE
National Instruments
0 Kudos
Message 4 of 5
(3,325 Views)

Sounds good, I will get back to you.

 

Regards,

Javier

0 Kudos
Message 5 of 5
(3,322 Views)