0
我再次运行查找等高线功能,但总是返回空白。OpenCV FindContours return empty
我Xamarin的Android代码:
var frame = new Mat();
bitmapOptions = new BitmapFactory.Options();
bitmapOptions.InScaled = false;
var bitmapTemplateOrig = BitmapFactory.DecodeResource(this.Resources, Resource.Drawable.abi_canny, bitmapOptions);
OpenCV.Android.Utils.BitmapToMat(bitmapTemplateOrig, frame);
bitmapTemplateOrig.Dispose();
Imgproc.CvtColor(frame, frame, Imgproc.ColorRgba2gray);
var contours = new List<MatOfPoint>();
Imgproc.FindContours(frame, contours, new Mat(), Imgproc.RetrList, Imgproc.ChainApproxSimple, new Core.Point(0, 0));
var size = contours.Count(); // returns 0 here?
任何想法?
我能获得518组的轮廓为这个图象的一半大小。你如何运行它? –
不知道。我为Android使用了Xamarin。我更新了我的代码。 –
@JeruLuke:你可以发布你的代码吗? –