Skip to content

Commit 9ec2805

Browse files
author
Kirill Kornyakov
committed
Workaround build issue on Mac
1 parent 5970553 commit 9ec2805

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

modules/tracking/src/PFSolver.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ namespace cv{
103103
_particles.row(i).copyTo(new_particles.row(num_particles));
104104
}
105105
}
106-
Mat_<double> maxrow=_particles.row(std::max_element(_logweight.begin(),_logweight.end())-_logweight.begin());
106+
//Mat_<double> maxrow=_particles.row(std::max_element(_logweight.begin(),_logweight.end())-_logweight.begin());
107+
double max_element;
108+
minMaxLoc(_logweight, 0, &max_element);
109+
Mat_<double> maxrow=_particles.row(max_element);
107110
for(;num_particles<new_particles.rows;num_particles++){
108111
maxrow.copyTo(new_particles.row(num_particles));
109112
}
@@ -208,7 +211,9 @@ namespace cv{
208211
}
209212
void PFSolver::normalize(Mat_<double>& row){
210213
double logsum=0.0;
211-
double max=*(std::max_element(row.begin(),row.end()));
214+
//double max=*(std::max_element(row.begin(),row.end()));
215+
double max;
216+
minMaxLoc(row, 0, &max);
212217
row-=max;
213218
for(int i=0;i<row.cols;i++){
214219
logsum+=exp(row(0,i));

0 commit comments

Comments
 (0)