c++ - opencv中的Vec4i是什么

标签 c++ opencv

我正在使用 C++ 学习 opencv。我在 hough line transform 的代码中遇到了 Vector 。谁能解释一下 Vec4i 存储什么以及 4i 是什么意思。 代码片段:-

vector<Vec4i> lines;
  HoughLinesP(dst, lines, 1, CV_PI/180, 50, 50, 10 );
  for( size_t i = 0; i < lines.size(); i++ )
  {
    Vec4i l = lines[i];
    line( cdst, Point(l[0], l[1]), Point(l[2], l[3]), Scalar(0,0,255), 3, CV_AA);
  }

最佳答案

看看 OpenCV Basic Structures . Vec4i 是一种用于表示具有 4 个维度的 vector 的结构,每个值都是一个 int

如果您查看 HoughLinesP() documentation在这种特殊情况下,您会看到每个维度是什么:

lines – Output vector of lines. Each line is represented by a 4-element vector (x_1, y_1, x_2, y_2) , where (x_1,y_1) and (x_2, y_2) are the ending points of each detected line segment.

简而言之,每一行都是一个Vec4i,前两个元素是该行的起点(x1,y1),后两个是该行的终点(x2,y2)

关于c++ - opencv中的Vec4i是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44422591/

相关文章:

c++ - tr1::reference_wrapper 有什么用?

c++ - 含义 std::mutex unlock 与 lock 同步以重新获取

C++ char 单引号与双引号和内存内部工作原理

python - ReprojectImageTo3D 对应图像中的像素(立体视觉)

python - 使用 matplotlib 和 opencv2 在图像上绘图,更新图像?

c++ - 如何将 Tesseract 链接到 VS 2019 中的 C++ 项目?

opencv - 立体视觉物体识别

c++ - 如果括号里是case,需要换行吗?

c++ - 打印点和框

openCV:是否可以对 cvQueryFrame 进行计时以与投影仪同步?