I encountered such a problem.
OpenCV Error: Gpu API call (NCV Assertion Failed: NcvStat=28, file=D:\James\repos\opencv\modules\cudaobjdetect\src\cascadeclassifier.cpp, line=361) in `anonymous-namespace'::NCVDebugOutputHandler, file D:\James\repos\opencv\modules\cudaobjdetect\src\cascadeclassifier.cpp, line 156
I have a program that uses "CUDA" acceleration to identify faces and smiles, using cascades. Here is my function.
https://pastebin.com/T3E24CUq
I use special cascades, for "CUDA", the application itself is written in QT. This error can occur after 20 seconds of use, or maybe 5 seconds. I can not understand at all. Here is a screen from the console.