【发布时间】:2014-07-17 05:55:27
【问题描述】:
这是我想要实现对象测量的代码,但我不知道我必须使用什么函数以及如何对其进行编码以及如何使其自动生成。有谁能帮帮我吗?提前谢谢你。
cv::VideoCapture cap;
if (!cap.isOpened()) // check if succeeded to connect to the camera
CV_Assert("Can't open Web-Cam");
double CamHeight = cap.get(CV_CAP_PROP_FRAME_HEIGHT);
double CamWidth = cap.get(CV_CAP_PROP_FRAME_WIDTH);
//Display text on the screen function
int imgW = 650;
int imgH = 50;
int fontFace = FONT_HERSHEY_PLAIN;
double fontScale = 1.5;
int thickness = 2;
Point textOrg(imgW/5, imgH/1.3);
int value=10;
string someText = format("Dimension: %d ", value); //Display the dimension (output)
putText(frame, someText, textOrg, fontFace, fontScale, Scalar::all(255), thickness, 8);
imshow("Object Measurement",frame);;
【问题讨论】:
-
你能解释一下“物体上的测量”是什么意思吗?能不能举个具体的例子?
标签: opencv object dimension measure