Open
Description
From the code it seems that the images get cast to float32 ([0.0, 1.0] range, right?) anyway:
, so why is not working if I'm passing directly a float32 image?Is it supporting only uint8 inputs?
What is the effect of passing float32 and int32 images?
Thanks!
import numpy as np
import cv2
gs = cv2.ximgproc.segmentation.createGraphSegmentation(0.8, 150, 100)
np.random.seed(0)
img_float32 = np.random.rand(200, 300, 3)
img_float32_255 = img_float32 * 255
img_uint8 = (img_float32 * 255).astype('uint8')
img_int32 = (img_float32 * 255).astype('int32')
print(gs.processImage(img_uint8).max()) # 97
print(gs.processImage(img_float32).max()) # 0
print(gs.processImage(img_float32_255).max()) # 104
print(gs.processImage(img_int32).max()) # 97
Metadata
Assignees
Labels
No labels