예제 #1
0
 public void ReloadBc()
 {
     if (ImgDefaultPath1 == null || ImgDefaultPath1.Length <= 0 || VsFace1 == null)
     {
         return;
     }
     try
     {
         var image1 = new Bitmap(new MemoryStream((byte[])ImgDefaultPath1.Clone()));
         var image2 = new Bitmap(new MemoryStream((byte[])ImgChangedImage.Clone()));
         var brightnessCorrection = new BrightnessCorrection();
         brightnessCorrection.AdjustValue = Mainform.btBrightness.Value;
         var image3             = brightnessCorrection.Apply(image1);
         var image4             = brightnessCorrection.Apply(image2);
         var contrastCorrection = new ContrastCorrection();
         contrastCorrection.Factor = Mainform.btContrast.Value;
         var bitmap1      = contrastCorrection.Apply(image3);
         var bitmap2      = contrastCorrection.Apply(image4);
         var memoryStream = new MemoryStream();
         bitmap1.Save(memoryStream, ImageFormat.Bmp);
         ImgPath1 = (byte[])memoryStream.GetBuffer().Clone();
         bitmap2.Save(memoryStream, ImageFormat.Bmp);
         ImgChangedImage = (byte[])memoryStream.GetBuffer().Clone();
         memoryStream.Close();
         bitmap1.Dispose();
         bitmap2.Dispose();
         DrawSquare(VsFace1);
     }
     catch
     {
     }
 }
예제 #2
0
        public Bitmap ToBrightnessCorrection(Bitmap Im)
        {
            AForge.Imaging.Filters.BrightnessCorrection Img = new BrightnessCorrection();
            Bitmap bmImage = AForge.Imaging.Image.Clone(new Bitmap(Im), PixelFormat.Format24bppRgb);

            return(Img.Apply(bmImage));
        }
        public Bitmap GetNewFrame(Bitmap source)
        {
            var newFrame = brightnessCorrection.Apply(source);

            source.Dispose();
            return(newFrame);
        }
        public Bitmap ChangeAttributes(Bitmap bitmap, int brightness, int contrast)
        {
            BrightnessCorrection bfilter = new BrightnessCorrection(brightness);
            ContrastCorrection   cfilter = new ContrastCorrection(contrast);

            return(bfilter.Apply(cfilter.Apply(bitmap.Clone(new Rectangle(0, 0, bitmap.Width, bitmap.Height), PixelFormat.Format24bppRgb))));
        }
        /// <summary>
        /// Applies filter to bitmap.
        /// </summary>
        /// <param name="image">Bitmap</param>
        /// <returns>Bitmap</returns>
        public Bitmap Apply(Bitmap image)
        {
            Bitmap clone = (Bitmap)image.Clone();

            if (sc.Saturation != 0)
            {
                sc.Apply(clone);
            }

            if (ce.Contrast != 0)
            {
                ce.Apply(clone);
            }

            if (this.bc.Brightness != 0)
            {
                bc.Apply(clone);
            }

            if (this.ec.Offset != 0)
            {
                ec.Apply(clone);
            }

            if (this.gc.Gamma != 1.0)
            {
                gc.Apply(clone);
            }

            return(clone);
        }
예제 #6
0
        void DisplayLiveView()
        {
            if (LiveViewData == null || LiveViewData.ImageData == null)
            {
                return;
            }
            MemoryStream stream = new MemoryStream(LiveViewData.ImageData,
                                                   LiveViewData.ImageDataPosition,
                                                   LiveViewData.ImageData.Length -
                                                   LiveViewData.ImageDataPosition);

            using (var bmp = new Bitmap(stream))
            {
                Bitmap res = bmp;
                if (Brightness != 0)
                {
                    BrightnessCorrection filter = new BrightnessCorrection(Brightness);
                    res = filter.Apply(res);
                }

                DisplayBitmap = BitmapFactory.ConvertToPbgra32Format(BitmapSourceConvert.ToBitmapSource(res));
                DrawGrid(DisplayBitmap);
                DisplayBitmap.Freeze();
                live_view_image.Source = DisplayBitmap;
            }
        }
