Skip to content

Commit

Permalink
rename meshIntersection methods
Browse files Browse the repository at this point in the history
  • Loading branch information
servantftechnicolor committed Jan 17, 2025
1 parent c842742 commit 0434f1b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions src/aliceVision/mesh/MeshIntersection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ bool MeshIntersection::initialize(const std::string & pathToModel)
return true;
}

bool MeshIntersection::peekPoint(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords)
bool MeshIntersection::pickPoint(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords)
{
const Vec3 posCamera = _pose.center();
const Vec3 wdir = intrinsic.backprojectTransform(imageCoords, true, _pose, 1.0);
Expand Down Expand Up @@ -58,7 +58,7 @@ bool MeshIntersection::peekPoint(Vec3 & output, const camera::IntrinsicBase & in
return true;
}

bool MeshIntersection::peekNormal(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords)
bool MeshIntersection::pickNormal(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords)
{
const Vec3 posCamera = _pose.center();
const Vec3 wdir = intrinsic.backprojectTransform(imageCoords, true, _pose, 1.0);
Expand Down Expand Up @@ -88,7 +88,7 @@ bool MeshIntersection::peekNormal(Vec3 & output, const camera::IntrinsicBase & i
return true;
}

bool MeshIntersection::peekPointAndNormal(Vec3 & point, Vec3 & normal, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords)
bool MeshIntersection::pickPointAndNormal(Vec3 & point, Vec3 & normal, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords)
{
const Vec3 posCamera = _pose.center();
const Vec3 wdir = intrinsic.backprojectTransform(imageCoords, true, _pose, 1.0);
Expand Down
14 changes: 7 additions & 7 deletions src/aliceVision/mesh/MeshIntersection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class MeshIntersection
bool initialize(const std::string & pathToModel);

/**
* @brief Update pose to use for peeking
* @brief Update pose to use for picking
* @param pose transformation to use (in aliceVision standard form)
*/
void setPose(const geometry::Pose3 & pose)
Expand All @@ -31,32 +31,32 @@ class MeshIntersection
}

/**
* @brief peek a point on the mesh given a input camera observation
* @brief pick a point on the mesh given a input camera observation
* @param output the output measured point
* @param intrinsic the camera intrinsics to use for ray computation
* @param imageCoords the camera observation we want to use to estimate its 'depth'
* @return true if the ray intersect the mesh.
*/
bool peekPoint(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords);
bool pickPoint(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords);

/**
* @brief peek a point and get its normal on the mesh given a input camera observation
* @brief pick a point and get its normal on the mesh given a input camera observation
* @param output the output measured normal
* @param intrinsic the camera intrinsics to use for ray computation
* @param imageCoords the camera observation we want to use to estimate its 'depth'
* @return true if the ray intersect the mesh.
*/
bool peekNormal(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords);
bool pickNormal(Vec3 & output, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords);

/**
* @brief peek a point and get its normal on the mesh given a input camera observation
* @brief pick a point and get its normal on the mesh given a input camera observation
* @param point the output measured point
* @param normal the output measured normal
* @param intrinsic the camera intrinsics to use for ray computation
* @param imageCoords the camera observation we want to use to estimate its 'depth'
* @return true if the ray intersect the mesh.
*/
bool peekPointAndNormal(Vec3 & point, Vec3 & normal, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords);
bool pickPointAndNormal(Vec3 & point, Vec3 & normal, const camera::IntrinsicBase & intrinsic, const Vec2 & imageCoords);

private:
GEO::Mesh _mesh;
Expand Down
2 changes: 1 addition & 1 deletion src/aliceVision/sfm/pipeline/expanding/ExpansionChunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ void ExpansionChunk::setConstraints(sfmData::SfMData & sfmData, const track::Tra
}

Vec3 point, normal;
if (!_pointFetcherHandler->peekPointAndNormal(point, normal, intrinsics, trackItem.coords))
if (!_pointFetcherHandler->pickPointAndNormal(point, normal, intrinsics, trackItem.coords))
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/aliceVision/sfm/pipeline/expanding/PointFetcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class PointFetcher
* @param imageCoords the input image pixel coordinates in 2D.
* @return false on error
*/
virtual bool peekPointAndNormal(Vec3 & point,
virtual bool pickPointAndNormal(Vec3 & point,
Vec3 & normal,
const camera::IntrinsicBase & intrinsic,
const Vec2 & imageCoords) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/software/pipeline/main_sfmBootstraping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ bool landmarksFromMesh(
const double scale = track.featPerView.at(referenceViewId).scale;

Vec3 point;
if (!mi.peekPoint(point, intrinsic, refpt))
if (!mi.pickPoint(point, intrinsic, refpt))
{
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions src/software/pipeline/main_sfmExpanding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,12 @@ class MeshPointFetcher : public sfm::PointFetcher
* @param imageCoords the input image pixel coordinates in 2D.
* @return false on error
*/
bool peekPointAndNormal(Vec3 & point,
bool pickPointAndNormal(Vec3 & point,
Vec3 & normal,
const camera::IntrinsicBase & intrinsic,
const Vec2 & imageCoords) override
{
return _mi.peekPointAndNormal(point, normal, intrinsic, imageCoords);
return _mi.pickPointAndNormal(point, normal, intrinsic, imageCoords);
}

private:
Expand Down
2 changes: 1 addition & 1 deletion src/software/utils/main_depthMapRendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int aliceVision_main(int argc, char** argv)
//Find the 3d point
//Which is the intersection of the ray and the mesh
Vec3 pt3d;
if (!mi.peekPoint(pt3d, *intrinsic, pt))
if (!mi.pickPoint(pt3d, *intrinsic, pt))
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/software/utils/main_normalMapRendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ int aliceVision_main(int argc, char** argv)
//Which is the intersection of the ray and the mesh
//And get its normal
Vec3 normal;
if (!mi.peekNormal(normal, *intrinsic, pt))
if (!mi.pickNormal(normal, *intrinsic, pt))
{
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/software/utils/main_sfmTransform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ bool parseLineUp(const std::string & lineUpFilename, const std::string & tracksF
const Vec2 & imageCoords = trackitem.coords;

Vec3 pt3d;
if (!meshIntersection.peekPoint(pt3d, *intrinsic, imageCoords))
if (!meshIntersection.pickPoint(pt3d, *intrinsic, imageCoords))
{
continue;
}
Expand Down

0 comments on commit 0434f1b

Please sign in to comment.