DEEP ADDRESS RECOGNITION TECHNOLOGY
-
Based on a Custom Deep Neural Network Architecture (CRNN) designed and jointly trained on custom build, most comprehensive URDU Handwriting Recognition data-set: NUST-UHWR Dataset and Forms Dataset for English.
-
RECOGNIZES BOTH ENGLISH & URDU HANDWRITTEN ADDRESSES
-
Sends and receives data to DART high performance GPU Server.
// Create global camera reference in an activity or fragment
Camera camera;
// Build the camera
camera = new Camera.Builder()
.resetToCorrectOrientation(true)// it will rotate the camera bitmap to the correct orientation from meta data
.setTakePhotoRequestCode(1)
.setDirectory("pics")
.setName("ali_" + System.currentTimeMillis())
.setImageFormat(Camera.IMAGE_JPEG)
.setCompression(75)
.setImageHeight(1000)// it will try to achieve this height as close as possible maintaining the aspect ratio;
.build(this);
// Call the camera takePicture method to open the existing camera
try {
camera.takePicture();
}catch (Exception e){
e.printStackTrace();
}
Utils.bitmapToMat(bitmap, mrgba);
Imgproc.cvtColor(mrgba, mrgba, Imgproc.COLOR_RGB2GRAY, 3);
Imgproc.adaptiveThreshold(mrgba, mrgba, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, 15, 9);
Imgproc.medianBlur(mrgba,mrgba,5);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 0 /*ignored for PNG*/, bos);
array = bos.toByteArray();
while (clientConnected) {
try {
Log.d("ClientActivity", "C: Sending command.");
OutputStream output = socket.getOutputStream();
Log.d("ClientActivity", "C: image writing.");
output.write(array);
output.flush();
// out.println("Hey Server!");
Log.d("ClientActivity", "C: Sent.");
} catch (Exception e) {
Log.e("ClientActivity", "S: Error", e);
}
}
socket = serverSocket.accept();
Log.i("Server Thread:", "Started!");
this.input = new BufferedReader(new InputStreamReader(socket.getInputStream()));
String line = null;
while ((line = input.readLine()) != null) {
stringBuilder.append(line + '\n');
}
ocrOutput = stringBuilder.toString();
handler.post(new Runnable() {
@Override
public void run() {
textView.setText(ocrOutput);
}
});
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.READ_NETWORK_STATE" />