cv02_point.cpp 611 B

1234567891011121314151617181920212223242526
  1. #include <iostream>
  2. #include <opencv2/opencv.hpp>
  3. #include <vector>
  4. #pragma comment(lib, "opencv_world4100.lib")
  5. using namespace std;
  6. using namespace cv;
  7. int main()
  8. {
  9. Point2f p(6, 2);
  10. cout << "【2维点】p = " << p << ";\n" << endl;
  11. Point3f p3f(8, 2, 0);
  12. cout << "【3维点】p3f = " << p3f << ";\n" << endl;
  13. vector<float> v;
  14. v.push_back(3);
  15. v.push_back(5);
  16. v.push_back(7);
  17. vector<Point2f> points(20);
  18. for (size_t i = 0; i < points.size(); ++i) points[i] = Point2f((float)(i * 5), (float)(i % 7));
  19. cout << "【二维点向量】points = " << points << ";";
  20. }