企业网站的开发流程,python18,有哪些网站可以免费看电影,自动app优化最新版在OpenCV(Python)中将图像从RGB转换为LAB时#xff0c;我无法找到有关L * A * B *值范围的文档。寻找一些确认我的见解是正确的#xff0c;因为这些数字相当奇特。我的轻度结果是从0-255#xff0c;但对于a和b我分别得到了42-226和20-223。我知道这些数值不需要有一个预定的…在OpenCV(Python)中将图像从RGB转换为LAB时我无法找到有关L * A * B *值范围的文档。寻找一些确认我的见解是正确的因为这些数字相当奇特。我的轻度结果是从0-255但对于a和b我分别得到了42-226和20-223。我知道这些数值不需要有一个预定的范围但是有没有人能够理解为什么选择这些范围从RGB转换到LAB色彩空间 - 深入了解L * A * B *值的范围我试图在LAB空间中创建颜色直方图并需要知道值的范围以便以节省空间的方式存储箱值。import cv2import numpy as npimport sysimport urllibprint cv2.__version__ # 2.4.7print sys.version # 2.7.5 (default, Sep 19 2013, 13:48:49) \n[GCC 4.8.1]# Load an image that contains all possible colors.request urllib.urlopen(http://www.brucelindbloom.com/downloads/RGB16Million.png)image_array np.asarray(bytearray(request.read()), dtypenp.uint8)image cv2.imdecode(image_array, cv2.CV_LOAD_IMAGE_COLOR)# I was uncertain if it was BGR or RGB but in this case it doesnt matter because# of my input image.lab_image cv2.cvtColor(image, cv2.COLOR_BGR2LAB)l_channel,a_channel,b_channel cv2.split(lab_image)# Print the minimum and maximum of lightness.print np.min(l_channel) # 0print np.max(l_channel) # 255# Print the minimum and maximum of a.print np.min(a_channel) # 42print np.max(a_channel) # 226# Print the minimum and maximum of b.print np.min(b_channel) # 20print np.max(b_channel) # 223谢谢0快速谷歌搜索给了一个在线转换器提供的源代码http://colormine.org/convert/rgb-to-lab –0感谢您的链接M4rtini。我以前看过它但它与我的问题无关。我正在寻找为什么OpenCV的范围如此奇怪的数字。由colormine计算的范围允许a和b的正值和负值这在OpenCV(Python)中不是这种情况。不管怎么说多谢拉 –