gpt4 book ai didi

java - a 轴和 b 轴上的 Lab 图像值均超出范围

转载 作者:行者123 更新时间:2023-12-01 11:26:20 24 4
gpt4 key购买 nike

我将一张彩色图像转换到Lab颜色空间,当我显示Lab图像的值时,我发现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* 转换结果会自动缩放:

  • RGB <-> CIE Lab* (CV_BGR2Lab, CV_RGB2Lab, CV_Lab2BGR, CV_Lab2RGB).
    ...
    This outputs 0 <= L <= 100, -127 <= a <= 127, -127 <= b <= 127. The values are then converted to the destination data type:

  • 8-bit images
    L <- L*255/100, a <- a + 128, b <- b + 128

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 轴上的 Lab 图像值均超出范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30775434/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com