python调用海康摄像头_Windows下Python调用海康SDK实时显示网络摄像头

//int colhalf=col>>1;

tmp = (row / 2)*(width / 2) + (col / 2);

// if((row==1)&&( col>=1400 &&col<=1600))

// {

// printf("col=%d,row=%d,width=%d,tmp=%d.\n",col,row,width,tmp);

// printf("row*width+col=%d,width*height+width*height/4+tmp=%d,width*height+tmp=%d.\n",row*width+col,width*height+width*height/4+tmp,width*height+tmp);

// }

Y = (unsigned int)inYv12[row*width + col];

U = (unsigned int)inYv12[width*height + width*height / 4 + tmp];

V = (unsigned int)inYv12[width*height + tmp];

// if ((col==200))

// {

// printf("col=%d,row=%d,width=%d,tmp=%d.\n",col,row,width,tmp);

// printf("width*height+width*height/4+tmp=%d.\n",width*height+width*height/4+tmp);

// return ;

// }

if ((idx + col * 3 + 2)> (1200 * widthStep))

{

//printf("row * widthStep=%d,idx+col*3+2=%d.\n",1200 * widthStep,idx+col*3+2);

}

outYuv[idx + col * 3] = Y;

outYuv[idx + col * 3 + 1] = U;

outYuv[idx + col * 3 + 2] = V;

}

}

//printf("col=%d,row=%d.\n",col,row);

}

//解码回调 视频为YUV数据(YV12),音频为PCM数据

void CALLBACK DecCBFun(long nPort, char * pBuf, long nSize, FRAME_INFO * pFrameInfo, long nReserved1, long nReserved2)

{

long lFrameType = pFrameInfo->nType;

if (lFrameType == T_

你可能感兴趣的:(python调用海康摄像头)