1 QImage repairImg(width, height, QImage::Format_Mono); 2 for (int row = 0; row < height; row++) 3 { 4 // uchar* ucRow = maskImg.scanLine(y); 5 for (int col = 0; col < width; col++) 6 { 7 repairImg.setPixel(col, row, (qRed(maskImg.pixel(col, row)) == 255 ? 1 : 0)); 8 } 9 }
之前参数 col 和 row 给反了,,搞了俩天各种查资料,,问前辈,,我错了,,好蠢,,