Skip to content

Commit 9920562

Browse files
committed
init
1 parent 1163a27 commit 9920562

File tree

429 files changed

+525860
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

429 files changed

+525860
-0
lines changed

.gitignore

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
# Built application files
3+
*.apk
4+
*.ap_
5+
*.iml
6+
7+
# Mac
8+
/.idea
9+
10+
# Files for the Dalvik VM
11+
*.dex
12+
13+
# Java class files
14+
*.class
15+
16+
# Generated files
17+
bin/
18+
gen/
19+
out/*
20+
21+
# Gradle files
22+
.gradle/
23+
build/
24+
/*/build/
25+
26+
# Local configuration file (sdk path, etc)
27+
local.properties
28+
29+
# Proguard folder generated by Eclipse
30+
proguard/
31+
32+
# Log Files
33+
*.log

app/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
2+
# Built application files
3+
*.apk
4+
*.ap_
5+
*.iml
6+
7+
# Mac
8+
.idea
9+
10+
# Files for the Dalvik VM
11+
*.dex
12+
13+
# Java class files
14+
*.class
15+
16+
# Generated files
17+
bin/
18+
gen/
19+
out/*
20+
21+
# Gradle files
22+
.gradle/
23+
build/
24+
/*/build/
25+
26+
# Local configuration file (sdk path, etc)
27+
local.properties
28+
29+
# Proguard folder generated by Eclipse
30+
proguard/
31+
32+
# Log Files
33+
*.log
34+
/.externalNativeBuild

app/CMakeLists.txt

