Skip to content

OpenCV Matlab Code Generator module make error #3781

@jeremvv

Description

@jeremvv
System information (version)
  • OpenCV => 4.10.0
  • Operating System / Platform => Ubuntu 22.04
  • Compiler => g++ 11.4.0
Detailed description

Hi all,
I'm trying to compile the last OpenCV with the OpenCV Matlab Code Generator module enable in order to call OpenCV methods in Matlab. I was previously using https://github.com/kyamagu/mexopencv when on OpenCV 3. After a new install on my machine and a try with OpenCV 4, I can't make it work.

After successfully running cmake, running make leads to the following errors:

 CMake Error at /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/compile.cmake:65 (message):
  Failed to compile CamShift: In file included from
  /home/jeremy/work/opencv_build/opencv/modules/core/include/opencv2/core.hpp:3415,


                   from /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:52,
                   from /home/jeremy/work/opencv_build/opencv/build/modules/matlab/src/CamShift.cpp:13:

  
  /home/jeremy/work/opencv_build/opencv/modules/core/include/opencv2/core/operations.hpp:58:118:
  warning: â is an unrecognized format function type
  [-Wformat=]

     58 | #    define CV_FORMAT_PRINTF(string_idx, first_to_check) __attribute__ ((format (printf, string_idx, first_to_check)))
        |                                                                                                                      ^

  
  /home/jeremy/work/opencv_build/opencv/modules/core/include/opencv2/core/operations.hpp:499:48:
  note: in expansion of macro â

    499 | CV_EXPORTS String format(const char* fmt, ...) CV_FORMAT_PRINTF(1, 2);
        |                                                ^~~~~~~~~~~~~~~~

  In file included from
  /home/jeremy/work/opencv_build/opencv/build/modules/matlab/src/CamShift.cpp:13:


  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:88:17:
  error: â was not declared in this scope; did
  you mean â?

     88 | typedef cv::Ptr<DualTVL1OpticalFlow> Ptr_DualTVL1OpticalFlow;
        |                 ^~~~~~~~~~~~~~~~~~~
        |                 readOpticalFlow

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:88:36:
  error: template argument 1 is invalid

     88 | typedef cv::Ptr<DualTVL1OpticalFlow> Ptr_DualTVL1OpticalFlow;
        |                                    ^

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:95:17:
  error: â was not declared in this scope; did you
  mean â?

     95 | typedef cv::Ptr<TonemapDurand> Ptr_TonemapDurand;
        |                 ^~~~~~~~~~~~~
        |                 TonemapDrago

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:95:30:
  error: template argument 1 is invalid

     95 | typedef cv::Ptr<TonemapDurand> Ptr_TonemapDurand;
        |                              ^

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:477:11:
  error: â cannot be overloaded with
  â

    477 |   Bridge& operator=(const Ptr_DualTVL1OpticalFlow& ) { return *this; }
        |           ^~~~~~~~

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:292:11:
  note: previous declaration â

    292 |   Bridge& operator=(const int& ) { return *this; }
        |           ^~~~~~~~

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:479:3:
  error: â cannot be overloaded with
  â

    479 |   operator Ptr_DualTVL1OpticalFlow() { return toPtrDualTVL1OpticalFlow(); }
        |   ^~~~~~~~

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:294:3:
  note: previous declaration â

    294 |   operator int() { return toInt(); }
        |   ^~~~~~~~

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:512:11:
  error: â cannot be overloaded with
  â

    512 |   Bridge& operator=(const Ptr_TonemapDurand& ) { return *this; }
        |           ^~~~~~~~

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:292:11:
  note: previous declaration â

    292 |   Bridge& operator=(const int& ) { return *this; }
        |           ^~~~~~~~

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:514:3:
  error: â cannot be overloaded with
  â

    514 |   operator Ptr_TonemapDurand() { return toPtrTonemapDurand(); }
        |   ^~~~~~~~

  
  /home/jeremy/work/opencv_build/opencv_contrib/modules/matlab/include/opencv2/matlab/bridge.hpp:294:3:
  note: previous declaration â

    294 |   operator int() { return toInt(); }

Could anyone assist me or help me on this ?

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions