Skip to content

Commit

Permalink
Introduce cMo in render data
Browse files Browse the repository at this point in the history
  • Loading branch information
SamFlt committed Dec 13, 2024
1 parent 3684e5d commit 9a5d92d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct VISP_EXPORT vpRBRenderData
vpImage<unsigned char> isSilhouette; //! Binary image indicating whether a given pixel is part of the silhouette
double zNear, zFar; // clipping values
vpRect boundingBox;
vpHomogeneousMatrix cMo; //! Pose of the object in the camera frame for which the renders were generated.

vpRBRenderData() : zNear(0.0), zFar(0.0), boundingBox() { }

Expand All @@ -82,6 +83,7 @@ struct VISP_EXPORT vpRBRenderData
zNear = o.zNear;
zFar = o.zFar;
boundingBox = o.boundingBox;
cMo = o.cMo;
return *this;
}

Expand All @@ -95,6 +97,7 @@ struct VISP_EXPORT vpRBRenderData
zNear = std::move(o.zNear);
zFar = std::move(o.zFar);
boundingBox = std::move(o.boundingBox);
cMo = std::move(o.cMo);
return *this;
}
};
Expand Down
6 changes: 4 additions & 2 deletions modules/tracker/rbt/src/core/vpRBTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,8 @@ void vpRBTracker::updateRender(vpRBFeatureTrackerInput &frame)
{
m_renderer.setCameraPose(m_cMo.inverse());

frame.renders.cMo = m_cMo;

// Update clipping distances
frame.renders.normals.resize(m_imageHeight, m_imageWidth);
frame.renders.silhouetteCanny.resize(m_imageHeight, m_imageWidth);
Expand Down Expand Up @@ -496,7 +498,7 @@ std::vector<vpRBSilhouettePoint> vpRBTracker::extractSilhouettePoints(
#if defined(VISP_DEBUG_RB_TRACKER)
if (fabs(theta) > M_PI + 1e-6) {
throw vpException(vpException::badValue, "Theta expected to be in -Pi, Pi range but was not");
}
}
#endif
points.push_back(vpRBSilhouettePoint(n, m, norm, theta, Z));
// if (Zn > 0) {
Expand All @@ -521,8 +523,8 @@ std::vector<vpRBSilhouettePoint> vpRBTracker::extractSilhouettePoints(
// if (noNeighbor) {
// points.push_back(vpRBSilhouettePoint(n, m, norm, theta, Z));
// }
}
}
}

return points;
}
Expand Down

0 comments on commit 9a5d92d

Please sign in to comment.