public void Transform(string pictureFileName) { using (var baseImage = DalContext.FindPictureByFileName(pictureFileName)) using (var grayScale = TransformImages.GrayScale(baseImage, baseImage.Width, baseImage.Height)) { var grayScaleColorMatrix = ColorsMatrix.Get(grayScale); Instance.Transform(grayScaleColorMatrix); } }
public int CalcThreshold(string pictureFileName) { using (var baseImage = DalContext.FindPictureByFileName(pictureFileName)) using (var grayScale = TransformImages.GrayScale(baseImage, baseImage.Width, baseImage.Height)) { var grayScaleColorMatrix = ColorsMatrix.Get(grayScale); return(Instance.CalcThreshold(grayScaleColorMatrix)); } }
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)); } }
public void Binarization(string pictureFileName) { using (var baseImage = DalContext.FindPictureByFileName(pictureFileName)) using (var grayScale = TransformImages.GrayScale(baseImage, baseImage.Width, baseImage.Height)) { var grayScaleColorMatrix = ColorsMatrix.Get(grayScale); var threshold = Instance.CalcThreshold(grayScaleColorMatrix); Instance.Binarization(grayScaleColorMatrix, threshold); } }
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)); } }