当前位置: 首页>>代码示例>>C++>>正文


C++ Viewer::displayMsg方法代码示例

本文整理汇总了C++中Viewer::displayMsg方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewer::displayMsg方法的具体用法?C++ Viewer::displayMsg怎么用?C++ Viewer::displayMsg使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Viewer的用法示例。


在下文中一共展示了Viewer::displayMsg方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawScoreInfo

// 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;

}
开发者ID:oakfr,项目名称:omni3d,代码行数:54,代码来源:correspondence.cpp

示例2: drawInfo

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;
}
开发者ID:oakfr,项目名称:omni3d,代码行数:22,代码来源:correspondence.cpp


注:本文中的Viewer::displayMsg方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。