用手机摄像头拍摄的画面用吧code阅读用手、摄像头、画面、code

2023-09-06 13:19:01 作者:泪痣哥哥i

我们如何做到的就是用手机相机拍摄的一间酒吧code编程阅读?例如,如何做到这一点使用iPhone或Android或Java ME?我们需要独立的硬件来读取吧code,或者我们可以做图像处理?

How do we do programmatic reading of a barcode that is captured using a mobile phone camera? For example, how do that using iPhone or Android or Java ME? Do we need separate hardware to read bar code or can we do image manipulation?

推荐答案

谷歌已将此难以置信简单,他们的斑马线库。他们通过图像在以下平台上做扫描的支持:

Google has made this INCREDIBLY simple with their Zebra Crossing libraries. They have support for doing scanning via images on the following platforms:

在J2SE Android版的

和其他人移植到:

J2ME 的 CSHARP CPP 缘 iPhone 的 错误

作为另一个海报已经提到的,在Android上,你也可以使用一个意图打电话吧喜欢的东西code阅读:

As another poster already mentioned, on Android you could also use an Intent to call Barcode Reader with something like:

public Button.OnClickListener mScan = new Button.OnClickListener() {
    public void onClick(View v) {
        Intent intent = new Intent("com.google.zxing.client.android.SCAN");
        intent.putExtra("SCAN_MODE", "ONE_D_MODE");
        startActivityForResult(intent, 0);
    }
};

public void onActivityResult(int requestCode, int resultCode, Intent intent) {
    if (requestCode == 0) {
        if (resultCode == RESULT_OK) {
            String contents = intent.getStringExtra("SCAN_RESULT");
            String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
            // Handle successful scan
        } else if (resultCode == RESULT_CANCELED) {
            // Handle cancel
        }
    }
}