예제 #7
0
 public void vcdnf(Object sender, NewFrameEventArgs e)
 {
     bf                = (Bitmap)e.Frame.Clone();
     bc.AdjustValue    = trackBar1.Value;
     cc.Factor         = trackBar2.Value;
     pictureBox1.Image = cc.Apply(bc.Apply(bf));
 }
예제 #8
0
        private void videoNewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap               bitmap           = (Bitmap)eventArgs.Frame.Clone();
            Threshold            thresholdFilter  = new Threshold(120);
            Grayscale            grayscaleFilter  = new Grayscale(0.2, 0.7, 0.07);
            BrightnessCorrection brightnessFilter = new BrightnessCorrection(brightnessVal);
            ContrastCorrection   contrastFilter   = new ContrastCorrection(contrastVal);
            SaturationCorrection saturationFilter = new SaturationCorrection(saturationVal);

            bitmap = brightnessFilter.Apply((Bitmap)bitmap.Clone());
            bitmap = contrastFilter.Apply((Bitmap)bitmap.Clone());
            bitmap = saturationFilter.Apply((Bitmap)bitmap.Clone());

            if (isGray)
            {
                bitmap = grayscaleFilter.Apply((Bitmap)bitmap.Clone());
            }
            if (isBW)
            {
                bitmap = grayscaleFilter.Apply((Bitmap)bitmap.Clone());
                bitmap = thresholdFilter.Apply(bitmap);
            }

            currentFrame = (Bitmap)bitmap.Clone();
            if (fileWriter != null)
            {
                fileWriter.WriteVideoFrame((Bitmap)bitmap.Clone());
            }
        }
예제 #9
0
 void vcd_NewFrame(Object s, NewFrameEventArgs a)
 {
     using (source_bmp = (Bitmap)a.Frame.Clone())
     {
         source_bmp    = bc.Apply(source_bmp);
         source_bmp    = cc.Apply(source_bmp);
         camview.Image = source_bmp;
         using (g = camview.CreateGraphics())
         {
             fx = (float)source_bmp.Width / (float)camview.Width;
             fy = (float)source_bmp.Height / (float)camview.Height;
             g.DrawLine(grid, camview.Width / 2, 0, camview.Width / 2, camview.Height - 1);
             g.DrawLine(grid, 0, camview.Height / 2, camview.Width - 1, camview.Height / 2);
         }
     }
 }
예제 #10
0
        public static Bitmap AdjustContrastBrightness(Bitmap input, int brightnessAdjustment, int contrastAdjustment)
        {
            BrightnessCorrection bCorrector = new BrightnessCorrection(brightnessAdjustment);
            ContrastCorrection   cCorrector = new ContrastCorrection(contrastAdjustment);

            return(bCorrector.Apply(cCorrector.Apply(input)));
        }
예제 #11
0
        private void CameraOne_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            if (isRecording1)
            {
                using (var bitmap = (Bitmap)eventArgs.Frame.Clone())
                {
                    if (firstFrameTime != null)
                    {
                        writer.WriteVideoFrame(bitmap, DateTime.Now - firstFrameTime.Value);
                    }
                    else
                    {
                        writer.WriteVideoFrame(bitmap);
                        firstFrameTime = DateTime.Now;
                    }
                }
            }

            Bitmap bitmap1 = (Bitmap)eventArgs.Frame.Clone();
            BrightnessCorrection br = new BrightnessCorrection(brightess1);
            ContrastCorrection cr = new ContrastCorrection(contrast1);
            SaturationCorrection sr = new SaturationCorrection(saturation1);
            bitmap1 = br.Apply((Bitmap)bitmap1.Clone());
            bitmap1 = cr.Apply((Bitmap)bitmap1.Clone());
            bitmap1 = sr.Apply((Bitmap)bitmap1.Clone());
            try
            { 
                pbCam1.Image = bitmap1;
            }
            catch (NullReferenceException ex)
            {
                Console.WriteLine("A problem with image loading occured! You may want to close other apps using your camera!");
            }
        }
