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.
如何创建轮廓以传递给 cvContourArea?我有四个 2D 点,但不知道创建 CvSeq。
int[] myPolygon = new int[] { point1.x, point1.y, point2.x, point2.y, ... }; cvCountourArea(???, null, 0);
我找到了解决方案:
int[] myPolygon = new int[] { point1.x, point1.y, point2.x, point2.y, ... }; Mat rectMat = cvCreateMat(1, myPolygon.length/2, CV_32SC2); rectMat.getIntBuffer().put(myPolygon); cvCountourArea(rectMat, CV_WHOLE_SEQ, 0); cvReleaseMat(rectMat);