The data type for the bins should be int
not float
. e.g.
for (int i = 0; i < 256; i++){
std::cout<<hist_gray_c.at<int>(i)<<std::endl;
}
From the docs
hist Destination histogram with one row, 256 columns, and the CV_32SC1 type.
The data type for the bins should be int
not float
. e.g.
for (int i = 0; i < 256; i++){
std::cout<<hist_gray_c.at<int>(i)<<std::endl;
}
From the docs
hist Destination histogram with one row, 256 columns, and the CV_32SC1 type.