I am developing an application that includes image processing ( grayscale , Bw filte ,object detection ,color adjustment ,level adjustment ).
As you know, new mobile phones takes high quality images with large sizes.Due to memory limitations, it is difficult to image processing and outofmemoryException occurs frequently .So I've moved compeletely image proccessing from Java layer to JNI as follows:
- Mat file loaded in jni by source file path.
- Proccessing ....
- Result mat are stored in sd card.
- Result image loaded in inSampledSize bitmap as preview.
OutOfMemoryException does not occur with this method in image proccessing . but sometime when image have very large dimensions , Activity closed automattically during image processing without any exception and it's cause did not specify when debugging. Why is this happening? And How can I fix this?
Excuse me for my english.