Bitmap smart clipping using OpenCV
C++ Java Groovy C Shell
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
jni using FAST feature detector. static link Dec 4, 2013
libs/armeabi-v7a using FAST feature detector. static link Dec 4, 2013
res screen shot Dec 3, 2013
screenshots update readme Dec 3, 2013
src/com update readme Dec 3, 2013
AndroidManifest.xml add pager Dec 3, 2013 update readme Dec 4, 2013
build.gradle lib Nov 27, 2013

#Bitmap Smart Clipping using OpenCV

based on

recommend iOS version:

#Demo Screenshots

demo screenshots


  • using OpenCV to detect faces firstly, if have faces, won't cut faces off
  • using OpenCV to detect other characters secondly, if found significant zone, won't cut it off
  • using FAST feature detector instead of SURF, thanks for @yanunon


  • copy config file to app dir

    String configPath = TClip.copyConfig(context, TClip.CONFIG, R.raw.haarcascade_frontalface_alt);
  • get cropped bitmap

    //config: /data/data/com.demo.tclip.debug/haarcascade_frontalface_alt.xml
    Bitmap ret = TClip.crop(configPath, sourceBitmap, width, height);


  • download OpenCV & unzip to /home/user/opencv-android-sdk
  • export OPENCV_PACKAGE_DIR="/home/user/opencv-android-sdk"
  • & from beartung/nonfree-opencv-android
  • using FAST feature detector without libnonfree
  • cd jni && ndk-build