示例#1
0
 public ulong Get(string pictureFileName)
 {
     using (var baseImage = DalContext.FindPictureByFileName(pictureFileName))
         using (var grayScale = TransformImages.GrayScale(baseImage, 8, 8))
         {
             var grayScaleColorMatrix = ColorsMatrix.Get(grayScale);
             var threshold            = OtcuBinarization.CalcThreshold(grayScaleColorMatrix);
             return(Instance.Get(grayScaleColorMatrix, threshold));
         }
 }
示例#2
0
 public string ByImage(string pictureFileName)
 {
     using (var baseImage = DalContext.FindPictureByFileName(pictureFileName))
         using (var grayScale = TransformImages.GrayScale(baseImage, 128, 128))
         {
             var grayScaleColorMatrix = ColorsMatrix.Get(grayScale);
             var threshold            = OtcuBinarization.CalcThreshold(grayScaleColorMatrix);
             var result = Instance.ByImage(grayScaleColorMatrix, threshold);
             return(JsonConvert.SerializeObject(result));
         }
 }