Search Results

Search found 2 results on 1 pages for 'goffrey'.

Page 1/1 | 1 

  • OpenCV's cvKMeans2 - chosing clusters

    - by Goffrey
    Hi, I'm using cvKMeans2 for clustering, but I'm not sure, how it works in general - the part of choosing clusters. I thought that it set the first positions of clusters from given samples. So it means that in the end of clustering process would every cluster has at least one sample - in the output array of cluster labels will be full range of numbers (for 100 clusters - numbers 0 to 99). But as I checked output labels, I realised that some labels weren't used at all and only some were used. So, does anyone know, how it works? Or how should I use the parameters of cvKMeans2 to do what I want (cause I'm not sure if I use them right)? I'm using cvKMeans2 function also with optional parameters: cvKMeans2(descriptorMat, N_CLUSTERS, clusterLabels, cvTermCriteria( CV_TERMCRIT_EPS+CV_TERMCRIT_ITER, 10, 1.0), 1, 0, 0, clusterCenters, 0) Thanks for any advices!

    Read the article

  • C++ - repeatedly using istringstream

    - by Goffrey
    I have a code for reading files with float numbers on line stored like this: "3.34|2.3409|1.0001|...|1.1|". I would like to read them using istringstream, but it doesn't work as I would expect: string row; string strNum; istringstream separate; // textovy stream pro konverzi while ( getline(file,row) ) { separate.str(row); // = HERE is PROBLEM = while( getline(separate, strNum, '|') ) { // using delimiter flNum = strToFl(strNum); // my conversion insertIntoMatrix(i,j,flNum); // some function j++; } i++; } In marked point, row is copied into separate stream only first time. In next iteration it doesn't work and it does nothing. I expected it is possible to be used more times without constructing new istringstream object in every iteration.

    Read the article

1