|
imx258,这是我的调用代码
void *g_engine = NULL;
int init_rkisp(int vidFd)
{
const char *ispNode = "/dev/video1";
const char* tuningFile = "/etc/cam_iq_imx258.xml";
int ret;
ret = rkisp_start(g_engine, vidFd, ispNode,tuningFile);
return ret;
}
int main(int argc,char *argv[])
{
cout << "Built with OpenCV " << CV_VERSION << endl;
init_rkisp(2);
VideoCapture capture(0); // 打开摄像头
if(!capture.isOpened()) // 判断是否打开成功
{
cout << "open camera failed. " << endl;
return -1;
}
while(true)
{
Mat frame;
capture >> frame; // 读取图像帧至frame
if(!frame.empty()) // 判断是否为空
{
imshow("camera", frame);
}
if(waitKey(30) > 0) // delay 30 ms等待按键
{
break;
}
}
rkisp_stop(g_engine);
return 0;
}
|
|