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

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

你可能感兴趣的:(C++开发,Qt开发,qt,c++,图像处理)