Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Applying multiple Geometric Pattern Match Modes in C#

Solved!
Go to solution

I have a pattern match function that works well in the Vision Assistant for my images. I create a builder file or C file and it says I need to set the CWIMAQMatchGeometricPatternOptions.MatchMode to 7, which I take to mean as multiple match modes (There are 4. I'm assuming they are assigned values 1,2,4, and 8 and that they add together. 7=1+2+4).

 

In the Example program, it shows MatchModes being added together:

MatchMode =  CWIMAQGeometricMatchModes.cwimaqGeometricMatchOcclusionInvariant;

MatchMode = MatchOptions.MatchMode + CWIMAQGeometricMatchModes.cwimaqGeometricMatchRotationInvariant;

 

But this will not compile.

 

How do I add multiple modes?

0 Kudos
Message 1 of 2
(3,672 Views)
Solution
Accepted by topic author dstanisl

Found it:

 

You need to cast the number as a CWIMAQGeometricMatchModes

 

MatchOptions.MatchMode = (CWIMAQGeometricMatchModes) 7;
 

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