Is there any java library to read the vin number barcodes from image? [closed]

萝らか妹 提交于 2019-12-21 04:52:47

问题


I am building a application to read vin number barcodes using camera from android phone.I do not know how to read the barcodes from the image captured from the camera.(i.e) Is there any class to read the barcode of vin number format.I have tried zxing and other libs no use for me.Thanks

Note: I tried searching in DDG.gg and Stackoverflow but no proper solution.


回答1:


According to this thread on google code, zxing should support it. They say, the issue could be related to camera resolution. And they mention "auqoniq VIN scanner", which seems to be an android app based on zxing.




回答2:


I just integrated zxing into my app as a library, and I got my app to properly scan and decode a VIN. I even changed the mask to widen the available scan area.

The problem is definitely camera resolution. Large, clear VINS scan without a hitch. Dingy VINS do not.

I'm making my VIN field available for manual entry if it does not scan. Remember to run a check digit method to make sure it's a valid VIN.

I found one I may use here: http://introcs.cs.princeton.edu/java/31datatype/VIN.java.html




回答3:


I have successfully used zxing's source code to decode to valid VIN strings and encode VIN strings back into barcodes via intent (with a little help).

Here's the key -

  1. Integrate your zxing source code as a library. Here is the step-by-step link:

    http://damianflannery.wordpress.com/2011/06/13/integrate-zxing-barcode-scanner-into-your-android-app-natively-using-eclipse/

    Note, there is also a nice discussion here as to why this should not be done from a developer's standpoint, but the code is free-open-use and we need to modify it in a fashion that cannot currently be done via intent. So on we go.

  2. In your project, call zxing via intent (just as they recommend); specify intent.putExtra("SCAN_MODE","ONE_D_MODE");

    I have actually had it work both ways (with and without this line) but it's up to you if you see better results including it. I usually get a VIN to scan in less than 1/4 second of focus once it's in frame.

  3. Preview resolution matters, as the camera preview sends frames to the decoder to search for a valid barcode.

    so... in CameraConfigurationManager.java, specify a larger MAX_PREVIEW_PIXELS (that does not exceed your screen resolution). I used "1024 * 600" - my devices resolution. This may take some tweaking.

  4. in CameraManager.java, edit your framing rectangle to widen for the size of the larger barcode, via private static final int MAX_FRAME_WIDTH = screenpixelsinteger;, mine is 1000.

  5. in public Rect getFramingRect() {, edit int width to be = screenResolution.x * 1 (or * nothing), instead of * 3 / 4. This will widen the framing rectangle to be as wide as the screen resolution, but no wider than MAX_FRAME_WIDTH specified above (it will be clamped if the MFW is lower).

Finally, SCAN!

I don't believe I've edited any other variables, but if I find that I did to make this work, I will update this answer.



来源:https://stackoverflow.com/questions/5535445/is-there-any-java-library-to-read-the-vin-number-barcodes-from-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!