【发布时间】:2015-10-17 22:28:01
【问题描述】:
我有使用 cv::Mat 显示的图像,我正在尝试用圆圈突出显示某些点
cv::namedWindow("image_window");
cv::Mat image = cv::imread(fileLoc);
cv::imshow("image_window", image);
/*for (unsigned int b = 0; b < points.size(); b++)*/
if (points[0].num_parts() != 0)
{
for (unsigned int c = 0; c < points[0].num_parts(); c++)
{
dlib::point pp = points[0].part(c);
cv::circle(image, cv::Point(pp.x()/2 , pp.y()/2 ), 3, cv::Scalar(0, 0, 0));
std::stringstream ss;
ss << (c);
/*cout << c << endl;
cout << pp << endl;*/
cv::putText(image, ss.str(), cv::Point(pp.x() , pp.y() ), cv::FONT_HERSHEY_PLAIN, 0.8f, cv::Scalar(0x99, 0xFF, 0xFF));
}
}/**/
但是,除了相关图像之外,图像上没有显示任何内容。我哪里出错了,如何解决?
【问题讨论】:
-
您必须在更改图像后再次致电
cv::imshow("image_window", image);。 (后跟一个 cv::waitKey ) -
是的。好吧,我觉得很傻哈哈。感谢您的帮助
标签: c++ opencv opencv-mat