我正在尝试更改矩阵中图像存储的色调。我使用 split() 函数获得了一个色调通道,但我无法改变它的色调。我正在使用函数集(标量标量)来改变它的色调,但我没有看到图像有任何变化。
Mat eyeball_HSV = new Mat();
Mat dest = new Mat();
Mat eye = new Mat();
eye = mRgba.submat(eye_template);
List<Mat> hsv_channel = new ArrayList<Mat>();
Imgproc.cvtColor(eye, eyeball_HSV, Imgproc.COLOR_RGB2HSV, 0);
// get HSV channel
//hsv_channel[0] is hue
//hsv_channel[1] is saturation
//hsv_channel[2] is visibility
Core.split(eyeball_HSV, hsv_channel);
try
{
hsv_channel.get(0).setTo(new Scalar(145,25,45));
Log.v(TAG, "Got the Channel!");
}
catch(Exception ex)
{
ex.printStackTrace();
Log.v(TAG, "Didn't get any channel");
}
Imgproc.cvtColor(eyeball_HSV, dest, Imgproc.COLOR_HSV2RGB);
Imgproc.cvtColor(dest, eye, Imgproc.COLOR_RGB2RGBA);