Permalink
Browse files

cleaning up duplicated libs, testing different memory allocation

  • Loading branch information...
radames committed Apr 29, 2016
1 parent 522c98f commit 4f5eb8f7114f30d68023d9fb9a087ce940158829
Showing with 24 additions and 27 deletions.
  1. +6 −6 Android/selfieMemememe3/.idea/gradle.xml
  2. +0 −11 Android/selfieMemememe3/app/build.gradle
  3. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/arm64-v8a/libIlmImf.a
  4. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/arm64-v8a/liblibjasper.a
  5. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/arm64-v8a/liblibjpeg.a
  6. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/arm64-v8a/liblibpng.a
  7. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/arm64-v8a/liblibtiff.a
  8. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/arm64-v8a/liblibwebp.a
  9. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/arm64-v8a/libtbb.a
  10. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi-v7a/libIlmImf.a
  11. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi-v7a/liblibjasper.a
  12. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi-v7a/liblibjpeg.a
  13. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi-v7a/liblibpng.a
  14. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi-v7a/liblibtiff.a
  15. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi-v7a/liblibwebp.a
  16. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi-v7a/libtbb.a
  17. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi/libIlmImf.a
  18. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi/liblibjasper.a
  19. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi/liblibjpeg.a
  20. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi/liblibpng.a
  21. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi/liblibtiff.a
  22. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi/liblibwebp.a
  23. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/armeabi/libtbb.a
  24. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips/libIlmImf.a
  25. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips/liblibjasper.a
  26. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips/liblibjpeg.a
  27. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips/liblibpng.a
  28. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips/liblibtiff.a
  29. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips/liblibwebp.a
  30. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips/libtbb.a
  31. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips64/libIlmImf.a
  32. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips64/liblibjasper.a
  33. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips64/liblibjpeg.a
  34. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips64/liblibpng.a
  35. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips64/liblibtiff.a
  36. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips64/liblibwebp.a
  37. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/mips64/libtbb.a
  38. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86/libIlmImf.a
  39. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86/liblibjasper.a
  40. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86/liblibjpeg.a
  41. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86/liblibpng.a
  42. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86/liblibtiff.a
  43. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86/liblibwebp.a
  44. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86/libtbb.a
  45. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86_64/libIlmImf.a
  46. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86_64/liblibjasper.a
  47. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86_64/liblibjpeg.a
  48. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86_64/liblibpng.a
  49. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86_64/liblibtiff.a
  50. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86_64/liblibwebp.a
  51. BIN Android/selfieMemememe3/app/src/main/3rdparty/libs/x86_64/libtbb.a
  52. +18 −10 Android/selfieMemememe3/app/src/main/java/memememe/me/selfiememememe/MemememeActivity.java
  53. BIN Android/selfieMemememe3/app/src/main/jniLibs/libdetection_based_tracker.so
  54. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_calib3d.a
  55. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_core.a
  56. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_features2d.a
  57. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_flann.a
  58. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_highgui.a
  59. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_imgcodecs.a
  60. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_imgproc.a
  61. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_ml.a
  62. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_objdetect.a
  63. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_photo.a
  64. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_shape.a
  65. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_stitching.a
  66. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_superres.a
  67. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_ts.a
  68. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_video.a
  69. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_videoio.a
  70. BIN Android/selfieMemememe3/app/src/main/jniLibs/libopencv_videostab.a
  71. BIN Android/selfieMemememe3/app/src/main/libs/arm64-v8a/libdetection_based_tracker.so
  72. BIN Android/selfieMemememe3/app/src/main/libs/armeabi-v7a/libdetection_based_tracker.so
  73. BIN Android/selfieMemememe3/app/src/main/libs/armeabi/libdetection_based_tracker.so
  74. BIN Android/selfieMemememe3/app/src/main/libs/mips/libdetection_based_tracker.so
  75. BIN Android/selfieMemememe3/app/src/main/libs/mips64/libdetection_based_tracker.so
  76. BIN Android/selfieMemememe3/app/src/main/libs/x86/libdetection_based_tracker.so
  77. BIN Android/selfieMemememe3/app/src/main/libs/x86_64/libdetection_based_tracker.so
