2016-08-04 18:27:16 -0600 | commented answer | OpenCV4Android 3.1 Mat to Allocation Renderscript No worries, you've helped me plenty! It is odd as to why their Sepia Matrix is rotated, but I will be investigating tomorrow :) |
2016-08-04 17:11:27 -0600 | commented answer | OpenCV4Android 3.1 Mat to Allocation Renderscript This looks promising for Sepia, but absolutely not for my Protan Matrix. Why is yours left-rotated? Or do I completely misunderstand how the OpenCV Matrix is structured? I'm gonna be off soon, so might be looking at this again tomorrow. |
2016-08-04 16:48:56 -0600 | commented answer | OpenCV4Android 3.1 Mat to Allocation Renderscript If you are on Stack Overflow and want to get points here is the Thread I made there: http://stackoverflow.com/questions/38... Didn't see your reply until it refreshed after my answer, will check. |
2016-08-04 16:05:09 -0600 | received badge | ● Scholar (source) |
2016-08-04 16:04:21 -0600 | commented answer | OpenCV4Android 3.1 Mat to Allocation Renderscript Hi and thank you so much! I think this is doing exactly what I need. I ran into problems with applying the Sepia filter (it just turns the image into shades of green). I had this problem before, as I ran the intrinsic over Bitmap, so I don't think there's a problem in your code. I've marked your answer, but maybe you're a genius for this too: |
2016-08-04 15:43:42 -0600 | received badge | ● Supporter (source) |
2016-08-04 12:26:05 -0600 | received badge | ● Student (source) |
2016-08-03 09:51:37 -0600 | asked a question | OpenCV4Android 3.1 Mat to Allocation Renderscript I am making an Android app to simulate colourblindness. It takes a camera feed and manipulates at runtime.
I have an OpenCV Mat object rgba, containing all Pixels of a given frame with red, green, blue and alpha (rgba) values. To speed up processing I'd like to use Renderscript, but when I convert that Mat rgba to Bitmap I lose about 5 fps, making any speedgain by Renderscript pointless. So I would like to know a way of placing the contents of Mat rgba into an Allocation that I can give to Renderscript, where I then just do Matrix multiplication for it all and return it.
I based my app on the imagemanipulations example provided by OpenCV, specifically the Sepia filter option. In Then in onCameraFrame OpenCV places the frame into a Mat and the filter is run over it, causing it to have this yellowish tint. I have this running for Protan, Deutan and Tritan and on the S7 edge I get 10 fps. This is okayish, but as soon as we put the app on an older phone it becomes incredibly slow.
Hence I would like to do what |