imagyne
12th July 2011, 15:56
Hi,
Using OpenCV, I have calculated image features, which are stored in a data structure of points. I have to display those point coordinates as circles on the image open in Qt.
I am unable to convert the coordinates of the OpenCV points to Qt.
This is how I am able to display the points in OpenCV (taken from the OpenCV codebook)
void drawOnImage(cv::Mat &image, const std::vector<cv::Point> &points, cv::Scalar color= cv::Scalar(255,255,255), int radius=1, int thickness=1) {
std::vector<cv::Point>::const_iterator it= points.begin();
// for all corners
while (it!=points.end()) {
// draw a circle at each corner location
cv::circle(image,*it,radius,color,thickness);
++it;
}
}
Now, I want to pass the const std::vector<cv::Point> &points to the mainwindow.h and then in mainwindow.cpp, using the coordinates of the points, print them on the Qt image using Qt Ecllipse tool.
Anyone can help? Thanks!
Using OpenCV, I have calculated image features, which are stored in a data structure of points. I have to display those point coordinates as circles on the image open in Qt.
I am unable to convert the coordinates of the OpenCV points to Qt.
This is how I am able to display the points in OpenCV (taken from the OpenCV codebook)
void drawOnImage(cv::Mat &image, const std::vector<cv::Point> &points, cv::Scalar color= cv::Scalar(255,255,255), int radius=1, int thickness=1) {
std::vector<cv::Point>::const_iterator it= points.begin();
// for all corners
while (it!=points.end()) {
// draw a circle at each corner location
cv::circle(image,*it,radius,color,thickness);
++it;
}
}
Now, I want to pass the const std::vector<cv::Point> &points to the mainwindow.h and then in mainwindow.cpp, using the coordinates of the points, print them on the Qt image using Qt Ecllipse tool.
Anyone can help? Thanks!