title: function in C++ similar to numpy flatten
body: <p>Is there any function in C++ or opencv that can do the same operation as numpy flatten() function does ?? </p>
  
  <p>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 <a href="http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_ml/py_kmeans/py_kmeans_opencv/py_kmeans_opencv.html" rel="nofollow noreferrer">http://docs.opencv.org/3.0-beta/doc/py_tutorials/py_ml/py_kmeans/py_kmeans_opencv/py_kmeans_opencv.html</a> </p>
  
  <p><code>center = np.uint8(center)
  res = center[label.flatten()]</code> </p>
  
  <p>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 . </p>
  
  <p>So my question is How do i do this in C++ with opencv ?  </p>
  
  <p>Thanks</p>