64,683
社区成员
发帖
与我相关
我的任务
分享
int iMax = saturate_cast<int>(hist.at<float>(0));
for (int i = 0; i < hsize; i++)
{
if (iMax < saturate_cast<int>(hist.at<float>(0)))
iMax = saturate_cast<int>(hist.at<float>(0));
int val = saturate_cast<int>(hist.at<float>(i)*histimg.rows / 255);
rectangle(histimg, Point(i*binW, histimg.rows),
Point((i + 1)*binW, histimg.rows - val),
Scalar(buf.at<Vec3b>(i)), -1, 8);
cout << "Value" << i << "=" << hist.at<float>(i) << endl;
}