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


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

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


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

示例1: getSeedsBetween

int NewMapPtsNCC::getSeedsBetween(MapPointList& mapPts, int iCam, int jCam,
		Mat_d& seed1, Mat_d& seed2) {
	MapPoint* pHead = mapPts.getHead();
	if (!pHead)
		repErr("SLAM failed - No map point can be found!\n");
	std::vector<FeaturePoint*> vecFeatPts1, vecFeatPts2;
	for (MapPoint* p = pHead; p; p = p->next) {
		//if ((p->iLocalType == TYPE_MAPPOINT_STATIC || p->iLocalType == TYPE_MAPPOINT_DYNAMIC) && p->numVisCam >= 2 && p->pFeatures[iCam] && p->pFeatures[iCam]->f == m_curFrame && p->pFeatures[jCam] && p->pFeatures[jCam]->f == m_curFrame) {
		if (!p->isFalse() && !p->isUncertain() && p->numVisCam >= 2
				&& p->pFeatures[iCam] && p->pFeatures[iCam]->f == m_curFrame
				&& p->pFeatures[jCam] && p->pFeatures[jCam]->f == m_curFrame) {
			vecFeatPts1.push_back(p->pFeatures[iCam]);
			vecFeatPts2.push_back(p->pFeatures[jCam]);
		}
	}
	if (vecFeatPts1.empty())
		return 0;

	seed1.resize(vecFeatPts1.size(), 2);
	seed2.resize(vecFeatPts2.size(), 2);

	for (size_t i = 0; i < vecFeatPts1.size(); i++) {
		seed1.data[2 * i] = vecFeatPts1[i]->x;
		seed1.data[2 * i + 1] = vecFeatPts1[i]->y;
		seed2.data[2 * i] = vecFeatPts2[i]->x;
		seed2.data[2 * i + 1] = vecFeatPts2[i]->y;
	}
	return seed1.rows;
}
开发者ID:Kyate,项目名称:CoSLAM,代码行数:29,代码来源:SL_NewMapPointsInterCam.cpp

示例2: decidePointType

void NewMapPts::decidePointType() {
	using namespace std;
	assert(pCoSLAM);

	const int hw = 20;

	//generate dynamic masks
	int numCams = pCoSLAM->numCams;
	Mat_uc mask[SLAM_MAX_NUM];
	for (int c = 0; c < numCams; c++) {
		int camId = m_camGroup.camIds[c];
		mask[camId].resize(pCoSLAM->slam[camId].H, pCoSLAM->slam[camId].W);
		mask[camId].fill(0);
	}

	for (int c = 0; c < numCams; c++) {
		int camId = m_camGroup.camIds[c];
		vector<FeaturePoint*> vecDynMapPts;
		pCoSLAM->slam[camId].getMappedDynPts(vecDynMapPts);

		int W = mask[camId].cols;
		int H = mask[camId].rows;
		for (size_t i = 0; i < vecDynMapPts.size(); i++) {
			FeaturePoint* fp = vecDynMapPts[i];
			int x = static_cast<int>(fp->x + 0.5);
			int y = static_cast<int>(fp->y + 0.5);

			for (int s = -hw; s <= hw; s++) {
				for (int t = -hw; t <= hw; t++) {
					int x1 = x + t;
					int y1 = y + s;
					if (x1 < 0 || x1 >= W || y1 < 0 || y1 >= H)
						continue;
					mask[camId].data[y1 * W + x1] = 1;
				}
			}
		}
	}

	for (size_t i = 0; i < newMapPts.size(); i++) {
		MapPoint* mpt = newMapPts[i];
		if (mpt->isUncertain()) {
			bool isStatic = true;
			for (int c = 0; c < numCams; c++) {
				int camId = m_camGroup.camIds[c];
				int W = mask[camId].cols;
				int H = mask[camId].rows;
				FeaturePoint* fp = mpt->pFeatures[camId];
				if (fp) {
					int x = static_cast<int>(fp->x + 0.5);
					int y = static_cast<int>(fp->y + 0.5);

					if (x >= 0 && x < W && y >= 0 && y < H) {
						if (mask[camId][y * W + x] > 0) {
							isStatic = false;
							break;
						}
					}
				}
			}
			if (isStatic) {
				mpt->setLocalStatic();
			}
		}
	}

}
开发者ID:Kyate,项目名称:CoSLAM,代码行数:67,代码来源:SL_NewMapPointsInterCam.cpp


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