Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i tried that code too. but its not working. as its return nothing but a total white output.
XML
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;

    
}
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900