示例#1
0
        private VerificationStatus VerifyElasto(ref Elastogram workingElasto, out ElastoBlob workingBlob)
        {
            workingElasto.GetFibroLine();
            _fibroline = workingElasto.Fibroline;
            workingElasto.PaintOverFibroline();
            workingElasto = new Elastogram(new SimpleGrayImage(workingElasto.Image.Bitmap.GrayscaleKuwahara(KuwaharaKernel)));

            _workingElasto = new Elastogram(new SimpleGrayImage(_workingElasto.Image.Bitmap.MorphologyNiblackBinarization(
                                                                    MorphologyBin_K, MorphologyBinLocalRadius, MorphologyBinGlobalRadius, MorphologyBinThreshold)));

            workingElasto.RemoveEdgeObjects(LeftEdgeDistance1, LeftCentralEdgeDist1,
                                            LeftEdgeDistance2, LeftCentralEdgeDist2,
                                            RightEdgeDistance, RightCentralEdgeDist);

            workingElasto = new Elastogram(new SimpleGrayImage(workingElasto.Image.Bitmap.MorphologyOpening(MorphologyOpeningKernel)));

            workingElasto.CropObjects(CropSteps, CropDistance);

            workingElasto.ChooseContour(AreaProportion, AreaMinLimit, HeightProportion);

            workingBlob = workingElasto.TargetObject;

            if (workingBlob == null)
            {
                return(VerificationStatus.NotCalculated);
            }

            workingBlob.Approximate(ElastogramTopIndention, SampleShare, OutliersShare, RansacIterations);
            return((new OldElastoClassificator()).Classiffy(workingBlob, _fibroline));
        }
示例#2
0
        private void Proceed()
        {
            _workingElasto = LoadGrayElstogram();
            _elastoStatus  = VerifyElasto(ref _workingElasto, out _workingBlob);

            _workingUltrasoundModM = LoadGrayUltrasoundModM(UsDeviationThreshold, UsDeviationStreak);
            //_ultrasoundModeMStatus = _workingUltrasoundModM.DeviationStreakLines.Count < BadLinesLimit ? VerificationStatus.Correct : VerificationStatus.Incorrect;
            _ultrasoundModeMStatus = _workingUltrasoundModM.getBrightLines(ModMThreshold, ModMBrightPixelLimit).Count < ModMBrightLinesLimit ? VerificationStatus.Correct : VerificationStatus.Incorrect;

            _workingUltrasoundModA = LoadGrayUltrasoundModA();
            _ultrasoundModeAStatus = _workingUltrasoundModA.RelativeEstimation > ModARelativeEstimationLimit ? VerificationStatus.Correct : VerificationStatus.Incorrect;
        }
        public Image Step6Morphology(int morphologyTimes)
        {
            if (!_debugMode)
            {
                throw new Exception("Can`t use this method in production mode");
            }

            Bitmap result = _workingElasto.Image.Bitmap.MorphologyOpening(morphologyTimes);

            _workingElasto = new Elastogram(new SimpleGrayImage(result));

            return(_workingElasto.Image.Bitmap);
        }
        public Image Step3KuwaharaElasto(int kernel)
        {
            if (!_debugMode)
            {
                throw new Exception("Can`t use this method in production mode");
            }

            Bitmap result = _workingElasto.Image.Bitmap.GrayscaleKuwahara(kernel);

            _workingElasto = new Elastogram(new SimpleGrayImage(result));

            return(result);
        }
        public Image Step4SimpleMorphologyBinarization(ref long timer, int morphologyKernel = 8, byte morphologyThreshold = 65)
        {
            if (!_debugMode)
            {
                throw new Exception("Can`t use this method in production mode");
            }

            Stopwatch watch = Stopwatch.StartNew();

            Bitmap result = _workingElasto.Image.Bitmap.MorphologySimpleBinarization(morphologyKernel, morphologyThreshold);

            _workingElasto = new Elastogram(new SimpleGrayImage(result));

            watch.Stop();
            timer = watch.ElapsedMilliseconds;

            return(result);
        }
        public Image Step4WolfJoulionBinarization(ref long timer, double k = 0.2, int radius = 20)
        {
            if (!_debugMode)
            {
                throw new Exception("Can`t use this method in production mode");
            }

            Stopwatch watch = Stopwatch.StartNew();

            Bitmap result = _workingElasto.Image.Bitmap.WolfJoulionBinarization(k, radius);

            _workingElasto = new Elastogram(new SimpleGrayImage(result));

            watch.Stop();
            timer = watch.ElapsedMilliseconds;

            return(_workingElasto.Image.Bitmap);
        }
        public Image Step4MorphologyNiblackBinarization(ref long timer, double k = 0.2, int localRadius    = 20,
                                                        int globalRadius         = 8, byte globalThreshold = 65)
        {
            if (!_debugMode)
            {
                throw new Exception("Can`t use this method in production mode");
            }

            Stopwatch watch = Stopwatch.StartNew();

            //WorkingElasto.Image.DrawVerticalGrayLine(0, 150, 85, 128);
            Bitmap result = _workingElasto.Image.Bitmap.MorphologyNiblackBinarization(k, localRadius, globalRadius, globalThreshold);

            _workingElasto = new Elastogram(new SimpleGrayImage(result));
            watch.Stop();
            timer = watch.ElapsedMilliseconds;

            return(result);
        }