You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Jaonary Rabarisoa <ja...@gmail.com> on 2014/03/17 16:59:56 UTC
Efficiently map external array data (OpenCV) to spark array
Hi all,
I'm currently trying to use Spark Kmean|| to cluster keypoints descriptor
extracted using OpenCV.
OpenCV extract and store descriptors insinde Mat object. I convert Mat
object into Array[Array[Double]] with the following code :
(0 until descriptors.rows).map { i =>
val row = new Array[Float](descriptors.cols)
descriptors.get(i,0,row)
row.map(_.toDouble)
}
This works but really slow down the code.
Is there another alternatives ?
Cheers,