Best way to apply a function to each element of Mat (Android)
Hello,
I've seen the thread here with the same request but the two main answers were to use pointers and to use parallel methods. Neither are really available on the Android implementation of OpenCV.
What would be the fastest way to apply a function like sin(pi/k * element^2) on Android OpenCV and then insert that value into another matrix?
edit: related question: is it faster to collect elements in a Java array first and then insert all of them at once as a row instead of individually with .put()
" is it faster to collect elements in a Java array first and then insert all of them at once " -- definitely !
@berak, confirming that you mean collect as a row right? Or can I collect all elements in some kind of multi-dimensional array and then do only one operation to stick it in to the matrix?
I've just seen this answer which answers some of my questions