首页 > 编程知识 正文

qt c 中取像每个像素点的rgb的数值的方法

时间:2023-05-04 06:47:04 阅读:228851 作者:3474

qt c++中取图像每个像素点的rgb的数值的方法

for(int i=0;i<curFrame.cols/5;i++) { for(int k=0;k<curFrame.cols/5;k++) { int temp_x=(int)(5*i+5); int temp_y=(int)(5*k+5); Scalar temp_color = curFrame.at<Vec3b>(temp_x, temp_y); double blue=temp_color.val[0]; double green=temp_color.val[1]; double red=temp_color.val[2]; redsum+=red; bluesum+=blue; greensum+=green; totalsum++; } }

秋风写于淄博 业务联系与技术交流:375172665

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。