Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // meshgridTest(cv::Range(1,3), cv::Range(10, 14), X, Y);
- std::pair<cv::Mat1i, cv::Mat1i> meshgrid(const cv::Range &xgv, const cv::Range &ygv)
- {
- struct meshgrid_test
- {
- static void meshgrid_test1(const cv::Mat &xgv, const cv::Mat &ygv,
- cv::Mat1i &X, cv::Mat1i &Y)
- {
- cv::repeat(xgv.reshape(1, 1), ygv.total(), 1, X);
- cv::repeat(ygv.reshape(1, 1).t(), 1, xgv.total(), Y);
- }
- };
- std::pair<cv::Mat1i, cv::Mat1i> mesh_pair;
- std::vector<int> t_x, t_y;
- for (int i = xgv.start; i <= xgv.end; i++) t_x.push_back(i);
- for (int i = ygv.start; i <= ygv.end; i++) t_y.push_back(i);
- meshgrid_test::meshgrid_test1(cv::Mat(t_x), cv::Mat(t_y), mesh_pair.first, mesh_pair.second);
- return mesh_pair;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement