EmptyMat()

Semantic Image Segmentation with Conditional Random Fields
Clue

EmptyMat()

Postby Clue » Fri Mar 22, 2019, 08:19

there is something wrong when i try to run the demo dense.cpp
the error like that
''Severity Code Description Project File Line Suppression State
Error C2664 'DirectGraphicalModels::CKDNode::CKDNode(cv::Mat &,byte,pair_mat_t &,byte,int,std::shared_ptr<_Ty>,std::shared_ptr<_Ty>)': cannot convert argument 1 from 'cv::Mat' to 'cv::Mat &' Project16 e:\dgm-master\modules\dgm\kdnode.h 38''

How can I solve it?

User avatar
Creator
Posts: 151
Joined: Tue Dec 16, 2008, 20:52
Location: Hannover, Germany
Contact:

Re: EmptyMat()

Postby Creator » Fri Mar 22, 2019, 16:27

Hi, Clue!
Could you please specify which Operating System and which compiler do you use?

Clue

Re: EmptyMat()

Postby Clue » Sat Mar 23, 2019, 06:37

Compiler is Visual Studio 2017 and Operating System is 64-bit Operating System,x64-based processor Win10
What'more,is this error related to the version of OpenCV? My OpenCv version is 4.0.0

User avatar
Creator
Posts: 151
Joined: Tue Dec 16, 2008, 20:52
Location: Hannover, Germany
Contact:

Re: EmptyMat()

Postby Creator » Sat Mar 23, 2019, 22:27

This bug is really strange. The thing is that MSVS 2017 and Win 10 are the main development platforms and this problem never appeared before.
I could not reproduce the bug.
However, I have replaced the EmptyMat with std::optional<Mat>. Please update the DGM from GitHub repository. I hope this will fix the problem.

Clue

Re: EmptyMat()

Postby Clue » Sun Mar 24, 2019, 12:53

I download the file again from github,and restart to compile it.
But these problems still exist.
So maybe these problems are due to the wrong environment?

User avatar
Creator
Posts: 151
Joined: Tue Dec 16, 2008, 20:52
Location: Hannover, Germany
Contact:

Re: EmptyMat()

Postby Creator » Sun Mar 24, 2019, 17:04

This is very strange.
Does the problem still appears here?

Code: Select all

e:\dgm-master\modules\dgm\kdnode.h   38

Or at another place with EmptyMat?
Did you run CMake as described in the installation guide? If EmptyMat is replaced with the Mat()?

Clue

Re: EmptyMat()

Postby Clue » Mon Mar 25, 2019, 02:34

Another place with EmptyMat.
It seems to work, the error vanished in the header file ''kdnode.h''.
But it still exit in another header file ''kdgauss.h'',''parallel.h'',''infer.h'',''decode.h'' and ''decodeexact.h''.
By the way, I have runed CMake as described in the installation guide and tried to replaced EmptyMat with the Mat().It doesn't work.

User avatar
Creator
Posts: 151
Joined: Tue Dec 16, 2008, 20:52
Location: Hannover, Germany
Contact:

Re: EmptyMat()

Postby Creator » Mon Mar 25, 2019, 22:45

I have some ideas, that I can offer to try. Sorry, I can't try it myself because I can't reproduce the problem.
  1. Try to add const before Mat & in the corresponding functions' declaration (and subsequently implementation if needed) for one function and check whether the error for this particular case disappears.
  2. Try to remove the reference & in the corresponding functions' declaration (and subsequently implementation if needed) for one function and check whether the error for this particular case disappears.
  3. Try to replace Mat() with lvalue_cast(Mat()) in that place where error occurs.
  4. Try to re-build OpenCV from the sources using the same Visual Studio compiler.
I really hope that one of these ideas will help. I am really interested why this problem exists.

Clue

Re: EmptyMat()

Postby Clue » Wed Mar 27, 2019, 07:19

I replace Mat() with lvalue_cast(Mat()) in these head files,those errors have vanished.
Thank you for your help:)


Return to “Direct Graphical Models”

Who is online

Users browsing this forum: No registered users and 1 guest