LabVIEW Development Best Practices Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How to test case for a unit test of a picture manipulating VI?

Since the Unit Test Framework discussion was started in this forum by Elijah, I thought this would be the best place for this question.

I am busily adding unit tests to some of our previously developed reuse libraries and I have come across one that I am not sure how to build the test itself.  I know the method for creating a new unit test what I am having trouble is the test itself.

The VI in question simply takes in a path to an image and a reference to a picture control and then resizes the image to fill the draw area as much as possible i.e. it fits the image to the control.  I am having trouble setting up good test cases or perhaps I should say the evaulation methodolgy for the VI.  The VI can recieve a bmp, jpg, or png as an input.  I setup a user defined test and then added a picture control to the VI.  The plan was to have an array of paths to copies of the same image in different formats and compare the final state of the picture control to a predefined image constant.  That seemed easy enough, however one of my comparisons is failing but I can see the actual result and it is fine.  This is being a bit of a stumper so I would appreciate any suggestions anyone might have.

Thanks

Jason

Wire Warrior

Behold the power of LabVIEW as my army of Roomba minions streaks across the floor!
0 Kudos
Message 1 of 2
(3,953 Views)

Jason,

image comparision is a hard thing - humans can do much easier that algorithms. Even the smallest color or size difference is recognised by comparisions or intentionally ignored by humans.

What I do in such cases is to provide different comparision constants to each single comparisions or use a more tolerant comparision method. This would be something like:

For each single dot the difference of the actual basal color value from the expectation is below a given theshold. This can be quite slow, though.

0 Kudos
Message 2 of 2
(3,386 Views)