随笔分类 -  OpenCV代码片段

摘要:截取任意四边形区域的图像。 mask就是结果。 需要定义四边形区域,分别是 tl, tr, bl, br 阅读全文
posted @ 2018-09-26 22:04 路边的十元钱硬币 阅读(1990) 评论(0) 推荐(0) 编辑
摘要:Transform得到的是重MatFrom到MatTo的变换矩阵。inlier给一个空矩阵就可以。 MatFrom和MatTo都是点的矩阵,每一行就是一个点。 这个函数使用的是点对来估计变换矩阵。是三维的,所以需要XYZ坐标。优化方法是RANSAC。 阅读全文
posted @ 2018-09-09 17:08 路边的十元钱硬币 阅读(1059) 评论(0) 推荐(0) 编辑
摘要:代码 注意 xml中保存的节点超过4个就会打开失败,opencv的问题。 阅读全文
posted @ 2018-09-09 17:01 路边的十元钱硬币 阅读(784) 评论(0) 推荐(0) 编辑
摘要:今天测试发现一个问题,cv::FileStorage读取中,xml文件的第一层节点不能超过4个。 在加一个test4的话,就会在 中挂掉。 阅读全文
posted @ 2018-09-02 20:01 路边的十元钱硬币 阅读(822) 评论(0) 推荐(0) 编辑
摘要:摘自opencv 源代码 阅读全文
posted @ 2018-08-17 14:47 路边的十元钱硬币 阅读(1362) 评论(0) 推荐(0) 编辑
摘要:一种推荐的做法是,使用opencv自己的时间函数作为随机数的种子。 阅读全文
posted @ 2018-08-17 13:51 路边的十元钱硬币 阅读(1355) 评论(0) 推荐(0) 编辑
摘要:#include /* @param o The customer origin @param x The customer x @Note The return matrix include translation */ cv::Mat ZRotationMatrix(const cv::Point2d o, const cv::Point2d x) { cv::Mat Rz = ... 阅读全文
posted @ 2018-07-31 21:41 路边的十元钱硬币 阅读(180) 评论(0) 推荐(0) 编辑
摘要:std::vector> fillContour(const std::vector> & _contours) { // sort as x descent y descent. std::vector> contours(_contours); for(size_t i = 0; i sub(contours[i]); std::sort(sub.begin(), sub.end(... 阅读全文
posted @ 2018-07-27 14:15 路边的十元钱硬币 阅读(3496) 评论(0) 推荐(1) 编辑
摘要:cv::Mat left_image; right_image.push_back(cv::Mat((cv::Mat_(1, 3) << ori.x, ori.y, ori.z))); 阅读全文
posted @ 2018-07-25 14:37 路边的十元钱硬币 阅读(1683) 评论(0) 推荐(0) 编辑
摘要:cv::normalize(src, dst, 0.0, 255.0, cv::NORM_MINMAX); 阅读全文
posted @ 2018-07-03 11:01 路边的十元钱硬币 阅读(214) 评论(0) 推荐(0) 编辑
摘要:#include using namespace cv; struct mouse_para { cv::Mat org; cv::Mat img; std::string winName = ""; // todo: you can add your own members here. }; void on_mouse(int event, int x, int y, i... 阅读全文
posted @ 2018-06-27 10:01 路边的十元钱硬币 阅读(166) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示