1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-20 21:40:49 +08:00

Workaround build issue on Mac

This commit is contained in:
Kirill Kornyakov
2014-04-01 16:48:43 -07:00
parent 5970553620
commit 9ec2805e11

View File

@@ -103,7 +103,10 @@ namespace cv{
_particles.row(i).copyTo(new_particles.row(num_particles));
}
}
Mat_<double> maxrow=_particles.row(std::max_element(_logweight.begin(),_logweight.end())-_logweight.begin());
//Mat_<double> maxrow=_particles.row(std::max_element(_logweight.begin(),_logweight.end())-_logweight.begin());
double max_element;
minMaxLoc(_logweight, 0, &max_element);
Mat_<double> maxrow=_particles.row(max_element);
for(;num_particles<new_particles.rows;num_particles++){
maxrow.copyTo(new_particles.row(num_particles));
}
@@ -208,7 +211,9 @@ namespace cv{
}
void PFSolver::normalize(Mat_<double>& row){
double logsum=0.0;
double max=*(std::max_element(row.begin(),row.end()));
//double max=*(std::max_element(row.begin(),row.end()));
double max;
minMaxLoc(row, 0, &max);
row-=max;
for(int i=0;i<row.cols;i++){
logsum+=exp(row(0,i));