opencv 中将图像中的某点颜色提取怎么写呢~

1个回答

  • ((uchar *)(ipl_img->imageData + x * ipl_img->widthStep ))[(y+ ipl_img->width)* ipl_img->nChannels + 0] = ((src->imageData + ((int)j) * src->widthStep ))[((int)i) * src->nChannels + 0]; //改变该像素b的颜色分量

    ((uchar *)(ipl_img->imageData + x * ipl_img->widthStep ))[(y + ipl_img->width)* ipl_img->nChannels + 1] = ((src->imageData + ((int)j) * src->widthStep ))[((int)i)* src->nChannels + 1] ; //改变该像素g的颜色分量

    ((uchar *)(ipl_img->imageData + x * ipl_img->widthStep ))[(y+ ipl_img->width) * ipl_img->nChannels + 2] = ((src->imageData + ((int)j) * src->widthStep ))[((int)i)* src->nChannels + 2]; //改变该像素r的颜色分量