Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

hierarchical clustering

I am trying to cluster features using the flann hierarchicalClustering function. The features' dimension is 48 and I have around 100 features. I don't understand why the clustering crashes ? (seg fault). Below is a sample code of what I am doing :

//samples cv::Mat1f descriptorsSamples = cv::Mat1f::zeros(nSamples, 48);

//here I fill descriptorsSamples with float values (48 dim descriptors)

unsigned int branching = 32; // 32 unsigned int niterations = 10; // 100 int nClusters = 0;

cvflann::KMeansIndexParams kmean_params;

unsigned int initiNCenters = 10; cv::Mat1f centers(initiNCenters, 3);

nClusters = cv::flann::hierarchicalClustering< cv::flann::L2<float> >((const cv::Mat &) descriptorsSamples, (cv::Mat &) centers, (const::cvflann::KMeansIndexParams &) kmean_params);

IMPORTANT : I am using OpenCV 2.4.8 (this version is imposed)

click to hide/show revision 2
None

updated 2019-07-12 03:37:27 -0600

berak gravatar image

hierarchical clustering

I am trying to cluster features using the flann hierarchicalClustering function. The features' dimension is 48 and I have around 100 features. I don't understand why the clustering crashes ? (seg fault). Below is a sample code of what I am doing :

//samples
cv::Mat1f descriptorsSamples = cv::Mat1f::zeros(nSamples, 48);

48); //here I fill descriptorsSamples with float values (48 dim descriptors)

descriptors) unsigned int branching = 32; // 32 unsigned int niterations = 10; // 100 int nClusters = 0;

0; cvflann::KMeansIndexParams kmean_params;

kmean_params; unsigned int initiNCenters = 10; cv::Mat1f centers(initiNCenters, 3);

3); nClusters = cv::flann::hierarchicalClustering< cv::flann::L2<float> >((const cv::Mat &) descriptorsSamples, (cv::Mat &) centers, (const::cvflann::KMeansIndexParams &) kmean_params);

kmean_params);

IMPORTANT : I am using OpenCV 2.4.8 (this version is imposed)