C# 中条形码图像到 Code39 的转换?
我有 jpg 格式的条形码图像,想从中提取条形码 #。 请帮忙!
I have barcode images in jpg format and want to extract barcode # from those. Please help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我们开发了 ac# 组件,可以从所有尺寸、旋转、质量等条形码中读取值。它尚未发布,但我们将在 http://blog.lemqi.com 。 它可能是免费的(也许是开源的)。 但也许距离发布还有 1-2 周的时间,因为我们之前必须重构代码。
we've developed a c# component that reads values from barcodes of all dimension, rotation, quality etc. it's not yet release but we will release detailed information about it at http://blog.lemqi.com . it will be probably free (maybe open source). but maybe it's still 1-2 weeks till release as we have to refactor the code before.
请参阅 CodeProject 文章:从图像读取条形码 - II。
作者 (James) 改进(并归功于)< a href="http://www.codeproject.com/KB/dotnet/barcodeImaging.aspx" rel="nofollow noreferrer">以前编写的 VB 库,仅使用 .NET 代码从图像中解码条形码。
可下载解决方案中有两个项目:
我已成功使用 VS2008 中的 C# 代码来处理带有扩展(包括 alpha 字符)代码 39 条形码的 JPG 图像。
该库能够扫描整个图像中的条形码,其中条形码只是一部分。 这有好处也有坏处。 它更灵活,但您可能必须解析噪音。 当然,您会希望从尽可能干净的图像开始。 此外,扫描的条形码必须相当直,不能旋转或倾斜一定角度。
如果您可以将扫描限制为实际条形码的“切片”,则可能会获得更高的准确性。
在文章评论中,另一位用户提交重新扫描条形码并使用的功能校验和数字,如果您控制原始条形码的打印并且可以首先包含校验和,那么这非常有用。
当然,有一些非常令人印象深刻(有些非常昂贵)的商业解决方案,其优点是经过充分测试、更灵活、可以扫描更多条形码格式,并且由于改进的图像采样而对图像质量更加宽容。 但这是一个良好的(免费)开始!
您需要注册 CodeProject 才能下载代码,但这也是免费的 - 而且值得花时间,因为该网站上有很多好的代码!
更新:顺便说一下,我刚刚查看了博客 Joachim Kerschbaumer 在另一个答案中提到你的问题。 一定要密切关注该项目! 它看起来像是一个非常强大的解决方案。 如果它可以从那些繁忙的图像中读取那些倾斜的条形码,那么它就可以做任何事情!
See the CodeProject article: Reading Barcodes from an Image - II.
The author (James) improves (and credits) a previously written VB library to decode barcodes from an image using only .NET code.
There are two projects in the downloadable solution:
I have successfully used the C# code in VS2008 against a JPG image with an extended (includes alpha chars) code 39 barcode.
The library has the ability to scan an entire image for a barcode, where the barcode is only a portion. This has good and bad points. It is more flexible, but you may have to parse out noise. Of course, you will want to start with the cleanest image possible. Also, the scanned barcode must be fairly straight, not rotated or skewed at an angle.
If you can limit the scan to a "slice" of the actual barcode, you might get better accuracy.
In the article comments, another user submits a function that re-scans the barcode and uses a checksum digit, which is great if you control the printing of the original barcode and can include the checksum in the first place.
There are, of course some very impressive (and some very expensive) commercial solutions that have the advantage of being well-tested, more flexible, can scan more barcode formats, and are more tolerant of image quality due to improved image sampling. But this is a good (free) start!
You will need to sign up with CodeProject to download the code, but that is free also - and worth the time because there is so much good code on that site!
UPDATE: Incidentally, I just looked at the blog that Joachim Kerschbaumer mentions in another answer to your question. Definitely keep an eye on that project! It looks like a very robust solution. If it can read those skewed barcodes from those busy images, then it can do anything!
我使用 Softek 条形码工具包 - http://www.bardecode.com/
效果很好 - 249 美元单一开发商。
I use the softek barcode toolkit - http://www.bardecode.com/
Works very well - $249 for single developer.