diff options
author | lluís gómez i bigordà <lluisbigorda@users.sourceforge.net> | 2011-02-25 21:36:45 +0000 |
---|---|---|
committer | lluís gómez i bigordà <lluisbigorda@users.sourceforge.net> | 2011-02-25 21:36:45 +0000 |
commit | ea655d5bd44ad552288a142f3b8515acff9aec19 (patch) | |
tree | ab393db5cfb4e8df65e7b3915c162209928cb2fd | |
parent | 2b3a76c84e83fa86868d6409ac4d8295ce4488ba (diff) |
added upper limit to blovksize message. values higher than 100 cause too much cpu ussage
svn path=/trunk/externals/pix_opencv/; revision=14971
-rwxr-xr-x | pix_opencv_of_bm.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pix_opencv_of_bm.cc b/pix_opencv_of_bm.cc index 97bc9bf..c3d280a 100755 --- a/pix_opencv_of_bm.cc +++ b/pix_opencv_of_bm.cc @@ -532,8 +532,8 @@ void pix_opencv_of_bm :: tresholdMess(float threshold) void pix_opencv_of_bm :: blocksizeMess(float fwidth, float fheight) { - if (fwidth>=5.0) x_blocksize.width = (int)fwidth; - if (fheight>=5.0) x_blocksize.height = (int)fheight; + if ((fwidth>=5.0)&&(fwidth<=100.0)) x_blocksize.width = (int)fwidth; + if ((fheight>=5.0)&&(fheight<=100.0)) x_blocksize.height = (int)fheight; x_velsize.width = (comp_xsize-x_blocksize.width)/x_shiftsize.width; x_velsize.height = (comp_ysize-x_blocksize.height)/x_shiftsize.height; @@ -546,8 +546,8 @@ void pix_opencv_of_bm :: blocksizeMess(float fwidth, float fheight) void pix_opencv_of_bm :: shiftsizeMess(float fwidth, float fheight) { - if (fwidth>=5.0) x_shiftsize.width = (int)fwidth; - if (fheight>=5.0) x_shiftsize.height = (int)fheight; + if ((fwidth>=5.0)&&(fwidth<=100.0)) x_shiftsize.width = (int)fwidth; + if ((fheight>=5.0)&&(fheight<=100.0)) x_shiftsize.height = (int)fheight; x_velsize.width = (comp_xsize-x_blocksize.width)/x_shiftsize.width; x_velsize.height = (comp_ysize-x_blocksize.height)/x_shiftsize.height; @@ -560,8 +560,8 @@ void pix_opencv_of_bm :: shiftsizeMess(float fwidth, float fheight) void pix_opencv_of_bm :: maxrangeMess(float fwidth, float fheight) { - if (fwidth>=5.0) x_maxrange.width = (int)fwidth; - if (fheight>=5.0) x_maxrange.height = (int)fheight; + if ((fwidth>=5.0)&&(fwidth<=100.0)) x_maxrange.width = (int)fwidth; + if ((fheight>=5.0)&&(fheight<=100.0)) x_maxrange.height = (int)fheight; } void pix_opencv_of_bm :: usePreviousMess(float previous) |