File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ language : cpp
2+ compiler :
3+ - gcc
4+ - clang
5+ before_script :
6+ - cd ../
7+ - git clone https://github.com/Itseez/opencv.git
8+ - mkdir build-opencv
9+ - cd build-opencv
10+ - cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
11+ script :
12+ - make -j5
13+ notifications :
14+ email : false
Original file line number Diff line number Diff line change 7777#include " precomp.hpp"
7878#include " basicretinafilter.hpp"
7979
80+ #include < sstream>
81+
8082#define _SEGMENTATIONDEBUG // define SEGMENTATIONDEBUG to access more data/methods
8183
8284namespace cv
Original file line number Diff line number Diff 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));
You can’t perform that action at this time.
0 commit comments