@@ -16,7 +16,7 @@ KeyPointAndDesc processOneFrameSuperPoint(const Ort::SuperPoint& superPointOsh,
16
16
int borderRemove = 4 , float confidenceThresh = 0.015 ,
17
17
bool alignCorners = true , int distThresh = 2 );
18
18
19
- void normalizeDescriptors (cv::Mat& descriptors);
19
+ void normalizeDescriptors (cv::Mat* descriptors);
20
20
} // namespace
21
21
22
22
int main (int argc, char * argv[])
@@ -57,7 +57,7 @@ int main(int argc, char* argv[])
57
57
});
58
58
59
59
for (auto & curKeyPointAndDesc : superPointResults) {
60
- normalizeDescriptors (curKeyPointAndDesc.second );
60
+ normalizeDescriptors (& curKeyPointAndDesc.second );
61
61
}
62
62
63
63
// superglue
@@ -134,14 +134,14 @@ int main(int argc, char* argv[])
134
134
135
135
namespace
136
136
{
137
- void normalizeDescriptors (cv::Mat& descriptors)
137
+ void normalizeDescriptors (cv::Mat* descriptors)
138
138
{
139
139
cv::Mat rsquaredSumMat;
140
- cv::reduce (descriptors. mul (descriptors), rsquaredSumMat, 1 , cv::REDUCE_SUM);
140
+ cv::reduce (descriptors-> mul (* descriptors), rsquaredSumMat, 1 , cv::REDUCE_SUM);
141
141
cv::sqrt (rsquaredSumMat, rsquaredSumMat);
142
- for (int i = 0 ; i < descriptors. rows ; ++i) {
142
+ for (int i = 0 ; i < descriptors-> rows ; ++i) {
143
143
float rsquaredSum = std::max<float >(rsquaredSumMat.ptr <float >()[i], 1e-12 );
144
- descriptors. row (i) /= rsquaredSum;
144
+ descriptors-> row (i) /= rsquaredSum;
145
145
}
146
146
}
147
147
0 commit comments