1
我有圖像的投資回報率,我需要創建新的圖像,這將是圖像的子部分。我怎樣才能做到這一點? (我想製作一組圖像,而不是矩形。)Emgu.CV中的裁剪圖像
Image<Bgr, byte> img = frame.Copy();
pieces = new List<System.Drawing.Rectangle>();
int input_cell_width = img.Width/Cols;
int input_cell_height = img.Height/Rows;
System.Drawing.Rectangle old_roi = img.ROI;
for (int row = 0; row < Rows; ++row)
{
for (int col = 0; col < Cols; ++col)
{
// Get template
img.ROI = gridOuput.GetCellItemRect(row, col, new System.Drawing.Point(0, 0));
pieces.Add(img.ROI);
}
}
謝謝。