32 #include <Math/Math3d.h>
33 #include <Math/Math2d.h>
36 #include <opencv2/opencv.hpp>
43 class CSIFTFeatureCalculator;
56 void FindObjectHypotheses(CByteImage* pImageLeftColor, CByteImage* pImageRightColor, CByteImage* pImageLeftGrey, CByteImage* pImageRightGrey,
57 CSIFTFeatureArray& aAllSIFTPoints, std::vector<CMSERDescriptor3D*>& aAllMSERs, std::vector<CHypothesisPoint*>& aPointsFromDisparity,
61 std::vector<Vec3d>& aSigmaPoints,
const CByteImage* pLeftColorImage,
const CByteImage* pLeftGreyImage);
64 std::vector<CMSERDescriptor3D*>& aMSERs, std::vector<Vec3d>& aSigmaPoints,
const CByteImage* pLeftColorImage,
const CByteImage* pLeftGreyImage);
67 std::vector<Vec3d>& aSigmaPoints,
const CByteImage* pLeftColorImage,
const CByteImage* pLeftGreyImage);
73 float GetVariance(
const CVec3dArray& avPoints,
Vec3d& vMean);
75 void RemoveOutliers(CVec3dArray& avPoints,
float fStdDevFactor = 2.0f, std::vector<int>* paIndices = NULL);
77 bool FindCylinder(
const CVec3dArray& avSamplePoints,
const CVec3dArray& avAllPoints,
const float fToleranceThreshold,
const float fMaxRadius,
78 CVec3dArray& avResultPoints,
Vec3d& vCylinderAxis,
Vec3d& vCylinderCenter,
float& fCylinderRadius);
80 void QuickSort2DPointsX(CFloatMatrix& mPoints,
int nLeft,
int nRight);
82 void ClusterPointsRegularGrid2D(
const CVec3dArray& avPoints,
const CCalibration* calibration,
83 const int nNumSectionsX,
const int nNumSectionsY, CVec3dArray*& pClusters,
int& nNumClusters);
85 bool RANSACCylinders(
const CVec3dArray& avPoints,
const CCalibration* calibration,
86 const float fToleranceThreshold,
const float fMaxRadius, CVec3dArray& avCylinder);
88 bool RANSACCylinders2(
const CVec3dArray& avPoints,
const CCalibration* calibration,
89 const float fToleranceThreshold,
const float fMaxRadius, CVec3dArray& avCylinder,
90 Vec3d& vCylinderAxis,
Vec3d& vCylinderCenter,
float& fCylinderRadius);
92 bool RANSACPlane(
const CVec3dArray& pointCandidates,
const float fRANSACThreshold,
93 const int nIterations, CVec3dArray& resultPoints,
Vec3d& vAxis,
float& d);
95 bool RANSACSphere(
const CVec3dArray& aPointCandidates,
const float fRANSACThreshold,
const float fMaxSphereRadius,
96 const int nMaxIterations, CVec3dArray& aResultPoints,
Vec3d& vCenter,
float& fRadius);
98 bool CreateFeatureDescriptorForPoint(
CHypothesisPoint* pPoint,
Vec3d vPosition, std::vector<CMSERDescriptor3D*>& aMSERs,
99 std::vector<Vec3d>& aSigmaPoints,
const CByteImage* pLeftColorImage,
const CByteImage* pLeftGreyImage);
100 void AddSIFTFeatureDescriptors(
CSIFTFeatureArray* pFeatures,
Vec2d vPoint2d,
const CByteImage* pLeftGreyImage);
102 void ClusterXMeans(
const CVec3dArray& aPoints,
const int nMaxNumClusters,
const float fBICFactor, std::vector<CVec3dArray*>& aaPointClusters);
104 inline void SortMSERsBySize(std::vector<CMSERDescriptor3D*>& aRegions3D);
105 inline void SortMSERsByX(std::vector<CMSERDescriptor3D*>& aRegions3D);
106 inline int FindRegionForPoint(
Vec3d vPoint, std::vector<CMSERDescriptor3D*>& aRegions3D);
108 inline void SortVec3dsByX(std::vector<Vec3d>& aPoints);
109 inline bool PointIsInList(
Vec3d vPoint, std::vector<Vec3d>& aPoints);
114 CVec3dArray m_vFeaturePoints3d;
116 CCalibration* calibration;
117 CSIFTFeatureCalculator* m_pSIFTFeatureCalculator;
120 CByteImage* m_pSaliencyImage, *m_pHypothesesCoveringImage, *m_pSaliencyHypothesisRegionsImage, *m_pTempImageGray;
128 LCCPSegmentationWrapper* lccpSegmentation1, *lccpSegmentation2;