Scriptimin gri tonlamalı bir resim alması ve değerleri tonlara eşleştirmesi gerekiyor.HSV2BGR dönüşümü Python OpenCV betiğinde başarısız oluyor
#!/usr/bin/env python
import cv2
import numpy
infile = cv2.imread('Lenna.png')
infile = infile[:,:,0]
hues = (numpy.array(infile)/255.)*179
outimageHSV = numpy.array([[[b,255,255] for b in a] for a in hues]).astype(int)
outimageBGR = cv2.cvtColor(outimageHSV, cv2.COLOR_HSV2BGR)
cv2.imshow('dst_rt', outimageBGR)
cv2.waitKey(0)
cv2.destroyAllWindows()
O cvtColor ile on line başarısız olur ve bu hatayı alıyorum:
OpenCV Error: Assertion failed (depth == CV_8U || depth == CV_16U || depth == CV_32F) in cvtColor, file /tmp/opencv20150506-38415-u2kidu/opencv-2.4.11/modules/imgproc/src/color.cpp, line 3644
Traceback (most recent call last):
File "luma2hue.py", line 16, in <module>
outimageBGR = cv2.cvtColor(outimageHSV, cv2.COLOR_HSV2BGR)
cv2.error: /tmp/opencv20150506-38415-u2kidu/opencv-2.4.11/modules/imgproc/src/color.cpp:3644: error: (-215) depth == CV_8U || depth == CV_16U || depth == CV_32F in function cvtColor
benim outimageHSV dizisi cvtColor için hazır hale getirmek için başka bir şey yapmak gerekir mi?