本文整理汇总了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;
}
示例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();
}
}
}
}