How to pass complex data from unity c# to native cpp plugin

I want to pass complex data like the image in a webcamtexture to my c++ plugin that uses opencv Mat for processing, but untill now every intent crashes the program even when it is wrapped in try catch.

Specifically i am using a samsung galaxy s6
I am sure that i am accesing the method, but it crashes when i try to reconvert the data i sent into a image again

Hi @Urlish can you post some code? And can you post the logcat? You are probably running into a segmentation fault or running out of memory.

I also want to suggest using NatCam and OpenCVForUnity. NatCam provides amazing camera functionality and support while OpenCVForUnity is very good for performing OpenCV on mobile. The icing on the cake is that these two packages are developed with compatibility with each other.