Ask Your Question

lcmai's profile - activity

2017-01-14 21:39:51 -0600 commented question How to get the GMM co-variance matrix?

Thank you for your advise! I did try vector<mat> covs = em.getMatVector("covs"); and it did get the co-variance matrix successfully. However, while the program hit the end bracket of if, an error had came up, which is:

Debug Assertion Failed!

Program: D:\Kinect test\GMM\GMM\x64\Debug\GMM.exe File: minkernel\crts\ucrt\src\appcrt\heap\debug_heap.cpp Line: 980

Expression: __acrt_first_block == header

It looks like the problem is in assigning memory to vectors. I try to assign the co-variance matrix to a new cv::Mat object once the function executed, and then apply cov.clear() function and it works fine.

2017-01-13 02:22:55 -0600 commented question How to get the GMM co-variance matrix?

Yes, it runs in debug mode.

2017-01-13 00:33:36 -0600 commented question How to get the GMM co-variance matrix?

I already update the call stack, thank you.

2017-01-13 00:32:44 -0600 received badge  Editor (source)
2017-01-12 21:29:28 -0600 received badge  Student (source)
2017-01-12 21:25:37 -0600 commented question How to get the GMM co-variance matrix?

The call stack is very long, can I just post it as an answer tomorrow? As I just created my account yesterday, I am not all allow to post answers within two days after the account created. Sorry for the delay.

2017-01-12 20:00:04 -0600 commented question How to get the GMM co-variance matrix?

The call stack of the error is: > GMM.exe! cv::Algorithm::get<std::vector<cv::mat,std::allocator<cv::mat> > >(const char * _name) Line 4095

2017-01-12 02:49:31 -0600 asked a question How to get the GMM co-variance matrix?

I am using cv::EM to train the GMMs. Everything works fine except when I want to get the co-variance matrix I got a Debug Assertion Failed.

The code is:

cout << "Test the EM algorithm in Opencv" << endl;
cv::EM em(5);
em.train(training_set);
if (em.isTrained())
{
    cout << "Finished trainging EM" << endl;
    const cv::Mat &weights =  em.get<cv::Mat>("weights");
    const cv::Mat &Means = em.get<cv::Mat>("means");
    const vector<cv::Mat> &Covs = em.get<vector<cv::Mat>>("covs");
}

system("pause");

and the error message is:

Debug Assertion Failed!

Program: D:\Kinect test\GMM\GMM\x64\Debug\GMM.exe File: f:\dd\vctools\crt\crtw32\misc\dbgheap.c Line: 1424

Expression: _pFirstBlock == pHead

For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.

The complete call stack is:

 ntdll.dll!NtWaitForSingleObject() Unknown

ntdll.dll!LdrpDrainWorkQueue()  Unknown

ntdll.dll!LdrpLoadDllInternal() Unknown

ntdll.dll!LdrpLoadDll() Unknown

ntdll.dll!LdrLoadDll()  Unknown

KernelBase.dll!LoadLibraryExW()    Unknown

SogouPY.ime!00007ff89b27daf8()  Unknown

SogouPY.ime!00007ff89b1186ce()  Unknown

SogouPY.ime!00007ff89b11873a()  Unknown

SogouPY.ime!00007ff89b1f7a02()  Unknown

SogouPY.ime!00007ff89b1f7b68()  Unknown

SogouPY.ime!00007ff89b2212e7()  Unknown

SogouPY.ime!00007ff89b228965()  Unknown

SogouPY.ime!00007ff89b2b6a85()  Unknown

SogouPY.ime!00007ff89b227437()  Unknown

SogouPY.ime!00007ff89b22759f()  Unknown

SogouPY.ime!00007ff89b227638()  Unknown

user32.dll!UserCallWinProcCheckWow()   Unknown

user32.dll!DispatchClientMessage() Unknown

user32.dll!__fnINLPCREATESTRUCT()  Unknown

ntdll.dll!KiUserCallbackDispatcherContinue()   Unknown

win32u.dll!NtUserCreateWindowEx()  Unknown

user32.dll!VerNtUserCreateWindowEx()   Unknown

user32.dll!CreateWindowInternal()  Unknown

user32.dll!CreateWindowExW()   Unknown

SogouTSF.ime!00007ff89b7fceae() Unknown

SogouTSF.ime!00007ff89b7e9dd5() Unknown

msctf.dll!CTip::Activate()  Unknown

msctf.dll!CThreadInputMgr::_ActivateTip()   Unknown

msctf.dll!CThreadInputMgr::ActivateInputProfile()   Unknown

msctf.dll!CThreadInputMgr::OnActiveProfileChange(void)  Unknown

msctf.dll!CThreadInputMgr::TimerProc(struct HWND__ *,unsigned int,unsigned __int64,unsigned long)   Unknown

user32.dll!UserCallWinProc()   Unknown

user32.dll!DispatchMessageWorker() Unknown

user32.dll!DialogBox2()    Unknown

user32.dll!InternalDialogBox() Unknown

user32.dll!SoftModalMessageBox()   Unknown

user32.dll!MessageBoxWorker()  Unknown

user32.dll!MessageBoxTimeoutW()    Unknown

user32.dll!MessageBoxW()   Unknown

msvcr120d.dll!__crtMessageBoxW(const wchar_t * lpText=0x0000008d4ddc2260, const wchar_t * lpCaption=0x00007ff877265140, unsigned int uType=73746) Line 250  C

msvcr120d.dll!__crtMessageWindowW(int nRptType=2, void * returnAddress=0x00007ff8771f0829, const wchar_t * szFile=0x00007ff877288a80, const wchar_t * szLine=0x0000008d4ddc5350, const wchar_t * szModule=0x0000000000000000, const wchar_t * szUserMessage=0x0000008d4ddca350) Line 391    C++

msvcr120d.dll!_VCrtDbgReportW(int nRptType=2, void * returnAddress=0x00007ff8771f0829, const wchar_t * szFile=0x00007ff877288a80, int nLine=1424, const wchar_t * szModule=0x0000000000000000, const wchar_t * szFormat=0x00007ff877263a3c, char * arglist=0x0000008d4ddcc448) Line 672 C

msvcr120d.dll!_CrtDbgReportWV(int nRptType=2, void * returnAddress=0x00007ff8771f0829, const wchar_t * szFile=0x00007ff877288a80, int nLine=1424, const wchar_t * szModule=0x0000000000000000, const wchar_t * szFormat=0x00007ff877263a3c, char * arglist=0x0000008d4ddcc448) Line 263 C++

msvcr120d.dll!_CrtDbgReportW(int nRptType=2, const wchar_t * szFile=0x00007ff877288a80, int nLine=1424, const wchar_t * szModule=0x0000000000000000, const wchar_t * szFormat=0x00007ff877263a3c, ...) Line 279 C++

msvcr120d.dll!_free_dbg_nolock(void * pUserData=0x000001a3b4141ca0, int nBlockUse=1) Line 1424  C++

msvcr120d.dll!_free_dbg(void * pUserData=0x000001a3b4141ca0, int nBlockUse=1) Line 1265 C++

msvcr120d.dll!operator delete(void * pUserData=0x000001a3b4141ca0) Line 54  C++

opencv_core2413d.dll!00007ff8773146a2() Unknown

opencv_core2413d.dll!00007ff87731449c() Unknown

opencv_core2413d.dll!00007ff87730f20d() Unknown

opencv_core2413d.dll!00007ff87730ac61() Unknown

opencv_core2413d.dll!00007ff87730b16c() Unknown

opencv_core2413d.dll!00007ff87731756b ...
(more)