OpenCVForUnity icon indicating copy to clipboard operation
OpenCVForUnity copied to clipboard

OpenCVForUnity.UnityUtils.Utils.renderTextureToMat has memory leak

Open CurtWachs opened this issue 1 year ago • 4 comments

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.

CurtWachs avatar Feb 09 '24 19:02 CurtWachs

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

EnoxSoftware avatar Feb 10 '24 11:02 EnoxSoftware

I am using version 2.5.8.

CurtWachs avatar Feb 11 '24 07:02 CurtWachs

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

EnoxSoftware avatar Feb 11 '24 09:02 EnoxSoftware

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

CurtWachs avatar Feb 12 '24 03:02 CurtWachs