如何用Opencv 把视频提取的图像中特定区域的颜色读取出来?求范例程序

如题所述

第1个回答  2012-11-13
for(i=0;i<Img->height;i++)
for(j=0;j<Img->width;j++)
{
color[i][j][0]=(Img->imageData+i*Img->widthStep)[3*j];
color[i][j][1]=(Img->imageData+i*Img->widthStep)[3*j+1];
color[i][j][2]=(Img->imageData+i*Img->widthStep)[3*j+2];
}
其中:img为要提取的图像(RGB图像,若为灰度图像或者二值图更简单);
color数组用于存放颜色的RGB值;
相似回答