public void watershed(Bitmap bm) { Image<Bgr, Byte> imWa = new Image<Bgr, byte>(bm); Image<Gray, Int32> imgr = new Image<Gray, int>(imWa.Width, imWa.Height); Rectangle rec = imWa.ROI; CvInvoke.cvZero(imgr); imgr.Draw(new CircleF(new PointF(rec.Left + rec.Width / 2.0f, rec.Top + rec.Height / 2.0f), (float)(Math.Min(imWa.Width, imWa.Height) / 4.0f)), new Gray(255), 0); CvInvoke.cvWatershed(imWa, imgr); pictureBox1.Image = imWa.ToBitmap() ; MessageBox.Show("imWa"); pictureBox1.Image = imgr.ToBitmap(); MessageBox.Show("imgr"); Bitmap bmF = new Bitmap(bm.Width, bm.Height); pictureBox1.Image = bmF; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)