Commit 9e5c28b8 authored by Alexandre Benoit's avatar Alexandre Benoit

Merge pull request #16 from kirill-kornyakov/enable-travis

Enable travis and other fixes
parents 881b115e 9ec2805e
language: cpp
compiler:
- gcc
- clang
before_script:
- cd ../
- git clone https://github.com/Itseez/opencv.git
- mkdir build-opencv
- cd build-opencv
- cmake -DOPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv
script:
- make -j5
notifications:
email: false
...@@ -77,6 +77,8 @@ ...@@ -77,6 +77,8 @@
#include "precomp.hpp" #include "precomp.hpp"
#include "basicretinafilter.hpp" #include "basicretinafilter.hpp"
#include <sstream>
#define _SEGMENTATIONDEBUG //define SEGMENTATIONDEBUG to access more data/methods #define _SEGMENTATIONDEBUG //define SEGMENTATIONDEBUG to access more data/methods
namespace cv namespace cv
......
...@@ -103,7 +103,10 @@ namespace cv{ ...@@ -103,7 +103,10 @@ namespace cv{
_particles.row(i).copyTo(new_particles.row(num_particles)); _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++){ for(;num_particles<new_particles.rows;num_particles++){
maxrow.copyTo(new_particles.row(num_particles)); maxrow.copyTo(new_particles.row(num_particles));
} }
...@@ -208,7 +211,9 @@ namespace cv{ ...@@ -208,7 +211,9 @@ namespace cv{
} }
void PFSolver::normalize(Mat_<double>& row){ void PFSolver::normalize(Mat_<double>& row){
double logsum=0.0; 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; row-=max;
for(int i=0;i<row.cols;i++){ for(int i=0;i<row.cols;i++){
logsum+=exp(row(0,i)); logsum+=exp(row(0,i));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment