我使用Image.InRange从图像创建一个蒙版。为了保持最大性能,我使用Image.ROI裁剪图像,并在使用InRange方法之前。为了实际处理图像,我需要它具有与原始尺寸相同的尺寸,但对我而言,显而易见的是如何缩放图像,而不是更改保留图像的尺寸。调整图像<Gray, byte>无缩放。 Emgu CV
这里是有问题的代码:
public Image<Gray, byte> Process(Image<Bgr, byte> frameIn, Rectangle roi)
{
Image<Bgr, byte> rectFrame = null;
Image<Gray, byte> mask = null;
if (roi != Rectangle.Empty)
{
rectFrame = frameIn.Copy(roi);
}
else
{
rectFrame = frameIn;
}
if (Equalize)
{
rectFrame._EqualizeHist();
}
mask = rectFrame.InRange(minColor, maxColor);
mask ._Erode(Iterations);
mask ._Dilate(Iterations);
if (roi != Rectangle.Empty)
{
//How do I give the image its original dimensions?
}
return mask;
}
谢谢 克里斯
你能证明你做了/把这个问题的形式是什么? – JesseBuesking 2011-12-19 04:57:50