Possible Bug cv::Mat at() throws exception in debug mode

Please view images to recreate bug in debug mode.
There might be a problem with the Assert on line 900 in the image. Use the following line in Google Tests:

    auto distances = cv::Mat(3, 3, CV_32F);
    double x = distances.at<double>(0, 0);

i took the liberty to remove your useless screenshot
(please post text, not images of it !)

however the answer is simple: if your Mat’s type is CV_32F, you must use:

distances.at<float>(0, 0);

in other words, you have to match the underlying datatpe exactly, no liberties allowed here, with CV_64F you would use at<double>(y,x) and so on …

(problem is ofc the same in release mode, it just wont assert there
(similar to how std::vector behaves))

thank you so much, that helped me out greatly