예제 #12
0
        public static Bitmap BrightnessCorrection(Bitmap Imagem)
        {
            BrightnessCorrection filter = new BrightnessCorrection();

            Imagem = Imagem.Clone(new Rectangle(0, 0, Imagem.Width, Imagem.Height), System.Drawing.Imaging.PixelFormat.Format24bppRgb);
            Imagem = filter.Apply(Imagem);
            return(Imagem);
        }
 private void streamedFrame(object sender, NewFrameEventArgs eventArgs)
 {
     try
     {
         if (_isRecording)
         {
             recordVideo(eventArgs);
         }
         using (var bitmap = (Bitmap)eventArgs.Frame.Clone())
         {
             if (_isMonochromatic)
             {
                 using (var isgrayscaledBitmap = Grayscale.CommonAlgorithms.BT709.Apply(bitmap))
                     using (var monochromaticcBitmap = new Threshold(100).Apply(isgrayscaledBitmap))
                     {
                         bitmapImage = monochromaticcBitmap.ToBitmapImage();
                     }
             }
             else if (_isGrayScaled)
             {
                 using (var isGrayscaledBitmap = Grayscale.CommonAlgorithms.BT709.Apply(bitmap))
                 {
                     bitmapImage = isGrayscaledBitmap.ToBitmapImage();
                 }
             }
             else if (contrast != 0)
             {
                 ContrastCorrection filter = new ContrastCorrection((int)contrast);
                 using (var contrastBitMap = filter.Apply(bitmap))
                     bitmapImage = contrastBitMap.ToBitmapImage();
             }
             else if (brightness != 0)
             {
                 BrightnessCorrection bfilter = new BrightnessCorrection((int)brightness);
                 using (var brightnessBitMap = bfilter.Apply(bitmap))
                     bitmapImage = brightnessBitMap.ToBitmapImage();
             }
             else if (saturation != 0)
             {
                 SaturationCorrection bfilter = new SaturationCorrection((int)brightness);
                 using (var saturationBitMap = bfilter.Apply(bitmap))
                     bitmapImage = saturationBitMap.ToBitmapImage();
             }
             else
             {
                 bitmapImage = bitmap.ToBitmapImage();
             }
         }
         bitmapImage.Freeze();
         Dispatcher.BeginInvoke(new ThreadStart(delegate { VideoSource.Source = bitmapImage; }));
         motionDetect(eventArgs);
     }
     catch (Exception e)
     {
         MessageBox.Show("Error:\n", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
         StopCamera();
     }
 }
예제 #14
0
        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            BrLabel.Text = trackBar1.Value.ToString();
            int br = trackBar1.Value;

            if (pictureBox1.Image != null)
            {
                BrightnessCorrection brc = new BrightnessCorrection(br);
                pictureBox2.Image = brc.Apply((Bitmap)pictureBox1.Image.Clone());
            }
        }
예제 #15
0
        public Bitmap Apply(Bitmap input)
        {
            var            resize  = new Resize_filter(input.Width, input.Height);
            var            resMask = resize.Apply(_mask);
            GrayscaleToRGB grayscaleToRGBFilter = new GrayscaleToRGB();

            resMask = grayscaleToRGBFilter.Apply(resMask);
            resMask = _brightnessCorrection.Apply(resMask);
            Add subtractFilter = new Add(resMask);

            return(subtractFilter.Apply(input));
        }
