我将彩色图像转换为Lab-color空间,当我显示Lab-image的值时,我发现a轴和b轴上的像素值都大于128!而a轴和b轴上的值应
从-128到+128

请让我知道为什么a轴和b轴的值超出范围?

代码:

Log.D(TAG, "main", "labImg.size(): " + labImg.size());
    Log.D(TAG, "main", "dst.dump() \n" + labImg.dump());
    Log.D(TAG, "main", "Luminance:dst.get(0, 9)[0]: " + labImg.get(0, 9)[0]);
    Log.D(TAG, "main", "a-axis:dst.get(0, 9)[1]: " + labImg.get(0, 9)[1]);
    Log.D(TAG, "main", "b-axis:dst.get(0, 9)[2]: " + labImg.get(0, 9)[2]);

输出:
[82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20;
82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20, 82, 207, 20]
3: Debug: MainClass -> main: Luminance:dst.get(0, 9)[0]: 82.0
4: Debug: MainClass -> main: a-axis:dst.get(0, 9)[1]: 207.0
5: Debug: MainClass -> main: b-axis:dst.get(0, 9)[2]: 20.0

最佳答案

8位图像上L*a*b*转换的结果将自动缩放:

http://docs.opencv.org/java/2.4.9/org/opencv/imgproc/Imgproc.html#cvtColor(org.opencv.core.Mat,%20org.opencv.core.Mat,%20int)

关于java - a和b轴上的实验室图像值均超出范围,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/30775434/

10-10 11:25