Skip to content
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.

Commit

Permalink
starting o filtered
Browse files Browse the repository at this point in the history
  • Loading branch information
Udayraj123 committed Jun 20, 2019
1 parent 96d3da9 commit 6c859e9
Show file tree
Hide file tree
Showing 34 changed files with 40 additions and 55 deletions.
39 changes: 15 additions & 24 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@ Helps you find the details of an Indian vehicle by pointing your camera at its n

Details of the vehicle are(obtained from the government's vahan portal):

◈ Registered Date

◈ Chassis No.

◈ Engine No.

◈ Owner Name

◈ Vehicle Class

◈ Fuel Type

◈ Vehicle Maker/Model

◈ Registration Upto

◈ Insurance Upto
◈ Registered Date <br>
◈ Chassis No. <br>
◈ Engine No. <br>
◈ Owner Name <br>
◈ Vehicle Class <br>
◈ Fuel Type <br>
◈ Vehicle Maker/Model <br>
◈ Registration Upto <br>
◈ Insurance Upto <br>

## App Release
Get the latest apk from github releases: https://github.com/Udayraj123/VehicleInfoOCR/releases
Expand All @@ -44,13 +36,10 @@ Vahan portals:

## Libraries

◉ App workflow inspired from [miniRTO app](https://github.com/chandruscm/miniRTO)

[Android Web Scraper](https://github.com/daandtu/android-web-scraper)

[Splashy](https://github.com/rahuldange09/Splashy)

[EditTextPicker](https://github.com/AliAzaz/Edittext-Library)
◉ App workflow inspired from [miniRTO app](https://github.com/chandruscm/miniRTO) <br>
[Android Web Scraper](https://github.com/daandtu/android-web-scraper) <br>
[Splashy](https://github.com/rahuldange09/Splashy) <br>
[EditTextPicker](https://github.com/AliAzaz/Edittext-Library) <br>

<!-- Trail : https://github.com/Orange-OpenSource/android-trail-drawing -->
<!-- Owl sheet : link?! -->
Expand Down Expand Up @@ -90,7 +79,9 @@ FirebaseMLKit : 2 MB

## License
This software is published under GNU GPLv3 license. Please disclose usage when using this source code in your software.
```
Copyright © 2019 Udayraj Deshmukh
Vehicle Info Live : Helps you find the details of an Indian vehicle by pointing your camera at its numberplate.
This is free software, and you are welcome to redistribute it under certain conditions;
For more details see LICENSE
```
2 changes: 2 additions & 0 deletions Rough.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ Optimizations

Later:
Run Apk analyzer on OMR apk
Make Starter Android template.
Make minimal size android apk (note size and startup time, compare with studio's hello world size)
Firebase usage analytics (Have to see how many ppl opened the app[Privacy Policy?!])

Note numplate pattern:
Expand Down
14 changes: 9 additions & 5 deletions app/src/main/java/com/udayraj/vehicleinfolive/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ public void onClick(View v) {
if(f.getName().contains("easter")){
// easter.add
TableRow row = new TableRow(MainActivity.this);
// row.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,TableRow.LayoutParams.WRAP_CONTENT));
row.setLayoutParams(new TableRow.LayoutParams(TableRow.LayoutParams.MATCH_PARENT,TableRow.LayoutParams.WRAP_CONTENT));

row.setBackgroundResource(f.getInt(drawableResources));
easterTable.addView(row);
// ImageView meme = new ImageView(MainActivity.this);
Expand Down Expand Up @@ -616,12 +617,15 @@ private void setSearchButtonListeners() {
public void onClick(View v) {
Toast.makeText(MainActivity.this, "Searching...", Toast.LENGTH_SHORT).show();
//todo: make this run on api 16
if(vehicleNumber.getText()!=null)
if(vehicleNumber.getText()!=null && eltVehicleNumber!=null)
eltVehicleNumber.setText(vehicleNumber.getText().toString());
else{
Log.e(TAG,"UNEXPECTED!! VehicleNumber Text is NULL!");
logToast("UNEXPECTED!! VehicleNumber Text is NULL!");
}
eltVehicleNumber.setAttribute("style","background-color:lightgreen !important");
if(eltCaptchaInput == null){
logToast(CRYING_EMOJI + " Unexpected error, please report to my creator Udayraj");
}
eltCaptchaInput.setText(captchaInput.getText().toString());
eltCaptchaInput.setAttribute("style","background-color:lightgreen !important");
if(checkInternetConnection()) {
Expand Down Expand Up @@ -737,8 +741,8 @@ public void run() {
drawerView.setVisibility(INVISIBLE);
}
}
else {
Crashlytics.getInstance().crash();
else {
// Crashlytics.getInstance().crash();
findViewById(R.id.easter).setVisibility(INVISIBLE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ private Task<FirebaseVisionText> detectInImage(FirebaseVisionImage image) {
return detector.processImage(image);
}
private String numPlateFilter(String s){
return s.toUpperCase().replaceAll("[^A-Z0-9]","");
// starting o jugaad
if(s.length()>0 && s.charAt(0)=='o'){
s = s.substring(1);
Log.d(TAG,"Removed starting o");
}
return s.toUpperCase().replaceAll("[^A-Z0-9]","");
}

private String convertToStrict(String line){
Expand Down Expand Up @@ -149,12 +154,13 @@ private void onSuccess( @NonNull FirebaseVisionText results, @NonNull GraphicOve
//VERIFY preference to block than line?!
autoUpdateMajorText(addText);

//FIXLATER - IND jugaad for now
if(!addText.toUpperCase().equals("IND")){
//FIXLATER - IND and 'o' jugaad for now
if(!addText.toUpperCase().equals("IND") && !addText.equals("o")){
builder.append(addText);
}
else{
Log.d(TAG,"IND detected, not suffixing");
// doesn't get here
Log.d(TAG,addText.toUpperCase()+" detected, not suffixing");
}
}
allText = builder.toString();
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_weight="0.3"
android:layout_weight="0.42"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="vertical">
Expand Down
24 changes: 3 additions & 21 deletions app/src/main/res/layout/easter.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,33 +56,15 @@
android:id="@+id/easter_table"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:src="@drawable/wall1" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:src="@drawable/wall2" />
</TableRow>
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="180dp"
android:src="@drawable/wall3" />
android:layout_height="450dp"
android:scaleType="fitXY"
android:src="@drawable/splash_guide" />
</TableRow>
</TableLayout>
</LinearLayout>
Expand Down

0 comments on commit 6c859e9

Please sign in to comment.