Based off of the OpenCV4Android Native Sample. The Square finding code is located in jni/jni_part.cpp