Esempio n. 1
0
        private void SetTableEraserParam()
        {
            EraserParams env = new EraserParams();

            env.MinLenght          = (int)this.numMinLength.Value;
            env.LineRectRatio      = (int)this.numRatio.Value;
            env.MinScanLength      = (int)this.numMinStep.Value;
            env.MaxDotSpace        = (int)this.numMaxSpace.Value;
            env.HighSpeedStep      = (int)this.numHStep.Value;
            env.ExtractFrameMargin = (int)this.numExtraFrameMargin.Value;
            TableEraser.SetParams(env);
        }
Esempio n. 2
0
        /// <summary>
        /// EraseRuleLine
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void tsbEraseLines_Click(object sender, EventArgs e)
        {
            Image            processImg = this.picOrg.Image;
            List <Rectangle> regions    = this.picOrg.Frames.ToAllRects();

            if (processImg == null)
            {
                return;
            }
            picChg.Frames = this.picOrg.Frames;
            Bitmap targetImg = CloneIMage((Bitmap)processImg);

            ClearMessag();
            TableEraser eraser = new TableEraser(SetSubTimeCount);
            Image       resultImg;

            if (!this.tsbShowRuleLine.Checked)
            {
                counter.Start();
                resultImg = eraser.EraseLines(targetImg, Color.White, regions);
                counter.End();
                picChg.Image        = CloneIMage((Bitmap)resultImg);
                trackBarRight.Value = (int)picOrg.Zoom;
                picChg.Zoom         = picOrg.Zoom;
                picChg.Refresh();
            }
            else
            {
                counter.Start();
                resultImg = eraser.DrawLineRects(targetImg, Color.Red);
                counter.End();
                picChg.Image        = CloneIMage((Bitmap)resultImg);
                trackBarRight.Value = (int)picOrg.Zoom;
                picChg.Zoom         = picOrg.Zoom;
                picChg.Refresh();
            }
        }