参考:https://www.cnblogs.com/ggYYa/p/5707259.html
原图:
处理后的图片:
代码:
public class BalanceWhite {
public static void main(String[] args) {
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
Mat src = Imgcodecs.imread("d:/c/bai1.png");
if (src.empty()) {
System.err.println("The picture doesn't exist");
return;
}
// 自己写的显示图片的方法
Images.showImage(src);
BalanceWhite b = new BalanceWhite();
b.balanceWhite(src);
}
// 白平衡算法
void balanceWhite(Mat src) {
Mat dstImage = new Mat();
List<Mat> imgChannels = new ArrayList&l