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


C++ MapPoint::isCertainStatic方法代码示例

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


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

示例1: propagateFeatureStates

void SingleSLAM::propagateFeatureStates() {
	for (int i = 0; i < m_tracker.m_nMaxCorners; i++) {
		Track2D& tk = m_tracker.m_tks[i];
		if (tk.empty())
			continue;
		Track2DNode* node = tk.tail;
		if (node->pre) {
			//propagate the type of feature points
			node->pt->type = node->pre->pt->type;
			if (node->pre->pt->mpt) {
				MapPoint* pMapPt = node->pre->pt->mpt;
				if (pMapPt->state != STATE_MAPPOINT_CURRENT)
					continue;
				//map correspondence propagation
				if (!pMapPt->isFalse()) {
					pMapPt->pFeatures[camId] = node->pt;
					node->pt->mpt = pMapPt;
					pMapPt->lastFrame = currentFrame();
					if (pMapPt->isCertainStatic())
						pMapPt->staticFrameNum++;
					node->pt->reprojErr = node->pre->pt->reprojErr;
				}
			}
		}
	}
}
开发者ID:danping,项目名称:CoSLAM,代码行数:26,代码来源:SL_SingleSLAM.cpp

示例2: saveFeatureTracks

void SingleSLAM::saveFeatureTracks(const char* filePath, int minLen,
		int startFrame) {
	FILE* fp = fopen(filePath, "w");
	if (!fp)
		repErr("SingleSLAM::saveCamPoses -- cannot open '%s'!", filePath);

	for (int i = 0; i < m_tracker.m_nMaxCorners; i++) {
		Track2D& tk = m_tracker.m_tks[i];
		if (tk.empty() || tk.length() < minLen)
			continue;

		if (tk.tail->pt->type == TYPE_FEATPOINT_DYNAMIC)
			continue;

		Track2DNode* node = tk.tail;
		MapPoint* mpt = node->pt->mpt;
		if (mpt && mpt->isCertainStatic())
			fprintf(fp, "1 %g %g %g\n", mpt->M[0], mpt->M[1], mpt->M[2]);
		else
			fprintf(fp, "0 0 0 0\n");
		//output the feature points

		std::vector<FeaturePoint*> tmpFeatPts;
		for (FeaturePoint* featPt = node->pt; featPt && featPt->f >= startFrame;
				featPt = featPt->preFrame) {
			tmpFeatPts.push_back(featPt);
		}

		for (std::vector<FeaturePoint*>::reverse_iterator iter =
				tmpFeatPts.rbegin(); iter != tmpFeatPts.rend(); iter++) {
			FeaturePoint* featPt = *iter;
			fprintf(fp, "%d %g %g ", featPt->f, featPt->x, featPt->y);
		}
		fprintf(fp, "\n");
	}
	fclose(fp);
}
开发者ID:danping,项目名称:CoSLAM,代码行数:37,代码来源:SL_SingleSLAM.cpp


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