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?
EmptyMat()
Re: EmptyMat()
Hi, Clue!
Could you please specify which Operating System and which compiler do you use?
Could you please specify which Operating System and which compiler do you use?
Re: EmptyMat()
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
What'more,is this error related to the version of OpenCV? My OpenCv version is 4.0.0
Re: EmptyMat()
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.
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.
Re: EmptyMat()
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?
But these problems still exist.
So maybe these problems are due to the wrong environment?
Re: EmptyMat()
This is very strange.
Does the problem still appears here?
Or at another place with EmptyMat?
Did you run CMake as described in the installation guide? If EmptyMat is replaced with the Mat()?
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()?
Re: EmptyMat()
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.
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.
Re: EmptyMat()
I have some ideas, that I can offer to try. Sorry, I can't try it myself because I can't reproduce the problem.
- 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.
- 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.
- Try to replace Mat() with lvalue_cast(Mat()) in that place where error occurs.
- Try to re-build OpenCV from the sources using the same Visual Studio compiler.
Re: EmptyMat()
I replace Mat() with lvalue_cast(Mat()) in these head files,those errors have vanished.
Thank you for your help:)
Thank you for your help:)
Return to “Direct Graphical Models”
Who is online
Users browsing this forum: No registered users and 6 guests