Reputation:
i tried with the following line code:
image.at<char>(row, column);
image.at<uchar>(row, column);
image.at<unsigned char>(row, column);
image.at<double>(row, column);
what is wrong?
after that, i need to convert this value to a float. A casting is enough?
Upvotes: 5
Views: 13800
Reputation: 5470
CV_16UC1 has unsigned short as an underlying type, so you probably need
unsigned short val = image.at<unsigned short>(row, column);
And yes, you can simply static cast that to a float afterwards:
float fval = static_cast<float>(val);
Upvotes: 9