问题
I got that code from emgu's site, I fixed some bugs, but there is 2 more, which I can understand:
Rectangle[] regions;
regions = des.DetectMultiScale(gpuBgra);
Cannot implicitly convert type 'Emgu.CV.Structure.MCvObjectDetection[]' to 'System.Drawing.Rectangle[]'
How do I solve the problem?
回答1:
You can try this:
MCvObjectDetection[] results = hog.DetectMultiScale(gpuBgra);
Rectangle[] regions = new Rectangle[results.Length];
for (int i = 0; i < results.Length; i++)
regions[i] = results[i].Rect;
First, get the results as MCvObjectDetection[], then transform it into Rectangle[].
来源:https://stackoverflow.com/questions/56989219/how-to-implicitly-convert-type-emgu-cv-structure-mcvobjectdetection-to-syst