Skip to content

Commit 731985c

Browse files
committed
All the files
1 parent 40d7d07 commit 731985c

Some content is hidden

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

54 files changed

+5114
-0
lines changed

AndroidManifest.xml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.xiegeo.cssr"
4+
android:versionCode="7"
5+
android:versionName="1.1.1">
6+
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15"/>
7+
8+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
9+
10+
<uses-permission android:name="android.permission.CAMERA" />
11+
<uses-feature android:name="android.hardware.camera" android:required="false"/>
12+
13+
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name"
14+
>
15+
<activity android:name=".MainActivity"
16+
android:screenOrientation="landscape"
17+
android:label="@string/app_name"
18+
android:configChanges="orientation"
19+
android:launchMode="singleTask">
20+
<!-- android:theme="@style/Theme.NoBackground" -->
21+
<intent-filter>
22+
<action android:name="android.intent.action.MAIN" />
23+
<category android:name="android.intent.category.LAUNCHER" />
24+
25+
</intent-filter>
26+
27+
</activity>
28+
<activity android:name="Preferences"
29+
></activity>
30+
<activity android:name="HelpActivity"
31+
></activity>
32+
<activity android:name="ImageGridActivity"
33+
></activity>
34+
<activity android:name="GroupsActivity"
35+
></activity>
36+
<activity android:name="ListOfLibrarysActivity"
37+
android:label="@string/app_name">
38+
<intent-filter>
39+
<action android:name="android.intent.action.VIEW" />
40+
<category android:name="android.intent.category.DEFAULT" />
41+
<category android:name="android.intent.category.BROWSABLE" />
42+
<data android:scheme="file" android:mimeType="*/*" android:host="*" android:pathPattern=".*\\.cssl" />
43+
</intent-filter>
44+
45+
</activity>
46+
<activity android:name="com.xiegeo.cssr.FileListActivity"></activity>
47+
</application>
48+
</manifest>

proguard.cfg

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
-optimizationpasses 5
2+
-dontusemixedcaseclassnames
3+
-dontskipnonpubliclibraryclasses
4+
-dontpreverify
5+
-verbose
6+
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
7+
8+
-keep public class * extends android.app.Activity
9+
-keep public class * extends android.app.Application
10+
-keep public class * extends android.app.Service
11+
-keep public class * extends android.content.BroadcastReceiver
12+
-keep public class * extends android.content.ContentProvider
13+
-keep public class * extends android.app.backup.BackupAgentHelper
14+
-keep public class * extends android.preference.Preference
15+
-keep public class com.android.vending.licensing.ILicensingService
16+
17+
#To remove debug logs:
18+
-assumenosideeffects class android.util.Log {
19+
public static *** d(...);
20+
public static *** v(...);
21+
public static *** w(...);
22+
}
23+
24+
25+
-keepclasseswithmembers class * {
26+
native <methods>;
27+
}
28+
29+
-keepclasseswithmembers class * {
30+
public <init>(android.content.Context, android.util.AttributeSet);
31+
}
32+
33+
-keepclasseswithmembers class * {
34+
public <init>(android.content.Context, android.util.AttributeSet, int);
35+
}
36+
37+
-keepclassmembers enum * {
38+
public static **[] values();
39+
public static ** valueOf(java.lang.String);
40+
}
41+
42+
-keep class * implements android.os.Parcelable {
43+
public static final android.os.Parcelable$Creator *;
44+
}
45+
46+
#Uncomment if using Serializable
47+
-keepclassmembers class * implements java.io.Serializable {
48+
private static final java.io.ObjectStreamField[] serialPersistentFields;
49+
private void writeObject(java.io.ObjectOutputStream);
50+
private void readObject(java.io.ObjectInputStream);
51+
java.lang.Object writeReplace();
52+
java.lang.Object readResolve();
53+
}

project.properties

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system use,
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
10+
# Project target.
11+
target=android-16
12+
proguard.config=proguard.cfg
577 Bytes
Loading

res/drawable-hdpi/ic_action_sound.png

764 Bytes
Loading

res/drawable-hdpi/ic_launcher.png

6.3 KB
Loading
312 Bytes
Loading

res/drawable-ldpi/ic_action_sound.png

377 Bytes
Loading

res/drawable-ldpi/ic_launcher.png

2.02 KB
Loading
398 Bytes
Loading

res/drawable-mdpi/ic_action_sound.png

504 Bytes
Loading

res/drawable-mdpi/ic_launcher.png

3.08 KB
Loading
747 Bytes
Loading
1007 Bytes
Loading

res/drawable-xhdpi/ic_launcher.png

10.5 KB
Loading

