Maybe you can begin with OpenAlpr.Here is the source code I ever used in this alpr system
import android.app.Activity;
import android.content.ContentValues;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.support.v7.app.AppCompatActivity;
import android.text.format.DateFormat;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.openalpr.api.DefaultApi;
import com.openalpr.api.invoker.ApiException;
import com.openalpr.api.models.InlineResponse200;
import com.yalantis.ucrop.UCrop;
import com.yalantis.ucrop.UCropActivity;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Calendar;
import java.util.Locale;
public class MainActivity extends AppCompatActivity {
private final DefaultApi api = new DefaultApi();
private static final String TAG = "MainActivity";
Button reconize,select;
TextView result,plate;
ImageView showImage;
Spinner spinner;
String secretKey = "sk_960d6f4c62d1c20452c7613e";
String url = "https://qnwww2.autoimg.cn/youchuang/g...";
File cameraFile,cropFile;
private boolean isFromfile = false;
String country = "us";
final Integer recognizeVehicle = 0;
final String state = "";
final Integer returnImage = 1;
final Integer topn = 10;
final String prewarp = "";
private String cropPath = "";
String[] countrys ;
String[] countryCodes ;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
reconize = (Button) findViewById(R.id.reconize);
select = (Button) findViewById(R.id.selectImage);
result = (TextView) findViewById(R.id.result);
showImage = (ImageView) findViewById(R.id.imageShow);
plate = (TextView) findViewById(R.id.plate);
spinner = (Spinner) findViewById(R.id.spinner);
// GlideUtils.setUrlImage(this,url,showImage);
countrys = getResources().getStringArray(R.array.countrys);
countryCodes = getResources().getStringArray(R.array.country_codes);
select.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String filename = DateFormat.format("yyyyMMdd_hhmmss", Calendar.getInstance(Locale.CHINA)) + ".jpg";
cameraFile = new File(Environment.getExternalStorageDirectory() + "/Pictures/Camera/" + filename);
if(!cameraFile.exists()){
try {
cameraFile.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
}
Intent intent0 = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
if (Build.VERSION.SDK_INT < 24) {
intent0 = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
intent0.putExtra("android.intent.extras.CAMERA_FACING", 0);
intent0.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(cameraFile));
} else {
ContentValues contentValues = new ContentValues(1);
intent0.putExtra("android.intent.extras.CAMERA_FACING", 0);
contentValues.put(MediaStore.Images.Media.DATA, cameraFile.getAbsolutePath());
Uri uri = MainActivity.this.getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, contentValues);
intent0.putExtra(MediaStore.EXTRA_OUTPUT, uri);
}
isFromfile = true;
startActivityForResult(intent0, 200);
}
});
reconize.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
result.setText("identifying...");
plate.setText("");
try {
new Thread(){
@Override
public void run() {
super.run();
InlineResponse200 response = null;
try {
if(isFromfile){
response = api.recognizeFile(cropFile, secretKey, country, recognizeVehicle, state, returnImage, topn, prewarp);
}else {
response = api.recognizeUrl(url, secretKey, country, recognizeVehicle, state, returnImage, topn, prewarp);
}
} catch (ApiException e) {
e.printStackTrace();
}
final InlineResponse200 finalResponse = response;
runOnUiThread(new Runnable() {
@Override
public void run() {
if(finalResponse == null){
Toast.makeText(MainActivity.this, "识别失败", Toast.LENGTH_SHORT).show();
return;
}
Toast.makeText(MainActivity.this, "识别成功", Toast.LENGTH_SHORT).show();
if(finalResponse.getResults()!=null && finalResponse.getResults().size()>=1 ...
(more)
take a look at openalpr
Question #4. Python has been rating #1. Java placed second and c++ placed third. Fortunately, Python is easier for you and it widely used electronics, industries, appliances, etc.