From d73865ef6cd1fb75d421dd26665a318c39be13fc Mon Sep 17 00:00:00 2001 From: andresusanto Date: Mon, 5 Oct 2015 23:34:35 +0700 Subject: [PATCH 01/38] New life --- .gitattributes | 17 - .gitignore | 7 - .idea/.name | 1 - .idea/compiler.xml | 22 - .idea/copyright/profiles_settings.xml | 3 - .idea/encodings.xml | 6 - .idea/gradle.xml | 19 - .idea/misc.xml | 46 - .idea/modules.xml | 9 - .idea/runConfigurations.xml | 12 - .idea/vcs.xml | 6 - NumberVision.iml | 19 - app/.gitignore | 1 - app/app.iml | 118 -- app/build.gradle | 50 - app/proguard-rules.pro | 17 - .../ganesus/numbervision/ApplicationTest.java | 13 - app/src/main/AndroidManifest.xml | 25 - .../ganesus/numbervision/MainActivity.java | 152 -- app/src/main/jni/numbervision.cpp | 1243 ----------------- app/src/main/res/drawable/delapan.bmp | Bin 11718 -> 0 bytes app/src/main/res/drawable/dua.bmp | Bin 11574 -> 0 bytes app/src/main/res/drawable/empat.bmp | Bin 11598 -> 0 bytes app/src/main/res/drawable/enam.bmp | Bin 11534 -> 0 bytes app/src/main/res/drawable/kurang.bmp | Bin 16254 -> 0 bytes app/src/main/res/drawable/learning.bmp | Bin 99576 -> 0 bytes app/src/main/res/drawable/learning_andre.bmp | Bin 132894 -> 0 bytes app/src/main/res/drawable/lima.bmp | Bin 10934 -> 0 bytes app/src/main/res/drawable/nol.bmp | Bin 13502 -> 0 bytes app/src/main/res/drawable/satu.bmp | Bin 11286 -> 0 bytes app/src/main/res/drawable/sembilan.bmp | Bin 11154 -> 0 bytes app/src/main/res/drawable/tambah.bmp | Bin 10710 -> 0 bytes app/src/main/res/drawable/tc1.bmp | Bin 48654 -> 0 bytes app/src/main/res/drawable/tc2.bmp | Bin 132894 -> 0 bytes app/src/main/res/drawable/tiga.bmp | Bin 9174 -> 0 bytes app/src/main/res/drawable/tujuh.bmp | Bin 9994 -> 0 bytes app/src/main/res/layout/activity_main.xml | 127 -- app/src/main/res/menu/menu_main.xml | 6 - app/src/main/res/mipmap-hdpi/ic_launcher.png | Bin 3418 -> 0 bytes app/src/main/res/mipmap-mdpi/ic_launcher.png | Bin 2206 -> 0 bytes app/src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 4842 -> 0 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 7718 -> 0 bytes app/src/main/res/raw/knowledge.txt | 30 - app/src/main/res/values-w820dp/dimens.xml | 6 - app/src/main/res/values/colors.xml | 19 - app/src/main/res/values/dimens.xml | 5 - app/src/main/res/values/strings.xml | 6 - app/src/main/res/values/styles.xml | 13 - .../ganesus/numbervision/ExampleUnitTest.java | 15 - build.gradle | 23 - gradle.properties | 18 - gradle/wrapper/gradle-wrapper.jar | Bin 49896 -> 0 bytes gradle/wrapper/gradle-wrapper.properties | 6 - gradlew | 164 --- gradlew.bat | 90 -- settings.gradle | 1 - testcases/MOBIL2.jpg | Bin 756551 -> 0 bytes testcases/city.png | Bin 1146344 -> 0 bytes testcases/mobil.jpg | Bin 659442 -> 0 bytes 59 files changed, 2315 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore delete mode 100644 .idea/.name delete mode 100644 .idea/compiler.xml delete mode 100644 .idea/copyright/profiles_settings.xml delete mode 100644 .idea/encodings.xml delete mode 100644 .idea/gradle.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/runConfigurations.xml delete mode 100644 .idea/vcs.xml delete mode 100644 NumberVision.iml delete mode 100644 app/.gitignore delete mode 100644 app/app.iml delete mode 100644 app/build.gradle delete mode 100644 app/proguard-rules.pro delete mode 100644 app/src/androidTest/java/com/ganesus/numbervision/ApplicationTest.java delete mode 100644 app/src/main/AndroidManifest.xml delete mode 100644 app/src/main/java/com/ganesus/numbervision/MainActivity.java delete mode 100644 app/src/main/jni/numbervision.cpp delete mode 100644 app/src/main/res/drawable/delapan.bmp delete mode 100644 app/src/main/res/drawable/dua.bmp delete mode 100644 app/src/main/res/drawable/empat.bmp delete mode 100644 app/src/main/res/drawable/enam.bmp delete mode 100644 app/src/main/res/drawable/kurang.bmp delete mode 100644 app/src/main/res/drawable/learning.bmp delete mode 100644 app/src/main/res/drawable/learning_andre.bmp delete mode 100644 app/src/main/res/drawable/lima.bmp delete mode 100644 app/src/main/res/drawable/nol.bmp delete mode 100644 app/src/main/res/drawable/satu.bmp delete mode 100644 app/src/main/res/drawable/sembilan.bmp delete mode 100644 app/src/main/res/drawable/tambah.bmp delete mode 100644 app/src/main/res/drawable/tc1.bmp delete mode 100644 app/src/main/res/drawable/tc2.bmp delete mode 100644 app/src/main/res/drawable/tiga.bmp delete mode 100644 app/src/main/res/drawable/tujuh.bmp delete mode 100644 app/src/main/res/layout/activity_main.xml delete mode 100644 app/src/main/res/menu/menu_main.xml delete mode 100644 app/src/main/res/mipmap-hdpi/ic_launcher.png delete mode 100644 app/src/main/res/mipmap-mdpi/ic_launcher.png delete mode 100644 app/src/main/res/mipmap-xhdpi/ic_launcher.png delete mode 100644 app/src/main/res/mipmap-xxhdpi/ic_launcher.png delete mode 100644 app/src/main/res/raw/knowledge.txt delete mode 100644 app/src/main/res/values-w820dp/dimens.xml delete mode 100644 app/src/main/res/values/colors.xml delete mode 100644 app/src/main/res/values/dimens.xml delete mode 100644 app/src/main/res/values/strings.xml delete mode 100644 app/src/main/res/values/styles.xml delete mode 100644 app/src/test/java/com/ganesus/numbervision/ExampleUnitTest.java delete mode 100644 build.gradle delete mode 100644 gradle.properties delete mode 100644 gradle/wrapper/gradle-wrapper.jar delete mode 100644 gradle/wrapper/gradle-wrapper.properties delete mode 100644 gradlew delete mode 100644 gradlew.bat delete mode 100644 settings.gradle delete mode 100644 testcases/MOBIL2.jpg delete mode 100644 testcases/city.png delete mode 100644 testcases/mobil.jpg diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index bdb0cab..0000000 --- a/.gitattributes +++ /dev/null @@ -1,17 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto - -# Custom for Visual Studio -*.cs diff=csharp - -# Standard to msysgit -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9c4de58..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index a1c3b95..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -NumberVision \ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml deleted file mode 100644 index 96cc43e..0000000 --- a/.idea/compiler.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml deleted file mode 100644 index e7bedf3..0000000 --- a/.idea/copyright/profiles_settings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml deleted file mode 100644 index 97626ba..0000000 --- a/.idea/encodings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 5f8ec24..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index 5d19981..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 4b63c0c..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/runConfigurations.xml b/.idea/runConfigurations.xml deleted file mode 100644 index 7f68460..0000000 --- a/.idea/runConfigurations.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 6564d52..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/NumberVision.iml b/NumberVision.iml deleted file mode 100644 index 0f1c251..0000000 --- a/NumberVision.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/.gitignore b/app/.gitignore deleted file mode 100644 index 796b96d..0000000 --- a/app/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build diff --git a/app/app.iml b/app/app.iml deleted file mode 100644 index b090dfe..0000000 --- a/app/app.iml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 11de2f3..0000000 --- a/app/build.gradle +++ /dev/null @@ -1,50 +0,0 @@ -apply plugin: 'com.android.application' - -android { - compileSdkVersion 22 - buildToolsVersion "22.0.1" - - defaultConfig { - applicationId "com.ganesus.numbervision" - minSdkVersion 15 - targetSdkVersion 22 - versionCode 1 - versionName "1.0" - - ndk { - moduleName "numbervision" - stl "stlport_shared" - ldLibs "log", "jnigraphics" - } - } - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - - productFlavors { - x86 { - ndk { - abiFilter "x86" - } - } - arm { - ndk { - abiFilter "armeabi-v7a" - } - } - mips { - ndk { - abiFilter "mips" - } - } - } -} - -dependencies { - compile fileTree(include: ['*.jar'], dir: 'libs') - testCompile 'junit:junit:4.12' - compile 'com.android.support:appcompat-v7:22.+' -} diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro deleted file mode 100644 index 9d9c70f..0000000 --- a/app/proguard-rules.pro +++ /dev/null @@ -1,17 +0,0 @@ -# Add project specific ProGuard rules here. -# By default, the flags in this file are appended to flags specified -# in D:\SETUP\Android Develompent Tools\adt-bundle-windows-x86_64-20140321\sdk/tools/proguard/proguard-android.txt -# You can edit the include path and order by changing the proguardFiles -# directive in build.gradle. -# -# For more details, see -# http://developer.android.com/guide/developing/tools/proguard.html - -# Add any project specific keep options here: - -# If your project uses WebView with JS, uncomment the following -# and specify the fully qualified class name to the JavaScript interface -# class: -#-keepclassmembers class fqcn.of.javascript.interface.for.webview { -# public *; -#} diff --git a/app/src/androidTest/java/com/ganesus/numbervision/ApplicationTest.java b/app/src/androidTest/java/com/ganesus/numbervision/ApplicationTest.java deleted file mode 100644 index 725ddad..0000000 --- a/app/src/androidTest/java/com/ganesus/numbervision/ApplicationTest.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.ganesus.numbervision; - -import android.app.Application; -import android.test.ApplicationTestCase; - -/** - * Testing Fundamentals - */ -public class ApplicationTest extends ApplicationTestCase { - public ApplicationTest() { - super(Application.class); - } -} \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml deleted file mode 100644 index 120f952..0000000 --- a/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/java/com/ganesus/numbervision/MainActivity.java b/app/src/main/java/com/ganesus/numbervision/MainActivity.java deleted file mode 100644 index ce24963..0000000 --- a/app/src/main/java/com/ganesus/numbervision/MainActivity.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.ganesus.numbervision; - -import android.content.Context; -import android.content.Intent; -import android.content.res.Resources; -import android.database.Cursor; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.net.Uri; -import android.provider.MediaStore; -import android.support.v7.app.AppCompatActivity; -import android.os.Bundle; -import android.view.View; -import android.widget.ImageView; -import android.widget.TextView; - -import org.w3c.dom.Text; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; - -public class MainActivity extends AppCompatActivity { - - private static final int RESULT_LOAD_IMAGE = 635; - private static String KNOWLEDGE_PATH = ""; - - public static File copyResource (Resources r, int rsrcId, File dstFile) throws IOException - { - InputStream is = r.openRawResource(rsrcId); - FileOutputStream os = new FileOutputStream(dstFile); - - byte[] buffer = new byte[4096]; - int bytesRead; - while ((bytesRead = is.read(buffer)) != -1) - os.write(buffer, 0, bytesRead); - is.close(); - os.close(); - - return dstFile; - } - - public void klikGallery(View v){ - Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); - startActivityForResult(i, RESULT_LOAD_IMAGE); - } - - private void prosesBitmap(String path){ - Bitmap merek = null; - Bitmap bmp = BitmapFactory.decodeFile(path); - - if (bmp.getWidth() == 1632){ - merek = Bitmap.createBitmap(bmp, 644, 303, 346, 112); - bmp = Bitmap.createBitmap(bmp, 546, 491, 549, 115); - }else if(bmp.getWidth() == 1024){ - bmp = Bitmap.createBitmap(bmp, 345, 323, 390, 107); - }else if(bmp.getWidth() == 1019){ - merek = Bitmap.createBitmap(bmp, 382, 302, 247, 93); - bmp = Bitmap.createBitmap(bmp, 341, 438, 332, 55); - } - - - - String hasil[] = detectAll(bmp, KNOWLEDGE_PATH); - - Bitmap.Config conf = Bitmap.Config.ARGB_8888; - Bitmap canvas = Bitmap.createBitmap(bmp.getWidth(), bmp.getHeight(), conf); - - Bitmap hh = preProses(bmp, canvas); - merek=null; - if (merek != null){ - Bitmap p_merek = preProses(bmp, canvas); - - Bitmap.Config conf_merek = Bitmap.Config.ARGB_8888; - Bitmap canvas_merek = Bitmap.createBitmap(merek.getWidth(), merek.getHeight(), conf_merek); - Bitmap hmerek = preProses(merek, canvas_merek); - - ImageView iv_merek = (ImageView) findViewById(R.id.imageView2); - iv_merek.setImageBitmap(hmerek); - - String merekmobil[] = detectMerek(merek); - TextView tv = (TextView) findViewById(R.id.txtPerhitungan); - tv.setText(merekmobil[0] + "(" + merekmobil[1] + ")"); - - }else{ - ImageView iv_merek = (ImageView) findViewById(R.id.imageView2); - iv_merek.setImageBitmap(null); - - TextView tv = (TextView) findViewById(R.id.txtPerhitungan); - tv.setText("Tidak diketahui"); - } - - TextView tv = (TextView) findViewById(R.id.txtInterpretasi); - tv.setText(hasil[0]); - - TextView tv2 = (TextView) findViewById(R.id.txtKodeBelok); - tv2.setText(hasil[1]); - - - - ImageView iv = (ImageView) findViewById(R.id.imageView); - iv.setImageBitmap(hh); - } - - @Override - protected void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.activity_main); - - File dstDir = getDir("data", Context.MODE_PRIVATE); - File knowledgeFile = new File(dstDir, "knowledge.txt"); - - try { - copyResource(getResources(), R.raw.knowledge, knowledgeFile); - } catch (IOException e) { - e.printStackTrace(); - } - KNOWLEDGE_PATH = knowledgeFile.getAbsolutePath(); - } - - - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - super.onActivityResult(requestCode, resultCode, data); - - if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) { - Uri selectedImage = data.getData(); - String[] filePathColumn = {MediaStore.Images.Media.DATA}; - - Cursor cursor = getContentResolver().query(selectedImage, filePathColumn, null, null, null); - cursor.moveToFirst(); - - int columnIndex = cursor.getColumnIndex(filePathColumn[0]); - String picturePath = cursor.getString(columnIndex); - cursor.close(); - - - prosesBitmap(picturePath); - - } - - } - - public native String[] detectAll(Bitmap bitmap, String knowledge); - public native String[] detectMerek(Bitmap bitmap); - public native Bitmap preProses(Bitmap bitmap, Bitmap canvas); - - static { - System.loadLibrary("numbervision"); - } -} diff --git a/app/src/main/jni/numbervision.cpp b/app/src/main/jni/numbervision.cpp deleted file mode 100644 index eb0a078..0000000 --- a/app/src/main/jni/numbervision.cpp +++ /dev/null @@ -1,1243 +0,0 @@ -// EQUALIGRAM - EQUALIZER INSTAGRAM -// Andre Susanto, M Yafi, Ramandika P, Kevin Yudi -// Pengcit - IF ITB - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define LOG_TAG "NUMBER VISION" -#define LOGD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__) -#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) - -#define STABILIZATION_FACTOR 4 // faktor untuk stabilisasi (copot noise dari chain code) -#define NOT_SPECIFIED_COLOR -1 -#define TRESHOLD_ERROR 70 -#define CHUNK_BAR 5 //mxn ke 5x5 -#define TRESHOLD_BLACK 0.5 //minimum value to be perceived as black - -#define E '0' -#define S '2' -#define W '4' -#define N '6' -#define RIGHT 'R' -#define LEFT 'L' - -//subchain code data yang diambil -#define LENGTH_TAKE 20 -//derajat minimal agar dia dikatakan belok -#define MIN_D 50.0 -//derajat maximal agar dia dikatakan belok -#define MAX_D 90.0 -//maximal banyak kode belok -#define MAX_TURN_CODE 50 - -// supaya bisa dipanggil sama java -extern "C" -{ - JNIEXPORT jobjectArray JNICALL Java_com_ganesus_numbervision_MainActivity_detectAll (JNIEnv * env, jobject obj, jobject bitmap, jstring path); - JNIEXPORT jobject JNICALL Java_com_ganesus_numbervision_MainActivity_preProses (JNIEnv * env, jobject obj, jobject bitmap, jobject canvas); - JNIEXPORT jobjectArray JNICALL Java_com_ganesus_numbervision_MainActivity_detectMerek (JNIEnv * env, jobject obj, jobject bitmap); -} - - -using namespace std; - -///////////////////////////////////////////////////////////////////////////////////// -// helper class and functions -///////////////////////////////////////////////////////////////////////////////////// -typedef struct{ - char value; - string chain; // untuk keperluan learning... mager :D - int start; -} DetectedChar; - -struct Train { - char label; - string path; - Train(char label,string path){ - this->label = label; - this->path = path; - } -}; - -typedef struct{ - char direction; - int value; -} ECode; - -typedef struct{ - char meaning; - string data; -} Knowledge; - -typedef struct point{ - int x; - int y; - - point() : x(0) , y(0) {} - point(int x,int y) : x(x), y(y) {} -} Point; - - -typedef struct border_info{ - Point start_point; - vector chain_codes; -}BorderInfo; - -class NativeBitmap{ -public: - uint32_t* pixels; - AndroidBitmapInfo bitmapInfo; - - NativeBitmap(){ - pixels = NULL; - } - - NativeBitmap(NativeBitmap* nBitmap){ - this->bitmapInfo = nBitmap->bitmapInfo; - uint32_t pixelsCount = this->bitmapInfo.height * this->bitmapInfo.width; - - this->pixels = new uint32_t[pixelsCount]; - memcpy(this->pixels, nBitmap->pixels, sizeof(uint32_t) * pixelsCount); - } -}; - - -typedef struct{ - uint8_t alpha, red, green, blue; -} ARGB; - -uint32_t convertArgbToInt(ARGB argb) { - return (argb.alpha << 24) | (argb.red) | (argb.green << 8) | (argb.blue << 16); -} - -void convertIntToArgb(uint32_t pixel, ARGB* argb){ - argb->red = ((pixel) & 0xff); - argb->green = ((pixel >> 8) & 0xff); - argb->blue = ((pixel >> 16) & 0xff); - argb->alpha = ((pixel >> 24) & 0xff); -} - -NativeBitmap* grayscaleBitmap(NativeBitmap* source){ - NativeBitmap* result = new NativeBitmap(source); - uint32_t nBitmapSize = source->bitmapInfo.height * source->bitmapInfo.width; - - - for (uint32_t i = 0; i < nBitmapSize; i++){ - ARGB bitmapColor; - convertIntToArgb(source->pixels[i], &bitmapColor); - - uint8_t grayscaleColor = (int)(0.2989f * bitmapColor.red + 0.5870f * bitmapColor.green + 0.1141 * bitmapColor.blue); - - bitmapColor.red = grayscaleColor; - bitmapColor.green = grayscaleColor; - bitmapColor.blue = grayscaleColor; - - result->pixels[i] = convertArgbToInt(bitmapColor); - } - - return result; -} - -NativeBitmap* convertBitmapToNative(JNIEnv * env, jobject bitmap){ - AndroidBitmapInfo bitmapInfo; - uint32_t* storedBitmapPixels = NULL; - - int ret; - if ((ret = AndroidBitmap_getInfo(env, bitmap, &bitmapInfo)) < 0){ - LOGE("Error eksekusi AndroidBitmap_getInfo()! error=%d", ret); - return NULL; - } - - LOGD("width:%d height:%d stride:%d", bitmapInfo.width, bitmapInfo.height, bitmapInfo.stride); - - if (bitmapInfo.format != ANDROID_BITMAP_FORMAT_RGBA_8888){ - LOGE("Format bitmap bukan RGBA_8888!"); - return NULL; - } - - void* bitmapPixels; - if ((ret = AndroidBitmap_lockPixels(env, bitmap, &bitmapPixels)) < 0){ - LOGE("Error eksekusi AndroidBitmap_lockPixels()! error=%d", ret); - return NULL; - } - - uint32_t* src = (uint32_t*) bitmapPixels; - storedBitmapPixels = new uint32_t[bitmapInfo.height * bitmapInfo.width]; - uint32_t pixelsCount = bitmapInfo.height * bitmapInfo.width; - memcpy(storedBitmapPixels, src, sizeof(uint32_t) * pixelsCount); - AndroidBitmap_unlockPixels(env, bitmap); - - // store ke memory sbg array int - NativeBitmap *nBitmap = new NativeBitmap(); - nBitmap->bitmapInfo = bitmapInfo; - nBitmap->pixels = storedBitmapPixels; - return nBitmap; -} - -jobject convertNativeToBitmap(JNIEnv * env, NativeBitmap* nBitmap){ - if (nBitmap->pixels == NULL){ - LOGD("Bitmap kosong / error"); - return NULL; - } - - // manggil fungsi bitmap java via env - jclass bitmapCls = env->FindClass("android/graphics/Bitmap"); - jmethodID createBitmapFunction = env->GetStaticMethodID(bitmapCls, "createBitmap", "(IILandroid/graphics/Bitmap$Config;)Landroid/graphics/Bitmap;"); - jstring configName = env->NewStringUTF("ARGB_8888"); - jclass bitmapConfigClass = env->FindClass("android/graphics/Bitmap$Config"); - jmethodID valueOfBitmapConfigFunction = env->GetStaticMethodID(bitmapConfigClass, "valueOf","(Ljava/lang/String;)Landroid/graphics/Bitmap$Config;"); - jobject bitmapConfig = env->CallStaticObjectMethod(bitmapConfigClass, valueOfBitmapConfigFunction, configName); - jobject newBitmap = env->CallStaticObjectMethod(bitmapCls, createBitmapFunction, nBitmap->bitmapInfo.width, nBitmap->bitmapInfo.height, bitmapConfig); - - // masukin pixel ke bitmap - int ret; - void* bitmapPixels; - - if ((ret = AndroidBitmap_lockPixels(env, newBitmap, &bitmapPixels)) < 0){ - LOGE("AndroidBitmap_lockPixels() failed ! error=%d", ret); - return NULL; - } - - uint32_t* newBitmapPixels = (uint32_t*) bitmapPixels; - uint32_t pixelsCount = nBitmap->bitmapInfo.height * nBitmap->bitmapInfo.width; - memcpy(newBitmapPixels, nBitmap->pixels, sizeof(uint32_t) * pixelsCount); - AndroidBitmap_unlockPixels(env, newBitmap); - - //LOGD("convert berhasil"); - return newBitmap; - -} - -jobjectArray createJavaArray(JNIEnv *env, jsize count, std::string elements[]){ - jclass stringClass = env->FindClass("java/lang/String"); - jobjectArray row = env->NewObjectArray(count, stringClass, env->NewStringUTF("")); - jsize i; - - for (i = 0; i < count; i++) { - env->SetObjectArrayElement( row, i, env->NewStringUTF(elements[i].c_str())); - } - return row; -} - -bool operator==(const Point& lhs, const Point& rhs) -{ - return (lhs.x == rhs.x) && (lhs.y == rhs.y); -} - -Point operator+(const Point& lhs, const Point& rhs) -{ - return Point(lhs.x + rhs.x , lhs.y + rhs.y); -} - - -Point get_next_traverse_point(Point current_black,Point current_traverse_point) { - Point next = current_traverse_point; - if (current_traverse_point.x == current_black.x-1 && - current_traverse_point.y == current_black.y+1) { - next.y -= 1; - } else if (current_traverse_point.x == current_black.x-1 && - current_traverse_point.y == current_black.y) { - next.y -= 1; - } else if (current_traverse_point.x == current_black.x-1 && - current_traverse_point.y == current_black.y-1) { - next.x += 1; - } else if (current_traverse_point.x == current_black.x && - current_traverse_point.y == current_black.y-1) { - next.x += 1; - } else if (current_traverse_point.x == current_black.x + 1 && - current_traverse_point.y == current_black.y-1) { - next.y += 1; - } else if (current_traverse_point.x == current_black.x + 1 && - current_traverse_point.y == current_black.y) { - next.y += 1; - } else if (current_traverse_point.x == current_black.x + 1 && - current_traverse_point.y == current_black.y + 1) { - next.x -= 1; - } else if (current_traverse_point.x == current_black.x && - current_traverse_point.y == current_black.y + 1) { - next.x -= 1; - } - return next; -} - -int get_chain_code(Point current_black,Point prev_black) { - int chain_code = 0; - if (prev_black.x == current_black.x-1 && - prev_black.y == current_black.y+1) { - chain_code = 7; - } else if (prev_black.x == current_black.x-1 && - prev_black.y == current_black.y) { - chain_code = 0; - } else if (prev_black.x == current_black.x-1 && - prev_black.y == current_black.y-1) { - chain_code = 1; - } else if (prev_black.x == current_black.x && - prev_black.y == current_black.y-1) { - chain_code = 2; - } else if (prev_black.x == current_black.x + 1 && - prev_black.y == current_black.y-1) { - chain_code = 3; - } else if (prev_black.x == current_black.x + 1 && - prev_black.y == current_black.y) { - chain_code = 4; - } else if (prev_black.x == current_black.x + 1 && - prev_black.y == current_black.y + 1) { - chain_code = 5; - } else if (prev_black.x == current_black.x && - prev_black.y == current_black.y + 1) { - chain_code = 6; - } - return chain_code; -} - -void erase_image(Point start_point, - bool **image,int length,int height) { - - Point direction[8] = {Point(1,0), Point(1,1), Point(0,1), Point(-1,1), - Point(-1,0), Point(-1,-1), Point(0,-1), Point(1,-1)}; - - queue bfs_queue; - bfs_queue.push(start_point); - image[start_point.y][start_point.x] = 0; - - while(!bfs_queue.empty()) { - Point front = bfs_queue.front(); - bfs_queue.pop(); - - for (int i=0;i<8;i++) { - Point current_point = front + direction[i]; - if (current_point.x >=0 && current_point.x <= length && current_point.y >= 0 && current_point.y <= height && - image[current_point.y][current_point.x]) { - image[current_point.y][current_point.x] = 0; - bfs_queue.push(current_point); - } - } - } -} - -bool is_point(Point point,bool **image) { - - int x = point.x; - int y = point.y; - - return image[y][x] && !image[y-1][x] && !image[y][x-1] && !image[y+1][x] && !image[y][x+1]; -} - -vector get_chain_codes(Point start_point, - bool **image,int length,int height) { - - vector chain_codes; - - if (is_point(start_point,image)) return chain_codes; - - Point current_black = start_point; - Point current_white = current_black; - current_white.x -= 1; - - Point black0 = current_black; - Point black1; - - bool has_first_found = false; - - Point traverse_point = current_white; - Point traverse_point_prev = current_white; - while (true) { - - traverse_point_prev = traverse_point; - traverse_point = get_next_traverse_point(current_black, traverse_point); - if (has_first_found && current_black == black0 && black1 == traverse_point) { - break; - } - if (image[traverse_point.y][traverse_point.x]) { - int chain_code = get_chain_code(traverse_point,current_black); - - if (!has_first_found) { - black1 = traverse_point; - has_first_found = true; - } - - chain_codes.push_back(chain_code); - current_black = traverse_point; - current_white = traverse_point_prev; - traverse_point = current_white; - - } - } - return chain_codes; -} - -Point get_start_point(bool **image, int length,int height) { - for (int i=0;i get_border_infos(bool **image,int length,int height) { - vector border_infos; - while(true) { - Point start_point = get_start_point(image, length, height); - if (start_point.x == -1 && start_point.y == -1) { - break; - } - BorderInfo border_info; - border_info.start_point = start_point; - border_info.chain_codes = get_chain_codes(start_point, image, length, height); - - border_infos.push_back(border_info); - erase_image(start_point,image,length,height); - } - return border_infos; -} - -float generateOtsu(uint32_t* histogram, uint32_t total) { - int sum = 0; - for (int i=1;i<256; ++i) sum+= i *histogram[i]; - - int sumB = 0; - int wB = 0; - int wF = 0; - int mB = 0; - int mF = 0; - float max = 0.0f; - float between = 0.0f; - float threshold1 = 0.0f; - float threshold2 = 0.0f; - - for (int i=0;i<256;++i) { - wB += histogram[i]; - if (wB == 0) continue; - wF = total - wB; - if (wF == 0) break; - - sumB += i * histogram[i]; - - mB = sumB / wB; - mF = (sum - sumB) /wF; - - between = wB * wF * (mB - mF) * (mB - mF); - if (between >= max) { - threshold1 = i; - if ( between > max ) { - threshold2 = i; - } - max = between; - } - } - - return (threshold1 + threshold2) / 2.0f; -} - - -uint32_t* get_cumulative_histogram(uint32_t* histogram) { - - uint32_t* cumulative_histogram = new uint32_t[256]; - - int accumulation = 0; - for (int i=0; i<256; i++) { - accumulation += histogram[i]; - cumulative_histogram[i] = accumulation; - } - - return cumulative_histogram; -} - -int get_lower_bound(uint32_t* histogram) { - for (int i=0;i<256;i++) { - if (histogram[i] !=0) { - return i; - } - } - return NOT_SPECIFIED_COLOR; -} - -int get_upper_bound(uint32_t* histogram) { - for (int i= 255; i>=0; i--) { - if (histogram[i] !=0) { - return i; - } - } - - return NOT_SPECIFIED_COLOR; -} - -uint32_t* cumulative_equalization(uint32_t* histogram) { - - uint32_t* color_transform = new uint32_t[256]; - uint32_t* cumulative_histogram = get_cumulative_histogram(histogram); - - int lower_bound = get_lower_bound(histogram); - int upper_bound = get_upper_bound(histogram); - - for (int i=0; i<256; i++) { - color_transform[i] = NOT_SPECIFIED_COLOR; - } - - int total_pixels = cumulative_histogram[upper_bound]; - int denominator = total_pixels - cumulative_histogram[lower_bound]; - for (int i=lower_bound;i<=upper_bound;i++) { - if (histogram[i]) - color_transform[i] = ((cumulative_histogram[i] - cumulative_histogram[lower_bound]) * - (254) / denominator) + 1; - } - - return color_transform; -} - -NativeBitmap* transformNativeBitmap(NativeBitmap* source, uint32_t* transform){ - NativeBitmap* result = new NativeBitmap(source); - uint32_t nBitmapSize = source->bitmapInfo.height * source->bitmapInfo.width; - - - for (uint32_t i = 0; i < nBitmapSize; i++){ - ARGB bitmapColor; - convertIntToArgb(source->pixels[i], &bitmapColor); - - bitmapColor.red = transform[bitmapColor.red]; - bitmapColor.green = transform[bitmapColor.green]; - bitmapColor.blue = transform[bitmapColor.blue]; - - result->pixels[i] = convertArgbToInt(bitmapColor); - } - - delete[] transform; - return result; -} - - -////////////////////////////////////////////////////////////////////////////////////// -/// ALGORITMA BELOK BELOK -////////////////////////////////////////////////////////////////////////////////////// - -double degree_by_vote(const string &test){ - double dx[] = { 1, 1, 0,-1,-1,-1, 0, 1}; - double dy[] = { 0,-1,-1,-1, 0, 1, 1, 1}; - - double x = 0; - double y = 0; - for(int i = 0; i < (int) test.size(); i++){ - int _dir = (int) (test[i] - '0'); - x += dx[_dir]; - y += dy[_dir]; - //printf("%c %.3lf\n",test[i],deg); - } - double temp = atan2 (-y,x) * 180 / 3.14159265; - temp += 360.; - if (temp > 360.0) temp -= 360.0; - return temp; -} - - -bool is_right_turn(double s,double d){ - double diff = fabs(s - d); - if (diff > 180.0) diff = 360.0 - diff; - if (diff < MIN_D || diff > MAX_D) return false; - - s = s + diff; - if (s > 360.0) s -= 360.0; - return fabs(s - d) <= 0.0001; -} - -bool is_left_turn(double s,double d){ - double diff = fabs(s - d); - if (diff > 180.0) diff = 360.0 - diff; - if (diff < MIN_D || diff > MAX_D) return false; - - d = d + diff; - if (d > 360.0) d -= 360.0; - return fabs(s - d) <= 0.0001; -} - -bool is_u_turn_cw(double s,double d){ - double diff = fabs(s - d); - if (diff > 180.0) diff = 360.0 - diff; - if (diff < 150.0) return false; - - s = s + diff; - if (s > 360.0) s -= 360.0; - return fabs(s - d) <= 0.0001; -} - -bool is_u_turn_ccw(double s,double d){ - double diff = fabs(s - d); - if (diff > 180.0) diff = 360.0 - diff; - if (diff < 150.0) return false; - - d = d + diff; - if (d > 360.0) d -= 360.0; - return fabs(s - d) <= 0.0001; -} - -string generate_turn(const string &code){ - LOGD("generate turn"); - string ret; - for(int i = 0; i + LENGTH_TAKE < (int) code.size(); ){ - string sleft = code.substr(i,LENGTH_TAKE/2); - string sright = code.substr(i + (LENGTH_TAKE/2),LENGTH_TAKE/2); - double dl = degree_by_vote(sleft); - double dr = degree_by_vote(sright); - double diff = fabs(dl - dr); - if (diff > 180.0) diff = 360. - diff; - if (is_left_turn(dl,dr)){ - ret += LEFT; - i += LENGTH_TAKE/2; - printf("got left turn at %d, %s %s, deg = %.3lf %.3lf %.3lf\n",i,sleft.c_str(),sright.c_str(),dl,dr,diff); - } else if (is_right_turn(dl,dr)){ - ret += RIGHT; - i += LENGTH_TAKE/2; - printf("got right turn at %d, %s %s , deg = %.3lf %.3lf %.3lf\n",i,sleft.c_str(),sright.c_str(),dl,dr,diff); - } else if (is_u_turn_cw(dl,dr)){ - ret += RIGHT; ret += RIGHT; - i += LENGTH_TAKE /2; - } else if (is_u_turn_ccw(dl,dr)) { - ret += LEFT; ret += LEFT; - i += LENGTH_TAKE /2; - } else { - i++; - } - } - LOGD("generate turn end"); - return ret; -} - - -int edit_distance(const string& a,const string& b){ - LOGD("edit distance start"); - int dp[1000][1000]; - - for(int ia = 1; ia <= (int) a.size(); ia++){ - dp[ia][0] = ia; - - } - for(int ib = 1; ib <= (int) b.size(); ib++){ - dp[0][ib] = ib; - } - - for(int ia = 1; ia <= (int) a.size(); ia++){ - for(int ib = 1; ib <= (int) b.size(); ib++){ - if (a[ia - 1] == b[ib- 1]){ - dp[ia][ib] = dp[ia-1][ib-1]; - } else { - //b gak boleh dihapus - dp[ia][ib] = min(dp[ia-1][ib],min(dp[ia-1][ib-1],dp[ia][ib-1])) + 1; - } - } - } - LOGD("edit distance end"); - return dp[a.size()][b.size()]; -} - -vector predict(const string& chain_code,const vector& trains){ - LOGD("predict start"); - vector probabilities; - probabilities.clear(); - - int cost = edit_distance(chain_code,trains[0].path); - LOGD("predict prob before"); - probabilities.push_back(trains[0].label); - LOGD("predict prob after"); - for(int i = 1; i < (int) trains.size(); i++){ - LOGD("%d",i); - int cnow = edit_distance(chain_code,trains[i].path); - if (cnow < cost){ - cost = cnow; - probabilities.clear(); - probabilities.push_back(trains[i].label); - } else if (cnow == cost){ - probabilities.push_back(trains[i].label); - } - } - LOGD("predict end"); - return probabilities; -} - - -//////////////////////////////////////////////////////////////////////////////////////// -// ALGORITMA MATCHER -//////////////////////////////////////////////////////////////////////////////////////// - - -vector stabileData(string original){ - vector training; - - char currentDirection = original[0]; - int currentValue = 1; - for (int i = 1 ; i < original.size(); i++){ - if (currentDirection == original[i]) - currentValue++; - else{ - ECode kode; - kode.direction = currentDirection; - kode.value = currentValue; - - training.push_back(kode); - - currentValue = 1; - currentDirection = original[i]; - } - } - ECode kode; - kode.direction = currentDirection; - kode.value = currentValue; - training.push_back(kode); - - // pemotong chain code, kalo ga dipake malah hasilnya lebih bagus :/ - /* - for (int i = 1; i < training.size() - 1; i++){ - if (training[i - 1].direction == training[i + 1].direction && training[i - 1].value + training[i + 1].value > STABILIZATION_FACTOR && training[i].value == 1){ - training[i - 1].value = training[i - 1].value + training[i].value + training[i + 1].value; - training.erase(training.begin() + i, training.begin() + i + 2); - //cout << (i-1) << " After Train : " << training[i - 1].value << endl; - - i--; - } - }*/ - - return training; -} - -uint32_t* createHistogram(NativeBitmap* nBitmap){ - if (nBitmap->pixels == NULL) - return NULL; - - uint32_t* result = new uint32_t[256]; - - for (int i=0; i<256; i++) - result[i] = 0; - - uint32_t nBitmapSize = nBitmap->bitmapInfo.height * nBitmap->bitmapInfo.width; - - for (uint32_t i = 0; i < nBitmapSize; i++){ - ARGB bitmapColor; - convertIntToArgb(nBitmap->pixels[i], &bitmapColor); - result[bitmapColor.red]++; - } - - return result; -} - -float calculateChain (string strKnowledge, string strTest ){ - vector knowledge, test; - vector data1 = stabileData (strKnowledge); - vector data2 = stabileData(strTest); - - // pilih yang paling besar sebagai basis (mengandung paling banyak error) - if (data1.size() > data2.size()){ - knowledge = data1; - test = data2; - }else{ - knowledge = data2; - test = data1; - } - - int testSize = test.size(), knowledgeSize = knowledge.size(); - int knowledgeChains = 0, testChains = 0; - - for (int i = 0 ; i < knowledgeSize; i++) - knowledgeChains += knowledge[i].value; - - for (int i = 0 ; i < testSize; i++) - testChains += test[i].value; - - - float currentScore = 0; int iteratorKnowledge = 0; - - for (int i = 0; i < testSize && iteratorKnowledge < knowledgeSize; i++){ - if (test[i].direction == knowledge[iteratorKnowledge].direction){ - currentScore += ((float)test[i].value / testChains + (float)knowledge[iteratorKnowledge].value / knowledgeChains) * 2.0f; - }else{ - currentScore -= (float)knowledge[iteratorKnowledge].value / (knowledgeChains * 2.0f); - i--; - } - iteratorKnowledge++; - - if (iteratorKnowledge == knowledgeSize){ - for (; i < testSize; i++){ - currentScore -= (float)test[i].value / testChains; - } - } - } - - - return currentScore; -} - -vector createKnowledge(const char* path){ - vector result; - LOGD("Loaded Knowledge File %s", path); - ifstream infile(path); - - char tmp_char; string tmp_string; - while (infile >> tmp_char >> tmp_string) - { - Knowledge tmp_knowledge; - tmp_knowledge.meaning = tmp_char; - tmp_knowledge.data = tmp_string; - - result.push_back(tmp_knowledge); - //result.push_back(Train(tmp_char, tmp_string)); - } - - return result; -} - -char guessChain(string chainCode, vector knowledge){ - - - char currentChar = knowledge[0].meaning; - float currentMax = calculateChain(knowledge[0].data, chainCode); - for (int i = 1 ; i < knowledge.size(); i++){ - float rate = calculateChain(knowledge[i].data, chainCode); - if (rate > currentMax){ - currentMax = rate; - currentChar = knowledge[i].meaning; - } - } - - return currentChar; -} - -bool** convertToBoolmage(NativeBitmap* nativeBitmap){ - bool** image = new bool*[nativeBitmap->bitmapInfo.height]; - NativeBitmap* pBitmap = grayscaleBitmap(nativeBitmap); - - uint32_t nBitmapSize = pBitmap->bitmapInfo.height * pBitmap->bitmapInfo.width; - uint32_t* histogram = createHistogram(pBitmap); - uint32_t* color_transform = cumulative_equalization(histogram); - - NativeBitmap* gBitmap = transformNativeBitmap(pBitmap, color_transform); - delete pBitmap; - - histogram = createHistogram(gBitmap); - - float otsu = generateOtsu(histogram, nBitmapSize); - - //FILE* file = fopen("/sdcard/textTest.txt","w+"); - - //stringstream ss; - - - for (int i=0;ibitmapInfo.height;i++) { - image[i] = new bool[gBitmap->bitmapInfo.width]; - for (int j=0;jbitmapInfo.width;j++) { - ARGB warna; - convertIntToArgb(gBitmap->pixels[i * gBitmap->bitmapInfo.width + j], &warna); - - image[i][j] = (warna.red > otsu); - - - //if (warna.red > otsu) - // ss << "image[" << i << "][" << j << "] = true;\n"; //LOGD("image[%d][%d] = true;", i, j); - //else - // ss << "image[" << i << "][" << j << "] = false;\n"; //LOGD("image[%d][%d] = false;", i, j); - - //fputs(ss.str().c_str(), file); - //ss.str(string()); - } - } - //fclose(file); - - for (int i=0;ibitmapInfo.width;i++) { - image[0][i] = false; - image[gBitmap->bitmapInfo.height-1][i] = false; - } - - for (int i=0;ibitmapInfo.height;i++) { - image[i][0] = false; - image[i][gBitmap->bitmapInfo.width-1] = false; - } - - delete gBitmap; - - return image; -} - -/*typedef struct border_info{ - Point start_point; - vector chain_codes; -}BorderInfo;*/ - -Point chcodeToPoint(Point start,int chcode){ - switch(chcode) { - case 0: - return Point(start.x+1,start.y); - break; - case 1: - return Point(start.x+1,start.y+1); - break; - case 2: - return Point(start.x,start.y+1); - break; - case 3: - return Point(start.x-1,start.y+1); - break; - case 4: - return Point(start.x-1,start.y); - break; - case 5: - return Point(start.x-1,start.y-1); - break; - case 6: - return Point(start.x,start.y-1); - break; - case 7: - return Point(start.x+1,start.y-1); - break; - default: - return Point(-1,-1); - break; - } -} -//Single digit to NxN -bool** singleToNxN(BorderInfo input,bool** image_copy){ - vector *temp=&(input.chain_codes); - vector::iterator it; - int up=input.start_point.y,bottom=input.start_point.y,right=input.start_point.x,left=input.start_point.x; - Point nextP=input.start_point; - //Find rectangle that includes the number - for(it=temp->begin();it!=temp->end();it++){ - nextP=chcodeToPoint(nextP,(*it)); - if(nextP.x>right) right=nextP.x; - else if(nextP.xup) up=nextP.y; - else if(nextP.yTRESHOLD_BLACK) array[(i-left)*CHUNK_BAR/width][(j-bottom)*CHUNK_BAR/height]=true; - } - } - return array; -} - -void write_bool(bool** arr,uint32_t width,uint32_t height) -{ - stringstream sskode; - for(int i=0;i -vector toNxN(NativeBitmap* src){ - bool** bool_image=convertToBoolmage(src); - bool** bool_image_copy=new bool*[src->bitmapInfo.width]; - vector after_transform; - vector::iterator it; - vector borders=get_border_infos(bool_image,src->bitmapInfo.width,src->bitmapInfo.height); - uint32_t width=src->bitmapInfo.width,height=src->bitmapInfo.height; - for(uint32_t i=0;ibitmapInfo.width,src->bitmapInfo.height); - write_bool(bool_image_copy,src->bitmapInfo.width,src->bitmapInfo.height); - - vector temp; - for(it=borders.begin();it!=borders.end();it++){ - temp=get_border_infos(singleToNxN(*it,bool_image_copy),CHUNK_BAR,CHUNK_BAR); - after_transform.insert(after_transform.end(),temp.begin(),temp.end()); - } - return temp; -} - - - -void write_to_file(uint32_t* arr,uint32_t size) -{ - stringstream sskode; - for(int i=0;ibitmapInfo.width; - uint32_t height=res->bitmapInfo.height; - uint32_t size=width*height; - vector value; - vector::iterator it; - uint32_t *value_array=res->pixels; - LOGD("Currr: %d %d %d",width,height,size); - for(uint32_t i=0;iwidth){bottom=(int)(i-width);value.push_back(bottom);}else{bottom=-1;} - if(i%width!=width-1){right=(int)(i+1);value.push_back(right);}else{right=-1;} - if(i%width!=0){left=(int)(i-1);value.push_back(left);}else{left=-1;} - if(up!=-1 && right!=-1) {up_right=up+1;value.push_back(up_right);} - if(up!=-1 && left!=-1) {up_left=up-1;value.push_back(up_left);} - if(bottom!=-1 && right!=-1) {bottom_right=bottom+1;value.push_back(bottom_right);} - if(bottom!=-1 && left!=-1) {bottom_left=bottom-1;value.push_back(bottom_left);} - uint32_t mean=0; - for(it=value.begin();it!=value.end();it++){ - mean+=value_array[(*it)]; - } - mean=mean/8; - value_array[i]=mean; - } - write_to_file(value_array,size); - return res; -} - -/////////////////////////////////////////////////////////////////////////////////// -// VOTING? -////////////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////// - -JNIEXPORT jobject JNICALL Java_com_ganesus_numbervision_MainActivity_preProses (JNIEnv * env, jobject obj, jobject bitmap, jobject canvas){ - NativeBitmap* nCanvas = convertBitmapToNative(env, canvas); - NativeBitmap* nativeBitmap = convertBitmapToNative (env, bitmap); - NativeBitmap* pBitmap = grayscaleBitmap(nativeBitmap); - delete nativeBitmap; - - uint32_t nBitmapSize = pBitmap->bitmapInfo.height * pBitmap->bitmapInfo.width; - uint32_t* histogram = createHistogram(pBitmap); - uint32_t* color_transform = cumulative_equalization(histogram); - - NativeBitmap* gBitmap = transformNativeBitmap(pBitmap, color_transform); - delete pBitmap; - delete histogram; - histogram = createHistogram(gBitmap); - - float otsu = generateOtsu(histogram, nBitmapSize); - - ARGB aGray; - aGray.red = 127; aGray.green = 127; aGray.blue = 127; aGray.alpha = 255; - uint32_t iGray= convertArgbToInt(aGray); - - for (uint32_t i = 0; i < nBitmapSize; i++){ - ARGB bitmapColor; - convertIntToArgb(gBitmap->pixels[i], &bitmapColor); - - if (bitmapColor.red > otsu){ - nCanvas->pixels[i] = iGray; - } - } - - return convertNativeToBitmap(env, nCanvas); -} - - -JNIEXPORT jobjectArray JNICALL Java_com_ganesus_numbervision_MainActivity_detectAll (JNIEnv * env, jobject obj, jobject bitmap, jstring path){ - NativeBitmap* nativeBitmap = convertBitmapToNative (env, bitmap); - nativeBitmap=smoothing(nativeBitmap); - bool **image = convertToBoolmage(nativeBitmap); - const char* path_knowledge = env->GetStringUTFChars( path , NULL ) ; - vector knowledge = createKnowledge(path_knowledge); - //vector train = createKnowledge(path_knowledge); - - vector interpretation; - //vector border_infos = get_border_infos(image,nativeBitmap->bitmapInfo.width,nativeBitmap->bitmapInfo.height); - vector border_infos=toNxN(nativeBitmap); - LOGD("Size borderinfo:%d",border_infos.size()); - vector::iterator it; - for(it=border_infos.begin();it!=border_infos.end();it++){ - vector temp=it->chain_codes; - vector::iterator it; - stringstream stream; - for(it=temp.begin();it!=temp.end();it++){ - stream<<(*it); - } - LOGD("kd belok:%s",stream.str().c_str()); - } - delete nativeBitmap; - - stringstream list_kode_belok; - - //FILE* file = fopen("/sdcard/textTest.txt","w+"); - - for (int i=0;i TRESHOLD_ERROR) { - - - //vector predictions = predict(turns, train); - - DetectedChar detectedChar; - detectedChar.start = border_info.start_point.x; - detectedChar.value = guessChain(sskode.str(), knowledge); - - sskode << endl; - detectedChar.chain = sskode.str(); - interpretation.push_back(detectedChar); - - //LOGD("%d, %d CHAIN CODE: %s", border_info.start_point.x, border_info.start_point.y, sskode.str().c_str()); - //LOGD("%s", turns.c_str()); - - } - //ss << guessChain(sskode.str()); - - - //sskode << endl; - //fputs(sskode.str().c_str(), file); - - } - //fclose(file); - - stringstream ss; - - FILE* file = fopen("/sdcard/textTest.txt","w+"); - - while(interpretation.size() > 0){ - int minValue = interpretation[0].start; - int currentMin = 0; - for (int i = 1; i < interpretation.size(); i++){ - if (interpretation[i].start < minValue){ - minValue = interpretation[i].start; - currentMin = i; - } - } - fputs(interpretation[currentMin].chain.c_str(), file); - ss << interpretation[currentMin].value; - - string turns = generate_turn(interpretation[currentMin].chain); - LOGD("CHAIN CODE: %s", interpretation[currentMin].chain.c_str()); - LOGD("%s", turns.c_str()); - list_kode_belok << turns << " -> " << interpretation[currentMin].value << endl; - interpretation.erase(interpretation.begin() + currentMin); - - } - fclose(file); - - // [1] adalah ekspresi input, [2] adalah hasil perhitungan*/ - std::string tes[] = { ss.str().c_str(), list_kode_belok.str().c_str() }; - //std::string tes[] = { ss.str().c_str(), "44" }; - jobjectArray hasil2 = createJavaArray(env, 2, tes); - - return hasil2; -} - -JNIEXPORT jobjectArray JNICALL Java_com_ganesus_numbervision_MainActivity_detectMerek (JNIEnv * env, jobject obj, jobject bitmap){ - NativeBitmap* nativeBitmap = convertBitmapToNative (env, bitmap); - bool **image = convertToBoolmage(nativeBitmap); - //vector train = createKnowledge(path_knowledge); - - vector trains; - - string turns; - - trains.push_back(Train('0',"RRRR")); - trains.push_back(Train('1',"RLRLLLLRRLLLRRRLLLLRLLRRLRLLLRLLR")); - - vector interpretation; - vector border_infos = get_border_infos(image,nativeBitmap->bitmapInfo.width,nativeBitmap->bitmapInfo.height); - delete nativeBitmap; - - //FILE* file = fopen("/sdcard/textTest.txt","w+"); - - for (int i=0;i TRESHOLD_ERROR) { - turns = generate_turn(sskode.str()); - vector predictions = predict(turns, trains); - - DetectedChar detectedChar; - detectedChar.start = border_info.start_point.x; - detectedChar.value = predictions[0]; //guessChain(sskode.str(), knowledge); - - sskode << endl; - detectedChar.chain = sskode.str(); - interpretation.push_back(detectedChar); - - //LOGD("%d, %d CHAIN CODE: %s", border_info.start_point.x, border_info.start_point.y, sskode.str().c_str()); - //LOGD("%s", turns.c_str()); - - } - //ss << guessChain(sskode.str()); - - - //sskode << endl; - //fputs(sskode.str().c_str(), file); - - } - //fclose(file); - - stringstream ss; - - //FILE* file = fopen("/sdcard/textTest.txt","w+"); - - while(interpretation.size() > 0){ - int minValue = interpretation[0].start; - int currentMin = 0; - for (int i = 1; i < interpretation.size(); i++){ - if (interpretation[i].start < minValue){ - minValue = interpretation[i].start; - currentMin = i; - } - } - //fputs(interpretation[currentMin].chain.c_str(), file); - ss << interpretation[currentMin].value; - interpretation.erase(interpretation.begin() + currentMin); - - } - //fclose(file); - - // [1] adalah ekspresi input, [2] adalah hasil perhitungan*/ - if (ss.str() == "0"){ - ss.str("HONDA"); - }else if (ss.str() == "1"){ - ss.str("TOYOTA"); - } - std::string tes[] = { ss.str().c_str(), turns }; - //std::string tes[] = { ss.str().c_str(), "44" }; - jobjectArray hasil2 = createJavaArray(env, 2, tes); - - return hasil2; -} \ No newline at end of file diff --git a/app/src/main/res/drawable/delapan.bmp b/app/src/main/res/drawable/delapan.bmp deleted file mode 100644 index 9e78793e0a517969fbf998bf93419bc0b7df8603..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11718 zcmeH~!EN0z5JcrJQbI09ZaL_fdk$$r^{5(^kS0`&Jpc2Xpm$fpq3i@UumnCqi`?bo za7f9&e*b-*?&T-y@A&<|?+<=Y(>K)9v_AUpe>|$=GZip>CY&RA_;#c|sSj6x_ojbR zAFcrJP5-1mTmjyj{z-kf0=)N{f7TrzmNR0*vMtxYfsv2{x4j(0vt0ladG_O&=GD)r zJUO1&&X^nt>i2`UYvEtdB>H; z3fBjbULxg`c^GB0FkP1iW6U*z5RPOd#ds8PqcM`n_u3b(*B@Rl=AC6ycB)Jz@`NfO zwhHCnbcF=94ue^Ao(KQiS5lqytl>2*dCuxl9^~!gxv{yFIY(A38zD>x#j#;j_#ev6S_Av zt-lh7R8n~S0q3jsNJhr$7T-{Kyf~pUZE~}5oWBk1@_6Sci}g|BMcw7`;&;U<>ouy1 z$A6SZSKe%y=<2V|bK~!Qlb8MaNBSVSc}FOI_E8_@A7nNwRV?JMEOiya_o_c)+?;;A zvV^kBT|bv$Mj}L^_$B*m=WJw2>uZen55p(sJ}DC^H5b#&rSl;00@4r+rWoSE__G}e zg%WRuR-#d!8tYF`MG}v8P1QCo^R!7mu$??y%+x3K;R^8H^iS%;72v(;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}0A8%X` z{k1MVEZQ%9IXYa>&_(#*brJi^h_IIjJfEV>X3iMJ@hvQ+j!Zk4P)&6g zfO~vyiKsw7=P7qS;RLbtmaNAmqpiTcpmD(aaj;pl#-EWpuaIfIWI&e)$2`Fp6ma diff --git a/app/src/main/res/drawable/kurang.bmp b/app/src/main/res/drawable/kurang.bmp deleted file mode 100644 index 5ef97e0cce35b57b719443c1a8834128487f149f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16254 zcmeI%u?fR45CA}Bi;R#7Qm6@}3WTiTF*1Xu$ub(|^B5Pdj4?q)IKe*>LcIP^r~B)D zEAzN!zGOTyo*Acd&YbIIe_kvp3<3lQ5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U z7${I%Uw_(e&*L)yn%@H}(4U>#>>ovFq{U<p_2xL}UunCen6_7yaAFA~TNg1V9xvx2Gv?VzxTvjkNFK}AlCKnGotZ4uSi zIKiS8v_`YUTNxB%Hb<01TrkISOm!(3`wAMmlL)y%P*>7oR#0`I9TXOEmY_-?sK|*C z=%7nao;-=DzQzd_wV*YcCEm)Q7_&K|B;tZOmSd_*!Pr;O(4E9ruUp_2xL}UunCen6_7yaACs8&)dIZ#! zw3ro9nmGrBMVuuIgNmFOfeyM9Q5rbGq80>90<|(I#%zu#iMU{n<(TSHF!mKRbSF_Z zKzan!m9&@@QJOgig+-ht3xkTB7=aGD6j2&D!J-xfOaiqsD8_7#D2cdWj^&u@QZV)v zG;}9XHb8m=)RnZD6;YZw2ZcqPB@2U!oEU))x)f0wIKiS81WW?8GAPDujwp$^V2QXTF6*P1wQ8qw&1k{zZm=#f)IR}MBoFxl`ikujM4!RUk8aTnC76eQJwK6EiY>p_2 zxL}UunCen6_7yaACs8&)dIZ#!w3ro9nmGrBMVuuIgNmFOfeyM9Q5rbGq80>90<|(I z#%zu#iMU{n<(TSHF!mKRbSF_Z*mU`*|#)oO)QZ?hNk{PViz;C&06C@D@I3vM{ldvGwoDV`f-L98evF^Y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PQ9mu=QdXkZJARV}U2Y!71;lJ)ANACat diff --git a/app/src/main/res/drawable/learning_andre.bmp b/app/src/main/res/drawable/learning_andre.bmp deleted file mode 100644 index 09955b2e0ef42d515b069eb3b9b13d0f9a9947b7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 132894 zcmeHQL5}3e4IKMmf5Cu(J^KYd^wD=;{D^r^zh*u&AMh{Mtj={J5lm6cB&n(zg@El< zNvUKo7!0a{o6(?xAFF_faZ%irFuNt_OV*6sPfB zK*zGL1d*(o=LjYk`m|E^0;uE9&kuXO^RE5QIi|1AOGoVnu-rL25(wlA6?L)3xcz*C zjb5)TsH+oA09^L&(TU!s zDS92%GZ~8u$WvTG_SbHCM2KG5>T%wwm@x zygfInHX;}HvM`L3!n5bp;*K0<=22^+ht)sPv56%h!HNE6|gm?l{j= zHWL3`9bM|;X*YieW93*WLpjC{cfR$gRN#PqtW(|8h&&D!NN)b9bm(fDx}k! z*(^KdF~K!RWOINx*hjH_^a9i`f(!5*D#^r}IPRv+*CY@a*@0FcI+vQ)nJ znkkann~s(1%|y%K)n2|x`V4B{LK*wgBCE6F{6?BSW_>%0if zD=7pqz=lhL)WjC~Cv=Tu?f(Uxli0p2LWpbvkH-ttfi0cDWUTn3t`QGp9n|Ew^Bv9~ zA_*MO9ZM}72>ZvQZ!}hbD4~6uD{XzUTl`pkgN>I@c7W!UEQ0+D8!jcKi7lEbk~o-T zJn^G)XyGjxGJHYU7VQx{=XL1xx)I#)fQo{ebmsWWEPIGKaDZa3mmE}I(zzakhd+&T z$?hNoIFeKI;16|%322RvkVxEGVZ$Z!xpJm}NlM~NR&P+MZviL%2GOEj;!`8pz5+fI z=^YOSNZi?9o}KTo=G|wC)CdIdf@1|bLJ-Okv2@tb*AClv;Y8=<5sYptA>>)^s>gjP63D$S7RdGC3&%$t3=mB4qht`-0puF@ggr2z z0ZGc!HG8pEpVIA+0uNI5Oeioh&m*hJF0BXgq|gF6F3lAE-Jz5s9j@-H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=}+pR-Qqn3r4d4$@&gsc z-4zt*6p5~8u5_IW=Q1Y)4}m!j(0S`qQTvadpI?7W(JrL@=TTEc4Z~hLG<@+_z6MN? z_&Z&9wEx*D51xzgYS$t{N9Q&sr0KK^PcD0FAlbMd?!nl23YZk>#&rv9I5&i+;x&aK zC8>GZ8DLz{J{wizBb|XqS$&6=dNbQcDA7+$0Hu zoMV~Vc`giX7doPGB^OMiLX&S7OA{EmVt0x`#q?J2bx2poHgml`i#lBt1Bsq%Sui4% z<+C;eB4B%gzN-t}yP&kCq9C^@op%d3#*?<`xG=@kyKf=(E!>LG zdg8<%sneB`h`Lzqk{j7ARb9@%&v#_zm@5gBhO3c(?*8J_q}Zl(xAE!0y;L2`m@Xm~+9y-XWpC4HbYFsn#7P;D!uv zrrfaTOqmRj0Wwg;0B1@OvD}snkO4AqLk2igZdi1tOa{mR87N|aGo^@FZc7Hp02#O; z1Dq*0EILyr17v^<6fwY=Qba7bB?DxD4BU_b&XgM#ohg$6GC&537~o7PB9_~d0Wv@a zZpZ*<$_Joc$RYr-}n1BaX*dMXyF#ZHP#0aq(< z#6g_suzrP-H^(7*K&m;mN^cQwJ)gld4LSNGYtL`H3WpGlso#qB{ zBg@BW9NB7iPCoQj!Cu{4fexVBlMnkFtM7WgIFI1)e2@MW#~=4&hxs9qTHXEXD6IZ+SUxb?O_VDi kO?t+nN5HG0r#0gj{pDw diff --git a/app/src/main/res/drawable/nol.bmp b/app/src/main/res/drawable/nol.bmp deleted file mode 100644 index 77e1a1e8bcc3f78eeee6c4ab50095fdf39905d3d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13502 zcmeI0L2iUF3`Nsh^awpb)dkD$yXhe~OP8F6WiP^EQZpbX*ctGTJ)^1QNToqd?8o;{ zApQLMeNUJ6LDx6>nSX!N&r5oxYf3-s-!C`oB|m*j>FE)3F#6OebPOGR6!3`>eheLb z6!3`>eheLb6!3`>eheLb6!3{+^J6zm<vrCLhAwc2*eYdHqIo(8*(OC&hK_ zM*;+zT~mId(q@;f!7 ztnvZil7(SP#W~E4dmW<`QBym){7)aNN~vQUCR)o~Sv%#X!qjh*QpebwN=m7GxKdCB zqb&5;1OLflu7u_;qzXo<1!OB$1C5bO5vi|WY&PSPifxzV>O2jM;`mm!M4gVT zSm@d`TIC^(a>+q<)-ke$iJD$AqDx!hMDPo|kgxmeTrktQ`%jXf5L2ragaRLw{;WZ@3XB?q^ONO=*) zdHDWhLefxU+oe>zI&72av;#6qi!J$2uWeOc@Il6PQccYRObZ}oY+|H&@-19tZ1&(H z#wv;GJyXtL{i;KW*Qi~YrB%l=#=ZN&=%aAx7&`hW;1ebM7&`hW;1ebM7&`hW;1ebM O7&`hW;1lJ4`0)?PasN#K diff --git a/app/src/main/res/drawable/satu.bmp b/app/src/main/res/drawable/satu.bmp deleted file mode 100644 index ac83a247209947bd7e535443f2e5a2a91938b296..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11286 zcmeI0K?=e!6hz}C#3Kj_?p$Q)UXPLU!Si0$f#o#D^2$s`4W~oB&t< zF+VP}pCv0t6C5X#RGc#VnsH&J8T>uC`GeqOi684@Reox#7b$3H3A;?sqWaO3_h+Rg z^&*?d4}k+oe8h(n;HvT?KAZqol^^lp1h}gFhz}>gRpm!~I03FIKj4$@@80499!I$L z=K}}E`g{Y8-u5jO_XA_N9(Nb7*4O@iaOh-zBlS;;`1xfC-GdNO$};_g5sI9s{=@$L zjmg?&OZ)pl?R-Sf2PaRAB7R^AW3s7O&<`wqgDUH%<1_$OgP-JTs}-T#YO785ksppx ge8h(n;HvT?KAZqol^^lp1h}gFhz}>g)e7_T0XR($WdHyG diff --git a/app/src/main/res/drawable/sembilan.bmp b/app/src/main/res/drawable/sembilan.bmp deleted file mode 100644 index 01d050308a40daf266c42a0e7618f7797475256c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11154 zcmeI0L2iUF3`N~r^az!@>ZS{p-B!Ip*PI9SFkFViq-KH`utWTlCeo;Kq@ghJ;Fq6o zgZlCH^Gdhz&c_%2yz%FgKTq_`N22d-{&uk)!s88kJfz@E*rvEnt`nvJ7Uh0&oiGKk zDEE`=geibUxu0AoOaUyaz)wpEG)%{L`Qv$*M=YZq1u@Y$AJb>f2cob{cG_%&%``26 zh;tQ;k;%fG&6}IFnZ}u!YDV>LmN8ukFicC5x(>@`%Bg&wODbA{)sl$`*+fLF=6zgA zdtT1zsxea%Yng^qPV1sQ6K52qTG}AGFfo>BX+=`?ViHmnxvCeFmI^Pxj!dFy%_Eu% zjk9VcF)y}n8aNj}$L-OPN%Sh*QXQG}yA5cm8YUsYy=M~%)6{i@GA3c$BaJwZ4XH1a z-UtDKTnZJh+z#o~1c;$qGKnpSk|dvEqW*<=U^}pNN~SR@DCxXrOj;!HfvU^14O8`f zqkqME+A!&j14Zh{Bwn$TzP>7H{=SP&!m9W)i-B|pY10e-8llVRi4(24 z;veLg#EMxnN5KsxLW1@f(Q+~875XaSvN{oo@6QfYlN7;*K>hSJU<+xnU9ysY)eB7gt_2q1s}0tg_0z+VMkr{MAj diff --git a/app/src/main/res/drawable/tc1.bmp b/app/src/main/res/drawable/tc1.bmp deleted file mode 100644 index 10fb9d3267df80518f8dc5ee5f0683fd64be4bd7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 48654 zcmeI4OOl%~5J1TVvd$55f-JnuK8sw!=ixN$l68)dDh@+BR>CkX`6o+_P(P~d!IY8c z*N>JA)O`K+@#k<^zR3G$dHs^tcX@pnKFRwq{QhzI^X_e7fdB*`009U<00Izz00bZa z0SG_<0uX=z1Rwwb2tWV=5P$##AOHafKmY;|fB*y_009U<00Izz00bZa0SL55;5;qw z9)HjJuuSJTvT2c)&spv1os#XxJsxF?2j;_h(ph}|^K>5KoSw${`IgdqB-@XBJjxai z%!_0{nfD?s2hYZncsn0Oo4dzZgiPbi>(%5U^nzDOhIiA~>=&FfR}-YuFf8-i%bWXMdIFV@xc7W7-ifV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