res/layout/help_layout.xml

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent" >
5+
6+
<LinearLayout
7+
android:layout_width="match_parent"
8+
android:layout_height="wrap_content"
9+
android:orientation="vertical" >
10+
11+
<TextView
12+
android:layout_width="wrap_content"
13+
android:layout_height="wrap_content"
14+
android:layout_marginLeft="10dp"
15+
android:layout_marginTop="10dp"
16+
android:text="About"
17+
android:textAppearance="?android:attr/textAppearanceLarge" />
18+
19+
<TextView
20+
android:layout_width="wrap_content"
21+
android:layout_height="wrap_content"
22+
android:layout_margin="5dp"
23+
android:gravity="fill_horizontal"
24+
android:text="This is an image recognition camera app. One important algorithm used is Curvature Scale Space, hence the name CSS Recognizer." />
25+
26+
<TextView
27+
android:id="@+id/links"
28+
android:layout_width="wrap_content"
29+
android:layout_height="wrap_content"
30+
android:layout_marginLeft="5dp"
31+
android:text="@string/links"
32+
/>
33+
34+
<TextView
35+
android:layout_width="wrap_content"
36+
android:layout_height="wrap_content"
37+
android:layout_marginLeft="10dp"
38+
android:layout_marginTop="10dp"
39+
android:text="How to Use"
40+
android:textAppearance="?android:attr/textAppearanceLarge" />
41+
42+
<TextView
43+
android:layout_width="wrap_content"
44+
android:layout_height="wrap_content"
45+
android:layout_margin="5dp"
46+
android:text="Play around with the camera, you should be able to find objects, such as toys, symbols, or hand gestures, that the app selects with little to no artifacts. The object can be anything that fits inside the view of the camera. Complex backgrounds, backgrounds with colors similar the object, shades, and highlights might confuse the selection algorithm." />
47+
48+
<TextView
49+
android:layout_width="wrap_content"
50+
android:layout_height="wrap_content"
51+
android:layout_margin="5dp"
52+
android:text="Once the app finds a good selection, click on the center of the screen and teach it the name of the object or the name of the shape. Find other objects and repeat." />
53+
54+
<TextView
55+
android:layout_width="wrap_content"
56+
android:layout_height="wrap_content"
57+
android:layout_margin="5dp"
58+
android:text="Point your camera back to a learned object, now the app should tell you what it is. If it does not, just teach it the intended name again for reinforcement." />
59+
60+
<TextView
61+
android:layout_width="wrap_content"
62+
android:layout_height="wrap_content"
63+
android:layout_marginLeft="10dp"
64+
android:layout_marginTop="10dp"
65+
android:text="Manage Library"
66+
android:textAppearance="?android:attr/textAppearanceLarge" />
67+
68+
<TextView
69+
android:layout_width="wrap_content"
70+
android:layout_height="wrap_content"
71+
android:layout_margin="5dp"
72+
android:text="You can manage the library of learned objects in Menu -> Library, this view allows you to do the following." />
73+
74+
<TextView
75+
android:layout_width="wrap_content"
76+
android:layout_height="wrap_content"
77+
android:layout_margin="5dp"
78+
android:text="Back to camera: the android back key." />
79+
80+
<TextView
81+
android:layout_width="wrap_content"
82+
android:layout_height="wrap_content"
83+
android:layout_margin="5dp"
84+
android:text="Backup and Share: Menu -> Export. This will create a file as named in the top level of your SD card. Open this file will start the import process." />
85+
86+
<TextView
87+
android:layout_width="wrap_content"
88+
android:layout_height="wrap_content"
89+
android:layout_margin="5dp"
90+
android:text="Rename objects: click on a name, you will view all the instances under this name. Select an image to rename it, or use menu to rename the group." />
91+
92+
<TextView
93+
android:layout_width="wrap_content"
94+
android:layout_height="wrap_content"
95+
android:layout_marginLeft="10dp"
96+
android:layout_marginTop="10dp"
97+
android:text="Thanks"
98+
android:textAppearance="?android:attr/textAppearanceLarge" />
99+
<TextView
100+
android:id="@+id/thanks"
101+
android:layout_width="wrap_content"
102+
android:layout_height="wrap_content"
103+
android:layout_margin="5dp"
104+
android:text="@string/thanks" />
105+
106+
</LinearLayout>
107+
108+
</ScrollView>

res/layout/list_item.xml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="fill_parent"
4+
android:layout_height="fill_parent"
5+
android:padding="10dp"
6+
android:textSize="16sp"
7+
android:background="@color/transparent">
8+
</TextView>

res/menu/groups_menu.xml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
3+
4+
<item
5+
android:id="@+id/change_lib"
6+
android:alphabeticShortcut="h"
7+
android:numericShortcut="1"
8+
android:title="Change Library"
9+
android:showAsAction="ifRoom|withText">
10+
</item>
11+
<item
12+
android:id="@+id/copy_lib"
13+
android:alphabeticShortcut="c"
14+
android:numericShortcut="2"
15+
android:title="Make Copy"
16+
android:showAsAction="ifRoom|withText">
17+
</item>
18+
<item
19+
android:id="@+id/delete_lib"
20+
android:alphabeticShortcut="d"
21+
android:numericShortcut="3"
22+
android:title="Delete all">
23+
</item>
24+
<item
25+
android:id="@+id/export_lib"
26+
android:alphabeticShortcut="e"
27+
android:numericShortcut="4"
28+
android:title="Export">
29+
</item>
30+
31+
</menu>

