简体   繁体   English

Android图像处理过滤器导致OutOfMemory异常

[英]Android image processing filters causes OutOfMemory Exception

i have been searching for a good and reliable solution for this problem please help me The problem is that i am creating image filtering app using OpenCV in Android (C++ ndk) and when i continuously apply filters on a bitmap every time it calls OpenCV native c++ function after converting bitmap into an integer array and passing it into the native c++ function. 我一直在寻找解决此问题的好的可靠方法,请帮助我。问题是我正在使用Android(C ++ ndk)中的OpenCV创建图像过滤应用程序,并且每次我调用OpenCV本机c ++时在位图上连续应用过滤器时,在将位图转换为整数数组并将其传递给本机c ++函数之后,将函数转换为函数。 Filters work fine and i get result but when i apply them continuously depending on the device the app gives OutOfMemory exception when i am converting the result of filter (integer array) into bitmap again. 过滤器工作正常,并且我得到结果,但是当我根据设备连续应用它们时,当我再次将过滤器(整数数组)的结果转换为位图时,应用会给出OutOfMemory异常。 On different devices i tested this and the number of times filter is applied successfully is different . 在不同的设备上,我对此进行了测试,并且成功应用过滤器的次数也不同。 The code line on which i get exception is 我得到异常的代码行是

bmOutImg = Bitmap.createBitmap(bmInImg.getWidth(), bmInImg.getHeight(),Config.ARGB_8888);

I dont want to resize images to smaller resolutio can anyone tell me the exact code solution to resolve this issue. 我不想将图像调整为较小的分辨率,谁能告诉我确切的代码解决方案来解决此问题。 I will be really thankful ! 我真的会很感激!

问题很简单,我没有用本地c ++代码发布数组。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM