Category : coordinates

After the pose estimation, my marker is detected and the ID appears on the image of my camera. Here my code : while(inputVideo.grab()) { cv::Mat frame, imgGray; inputVideo.retrieve(frame); if(frame.channels() == 3 || frame.channels() == 4) cv::cvtColor(frame, imgGray, cv::COLOR_BGR2GRAY); else frame.copyTo(imgGray); std::stringstream outFileName; boost::ptr_list<cctag::CCTag> markers; cctag::cctagDetection(markers, pipeId, frameId, imgGray, params, bank, true, durations); // if the ..

Read more

I have list in which coordinates of multiple Polygons are being fed. I need to arrange the Polygons in an order that the left most polygon is the first element of that list (sorting by comparing x coordinates). int main() { std::vector<cv::Point2f> vec1; vec1.push_back(cv::Point(400, 100)); vec1.push_back(cv::Point(500, 50)); vec1.push_back(cv::Point(600, 100)); vec1.push_back(cv::Point(500, 150)); std::vector<cv::Point2f> vec2; vec1.push_back(cv::Point(100, 100)); ..

Read more

I’m using this code to set my cursor position where I want it displayed while executing a console application: void setCursorPos(const int x, const int y) { COORD coordinates; coordinates.X = x; coordinates.Y = y; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); if(!(SetConsoleCursorPosition(hConsole, coordinates))) { std::cout << " FATAL ERROR SETTING CURSOR POSITION nnn"; exit(0); } return; } ..

Read more