hasUniqueCameras to camel case
parent
51fb3750e8
commit
e6ccf97712
|
|
@ -17,7 +17,6 @@
|
|||
*/
|
||||
|
||||
#pragma once
|
||||
#include <pybind11/stl.h>
|
||||
#include <Eigen/Core>
|
||||
|
||||
#include <gtsam/base/DSFMap.h>
|
||||
|
|
@ -39,8 +38,7 @@ typedef Eigen::MatrixX2i CorrespondenceIndices; // N x 2 array
|
|||
using KeypointCoordinates = Eigen::MatrixX2d;
|
||||
|
||||
|
||||
struct Keypoints
|
||||
{
|
||||
struct Keypoints {
|
||||
KeypointCoordinates coordinates;
|
||||
// typedef'd for Eigen::VectorXd
|
||||
boost::optional<gtsam::Vector> scales;
|
||||
|
|
@ -57,8 +55,7 @@ using MatchIndicesMap = std::map<ImagePair, CorrespondenceIndices>;
|
|||
// @param camera index
|
||||
// @param 2d measurement
|
||||
// Implemented as named tuple, instead of std::pair (like SfmMeasurement in SfmTrack.h)
|
||||
struct NamedSfmMeasurement
|
||||
{
|
||||
struct NamedSfmMeasurement {
|
||||
size_t i;
|
||||
gtsam::Point2 uv;
|
||||
|
||||
|
|
@ -71,8 +68,7 @@ struct NamedSfmMeasurement
|
|||
* Note: Equivalent to gtsam.SfmTrack, but without the 3d measurement.
|
||||
* This class holds data temporarily before 3D point is initialized.
|
||||
*/
|
||||
class SfmTrack2d
|
||||
{
|
||||
class SfmTrack2d {
|
||||
private:
|
||||
std::vector<NamedSfmMeasurement> measurements_;
|
||||
|
||||
|
|
@ -85,7 +81,7 @@ class SfmTrack2d
|
|||
// @brief Validates the track by checking that no two measurements are from the same camera.
|
||||
//
|
||||
// returns boolean result of the validation.
|
||||
bool has_unique_cameras()
|
||||
bool hasUniqueCameras()
|
||||
{
|
||||
std::vector<int> track_cam_idxs;
|
||||
for (auto & measurement : measurements_)
|
||||
|
|
@ -101,8 +97,7 @@ class SfmTrack2d
|
|||
/**
|
||||
* @brief Generates point tracks from connected components in the keypoint matches graph.
|
||||
*/
|
||||
class DsfTrackGenerator
|
||||
{
|
||||
class DsfTrackGenerator {
|
||||
|
||||
public:
|
||||
/** Default constructor. */
|
||||
|
|
@ -119,8 +114,7 @@ class DsfTrackGenerator
|
|||
// @param Length-N list of keypoints, for N images/cameras.
|
||||
std::vector<SfmTrack2d> generate_tracks_from_pairwise_matches(
|
||||
const MatchIndicesMap& matches_dict,
|
||||
const KeypointsList& keypoints_list)
|
||||
{
|
||||
const KeypointsList& keypoints_list) {
|
||||
std::vector<SfmTrack2d> track_2d_list;
|
||||
|
||||
std::cout << "[SfmTrack2d] Starting Union-Find..." << std::endl;
|
||||
|
|
@ -171,7 +165,7 @@ class DsfTrackGenerator
|
|||
|
||||
// Skip erroneous track that had repeated measurements within the same image.
|
||||
// This is an expected result from an incorrect correspondence slipping through.
|
||||
if (track_2d.has_unique_cameras())
|
||||
if (track_2d.hasUniqueCameras())
|
||||
{
|
||||
track_2d_list.emplace_back(track_2d);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,13 @@ class MatchIndicesMap {
|
|||
};
|
||||
|
||||
|
||||
class Keypoints
|
||||
{
|
||||
Keypoints(const gtsam::KeypointCoordinates& coordinates);
|
||||
gtsam::KeypointCoordinates coordinates;
|
||||
}; // check if this should be a method
|
||||
|
||||
|
||||
class KeypointsList {
|
||||
KeypointsList();
|
||||
KeypointsList(const gtsam::KeypointsList& other);
|
||||
|
|
@ -28,13 +35,6 @@ class KeypointsList {
|
|||
};
|
||||
|
||||
|
||||
class Keypoints
|
||||
{
|
||||
Keypoints(const gtsam::KeypointCoordinates& coordinates);
|
||||
gtsam::KeypointCoordinates coordinates;
|
||||
}; // check if this should be a method
|
||||
|
||||
|
||||
class NamedSfmMeasurement
|
||||
{
|
||||
size_t i;
|
||||
|
|
@ -46,7 +46,7 @@ class SfmTrack2d
|
|||
{
|
||||
void addMeasurement(const gtsam::NamedSfmMeasurement &m);
|
||||
std::vector<gtsam::NamedSfmMeasurement> measurements();
|
||||
bool has_unique_cameras();
|
||||
bool hasUniqueCameras();
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue