if (pSrcImage != 0) { //pSrcImage为IplImage* for (int i = 0; i < pSrcImage->height; ++i) { uchar * pucPixel = (uchar*) pSrcImage->imageData + i * pSrcImage->widthStep; for (int j = 0; j < pSrcImage->width; ++j) { pucPixel[3 * j] = 0; //像素第一个通道的值 pucPixel[3 * j + 1] = 0; //像素第二个通道的值 pucPixel[3 * j + 2] = 0; //像素第三个通道的值 } } }
本文链接:https://it72.com/2854.htm