oh wow, that looks like it’s using the ancient OpenCV 1.x API (a C API). abandon all hope. that stuff was made obsolete with OpenCV version 2.0, which introduced C++ API.
if you abandon freepascal too, and switch to embarcadero stuff, you’ll even find a somewhat active-ish community.
you didn’t pass anything for memstorage
. maybe you should. the parameters for a cascade classifier are probably not trivial enough to do without the memstorage.
generally, if you get a violated assertion, you can take that message and look for it in the source code. or see what source file and line is stated in that line of output (modules/core/src/persistence.cpp:4991
).