EnoxSoftware / OpenCVForUnity

OpenCV for Unity (Untiy Asset Plugin)
https://assetstore.unity.com/packages/tools/integration/opencv-for-unity-21088
550 stars 172 forks source link

OpenCVForUnity.UnityUtils.Utils.renderTextureToMat has memory leak #182

Open CurtWachs opened 4 months ago

CurtWachs commented 4 months ago

If I use the method OpenCVForUnity.UnityUtils.Utils.renderTextureToMat memory usage goes up constantly as I am using the method in a LateUpdate.

If I instead manually convert the RenderTexture into a Texture2D and then use OpenCVForUnity.UnityUtils.Utils.texture2DToMat there is no memory leak.

I commented out all other code in my LateUpdate aside from the Mat conversion and renderTextureToMat leaks, texture2DToMat does not.

EnoxSoftware commented 4 months ago

Thank you very much for reporting. Could you please tell me which version of OpenCVForUnity you tried?

CurtWachs commented 4 months ago

I am using version 2.5.8.

EnoxSoftware commented 4 months ago

The Utils.renderTextureToMat() method does not seem to exist in OpenCVForUnity 2.5.8. What code have you tested?

CurtWachs commented 4 months ago

My apologies, it seems the github version differs from the Asset store version. Is there somewhere better to direct my findings on that version?