HEAP; corruption or bug when detect face using cascade classifier
My program run perfectly when I convert data from buffer into Mat (program to run video from external camera with frame grabber card). But after I try to develop a program to detect face, it has triggered a breakpoint. My output window shows as follow:
/* HEAP[my.exe]: Invalid address specified to RtlValidateHeap ( 03EC0000, 03F10ED0) // these codes are changing every debug.
This may be due to a corruption of the heap, which indicates a bug in my.exe or any of the DLLs it has loaded.
This may also due to the user pressing F12 while ......
*/ 10/1/15
Since there is no problem with my code, I'd deleted it, to make sure a clean section for this question.
just a blind guess:
"I convert data from buffer into Mat" - you have to be careful here, the Mat just does a shallow copy of the data pointer, once that goes out of scope (e.g. if you have some kind of callback function), it is dead.
try like this:
I did that part, but it does not solve my problem sir.
The cause - of a heap corruption in particular - can be extremely hard to find. My suggestion is that you start building a minimum example that crashes and one that does not crash. This doesn't mean the one that doesn't crash doesn't have the error. But at least you have a small piece of code you can debug/inspect and possibly post here.
please append code to question.
I had appended the code just now. Hope there is a solution.
Nope. That's not me. Oh, but it my first time heard about 'nifty format' or '.nii'.
^^ sorry, my bad, i confused nii and ni images, ignore !
hmm, staring hard at the code, and the
{}
braces do not match. is this really all of the code ?(stráy
}
before the imshow())Ugh.. sorry. I'd edited the code. There is no
}
beforeimshow()
.