utils::VisualizationDescription ORBFeatureDetector::FeatureSetClass::vis() const{ VisualizationDescription d; d.color(255,0,0,255); for(size_t i=0;i<impl->keyPoints.size();++i){ const ocv::KeyPoint &k = impl->keyPoints[i]; float s = k.size / 2; float cx = k.pt.x; float cy = k.pt.y; d.color(0,255,0,255); if(k.angle != -1){ float angle = k.angle*M_PI/180.0; int cx2 = cx + cos(angle) * s; int cy2 = cy + sin(angle) * s; d.linewidth(2); d.line(cx,cy,cx2,cy2); } d.linewidth(1); d.color(0,100,255,255); d.fill(255,0,0,0); d.circle(cx,cy,s); } return d; }
VisualizationDescription vis() const{ VisualizationDescription d; d.color(255,0,0,255); d.linewidth(2); d.fill(255,0,0,40); std::vector<Point> pso = ps; d.polygon(pso); d.linewidth(1); for(int i=0;i<4;++i){ d.fill(255,0,0,1+127*handles[i]); d.rect(pso[i].x-5,pso[i].y-5,11,11); } return d; }
VisualizationDescription CheckerboardDetector::Checkerboard::visualize() const{ VisualizationDescription vis; static const Color cs[5] = { Color(255,0,0), Color(255,255,0), Color(0,255,255), Color(0,0,255), Color(255,0,255) }; vis.fill(0,0,0,0); for(int y=0, idx=0;y<size.height;++y){ const Color &c = cs[y%5]; vis.color(c[0],c[1],c[2],255); for(int x=0;x<size.width;++x,++idx){ const Point32f &p = corners[idx]; vis.circle(p.x+.5,p.y+.5,2); vis.line(p.x-1,p.y-1,p.x+1,p.y+1); vis.line(p.x+1,p.y-1,p.x-1,p.y+1); if(x || y){ vis.line(p.x,p.y,corners[idx-1].x, corners[idx-1].y); } } } return vis; }