// compute the score with a given line and display it // useful for debugging info void Correspondence::drawScoreInfo (Edge *line, Viewer &viewer, int x, int y, const float color[3]) { double cscore = 0.0; double cscore_alignment = 0.0; double cscore_overlap = 0.0; double cscore_distance = 0.0; if (line == NULL) { return; } bool cvalid = false; // if frontality test fails, score is zero if (!p.testFrontality(line)) { cscore = -p.length(); } else { cvalid = true; // alignment cscore_alignment = p.score_alignement(line); // 0: bad => 1: good // overlap cscore_overlap = p.overlap(line); // distance cscore_distance = 1/(0.5+p.distance(line)); // final score cscore = p.length() * cscore_alignment * cscore_overlap * cscore_distance; } if (line == NULL) viewer.displayMsg(x,y,color,0,"Line: NULL"); else viewer.displayMsg(x,y,color,0,"Line: %d",line->_id); y -= 15; viewer.displayMsg(x,y,color,0,"[valid: %d]",cvalid); y -= 15; viewer.displayMsg(x,y,color,0,"Alignment: %.2f",cscore_alignment); y -= 15; viewer.displayMsg(x,y,color,0,"Overlap: %.2f",cscore_overlap); y -= 15; viewer.displayMsg(x,y,color,0,"Distance: %.2f",cscore_distance); y -= 15; viewer.displayMsg(x,y,color,0,"Score: %.2f",cscore); y -= 15; }
void Correspondence::drawInfo (Viewer &viewer, int x, int y, const float color[3]) { if (l == NULL) viewer.displayMsg(x,y,color,0,"Line: NULL"); else viewer.displayMsg(x,y,color,0,"Line: %d",l->_id); y -= 15; viewer.displayMsg(x,y,color,0,"[valid: %d]",valid); y -= 15; viewer.displayMsg(x,y,color,0,"[frameId: %d]",_frameId); y -= 15; viewer.displayMsg(x,y,color,0,"Alignment: %.2f",score_alignment); y -= 15; viewer.displayMsg(x,y,color,0,"Overlap: %.2f",score_overlap); y -= 15; viewer.displayMsg(x,y,color,0,"Distance: %.2f",score_distance); y -= 15; viewer.displayMsg(x,y,color,0,"Score: %.2f",score); y -= 15; }