-
Notifications
You must be signed in to change notification settings - Fork 1
/
colorspaces.py
79 lines (57 loc) · 1.63 KB
/
colorspaces.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import numpy as np
from skimage import color
class RGB2Lab(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2lab(img)
return img
class RGB2HSV(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2hsv(img)
return img
class RGB2HED(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2hed(img)
return img
class RGB2LUV(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2luv(img)
return img
class RGB2YUV(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2yuv(img)
return img
class RGB2XYZ(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2xyz(img)
return img
class RGB2YCbCr(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2ycbcr(img)
return img
class RGB2YDbDr(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2ydbdr(img)
return img
class RGB2YPbPr(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2ypbpr(img)
return img
class RGB2YIQ(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2yiq(img)
return img
class RGB2CIERGB(object):
def __call__(self, img):
img = np.asarray(img, np.uint8)
img = color.rgb2rgbcie(img)
return img