1.亮度增强(线性方式)
int main(){
Mat src = imread("E:/2_05.jpg");
if (!src.data){
cout << "read error" << endl;
return -1;
}
imshow("src",src);
cout << src.channels() << endl;
Mat dst = src.clone();
for (int row = 0; row < src.rows; row++)
{
for (int col = 0; col < src.cols; col++)
{
Vec3b pixels = src.at<Vec3b>(row,col);
dst.at<Vec3b>(row, col)[0] = saturate_cast<uchar>(pixels[0] + 30);
dst.at<Vec3b>(row, col)[1] = saturate_cast<uchar>(pixels[1] + 30);
dst.at<Vec3b>(row, col)[2] = saturate_cast<uchar>(pixels[2] + 30);
}
}
imshow("dst",dst);
waitKey(0);
return 0;
}
2.直方均衡,提升对比度
int main(){
Mat src = imread