예제 #16
0
        private void trackBar1_Scroll(object sender, EventArgs e)
        {
            lbDeger.Text = trackBar1.Value.ToString();

            if (pictureBox1.Image != null)
            {
                BrightnessCorrection brgCrr = new BrightnessCorrection(trackBar1.Value);
                try
                {
                    pictureBox2.Image = brgCrr.Apply((Bitmap)pictureBox1.Image.Clone());
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }
예제 #17
0
        private void Brightness_ValueChanged(object sender, RoutedPropertyChangedEventArgs <double> e)
        {
            BrightnessLabel.Content = Brightness.Value;
            brightness = (int)Brightness.Value;

            if (mainPhoto != null)
            {
                bc = new BrightnessCorrection(brightness);
                System.Drawing.Bitmap tmp = bc.Apply((System.Drawing.Bitmap)mainPhoto.Clone());
                //BitmapImage tmpBmpIs = ToBitmapImage(tmp);

                Photography.Source = ToBitmapImage(tmp);

                UpdateHistograms(tmp);
                UpdateChannelPreviews(tmp);
            }
        }
        private void CameraTwo_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap2          = (Bitmap)eventArgs.Frame.Clone();
            BrightnessCorrection br = new BrightnessCorrection(brightess1);
            ContrastCorrection   cr = new ContrastCorrection(contrast1);
            SaturationCorrection sr = new SaturationCorrection(saturation1);

            bitmap2 = br.Apply((Bitmap)bitmap2.Clone());
            bitmap2 = cr.Apply((Bitmap)bitmap2.Clone());
            bitmap2 = sr.Apply((Bitmap)bitmap2.Clone());

            pbCam2.Image = bitmap2;

            if (isRecording2)
            {
                writer.WriteVideoFrame(bitmap2);
            }
        }
예제 #19
0
        public void doBrightness(int bright)
        {
            Bitmap img = new Bitmap(path);
            BrightnessCorrection filter = new BrightnessCorrection((double)bright / 1000);

            img = filter.Apply(img);
            // ImageEView
            if (mov != null)
            {
                this.WorkItem.Workspaces[WorkspaceNames.TabWorkspace].Close(mov);
            }
            mov = this.WorkItem.SmartParts.AddNew <ImageEView>();
            mov.panAndZoomPictureBox1.Image = img;
            SmartPartInfo spi =
                new SmartPartInfo("Brightness Correction", "MyOwnDescription");

            this.WorkItem.Workspaces[WorkspaceNames.TabWorkspace].Show(mov, spi);
        }
예제 #20
0
 internal void ReapplyFilters()
 {
     if (this.currentDicomElement != null)
     {
         Bitmap bmp = this.visibleImage.Clone() as Bitmap;
         if (!imageSettings.IsDefaultBrightness())
         {
             BrightnessCorrection filter = new BrightnessCorrection(imageSettings.Brightness);
             bmp = filter.Apply(bmp);
         }
         if (!imageSettings.IsDefaultContrast())
         {
             ContrastCorrection filter = new ContrastCorrection(imageSettings.Contrast);
             // apply filter
             bmp = filter.Apply(bmp);
         }
         previewBox.Image = bmp;
     }
 }
예제 #21
0
        /// <summary>
        /// This is the method that actually does the work.
        /// </summary>
        /// <param name="DA">The DA object is used to retrieve from inputs and store in outputs.</param>
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Bitmap sourceImage = null;

            DA.GetData(0, ref sourceImage);
            int C = 0;

            DA.GetData(1, ref C);
            int B = 0;

            DA.GetData(2, ref B);
            double S = 0;

            DA.GetData(3, ref S);

            sourceImage = ImageUtil.convert(sourceImage, System.Drawing.Imaging.PixelFormat.Format32bppArgb);

            Bitmap filteredImage = sourceImage;

            if (C >= 0)
            {
                IFilter myFilterContrast = new ContrastCorrection(C);
                filteredImage = myFilterContrast.Apply(sourceImage);
            }
            else
            {
                IFilter myFilterContrast = new ContrastStretch();
                filteredImage = myFilterContrast.Apply(sourceImage);
            }

            IFilter myFilterBrightness = new BrightnessCorrection(B);

            filteredImage = myFilterBrightness.Apply(filteredImage);

            IFilter mySaturationFilter = new SaturationCorrection(Convert.ToSingle(S));

            filteredImage = mySaturationFilter.Apply(filteredImage);



            DA.SetData(0, filteredImage);
        }