@@ -8,16 +8,16 @@
<option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-2.10" />
<option name="modules">
<set>
- <option value="$PROJECT_DIR$" />
- <option value="$PROJECT_DIR$/app" />
- <option value="$PROJECT_DIR$/openCVLibrary310" />
+ <option value="$USER_HOME$/Projetos/memememe/memememe/Android/selfieMemememe3" />
+ <option value="$USER_HOME$/Projetos/memememe/memememe/Android/selfieMemememe3/app" />
+ <option value="$USER_HOME$/Projetos/memememe/memememe/Android/selfieMemememe3/openCVLibrary310" />
</set>
</option>
<option name="myModules">
<set>
- <option value="$PROJECT_DIR$" />
- <option value="$PROJECT_DIR$/app" />
- <option value="$PROJECT_DIR$/openCVLibrary310" />
+ <option value="$USER_HOME$/Projetos/memememe/memememe/Android/selfieMemememe3" />
+ <option value="$USER_HOME$/Projetos/memememe/memememe/Android/selfieMemememe3/app" />
+ <option value="$USER_HOME$/Projetos/memememe/memememe/Android/selfieMemememe3/openCVLibrary310" />
</set>
</option>
</GradleProjectSettings>
@@ -65,14 +65,3 @@ dependencies {
compile files('src/main/libs/JTransforms-3.0.jar')
compile files('src/main/libs/jumblr-0.0.10-jar-with-dependencies.jar')
}
-
-task copyJniLibs(type: Copy) {
- from 'src/main/libs/armeabi-v7a'
- into 'src/main/jniLibs'
-}
-
-tasks.withType(JavaCompile) {
- compileTask -> compileTask.dependsOn(copyJniLibs)
-}
-
-//clean.dependsOn 'cleanCopyJniLibs'
@@ -74,7 +74,8 @@
private Mat mRgba;
private Mat mGray;
- private Mat mTempRgba;
+ private Mat mTempRgba;
+ private Mat tempT;
private File mCascadeFile;
private float mRelativeDetectSize = 0.15f;
@@ -129,7 +130,7 @@ public void onManagerConnected(int status) {
os.close();
mNativeDetector = new DetectionBasedTracker(mCascadeFile.getAbsolutePath(), 0);
-
+ mNativeDetector.start();
cascadeDir.delete();
}
catch (IOException e) {
@@ -252,17 +253,19 @@ public void onDestroy() {
}
public void onCameraViewStarted(int width, int height) {
- mGray = new Mat();
mRgba = new Mat();
+ mGray = new Mat();
mTempRgba = new Mat();
+ tempT = new Mat();
}
public void onCameraViewStopped() {
mNativeDetector.stop();
mAbsoluteDetectSize = 0;
- mGray.release();
mRgba.release();
+ mGray.release();
mTempRgba.release();
+ tempT.release();
}
private Thread sendCommandToPlatform(String cmd){
@@ -287,7 +290,8 @@ public void run() {
public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
mTempRgba = inputFrame.rgba();
- Core.flip(inputFrame.gray().t(), mGray, 0);
+ tempT = inputFrame.gray().t();
+ Core.flip(tempT, mGray, 0);
// save images for video...
/*
@@ -298,13 +302,15 @@ public Mat onCameraFrame(CvCameraViewFrame inputFrame) {
*/
// only need to do this once
+
if (mAbsoluteDetectSize == 0) {
int height = mGray.cols();
+ Log.e("NUMNUM", "COLUMUNS:" + String.valueOf(height));
+
if (Math.round(height*mRelativeDetectSize) > 0) {
mAbsoluteDetectSize = Math.round(height*mRelativeDetectSize);
}
mNativeDetector.setMinFaceSize(mAbsoluteDetectSize);
- mNativeDetector.start();
}
// always detect in order to keep NativeDetector consistent with camera
@@ -549,8 +555,8 @@ else if(mCurrentState == State.FLASHING){
Log.d(TAG, "state := SEARCHING");
sendCommandToPlatform("search").start();
}
-
- Core.flip(mTempRgba.t(), mRgba, 1);
+ tempT = mTempRgba.t();
+ Core.flip(tempT, mRgba, 1);
for(int i=0; i<mRandomGenerator.nextInt(5)+2; i++){
mCurrentFlashText = TEXTS[mRandomGenerator.nextInt(TEXTS.length)];
Size mTextSize = Imgproc.getTextSize(mCurrentFlashText, Core.FONT_HERSHEY_PLAIN, 1, 16, null);
@@ -561,7 +567,8 @@ else if(mCurrentState == State.FLASHING){
mRandomGenerator.nextInt((int)(mRgba.height() - mTextSize.height)));
Imgproc.putText(mRgba, mCurrentFlashText, mTextOrigin, Core.FONT_HERSHEY_PLAIN, mWidthScale, SCREEN_COLOR_BLACK, 16);
}
- Core.flip(mRgba.t(), mTempRgba, 1);
+ tempT = mRgba.t();
+ Core.flip(tempT, mTempRgba, 1);
}
else if(mCurrentState == State.WAITING){
mTempRgba.setTo(SCREEN_COLOR_BLACK);
@@ -575,7 +582,8 @@ else if(mCurrentState == State.WAITING){
}
}
else if(mCurrentState == State.POSTING){
- Core.flip(mTempRgba.t(), mRgba, 0);
+ tempT = mTempRgba.t();
+ Core.flip(tempT, mRgba, 0);
Imgproc.cvtColor(mRgba, mRgba, Imgproc.COLOR_BGR2RGB);
String selfieFilename = SELFIE_FILE_NAME+(System.currentTimeMillis()/1000)+".jpg";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 4f5eb8f

Please sign in to comment.