Ben scikit-görüntü ile oluşturulan iskeletize görüntüde cv2 piton kütüphanesi ile kontur bulmaya çalıştılar ve ben bu hata var:Görüntüleri scikit-image'den opencv2 ve diğer kütüphanelere nasıl dönüştürebilirim?
contours, hierarchy = cv2.findContours(skel,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
TypeError: <unknown> data type = 0 is not supported
Sorum şu: i cv2 ve tersine dönüştürmek için yapmanız gereken şey?
Ben opencv kullanımı numpy.uint8 tipi ikili görüntülerini temsil etmek olduğunu biliyoruz yerine scikit görüntü numpy.float64 Ben de mahotas (numpy.bool) ve pymorph kütüphaneleri kullanılan
. Scikit-image'den bu kütüphanelere ve viceversa'ya nasıl dönüşebilirim?
from skimage import img_as_ubyte
cv_image = img_as_ubyte(any_skimage_image)
Güncelleme:
Bence: scikit-resmi, kullanıcı kılavuzu şimdi bu konuda daha ayrıntılı bir bölüm vardır kendimi çözüm buldum! Kullandığım takdirde: skel = np.array (skel, dtype = np.uint8) kolayca opencv2 türünü ve diğer kütüphaneler için dönüştürürüm! – improc
http://scikit-image.org/docs/dev/user_guide/data_types.html#using-an-image-from-skimage-with-opencv – tidy