+134
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
cmake_minimum_required(VERSION 3.6)
2+
3+
set(CMAKE_VERBOSE_MAKEFILE on)
4+
set(libs "${CMAKE_SOURCE_DIR}/src/main/jniLibs")
5+
include_directories(${CMAKE_SOURCE_DIR}/src/main/cpp/include)
6+
7+
add_library(libopencv_java3 SHARED IMPORTED )
8+
set_target_properties(libopencv_java3 PROPERTIES
9+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_java3.so")
10+
11+
add_library(libopencv_java SHARED IMPORTED )
12+
set_target_properties(libopencv_java PROPERTIES
13+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_java.so")
14+
15+
add_library(libopencv_calib3d STATIC IMPORTED )
16+
set_target_properties(libopencv_calib3d PROPERTIES
17+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_calib3d.a")
18+
19+
add_library(libopencv_core STATIC IMPORTED )
20+
set_target_properties(libopencv_core PROPERTIES
21+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_core.a")
22+
23+
add_library(libopencv_features2d STATIC IMPORTED )
24+
set_target_properties(libopencv_features2d PROPERTIES
25+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_features2d.a")
26+
27+
add_library(libopencv_flann STATIC IMPORTED )
28+
set_target_properties(libopencv_flann PROPERTIES
29+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_flann.a")
30+
31+
add_library(libopencv_highgui STATIC IMPORTED )
32+
set_target_properties(libopencv_highgui PROPERTIES
33+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_highgui.a")
34+
35+
add_library(libopencv_imgcodecs STATIC IMPORTED )
36+
set_target_properties(libopencv_imgcodecs PROPERTIES
37+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_imgcodecs.a")
38+
39+
add_library(libopencv_imgproc STATIC IMPORTED )
40+
set_target_properties(libopencv_imgproc PROPERTIES
41+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_imgproc.a")
42+
43+
add_library(libopencv_ml STATIC IMPORTED )
44+
set_target_properties(libopencv_ml PROPERTIES
45+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_ml.a")
46+
47+
add_library(libopencv_objdetect STATIC IMPORTED )
48+
set_target_properties(libopencv_objdetect PROPERTIES
49+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_objdetect.a")
50+
51+
add_library(libopencv_photo STATIC IMPORTED )
52+
set_target_properties(libopencv_photo PROPERTIES
53+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_photo.a")
54+
55+
add_library(libopencv_shape STATIC IMPORTED )
56+
set_target_properties(libopencv_shape PROPERTIES
57+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_shape.a")
58+
59+
add_library(libopencv_stitching STATIC IMPORTED )
60+
set_target_properties(libopencv_stitching PROPERTIES
61+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_stitching.a")
62+
63+
add_library(libopencv_superres STATIC IMPORTED )
64+
set_target_properties(libopencv_superres PROPERTIES
65+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_superres.a")
66+
67+
add_library(libopencv_video STATIC IMPORTED )
68+
set_target_properties(libopencv_video PROPERTIES
69+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_video.a")
70+
71+
add_library(libopencv_videoio STATIC IMPORTED )
72+
set_target_properties(libopencv_videoio PROPERTIES
73+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_videoio.a")
74+
75+
add_library(libopencv_videostab STATIC IMPORTED )
76+
set_target_properties(libopencv_videostab PROPERTIES
77+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_videostab.a")
78+
79+
add_library(libopencv_ts STATIC IMPORTED )
80+
set_target_properties(libopencv_ts PROPERTIES
81+
IMPORTED_LOCATION "${libs}/${ANDROID_ABI}/libopencv_ts.a")
82+
83+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -fexceptions -frtti")
84+
85+
86+
#find_package(OpenCV REQUIRED)
87+
#target_link_libraries(${OpenCV_LIBS})
88+
89+
add_library( # Sets the name of the library.
90+
jupiter_opencv_320
91+
92+
# Sets the library as a shared library.
93+
SHARED
94+
95+
# Provides a relative path to your source file(s).
96+
# Associated headers in the same location as their source
97+
# file are automatically included.
98+
src/main/cpp/native-lib.cpp )
99+
100+
find_library( # Sets the name of the path variable.
101+
log-lib
102+
103+
# Specifies the name of the NDK library that
104+
# you want CMake to locate.
105+
log)
106+
107+
target_link_libraries(
108+
jupiter_opencv_320 #opencv Version3.2.0
109+
android log #Android日志
110+
111+
#为了避免额外安装 opencv manager 的 apk, 添加这两个动态链接库文件
112+
libopencv_java3 #opencv manager
113+
libopencv_java #opencv manager
114+
115+
#编译 opencv 需要依赖的静态链接库
116+
libopencv_calib3d
117+
libopencv_core
118+
libopencv_features2d
119+
libopencv_flann
120+
libopencv_highgui
121+
libopencv_imgcodecs
122+
libopencv_imgproc
123+
libopencv_ml
124+
libopencv_objdetect
125+
libopencv_photo
126+
libopencv_shape
127+
libopencv_stitching
128+
libopencv_superres
129+
libopencv_video
130+
libopencv_videoio
131+
libopencv_videostab
132+
133+
${log-lib}
134+
)

app/build.gradle

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
apply plugin: 'com.android.application'
2+
3+
android {
4+
compileSdkVersion 25
5+
buildToolsVersion "25.0.3"
6+
defaultConfig {
7+
applicationId "com.jupiter.facedetection"
8+
minSdkVersion 14
9+
targetSdkVersion 25
10+
versionCode 1
11+
versionName "1.0"
12+
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
13+
externalNativeBuild {
14+
cmake {
15+
//arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=gnustl_static'
16+
cppFlags "-std=c++11","-frtti", "-fexceptions"
17+
}
18+
}
19+
ndk{
20+
abiFilters 'armeabi-v7a'
21+
}
22+
}
23+
buildTypes {
24+
release {
25+
minifyEnabled false
26+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
27+
}
28+
}
29+
externalNativeBuild {
30+
cmake {
31+
path "CMakeLists.txt"
32+
}
33+
// ndkBuild {
34+
// path 'src/main/jni/Android.mk'
35+
// }
36+
}
37+
}
38+
39+
dependencies {
40+
compile fileTree(dir: 'libs', include: ['*.jar'])
41+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
42+
exclude group: 'com.android.support', module: 'support-annotations'
43+
})
44+
compile 'com.android.support:appcompat-v7:25.3.1'
45+
testCompile 'junit:junit:4.12'
46+
compile project(':openCVLibrary320')
47+
compile 'com.android.support:design:25.3.1'
48+
compile 'com.google.android.gms:play-services-vision:9.4.0+'
49+
}

app/proguard-rules.pro

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/chadliu/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
18+
19+
# Uncomment this to preserve the line number information for
20+
# debugging stack traces.
21+
#-keepattributes SourceFile,LineNumberTable
22+
23+
# If you keep the line number information, uncomment this to
24+
# hide the original source file name.
25+
#-renamesourcefileattribute SourceFile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.jupiter.facedetection;
2+
3+
import android.content.Context;
4+
import android.support.test.InstrumentationRegistry;
5+
import android.support.test.runner.AndroidJUnit4;
6+
7+
import org.junit.Test;
8+
import org.junit.runner.RunWith;
9+
10+
import static org.junit.Assert.assertEquals;
11+
12+
/**
13+
* Instrumentation test, which will execute on an Android device.
14+
*
15+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
16+
*/
17+
@RunWith(AndroidJUnit4.class)
18+
public class ExampleInstrumentedTest {
19+
@Test
20+
public void useAppContext() throws Exception {
21+
// Context of the app under test.
22+
Context appContext = InstrumentationRegistry.getTargetContext();
23+
24+
assertEquals("com.jupiter.facedetection", appContext.getPackageName());
25+
}
26+
}

app/src/main/AndroidManifest.xml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
package="com.jupiter.facedetection"
5+
android:installLocation="auto">
6+
7+
8+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
9+
<uses-permission android:name="android.permission.CAMERA"/>
10+
11+
<uses-feature
12+
android:name="android.hardware.camera"
13+
android:required="false"/>
14+
<uses-feature
15+
android:name="android.hardware.camera.autofocus"
16+
android:required="false"/>
17+
<uses-feature
18+
android:name="android.hardware.camera.front"
19+
android:required="false"/>
20+
<uses-feature
21+
android:name="android.hardware.camera.front.autofocus"
22+
android:required="false"/>
23+
24+
<application
25+
android:name=".FaceApplication"
26+
android:allowBackup="true"
27+
android:icon="@mipmap/ic_launcher"
28+
android:label="@string/app_name"
29+
android:supportsRtl="true"
30+
android:theme="@style/AppTheme">
31+
<activity
32+
android:name=".ui.HomeActivity"
33+
android:screenOrientation="portrait">
34+
<intent-filter>
35+
<action android:name="android.intent.action.MAIN"/>
36+
37+
<category android:name="android.intent.category.LAUNCHER"/>
38+
</intent-filter>
39+
</activity>
40+
<activity
41+
android:name=".ui.OpenCVActivity"
42+
android:label="@string/opencv"
43+
android:screenOrientation="landscape"/>
44+
<activity
45+
android:name=".ui.CameraAPIActivity"
46+
android:label="@string/camera_api"
47+
android:screenOrientation="nosensor"/>
48+
<activity
49+
android:name=".ui.MediaFaceDetectorActivity"
50+
android:label="@string/media"
51+
android:screenOrientation="portrait"/>
52+
53+
<meta-data
54+
android:name="com.google.android.gms.version"
55+
android:value="@integer/google_play_services_version"/>
56+
<meta-data
57+
android:name="com.google.android.gms.vision.DEPENDENCIES"
58+
android:value="face"/>
59+
60+
<activity
61+
android:name=".ui.VisionFaceTrackerActivity"
62+
android:label="Face Tracker"
63+
android:screenOrientation="portrait"
64+
android:theme="@style/Theme.AppCompat.NoActionBar"/>
65+
<activity
66+
android:name=".ui.FaceOutlineActivity"
67+
android:label="@string/vision_face_outline"/>
68+
</application>
69+
70+
</manifest>

0 commit comments

Comments
 (0)