your imageDiff
Mat is CV_8UC1, but you access it using imageDiff.at<float>()
, which has to be imageDiff.at<uchar>()
instead.
typical noob pitfall
but in general, please try to avoid loops like that, they’re slow and error prone
and again, no screenshots of code or error msgs here please, thank you.