@@ -16,7 +16,7 @@ KeyPointAndDesc processOneFrameSuperPoint(const Ort::SuperPoint& superPointOsh,
1616 int borderRemove = 4 , float confidenceThresh = 0.015 ,
1717 bool alignCorners = true , int distThresh = 2 );
1818
19- void normalizeDescriptors (cv::Mat& descriptors);
19+ void normalizeDescriptors (cv::Mat* descriptors);
2020} // namespace
2121
2222int main (int argc, char * argv[])
@@ -57,7 +57,7 @@ int main(int argc, char* argv[])
5757 });
5858
5959 for (auto & curKeyPointAndDesc : superPointResults) {
60- normalizeDescriptors (curKeyPointAndDesc.second );
60+ normalizeDescriptors (& curKeyPointAndDesc.second );
6161 }
6262
6363 // superglue
@@ -134,14 +134,14 @@ int main(int argc, char* argv[])
134134
135135namespace
136136{
137- void normalizeDescriptors (cv::Mat& descriptors)
137+ void normalizeDescriptors (cv::Mat* descriptors)
138138{
139139 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);
141141 cv::sqrt (rsquaredSumMat, rsquaredSumMat);
142- for (int i = 0 ; i < descriptors. rows ; ++i) {
142+ for (int i = 0 ; i < descriptors-> rows ; ++i) {
143143 float rsquaredSum = std::max<float >(rsquaredSumMat.ptr <float >()[i], 1e-12 );
144- descriptors. row (i) /= rsquaredSum;
144+ descriptors-> row (i) /= rsquaredSum;
145145 }
146146}
147147
0 commit comments