Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 OpenCV 的新手。请告诉我如何使用std::cout.
std::cout
std::vector<std::vector<cv::Point>> contours; std::vector<cv::Vec4i> hierarchy;
好吧,一种方法是:
for (auto vec : contours) for (auto v : vec) std::cout << v << std::endl;
然后对于层次结构:
for (auto vec : hierarchy) std::cout << vec << std::endl;
关键是 OpenCV 数据结构重载了<<操作符,所以你可以直接用cout.
<<
cout