res/menu/image_grid_menu.xml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
3+
4+
<item
5+
android:id="@+id/move"
6+
android:alphabeticShortcut="m"
7+
android:numericShortcut="1"
8+
android:title="Move group"
9+
android:showAsAction="ifRoom|withText">
10+
</item>
11+
<item
12+
android:id="@+id/delete"
13+
android:alphabeticShortcut="d"
14+
android:numericShortcut="2"
15+
android:title="Delete group"
16+
android:showAsAction="ifRoom|withText">
17+
</item>
18+
19+
</menu>

res/menu/main_menu.xml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<menu xmlns:android="http://schemas.android.com/apk/res/android" >
3+
4+
<item
5+
android:id="@+id/library"
6+
android:alphabeticShortcut="l"
7+
android:numericShortcut="1"
8+
android:title="Library">
9+
</item>
10+
<item
11+
android:id="@+id/game"
12+
android:alphabeticShortcut="g"
13+
android:numericShortcut="2"
14+
android:title="Game"
15+
android:visible="false">
16+
</item>
17+
<item
18+
android:id="@+id/help"
19+
android:alphabeticShortcut="h"
20+
android:numericShortcut="3"
21+
android:title="Help">
22+
</item>
23+
<item
24+
android:id="@+id/settings"
25+
android:alphabeticShortcut="s"
26+
android:numericShortcut="4"
27+
android:title="Settings">
28+
</item>
29+
30+
</menu>

res/values/pref_values.xml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string-array name="turtleJump"><item>1</item><item>2</item><item>3</item><item>4</item><item>5</item></string-array>
4+
</resources>

res/values/strings.xml

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<string name="app_name">CSS Recognizer</string>
4+
<color name="transparent">#0000</color>
5+
<string name="links">- More resources at <a href="http://cssr.xiegeo.com/">cssr.xiegeo.com</a> including a detail tutorial. And contact: <a href="mailto:[email protected]?subject=CSSR%20User%3A">[email protected]</a> for anything.</string>
6+
<string name="thanks">Professor <a href="http://www.cs.sfu.ca/people/faculty/ze-lianli.html">Ze-Nian Li</a>, for his guidance. This app started as a final project in one of his classes.</string>
7+
</resources>

res/values/theme.xml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<style name="Theme.NoBackground" parent="android:Theme">
4+
<item name="android:windowBackground">@null</item>
5+
</style>
6+
</resources>

res/xml/preferences.xml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<PreferenceScreen
3+
xmlns:android="http://schemas.android.com/apk/res/android">
4+
<ListPreference android:title="Select Camera"
5+
android:defaultValue="0" android:key="cameraId"
6+
android:summary="">
7+
</ListPreference>
8+
<CheckBoxPreference
9+
android:key="enableTTS"
10+
android:title="Enable Test To Speech"
11+
android:summaryOff = "Enable to speak out the names."
12+
android:summaryOn = "Disable to make it quiet."
13+
android:defaultValue = "false"
14+
/>
15+
<CheckBoxPreference
16+
android:key="pausable"
17+
android:title="Pause Camera Aggressively"
18+
android:summaryOff = "Enable to pause camera when data processing is paused."
19+
android:summaryOn = "Disable to show camera continuously."
20+
android:defaultValue = "false"
21+
/>
22+
<CheckBoxPreference
23+
android:key="mirror"
24+
android:title="Recognize Mirrored Object"
25+
android:summaryOff = "Enable to recognize mirrored objects without explicit leaning.\nMirrored outlines can be alike so that a simbol made by the left hand is the same as the right, or an object can be recgnised from the opposite side."
26+
android:summaryOn = "Disable to tell the difference between left and right.\nMirrored outlines can be alike so that a simbol made by the left hand is the same as the right, or an object can be recgnised from the opposite side."
27+
android:defaultValue = "true"
28+
/>
29+
<CheckBoxPreference
30+
android:key="showCSS"
31+
android:title="Show CSS Calculation"
32+
android:summary = "Show graphics related to Curvature Scale Space calculations.\n(Uses additional cpu to draw graphs.)"
33+
android:defaultValue = "false"
34+
/>
35+
<PreferenceScreen android:title="Advanced" android:key="advanced">
36+
<ListPreference android:title="Turtle Jump"
37+
android:entries="@array/turtleJump" android:entryValues="@array/turtleJump"
38+
android:defaultValue="1" android:key="turtleJump"
39+
android:summary="Turtle area selection step size.\n(larger -&gt; faster)">
40+
</ListPreference>
41+
</PreferenceScreen>
42+
</PreferenceScreen>

0 commit comments

Comments
 (0)