[CMakeList][转载]利用CmakeList构建opencv程序

[CMakeList][转载]利用CmakeList构建opencv程序,第1张

我重新编译了Calibration那个程序,然后自己写了个批处理bat文件,代码如下,删除txt,然后调用它

del /f /q list_of_images_auto(bmp)txt

dir bmp /B >> list_of_images_auto(bmp)txt

OpenCV_Example_Calibrationexe -w 7 -h 8 -s 5 -o cameratxt -op -oe list_of_images_auto(bmp)txt

pause

其中-o cameratxt表示输出参数的文件名。

不过这样用着不爽。

你看源代码里面

cvWrite( fs, "camera_matrix", camera_matrix );

cvWrite( fs, "distortion_coefficients", dist_coeffs );

的地方,知道什么意思了吧,向txt里面写这两个参数

我后来是这么存的

cvSave("DistortionMatrixxml",dist_coeffs);

cvSave("IntrinsicsMatrixxml",camera_matrix);

这样下次调用的时候可以直接用矩阵拿来计算矫正

intrinsic = (CvMat)cvLoad("IntrinsicsMatrixxml");

distortion = (CvMat)cvLoad("DistortionMatrixxml");

。。。

cvInitUndistortMap(this->imgprocessintrinsic, this->imgprocessdistortion, this->imgprocessmapx, this->imgprocessmapy);

cv::findContours( ) 这个函数是用来找轮廓的,我经常用,应该能解决你这个问题。 这个函数找到的线存储的数据结构是std::vector<std::vector<cv::Point> > ,这个里面就有你想要的所有的轮廓点的坐标。

以上就是关于[CMakeList][转载]利用CmakeList构建opencv程序全部的内容,包括:[CMakeList][转载]利用CmakeList构建opencv程序、运用VS2012,openCV2,求C++程序,使Kinect捕捉到深度图和三维坐标。、OpenCV_opencv毛星云等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/9753832.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-01
下一篇 2023-05-01

发表评论

登录后才能评论

评论列表(0条)

保存