12 lines
283 B
Python
12 lines
283 B
Python
|
import cv2
|
||
|
import numpy as np
|
||
|
|
||
|
class ComparisonComparison:
|
||
|
def convert_color (self, color, color_space) :
|
||
|
pixel = np.zeros([1, 1, 3], dtype=np.uint8)
|
||
|
pixel[:] = color
|
||
|
cvt = cv2.cvtColor(pixel, color_space)
|
||
|
return cvt[0, 0]
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
ComparisonComparison()
|