Last active
December 23, 2015 06:19
-
-
Save cocodrips/6592834 to your computer and use it in GitHub Desktop.
チャンネルごとのガンマ補正 / OpenCV for Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private double[] GAMMA_LEVEL_RGB = new double[3]; | |
//こんなかんじの宣言しといて、適当に補正したい値を入れる | |
public synchronized Mat channelsGamma(Mat inputPicture) { | |
Mat channel = new Mat(); | |
ArrayList<Mat> channels = new ArrayList<Mat>(); | |
inputPicture.copyTo(channel); | |
Core.split(channel, channels); | |
for (int i = 0; i < 3; i++) { | |
channels.get(i), GAMMA_LEVEL_RGB[i]); | |
Mat result = gammaFilter(channels.get(i), GAMMA_LEVEL_RGB[i]); | |
//gammaFilterは自作関数 | |
result.copyTo(channels.get(i)); | |
} | |
Core.merge(channels, channel); | |
return channel; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment