private void button8_Click(object sender, EventArgs e) { int[] allName = db.getAllImageID(); Image <Gray, byte>[] allImage = db.getTrainedImageList(); string tempPath = "\\tmpp.jpg"; string folderPath = "E:\\Visual2013\\Project\\EMGUCV\\EMGUCV\\bin\\x64\\Release"; Point[] pL = new Point[3]; Point[] pR = new Point[3]; int y0 = 105; int y1 = 174; int x0 = 0; int x1 = 34; int x2 = 105; int x3 = 139; pL[0] = new Point(x0, y0); pL[1] = new Point(x0, y1); pL[2] = new Point(x1, y1); pR[0] = new Point(x3, y0); pR[1] = new Point(x3, y1); pR[2] = new Point(x2, y1); int count = 0; foreach (var id in allName) { allImage[count].FillConvexPoly(pL, new Gray(128)); allImage[count].FillConvexPoly(pR, new Gray(128)); allImage[count].Save(folderPath + tempPath); string dbPath = (folderPath + tempPath).Replace("\\", "/"); db.updateImagePreprocessing(allName[count].ToString(), dbPath); count++; } MessageBox.Show("Image trans finish."); }