I’m using OpenCV 4.5.1 and really confuse about this condition:
So I just create a new Mat object:
Mat A = (Size(5, 1), CV_32FC1);
then I try to input some value in A by using Mat.at, like:
model_Input.at<float>(0, 0) = 1.0;
model_Input.at<float>(0, 1) = 2.0;
model_Input.at<float>(0, 2) = 3.0;
model_Input.at<float>(0, 3) = 4.0;
model_Input.at<float>(0, 4) = 5.0;
model_Input.at<float>(0, 5) = 6.0;
It seems like the code model_Input.at<float>(0, 5) = 6.0;
out of the bounds (Size(5,1))?
But no error was reported during the compilation process, and there is no problem even when debug.
The Mat A for sure only have 5 values since I try to cout it, but I don’t know why no errors in this code?