mat读取大于255的像素值
Mat dst;
input.convertTo(dst, CV_32S);
int rows = dst.rows;
int cols = dst.cols;
for(int i = 0; i < rows; i++)
{
for(int j = 0; j < cols; j++)
{
cout << "value : " << dst.at<int>(i, j) << endl ;
}
}
Mat roi_dst;
roi.convertTo(roi_dst, CV_64F);
for(int i = 0; i < roi_dst.rows; i++)
{
for(int j = 0; j < roi_dst.cols; j++)
{
roi_data.push_back((int)roi_dst.at<double>(i, j));
cout << roi_dst.at<double>(i, j) << " " ;
}
cout << endl;
}
浙公网安备 33010602011771号