Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

BOWKMeansTrainer cluster Python issue

$
0
0
Hello all, I'm trying to use cluster from the BOWKMeansTrainer class on python. Here's a snippet of code to give you an idea sift = cv2.SIFT() print names_path descriptors_unclustered = [] for p in training_paths: image = cv2.imread(p) gray = cv2.cvtColor(image, cv2.CV_LOAD_IMAGE_GRAYSCALE) kp, dsc= sift.detectAndCompute(gray, None) descriptors_unclustered.append(dsc) dictionarySize = 5 desc = np.empty(len(descriptors_unclustered), dtype=object) for i in range(len(descriptors_unclustered)): desc[i] = descriptors_unclustered[i] print desc BOW = cv2.BOWKMeansTrainer(dictionarySize) dictionary = BOW.cluster(desc) print dictionary I'm getting the error TypeError: descriptors data type = 17 is not supported When passing my numpy array to clusters(). Any idea what causes this, or what data type it's supposed to accept?

Viewing all articles
Browse latest Browse all 41027

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>