opencv 读取视频帧的数据函数


IplImage * RGBtoGRAYTmax(IplImage *in,IplImage *bg)
{   
	CvScalar s;
for (int y=0;y<in->height;y++)
{
//uchar *ptr=(uchar*)(in->imageData+y*in->widthStep);
for (int x=0;x<in->width;x++)
{
s=cvGet2D(bg,y,x); // get the (i,j) pixel value
s.val[0]=s.val[2]; 
cvSet2D(in,y,x,s); // set the (i,j) pixel value

}
}
return(in);
//return(out);
}


你可能感兴趣的:(opencv 读取视频帧的数据函数)