Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/146.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/opencv/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 从像素获取标记的真实坐标_C++_Opencv_Image Processing_Coordinates_Augmented Reality - Fatal编程技术网

C++ 从像素获取标记的真实坐标

C++ 从像素获取标记的真实坐标,c++,opencv,image-processing,coordinates,augmented-reality,C++,Opencv,Image Processing,Coordinates,Augmented Reality,姿势估计后,将检测到我的标记,ID将显示在我的相机图像上。 这是我的代码: while(inputVideo.grab()) { cv::Mat frame, imgGray; inputVideo.retrieve(frame); if(frame.channels() == 3 || frame.channels() == 4) cv::cvtColor(frame, imgGray, cv::COLOR_

姿势估计后,将检测到我的标记,ID将显示在我的相机图像上。 这是我的代码:

    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 original image is b/w convert it to BGRA so we can draw colors
        if(frame.channels() == 1)
          cv::cvtColor(imgGray, frame, cv::COLOR_GRAY2BGRA);

        const std::string windowName = "Detection result";
        cv::namedWindow(windowName, cv::WINDOW_NORMAL);
        drawMarkers(markers, frame);
        cv::imshow(windowName, frame);
        char key = (char) cv::waitKey(waitTime);
        if(key == 27)
            break;
        if(key == 65)
        {
            std::cout << "bonjour comment ca va ?" << std::endl;
            std::cout << markers.size() << std::endl;
            for(auto m : markers)
            {
                std::cout << m.x() << std::endl;
                std::cout << m.y() << std::endl;
                std::cout << m.nCircles() << std::endl;
                std::cout << m.id() << std::endl;
                std::cout << m.hasId() << std::endl;
                std::cout << m.scale() << std::endl;
                std::cout << m.quality() << std::endl;
            }
        }

        ++frameId;
    }
while(inputVideo.grab())
{
cv::垫架,imgGray;
输入视频。检索(帧);
如果(帧通道()==3 | |帧通道()==4)
cv::CVT颜色(边框、imgGray、cv::颜色为灰色);
其他的
frame.copyTo(imgGray);
std::stringstream outFileName;
boost::ptr_列表标记;
cctag::cctag检测(标记、管道ID、帧ID、imgGray、参数、库、真、持续时间);
//如果原始图像是黑白的,请将其转换为BGRA,以便我们可以绘制颜色
if(frame.channels()==1)
cv::cvtColor(imgGray,frame,cv::COLOR_gray 2bgra);
const std::string windowName=“检测结果”;
cv::namedWindow(windowName,cv::WINDOW_NORMAL);
绘图标记(标记、框架);
cv::imshow(窗口名、框架);
char key=(char)cv::waitKey(waitTime);
如果(键==27)
打破
如果(键==65)
{
标准::cout