예제 #22
0
파일: UsbCam.cs 프로젝트: Krl1/UP_L
        private void DisplayCapturedPicture(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap = new Bitmap(eventArgs.Frame, new Size(cameraPictureBox.Width, cameraPictureBox.Height));
            BrightnessCorrection brightnessCorrection = new BrightnessCorrection(Brightness);
            ContrastCorrection   contrastCorrection   = new ContrastCorrection(Contrast);
            SaturationCorrection saturationCorrection = new SaturationCorrection(Saturation * 0.1f);
            HueModifier          hueModifier          = new HueModifier(Hue);

            bitmap = brightnessCorrection.Apply((Bitmap)bitmap.Clone());
            bitmap = contrastCorrection.Apply((Bitmap)bitmap.Clone());
            bitmap = saturationCorrection.Apply((Bitmap)bitmap.Clone());
            bitmap = hueModifier.Apply((Bitmap)bitmap.Clone());

            if (connectedCameraIsRecording)
            {
                videoWriter.WriteVideoFrame(bitmap);
            }

            cameraPictureBox.Image = bitmap;
        }
예제 #23
0
        private void recordEventHandler(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap           = (Bitmap)eventArgs.Frame.Clone();
            BrightnessCorrection br = new BrightnessCorrection(brightess);
            ContrastCorrection   cr = new ContrastCorrection(contrast);
            SaturationCorrection sr = new SaturationCorrection(saturation);

            bitmap = br.Apply((Bitmap)bitmap.Clone());
            bitmap = cr.Apply((Bitmap)bitmap.Clone());
            bitmap = sr.Apply((Bitmap)bitmap.Clone());

            if (isRecording)
            {
                writer.WriteVideoFrame(bitmap);
            }
            else
            {
                oldBitmap  = bitmap;
                view.Image = bitmap;
            }
        }
예제 #24
0
        private void Video_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            brightness = new BrightnessCorrection(brightValue);
            contrast   = new ContrastCorrection(contrastValue);
            gamma      = new GammaCorrection(gammaValue);
            Bitmap image = (Bitmap)eventArgs.Frame.Clone();

            Graphics graphics = Graphics.FromImage(image);

            using (Pen pen = new Pen(Color.Green, 7))
            {
                //Top, left
                graphics.DrawLine(pen, 80, 28, 100, 28);
                graphics.DrawLine(pen, 80, 28, 80, 48);
                //Top, right
                graphics.DrawLine(pen, 80 + 146, 28, 80 + 126, 28);
                graphics.DrawLine(pen, 80 + 146, 28, 80 + 146, 48);
                //Bottom, left
                graphics.DrawLine(pen, 80, 35 + 171, 100, 35 + 171);
                graphics.DrawLine(pen, 80, 35 + 171, 80, 35 + 151);
                //Bottom, right
                graphics.DrawLine(pen, 80 + 146, 35 + 171, 80 + 126, 35 + 171);
                graphics.DrawLine(pen, 80 + 146, 35 + 171, 80 + 146, 35 + 151);
                //Middle left size
                graphics.DrawLine(pen, 80, 113, 80, 113 + 20);
                //Middle right size
                graphics.DrawLine(pen, 80 + 146, 113, 80 + 146, 113 + 20);
                //Middle top size
                graphics.DrawLine(pen, 146, 28, 166, 28);
                //Middle botom size
                graphics.DrawLine(pen, 146, 35 + 171, 166, 35 + 171);
                //graphics.DrawRectangle(pen, rectangle);
            }
            ptbImage.Image = brightness.Apply(gamma.Apply(contrast.Apply(image)));
            //ptbImage.Image = image;
            lblBrightness.Text = brightValue.ToString();
            lblContrast.Text   = contrastValue.ToString();
            lblGamma.Text      = gammaValue.ToString();
        }
