Ejemplo n.º 1
0
        /*
         * public MatchPosition Match(GrayImage sample, GrayImage template)
         * {
         *  Mat s = new Mat(sample.Size, DepthType.Cv8U, 1);
         *  s.SetTo<byte>(sample.Bits);
         *  Mat t = new Mat(template.Size, DepthType.Cv8U, 1);
         *  t.SetTo<byte>(template.Bits);
         *
         *  MatchPosition mp = Match(s, t);
         *  return mp;
         * }
         */

        public MatchPosition MatchWithOption(Mat sample, Mat template, AlignAlgorithm algorithm)
        {
            if (algorithm == AlignAlgorithm.patternMatch)
            {
                return(Match(sample, template));
            }
            if (algorithm == AlignAlgorithm.edgePatternMatch)
            {
                return(MatchThickEdge(sample, template));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 2
0
 public MatchPosition MatchWithOption(Mat sample, Rectangle virticalRect, Rectangle horizontalRect, AlignAlgorithm algorithm)
 {
     if (algorithm == AlignAlgorithm.lineScan)
     {
         return(LineScan(sample, virticalRect, horizontalRect));
     }
     else
     {
         return(null);
     }
 }