Application output :
12:21:02: The program has unexpectedly finished.
12:21:02: The process was ended forcefully.
12:21:02: C:\Users\mahdi\Documents\build-untitled-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug\debug\untitled.exe crashed.
I tested with the image above, When the value of the variable [dark_on_light] is false, I have no problem and no error occurs! BUT!!! When the value of the variable [dark_on_light] is true, it shows the following errors [ WHY??? ] :
OpenCV(4.5.4) Error: Assertion failed (channels() == CV_MAT_CN(dtype)) in cv::Mat::copyTo, file F:…\4.5.4\opencv\modules\core\src\copy.cpp, line 320
OpenCV: terminate handler is called! The last OpenCV error is:
OpenCV(4.5.4) Error: Assertion failed (channels() == CV_MAT_CN(dtype)) in cv::Mat::copyTo, file F:…\4.5.4\opencv\modules\core\src\copy.cpp, line 320
Test2
when use this image, app crash [ dark_on_light == true /// and /// dark_on_light == false, in both, app crash ]
error message :
18:12:49: The program has unexpectedly finished.
18:12:49: The process was ended forcefully.
18:12:49: C:…\build-untitled-Desktop_Qt_5_12_11_MSVC2017_64bit-Debug\debug\untitled.exe crashed.
Test3
dark_on_light == true ::: no error, no crash, show best result
dark_on_light == false ::: no error, no crash, The output is not the same as the previous test and is poor.