how to continously read data



  • actually i want to draw polyline example code is ther but how to data ia apply in list and how to call this polyline fucnction.

    void polylines(cv::Mat& img, const std::list<std::listcv::Point2i>& polylines)
    {
    for (auto& polyline : polylines)
    {
    auto current = polyline.begin();
    auto next = std::next(current, 1);
    for (; next != polyline.end(); current++, next++)
    {
    cv::line(img, *current, *next, cv::Scalar(255));
    }
    }
    }


  • Lifetime Qt Champion

    Hi,

    From the looks of it, this has nothing to do with Qt. You should ask that on the OpenCV forum.


  • Qt Champions 2017

    Hi
    Try this
    http://breckon.eu/toby/teaching/dip/practicals/ia/polygons.cpp

    The trick being

    const cv::Point *pts = (const cv::Point*) Mat(contour).data; // convert from vector to plain c array
    int npts = Mat(contour).rows;
    	polylines(img, &pts,&npts, 1,
    	    		true, 			// draw closed contour (i.e. joint end to start) 
    	            Scalar(0,255,0),// colour RGB ordering (here = green) 
    	    		3, 		        // line thickness
    			    CV_AA, 0);
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.