no suitable conversion function from "CvTermCriteria" to "int" exists
<p>How could I solve the error?</p>

<p>I use program that made for OpenCV 2.x but I compile it on OpenCV 3.0, and error appeared.
I change CvTermCriteria to TermCriteria::TermCriteria but thats not working.
How could I change CvTermCriteria to be int?</p>

<p>Hope anyone could help me. Thanks</p>

<p>Error appeared at this part:</p>

<pre><code>cvStereoCalibrate( &amp;_objectPoints, &amp;_imagePoints1, &amp;_imagePoints2, &amp;_npoints,&amp;_M1calib, &amp;_D1, &amp;_M2calib, &amp;_D2,imageSize, &amp;_R, &amp;_Tcalib, &amp;_E, &amp;_F, 
    cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, 1e-5),
    CV_CALIB_FIX_ASPECT_RATIO+CV_CALIB_ZERO_TANGENT_DIST + CV_CALIB_SAME_FOCAL_LENGTH );
</code></pre>

<p>This is the source code:</p>

<pre><code>//--------------Compute for calibration-------------------
    N = n_boards*n;
    objectPoints.resize(N);
    for( i = 0; i &lt; ny; i++ )
        for(j = 0; j &lt; nx; j++ )   objectPoints[i*nx + j] = cvPoint3D32f(i*squareSize, j*squareSize, 0);
    for( i = 1; i &lt; n_boards; i++ ) copy( objectPoints.begin(), objectPoints.begin() + n, objectPoints.begin() + i*n );
    npoints.resize(n_boards,n);

    CvMat _objectPoints = cvMat(1, N, CV_32FC3, &amp;objectPoints[0] );
    CvMat _imagePoints1 = cvMat(1, N, CV_32FC2, &amp;points[0][0] );
    CvMat _imagePoints2 = cvMat(1, N, CV_32FC2, &amp;points[1][0] );
    CvMat _npoints = cvMat(1, npoints.size(), CV_32S, &amp;npoints[0] );
    cvSetIdentity(&amp;_M1calib);
    cvSetIdentity(&amp;_M2calib);
    cvZero(&amp;_D1);
    cvZero(&amp;_D2);

    printf("\nRunning stereo calibration ...");
    fflush(stdout);
    cvStereoCalibrate( &amp;_objectPoints, &amp;_imagePoints1, &amp;_imagePoints2, &amp;_npoints,&amp;_M1calib, &amp;_D1, &amp;_M2calib, &amp;_D2,imageSize, &amp;_R, &amp;_Tcalib, &amp;_E, &amp;_F, 
    cvTermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, 1e-5),
    CV_CALIB_FIX_ASPECT_RATIO+CV_CALIB_ZERO_TANGENT_DIST + CV_CALIB_SAME_FOCAL_LENGTH );


    printf("\nDone Calibration");

    cvUndistortPoints( &amp;_imagePoints1, &amp;_imagePoints1,&amp;_M1calib, &amp;_D1, 0, &amp;_M1calib );
    cvUndistortPoints( &amp;_imagePoints2, &amp;_imagePoints2,&amp;_M2calib, &amp;_D2, 0, &amp;_M2calib );


    CvMat* mx1calib = cvCreateMat( imageSize.height,imageSize.width, CV_32F );
    CvMat* my1calib = cvCreateMat( imageSize.height,imageSize.width, CV_32F );
    CvMat* mx2calib = cvCreateMat( imageSize.height,imageSize.width, CV_32F );
    CvMat* my2calib = cvCreateMat( imageSize.height,imageSize.width, CV_32F );

    double R1[3][3], R2[3][3], P1[3][4], P2[3][4];
    CvMat _R1 = cvMat(3, 3, CV_64F, R1);
    CvMat _R2 = cvMat(3, 3, CV_64F, R2);

        CvMat _P1 = cvMat(3, 4, CV_64F, P1);
        CvMat _P2 = cvMat(3, 4, CV_64F, P2);
        cvStereoRectify( &amp;_M1calib, &amp;_M2calib, &amp;_D1, &amp;_D2, imageSize,&amp;_R, &amp;_Tcalib,&amp;_R1, &amp;_R2, &amp;_P1, &amp;_P2, &amp;_Qcalib,0/*CV_CALIB_ZERO_DISPARITY*/ );

        cvInitUndistortRectifyMap(&amp;_M1calib,&amp;_D1,&amp;_R1,&amp;_P1,mx1calib,my1calib);
        cvInitUndistortRectifyMap(&amp;_M2calib,&amp;_D2,&amp;_R2,&amp;_P2,mx2calib,my2calib);

        printf("\nSaving matries for later use ...\n");
        cvSave("CalibFile//M1.yml",&amp;_M1calib);
    //  cvSave("CalibFile//D1.yml",&amp;_D1);
    //  cvSave("CalibFile//R1.yml",&amp;_R1);
    //  cvSave("CalibFile//P1.yml",&amp;_P1);

        cvSave("CalibFile//M2.yml",&amp;_M2calib);
    //  cvSave("CalibFile//D2.yml",&amp;_D2);
    //  cvSave("CalibFile//R2.yml",&amp;_R2);
    //  cvSave("CalibFile//P2.yml",&amp;_P2);

        cvSave("CalibFile//Q.yml",&amp;_Qcalib);
        cvSave("CalibFile//T.yml",&amp;_Tcalib);
        cvSave("CalibFile//mx1.yml",mx1calib);
        cvSave("CalibFile//my1.yml",my1calib);
        cvSave("CalibFile//mx2.yml",mx2calib);
        cvSave("CalibFile//my2.yml",my2calib);
</code></pre>