Commit 6a15ff8d authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

added cvSave(contours) to the contours demo; added rational model demonstration…

added cvSave(contours) to the contours demo; added rational model demonstration to stereo_calib; fixed formatting in imgproc/types_c.h
parent f8632f6d
#include <opencv2/imgproc/imgproc.hpp> #include <opencv2/imgproc/imgproc_c.h>
#include <opencv2/highgui/highgui.hpp> #include <opencv2/highgui/highgui.hpp>
#include <stdio.h> #include <stdio.h>
void help() void help()
...@@ -76,6 +76,12 @@ int main( int argc, char** argv ) ...@@ -76,6 +76,12 @@ int main( int argc, char** argv )
cvFindContours( img, storage, &contours, sizeof(CvContour), cvFindContours( img, storage, &contours, sizeof(CvContour),
CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0) ); CV_RETR_TREE, CV_CHAIN_APPROX_SIMPLE, cvPoint(0,0) );
{
const char* attrs[] = {"recursive", "1", 0};
cvSave("contours.xml", contours, 0, 0, cvAttrList(attrs, 0));
contours = (CvSeq*)cvLoad("contours.xml", storage, 0, 0);
}
// comment this out if you do not want approximation // comment this out if you do not want approximation
contours = cvApproxPoly( contours, sizeof(CvContour), storage, CV_POLY_APPROX_DP, 3, 1 ); contours = cvApproxPoly( contours, sizeof(CvContour), storage, CV_POLY_APPROX_DP, 3, 1 );
......
...@@ -169,7 +169,9 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated= ...@@ -169,7 +169,9 @@ StereoCalib(const vector<string>& imagelist, Size boardSize, bool useCalibrated=
TermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, 1e-5), TermCriteria(CV_TERMCRIT_ITER+CV_TERMCRIT_EPS, 100, 1e-5),
CV_CALIB_FIX_ASPECT_RATIO + CV_CALIB_FIX_ASPECT_RATIO +
CV_CALIB_ZERO_TANGENT_DIST + CV_CALIB_ZERO_TANGENT_DIST +
CV_CALIB_SAME_FOCAL_LENGTH); CV_CALIB_SAME_FOCAL_LENGTH +
CV_CALIB_RATIONAL_MODEL +
CV_CALIB_FIX_K3 + CV_CALIB_FIX_K4 + CV_CALIB_FIX_K5);
cout << "done with RMS error=" << rms << endl; cout << "done with RMS error=" << rms << endl;
// CALIBRATION QUALITY CHECK // CALIBRATION QUALITY CHECK
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment