1 #ifndef RANSACSHAPEDETECTOR_HEADER
2 #define RANSACSHAPEDETECTOR_HEADER
30 , m_fitting(LS_FITTING)
32 , m_maxruntime(invalidRuntime)
54 return m_autoAcceptSize;
65 size_t numSamples,
size_t depth,
73 std::pair< size_t, float >* score)
const;
74 float CandidateFailureProbability(
float candidateSize,
75 float numberOfPoints,
float drawnCandidates,
float levels)
const
77 return std::min(std::pow(1.f - candidateSize
78 / (numberOfPoints * levels * (1 << (m_reqSamples - 1))),
79 drawnCandidates), 1.f);
81 float UpdateAcceptedFailureProbability(
82 float currentFailureProbability,
size_t numTries)
const
85 if (currentFailureProbability > 1.f)
87 currentFailureProbability = 1.f;
89 return currentFailureProbability;
91 template<
class ScoreVisitorT >
92 void GenerateCandidates(
96 size_t currentSize,
size_t numInvalid,
98 size_t* drawnCandidates,
100 float* bestExpectedValue,
101 CandidatesType* candidates)
const;
102 template<
class ScoreVisitorT >
103 bool FindBestCandidate(CandidatesType& candidates,
106 size_t currentSize,
size_t drawnCandidates,
107 size_t numInvalid,
size_t minSize,
float numLevels,
108 float* maxForgottenCandidate,
float* candidateFailProb)
const;
109 size_t StatBucket(
float score)
const;
110 void UpdateLevelWeights(
float factor,
114 ConstructorsType m_constructors;
116 size_t m_maxCandTries;
118 size_t m_autoAcceptSize;