예제 #25
0
        private void VideoCaptureDevice_NewFrame(object sender, NewFrameEventArgs e)
        {
            Bitmap image = (Bitmap)e.Frame.Clone();

            brightness = new BrightnessCorrection(jasnosc);
            image      = brightness.Apply((Bitmap)image.Clone());

            saturation = new SaturationCorrection(nasycenie);
            image      = saturation.Apply((Bitmap)image.Clone());

            contrast = new ContrastCorrection(kontrast);
            image    = contrast.Apply((Bitmap)image.Clone());

            if (recording == true)
            {
                writer.WriteVideoFrame(image);
            }

            if (detecting)
            {
                if (motionDetector.ProcessFrame(image) > 0.05)
                {
                    textBox4.Text     = "Wykryto ruch";
                    pictureBox1.Image = image;
                }
                else
                {
                    textBox4.Text     = "Brak ruchu";
                    pictureBox1.Image = image;
                }
            }
            else
            {
                pictureBox1.Image = image;
            }
        }
예제 #26
0
        private void CameraTwo_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            Bitmap bitmap2 = (Bitmap)eventArgs.Frame.Clone();
            BrightnessCorrection br = new BrightnessCorrection(brightess2);
            ContrastCorrection cr = new ContrastCorrection(contrast2);
            SaturationCorrection sr = new SaturationCorrection(saturation2);
            bitmap2 = br.Apply((Bitmap)bitmap2.Clone());
            bitmap2 = cr.Apply((Bitmap)bitmap2.Clone());
            bitmap2 = sr.Apply((Bitmap)bitmap2.Clone());

            try
            {
                pbCam2.Image = bitmap2;
            }
            catch (NullReferenceException ex)
            {
                Console.WriteLine("A problem with image loading occured! You may want to close other apps using your camera!");
            }

            if (isRecording2)
            {
                writer.WriteVideoFrame(bitmap2);
            }
        }
예제 #27
0
        public override void GetLiveImage()
        {
            lock (_locker)
            {
                try
                {
                    LiveViewData = LiveViewManager.GetLiveViewImage(CameraDevice);
                }
                catch (Exception)
                {
                    return;
                }

                if (LiveViewData == null || LiveViewData.ImageData == null)
                {
                    return;
                }
                MemoryStream stream = new MemoryStream(LiveViewData.ImageData,
                                                       LiveViewData.ImageDataPosition,
                                                       LiveViewData.ImageData.Length -
                                                       LiveViewData.ImageDataPosition);
                using (var bmp = new Bitmap(stream))
                {
                    Bitmap res     = bmp;
                    var    preview = BitmapFactory.ConvertToPbgra32Format(BitmapSourceConvert.ToBitmapSource(res));
                    var    zoow    = preview.Crop((int)(CentralPoint.X - (StarWindowSize / 2)),
                                                  (int)(CentralPoint.Y - (StarWindowSize / 2)),
                                                  StarWindowSize, StarWindowSize);
                    CalculateStarSize(zoow);
                    zoow.Freeze();
                    StarWindow = zoow;
                    if (CameraDevice.LiveViewImageZoomRatio.Value == "All")
                    {
                        preview.Freeze();
                        Preview = preview;
                    }


                    if (Brightness != 0)
                    {
                        BrightnessCorrection filter = new BrightnessCorrection(Brightness);
                        res = filter.Apply(res);
                    }
                    if (EdgeDetection)
                    {
                        var filter = new FiltersSequence(
                            Grayscale.CommonAlgorithms.BT709,
                            new HomogenityEdgeDetector()
                            );
                        res = filter.Apply(res);
                    }

                    var _bitmap = BitmapFactory.ConvertToPbgra32Format(BitmapSourceConvert.ToBitmapSource(res));
                    DrawGrid(_bitmap);

                    if (ZoomFactor > 1)
                    {
                        double d = _bitmap.PixelWidth / (double)ZoomFactor;
                        double h = _bitmap.PixelHeight / (double)ZoomFactor;
                        _bitmap = _bitmap.Crop((int)(CentralPoint.X - (d / 2)), (int)(CentralPoint.Y - (h / 2)),
                                               (int)d, (int)h);
                    }

                    _bitmap.Freeze();
                    Bitmap = _bitmap;
                }
            }
        }
