Opencv_contrib: optflow - ‘numeric_limits’ is not a member of ‘std’

Created on 29 Oct 2016  Â·  4Comments  Â·  Source: opencv/opencv_contrib

System information (version)
  • OpenCV => 3.1.0
  • Operating System / Platform => Ubuntu 14.04
  • Compiler => GCC 4.8.5
    Detailed description
[ 17%] Generating precomp.hpp.gch/opencv_cudaimgproc_Release.gch
In file included from /home/me/libraries/opencv/opencv-contrib/modules/optflow/include/opencv2/optflow.hpp:70:0,
                 from /home/me/libraries/opencv/opencv-contrib/modules/optflow/src/precomp.hpp:45,
                 from /home/me/libraries/opencv/opencv-3.1.0-build/modules/optflow/opencv_optflow_pch_dephelp.cxx:1:
/home/me/libraries/opencv/opencv-contrib/modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp: In member function ‘void cv::optflow::GPCPatchDescriptor::markAsSeparated()’:
/home/me/libraries/opencv/opencv-contrib/modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp:73:41: error: ‘numeric_limits’ is not a member of ‘std’
   void markAsSeparated() { feature[0] = std::numeric_limits< double >::quiet_NaN(); }
                                         ^
/home/me/libraries/opencv/opencv-contrib/modules/optflow/include/opencv2/optflow/sparse_matching_gpc.hpp:73:62: error: expected primary-expression before ‘double’
   void markAsSeparated() { feature[0] = std::numeric_limits< double >::quiet_NaN(); }
Steps to reproduce

I am not sure why nobody else seemed to have this problem, so it might be just my setup. The one thing that I might have been doing differently is that I only build ximgproc and optflow and do not include the other opencv_contrib modules.

To fix this, I only had to add #include <limits> to the affected file, but there probably is a better solution.

bug builinstall

Most helpful comment

Another input, for me this issue typically occurs If you use 3.1.0 download from OpenCV website and build with opencv_contrib master. If you build with opencv master and opencv_contrib master, then this issue does not occur.

All 4 comments

Saw this same error. Thanks for you suggestion to #include . That helped.

Another input, for me this issue typically occurs If you use 3.1.0 download from OpenCV website and build with opencv_contrib master. If you build with opencv master and opencv_contrib master, then this issue does not occur.

You're right I did as you said and ran into this error.

Thank you so much!!!! #include fixed error for me... yay!!!

Was this page helpful?
0 / 5 - 0 ratings