I was comparing the difference between skImage HSV color space and OpenCV hsv colourspace conversion methods, I found the below difference which I didn't understand:
from PIL import Image
from skimage import io
import numpy as np
import cv2
image = PIL.Image.open("112.jpg")
data = np.asarray(image) #Feeding the same RGB array
y1=cv2.cvtColor(np.float32(data),cv2.COLOR_RGB2HSV)
y1 = y1.astype(np.uint8)
y2= color.rgb2hsv(data) #skimage conversion
I used PIL to make sure I am feeding RGB array. Here, when I printed the images I got the following outputs.
y1
>>> array([[[ 52, 0, 252],
[ 52, 0, 252],
[ 52, 0, 252],
...,
[ 59, 0, 186],
[ 59, 0, 186],
[ 59, 0, 186]],
[[ 52, 0, 252],
[ 52, 0, 252],
[ 52, 0, 252],
...,
[ 59, 0, 186],
[ 59, 0, 186],
[ 59, 0, 186]],
[[ 52, 0, 252],
[ 52, 0, 252],
[ 52, 0, 252],
...,
[ 59, 0, 187],
[ 59, 0, 187],
[ 59, 0, 187]],
...,
y2
>>> array([[[0.14465409, 0.21031746, 0.98823529],
[0.14465409, 0.21031746, 0.98823529],
[0.14465409, 0.21031746, 0.98823529],
...,
[0.16515152, 0.59139785, 0.72941176],
[0.16515152, 0.59139785, 0.72941176],
[0.16515152, 0.59139785, 0.72941176]],
[[0.14465409, 0.21031746, 0.98823529],
[0.14465409, 0.21031746, 0.98823529],
[0.14465409, 0.21031746, 0.98823529],
...,
[0.16515152, 0.59139785, 0.72941176],
[0.16515152, 0.59139785, 0.72941176],
[0.16515152, 0.59139785, 0.72941176]],
[[0.14465409, 0.21031746, 0.98823529],
[0.14465409, 0.21031746, 0.98823529],
[0.14465409, 0.21031746, 0.98823529],
...,
[0.16515152, 0.58823529, 0.73333333],
[0.16515152, 0.58823529, 0.73333333],
[0.16515152, 0.58823529, 0.73333333]],
...,
why are my y1 and y2 arrays different? do skimage and opencv follow different conversion formulas for the same colorspace?
Which is the standard and the most followed way to convert an RGB image to HSV image: "cvtColor(....RGB2HSV) -cv2" or "rgbtohsv() -skimage"?
Thank you in advance :)