예제 #28
0
        public override Bitmap ApplyFilter(List <Bitmap> bitmap)
        {
            BrightnessCorrection filter = new BrightnessCorrection(Value);

            return(filter.Apply(bitmap[0]));
        }
예제 #29
0
        public Bitmap BrightnessAdjust(Bitmap myBitMap, float value)
        {
            BrightnessCorrection filter = new BrightnessCorrection((int)value);

            return(filter.Apply(myBitMap));
        }
예제 #30
0
        /*---correction preview---*/
        private UnmanagedImage previewCorrection(int imgID)
        {
            orginalImage = UnmanagedImage.FromManagedImage((Bitmap)System.Drawing.Image.FromFile(examImages[imgID]));
            grayImage    = UnmanagedImage.Create(orginalImage.Width, orginalImage.Height, PixelFormat.Format8bppIndexed);
            //bright into gray
            Grayscale.CommonAlgorithms.BT709.Apply(brightnessFilter.Apply(orginalImage), grayImage);
            //invert
            invertFilter.ApplyInPlace(grayImage);

            // create rotation filter
            RotateBilinear rotationFilter = new RotateBilinear(-skewChecker.GetSkewAngle(grayImage));

            rotationFilter.FillColor = Color.Black;
            //rotationFilter.KeepSize = true;
            // rotate filter
            grayImage = rotationFilter.Apply(grayImage);

            //smooth
            smoothFilter.ApplyInPlace(grayImage);
            //threshold
            thresholdFilter.ApplyInPlace(grayImage);
            //size filter
            blobFilter.CoupledSizeFiltering = true;
            blobFilter.MinWidth             = minBlobWidth;
            blobFilter.MinHeight            = minBlobHeight;
            blobFilter.ApplyInPlace(grayImage);

            //shape filter
            blobCounter.ProcessImage(grayImage);
            Blob[] blobs = blobCounter.GetObjectsInformation();
            circleBlobs = new List <Blob>();

            int anchorLeft  = 0;
            int anchorRight = 0;

            Bitmap          detactFilter = new Bitmap(grayImage.ToManagedImage());
            Graphics        graphics     = Graphics.FromImage(detactFilter);
            List <IntPoint> edgePoints;

            AForge.Point center;
            float        radius;

            for (int i = 0; i < blobs.Length; i++)
            {
                edgePoints = blobCounter.GetBlobsEdgePoints(blobs[i]);
                // is circle
                if (shapeChecker.IsCircle(edgePoints, out center, out radius))
                {
                    circleBlobs.Add(blobs[i]);
                    graphics.DrawEllipse(bluePen, (float)(center.X - radius), (float)(center.Y - radius), (float)(radius * 2), (float)(radius * 2));

                    //is answerd?
                    if (blobs[i].Fullness > fullnessAvg)
                    {
                        graphics.DrawEllipse(greenPen, (float)(center.X - radius), (float)(center.Y - radius), (float)(radius * 2), (float)(radius * 2));

                        //understand comulmn limits
                        for (int d = 4; d >= 1; d--)
                        {
                            if (blobs[i].Rectangle.X < grayImage.Width / 4 * d)
                            {
                                anchorRight = grayImage.Width / 4 * d;
                                anchorLeft  = (grayImage.Width / 4 * d) - grayImage.Width / 4;
                            }
                        }

                        for (int j = i + 1; j < blobs.Length; j++)
                        {
                            if (blobs[j].Fullness > fullnessAvg && Math.Abs(blobs[i].Rectangle.Y - blobs[j].Rectangle.Y) < yMinDis && blobs[j].Rectangle.X <anchorRight && blobs[j].Rectangle.X> anchorLeft)
                            {
                                graphics.DrawEllipse(yellowPen, (float)(center.X - radius), (float)(center.Y - radius), (float)(radius * 2), (float)(radius * 2));
                            }
                        }
                    } //end of is answerd
                }     //end of is cricle
            }         //end of for


            return(grayImage);
        }