Problem assigning values to Mat array in OpenCV 2.3 - seems simple
问题 Using the new API for OpenCV 2.3, I am having trouble assigning values to a Mat array (or say image) inside a loop. Here is the code snippet which I am using; int paddedHeight = 256 + 2*padSize; int paddedWidth = 256 + 2*padSize; int n = 266; // padded height or width cv::Mat fx = cv::Mat(paddedHeight,paddedWidth,CV_64FC1); cv::Mat fy = cv::Mat(paddedHeight,paddedWidth,CV_64FC1); float value = -n/2.0f; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) fx.at<cv::Vec2d>(i,j) = value++; value = -n/2