mebjas / mebjas.github.io

Repository for hosting my personal home page and blog.
https://blog.minhazav.dev
Apache License 2.0
13 stars 6 forks source link

Processing images fast with native code in Android | Minhaz’s Blog #36

Open utterances-bot opened 2 years ago

utterances-bot commented 2 years ago

Processing images fast with native code in Android | Minhaz’s Blog

If you are writing applications that processes large images captured with a camera or an existing image on the device you need to be extra careful. These days camera on phones are easily equipped with high resolution sensors. Let’s look at a 13MP image. It has 13,000,000 pixels. Any operation that interact with every pixel needs like 13 million iterations. In my experience, its both easier and better to handle these complex image processing operations with native code very particularly to keep it performant. This is a very basic article demonstrating how to do image processing with native code in Android. I’ll also show by an example that the performance of a very simple and unoptimized C++ code comes very close to fairly

https://blog.minhazav.dev/processing-images-fast-with-native-code-in-android/

amdlopes commented 2 years ago

Thanks for the post Minhaz. Very interesting. Just a quick question/clarification. Was the RenderScript implementation like for like with NDK? ie the RS code had two for loops like your native code and then you used invoke() or did you actually use the normal parallel kernel implementation with script_forEach()? Thanks

anhtuannd commented 2 months ago

Hi Minhaz, the post is very interesting. I wonder how we handle big bitmap file without scaling down. Do you have any suggestion?