├── README.md ├── libs ├── jxl.jar └── android-support-v4.jar ├── bin ├── classes.dex ├── resources.ap_ ├── android-object-recog.apk ├── android-object-recog.jar ├── classes │ ├── org │ │ └── opencv │ │ │ ├── R.class │ │ │ ├── R$id.class │ │ │ ├── R$attr.class │ │ │ └── R$styleable.class │ └── com │ │ └── android_object_recog │ │ ├── R.class │ │ ├── R$id.class │ │ ├── R$attr.class │ │ ├── R$layout.class │ │ ├── R$menu.class │ │ ├── R$string.class │ │ ├── R$style.class │ │ ├── R$drawable.class │ │ ├── BuildConfig.class │ │ ├── MainActivity.class │ │ ├── R$styleable.class │ │ ├── MainActivity$1.class │ │ ├── MainActivity$2.class │ │ ├── MainActivity$3.class │ │ ├── MainActivity$4.class │ │ ├── MainActivity$2$1.class │ │ ├── MainActivity$2$2.class │ │ ├── MainActivity$4$1.class │ │ ├── object_recog │ │ ├── Utilities.class │ │ ├── Utilities$1.class │ │ ├── MatchingStrategy.class │ │ └── ObjectRecognizer.class │ │ ├── MainActivity$TTSInitListener.class │ │ └── MainActivity$EditViewRunnable.class ├── jarlist.cache ├── res │ ├── drawable-hdpi │ │ └── ic_launcher.png │ ├── drawable-ldpi │ │ └── ic_launcher.png │ ├── drawable-mdpi │ │ └── ic_launcher.png │ └── drawable-xhdpi │ │ └── ic_launcher.png ├── dexedLibs │ ├── jxl-c512d41d7587ef97739d87b490a88a5d.jar │ ├── android-support-v4-6d59991163415349ceba181cd6ce7a09.jar │ ├── android-support-v4-c3a3a030300599281961cfe473f238d0.jar │ ├── androidtouchgallery-a16bd5778a2e9ee48356bd36aa5f5500.jar │ ├── opencv library - 2.4.5-c1de0c296a011ce3c3a1567f92b5b758.jar │ └── opencv library - 2.4.7.1-4d9ba55bf22955823f30bb7a7c8f3349.jar ├── R.txt └── AndroidManifest.xml ├── res ├── menu │ └── activity_main.xml ├── drawable-hdpi │ └── ic_launcher.png ├── drawable-ldpi │ └── ic_launcher.png ├── drawable-mdpi │ └── ic_launcher.png ├── drawable-xhdpi │ └── ic_launcher.png ├── values │ ├── strings.xml │ └── styles.xml ├── values-v11 │ └── styles.xml ├── values-v14 │ └── styles.xml └── layout │ └── activity_main.xml ├── ic_launcher-web.png ├── src └── com │ └── android_object_recog │ ├── object_recog │ ├── MatchingStrategy.java │ ├── Utilities.java │ └── ObjectRecognizer.java │ └── MainActivity.java ├── gen ├── com │ └── android_object_recog │ │ ├── BuildConfig.java │ │ └── R.java └── org │ └── opencv │ └── R.java ├── project.properties ├── proguard-project.txt └── AndroidManifest.xml /README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libs/jxl.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/libs/jxl.jar -------------------------------------------------------------------------------- /bin/classes.dex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes.dex -------------------------------------------------------------------------------- /bin/resources.ap_: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/resources.ap_ -------------------------------------------------------------------------------- /res/menu/activity_main.xml: -------------------------------------------------------------------------------- 1 |
-------------------------------------------------------------------------------- /ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/ic_launcher-web.png -------------------------------------------------------------------------------- /bin/android-object-recog.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/android-object-recog.apk -------------------------------------------------------------------------------- /bin/android-object-recog.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/android-object-recog.jar -------------------------------------------------------------------------------- /libs/android-support-v4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/libs/android-support-v4.jar -------------------------------------------------------------------------------- /bin/classes/org/opencv/R.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/org/opencv/R.class -------------------------------------------------------------------------------- /bin/classes/org/opencv/R$id.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/org/opencv/R$id.class -------------------------------------------------------------------------------- /res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-ldpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/res/drawable-ldpi/ic_launcher.png -------------------------------------------------------------------------------- /res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /bin/classes/org/opencv/R$attr.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nadanasreldin/android-object-recognition/HEAD/bin/classes/org/opencv/R$attr.class -------------------------------------------------------------------------------- /bin/jarlist.cache: -------------------------------------------------------------------------------- 1 | # cache for current jar dependecy. DO NOT EDIT. 2 | # format isMay be an integer value, such as "100".
13 |
This may also be a reference to a resource (in the form
14 | "@[package:]type:name") or
15 | theme attribute (in the form
16 | "?[package:][type:]name")
17 | containing a value of this type.
18 |
May be one of the following constant values.
19 || Constant | Value | Description |
|---|---|---|
any | -1 | |
back | 0 | |
front | 1 |
Must be a boolean value, either "true" or "false".
31 |
This may also be a reference to a resource (in the form
32 | "@[package:]type:name") or
33 | theme attribute (in the form
34 | "?[package:][type:]name")
35 | containing a value of this type.
36 | */
37 | public static final int show_fps=0x7f010000;
38 | }
39 | public static final class drawable {
40 | public static final int ic_launcher=0x7f020000;
41 | }
42 | public static final class id {
43 | public static final int any=0x7f040000;
44 | public static final int back=0x7f040001;
45 | public static final int cameraView=0x7f040005;
46 | public static final int detectedObjTextView=0x7f040006;
47 | public static final int front=0x7f040002;
48 | public static final int scrollLinearLayout=0x7f040004;
49 | public static final int scrollView=0x7f040003;
50 | }
51 | public static final class layout {
52 | public static final int activity_main=0x7f030000;
53 | }
54 | public static final class menu {
55 | public static final int activity_main=0x7f070000;
56 | }
57 | public static final class string {
58 | public static final int app_name=0x7f050000;
59 | public static final int menu_settings=0x7f050001;
60 | public static final int title_activity_main=0x7f050002;
61 | }
62 | public static final class style {
63 | /**
64 | Base application theme, dependent on API level. This theme is replaced
65 | by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
66 |
67 |
68 | Theme customizations available in newer API levels can go in
69 | res/values-vXX/styles.xml, while customizations related to
70 | backward-compatibility can go here.
71 |
72 |
73 | Base application theme for API 11+. This theme completely replaces
74 | AppBaseTheme from res/values/styles.xml on API 11+ devices.
75 |
76 | API 11 theme customizations can go here.
77 |
78 | Base application theme for API 14+. This theme completely replaces
79 | AppBaseTheme from BOTH res/values/styles.xml and
80 | res/values-v11/styles.xml on API 14+ devices.
81 |
82 | API 14 theme customizations can go here.
83 | */
84 | public static final int AppBaseTheme=0x7f060000;
85 | /** Application theme.
86 | All customizations that are NOT specific to a particular API-level can go here.
87 | */
88 | public static final int AppTheme=0x7f060001;
89 | }
90 | public static final class styleable {
91 | /** Attributes that can be used with a CameraBridgeViewBase.
92 |
Includes the following attributes:
93 || Attribute | Description |
|---|---|
{@link #CameraBridgeViewBase_camera_id com.android_object_recog:camera_id} | |
{@link #CameraBridgeViewBase_show_fps com.android_object_recog:show_fps} |
This symbol is the offset where the {@link com.android_object_recog.R.attr#camera_id} 108 | attribute's value can be found in the {@link #CameraBridgeViewBase} array. 109 | 110 | 111 |
May be an integer value, such as "100".
112 |
This may also be a reference to a resource (in the form
113 | "@[package:]type:name") or
114 | theme attribute (in the form
115 | "?[package:][type:]name")
116 | containing a value of this type.
117 |
May be one of the following constant values.
118 || Constant | Value | Description |
|---|---|---|
any | -1 | |
back | 0 | |
front | 1 |
This symbol is the offset where the {@link com.android_object_recog.R.attr#show_fps} 132 | attribute's value can be found in the {@link #CameraBridgeViewBase} array. 133 | 134 | 135 |
Must be a boolean value, either "true" or "false".
136 |
This may also be a reference to a resource (in the form
137 | "@[package:]type:name") or
138 | theme attribute (in the form
139 | "?[package:][type:]name")
140 | containing a value of this type.
141 | @attr name android:show_fps
142 | */
143 | public static final int CameraBridgeViewBase_show_fps = 0;
144 | };
145 | }
146 |
--------------------------------------------------------------------------------
/src/com/android_object_recog/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.android_object_recog;
2 |
3 | import java.io.File;
4 | import java.io.IOException;
5 | import java.util.ArrayList;
6 | import java.util.Collections;
7 | import java.util.Locale;
8 |
9 | import org.opencv.android.BaseLoaderCallback;
10 | import org.opencv.android.CameraBridgeViewBase;
11 | import org.opencv.android.CameraBridgeViewBase.CvCameraViewFrame;
12 | import org.opencv.android.CameraBridgeViewBase.CvCameraViewListener2;
13 | import org.opencv.android.LoaderCallbackInterface;
14 | import org.opencv.android.OpenCVLoader;
15 | import org.opencv.core.Mat;
16 |
17 | import com.android_object_recog.object_recog.ObjectRecognizer;
18 | import com.android_object_recog.object_recog.Utilities;
19 | import com.android_object_recog.R;
20 |
21 | import android.media.ThumbnailUtils;
22 | import android.net.Uri;
23 | import android.os.Bundle;
24 | import android.os.Environment;
25 | import android.os.Handler;
26 | import android.provider.MediaStore;
27 | import android.app.Activity;
28 | import android.app.AlertDialog;
29 | import android.app.Dialog;
30 | import android.content.DialogInterface;
31 | import android.content.Intent;
32 | import android.content.pm.ActivityInfo;
33 | import android.graphics.Bitmap;
34 | import android.graphics.BitmapFactory;
35 | import android.speech.tts.TextToSpeech;
36 | import android.speech.tts.TextToSpeech.OnInitListener;
37 | import android.view.View;
38 | import android.view.Window;
39 | import android.view.ViewGroup.LayoutParams;
40 | import android.widget.Button;
41 | import android.widget.EditText;
42 | import android.widget.ImageView;
43 | import android.widget.LinearLayout;
44 | import android.widget.TextView;
45 | import android.widget.Toast;
46 |
47 | public class MainActivity extends Activity implements CvCameraViewListener2 {
48 |
49 | private Mat mRgba;
50 | private Mat mGray;
51 |
52 | private CameraBridgeViewBase cameraView;
53 | private LinearLayout scrollLinearLayout;
54 |
55 | private Handler handler;
56 |
57 | private String detectedObj;
58 | private String lastDetectedObj;
59 |
60 | private ObjectRecognizer recognizer;
61 | private TextToSpeech synthesizer;
62 |
63 | private static final int CAPTURE_IMAGE = 100;
64 | private static final int TTS_CHECK = 200;
65 |
66 | private boolean isSynthesizerInitialized = false;
67 |
68 | private ArrayList