Is there any function in C++ or opencv that can do the same operation as numpy flatten() function does ??
I think my question was vague. I am trying to use K-means segmentation in C++ opencv environment, there is an example given in python here http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_ml/py_kmeans/py_kmeans_opencv/py_kmeans_opencv.html
center = np.uint8(center)
res = center[label.flatten()]
I have been able to do most of the operation until this flatten thing in C++ The dimension of label is 921600 X 1 which I also get in C++ as well. Center dimension is 4X3 matrix. I guess the trick here is to get all the label value specific to center value. so at the end "res" becomes 921600 X 3 .
So my question is How do i do this in C++ with opencv ?
Thanks