2016-08-04 17:18:59 -0600 | commented answer | OpenCV4Android 3.1 Mat to Allocation Renderscript Honestly, I'm not fond of this kind of topics, but I found this page: https://docs.rainmeter.net/tips/colormatrix-guide/ |
2016-08-04 16:30:37 -0600 | commented answer | OpenCV4Android 3.1 Mat to Allocation Renderscript Isn't the matrix the following one? |
2016-08-04 12:26:05 -0600 | received badge | ● Supporter (source) |
2016-08-04 12:24:21 -0600 | received badge | ● Editor (source) |
2016-08-04 09:22:38 -0600 | answered a question | OpenCV4Android 3.1 Mat to Allocation Renderscript Hi! This is a crazy one, but possible to achieve. Note: a feature like this one has to be treated as experimental. It is a proof of concept, based upon non-official ways of "doing things with RenderScript". I created this example just for this case: https://bitbucket.org/cmaster11/rsbookexamples/src/tip/OpenCVInteropExample/ Main file, for reference: MainActivity.java The concept of this example is based upon the RenderScript (RS) ability to instantiate an Allocation using a user-provided data pointer. Short explanation: inside RenderScript source code, you can see one method declaration: The last argument, What the sample project does is:
Note: please, refer to the The ability to support a user-provided data pointer is dependent upon the RS device-specific driver. When tested on a Galaxy Note 3 (Android 5.1), it didn't work. There is a high chance that later versions of Android provide good support for this functionality. This functionality works by enabling the RS support library at the cost of using a non-performant RS driver. The process of binding a RS allocation to a user-provided pointer can be achieved by directly calling the native RS function This process, however, requires the usage of Java reflection:
Reference: RenderScript: parallel computing on Android, the easy way |