Assert









How do I use Assert
Below are practical examples compiled from projects for learning and reference purposes

Featured Snippets


File name: EigenObjectRecognizer.cs Copy
129       public EigenObjectRecognizer(Image[] images, String[] labels, double eigenDistanceThreshold, ref MCvTermCriteria termCrit)
130       {
131          Debug.Assert(images.Length == labels.Length, "The number of images should equals the number of labels");
132          Debug.Assert(eigenDistanceThreshold >= 0.0, "Eigen-distance threshold should always >= 0.0");
133
134          CalcEigenObjects(images, ref termCrit, out _eigenImages, out _avgImage);
135
136          /*
137          _avgImage.SerializationCompressionRatio = 9;
138
139          foreach (Image img in _eigenImages)
140              //Set the compression ration to best compression. The serialized object can therefore save spaces
141              img.SerializationCompressionRatio = 9;
142          */
143
144          _eigenValues = Array.ConvertAll, Matrix>(images,
145              delegate(Image img)
146              {
147                 return new Matrix(EigenDecomposite(img, _eigenImages, _avgImage));
148              });
149
150          _labels = labels;
151
152          _eigenDistanceThreshold = eigenDistanceThreshold;
153       }

Assert 95 lượt xem

Gõ tìm kiếm nhanh...