May I ask why I get the wrong answer about rgb2luv
I use python. Today I try to convert an image(rgb) to luv.
The Doc
However , I am confused with the result.So I have a trial.
import cv2
import numpy as np
im=np.array([[[0.78039217, 0.73333335, 0.73333335]]],dtype=float32)
im_xyz=cv2.cvtColor(im,cv2.COLOR_RGB2XYZ) #the result is array([[[ 0.71641064, 0.74334133, 0.79932952]]], dtype=float32)
im_luv=cv2.cvtColor(im,cv2.COLOR_RGB2LUV)#array([[[ 76.84296417, 6.9851861 , 1.50677502]]], dtype=float32)
However,I use the matlab to rgb2luv,the result is 89.0798 , 3.5388 , 0.7616. So I try the xyz to luv, the value of L is also is 89.08016438386028. Why the result of the function cvtColor(im,cv2.COLOR_RGB2LUV) is not 89? 3Qs a lot.
As far as I know, Matlab does not have an official rgb2luv function (if I'm wrong, please point me to the corresponding docs). So probably the function you're using is implemented differently. About OpenCV one, here more info
Be careful, OpenCV loads an image by default as BGR
Yes,I know the BGR which also confused me a lot.
actually Matlab doesn't the official one. My rgb2luv comes from here, And I feel confused about the luv doesn't -16,which is 116y^(1/3) but 116y^(1/3) -16, Could you tell my the reason?3Qs a lot .