Android Bitmap 和 cv::Mat 互相转换
只考虑 Bitmap ARGB 8888 和 cv::Mat 的转换。OpenCV官方写好了例子,直接拿去放 jni 里用:
https://github.com/opencv/opencv/blob/master/modules/java/generator/src/cpp/utils.cpp
顺带可以看 Android Bitmap 官方文档
https://developer.android.com/reference/android/graphics/Bitmap
Greatness is never a given, it must be earned.