Question by
zhoushulun · Aug 19, 2016 at 12:09 PM ·
unity 5opencv
How to use watershed in OpencvForUnity
Hello, I'm stuck in this problem. In Emgucv, I use watershed by
Image<Gray, Int32> marker = new Image<Gray, Int32>(srcImg.Width, srcImg.Height);
marker.Draw(new CircleF(new PointF(Screen.width / 2, Screen.height / 2), 5), new Gray(255), -1);
CvInvoke.Watershed(srcImg, marker);
But, there is not Emgu.CV.Image in OpencvForUnity, so I do it as follow:
Mat marker = new Mat(srcImg.size(), CvType.CV_8U, new Scalar(0));
Core.circle(marker, new Point(srcImg.width() / 2, srcImg.height() / 2),5, new Scalar(255),-1);
marker.convertTo(marker,CvType.CV_32SC1);
Imgproc.watershed(srcImg, marker);
marker.convertTo(marker, CvType.CV_8U);
It doesn't work. What should I do to using watershed?
Comment
Your answer

Follow this Question
Related Questions
AR face Augmentation in Unity 0 Answers
OpenCVSharp in Unity error 0 Answers
iOs build fails on 5.3 1 Answer
Can't activate unity: License Error 0 Answers
how to use Facebook iOS SDK with unity? not Facebook unity SDK 1 Answer