条形码图像到C#中的Code39转换?

时间:2021-09-20 03:14:08

I have barcode images in jpg format and want to extract barcode # from those. Please help!

我有jpg格式的条形码图像,并希望从中提取条形码#。请帮忙!

3 个解决方案

#1


4  

See the CodeProject article: Reading Barcodes from an Image - II.

请参阅CodeProject文章:从图像中读取条形码 - II。

The author (James) improves (and credits) a previously written VB library to decode barcodes from an image using only .NET code.

作者(James)改进(并归功于)以前编写的VB库,仅使用.NET代码解码图像中的条形码。

There are two projects in the downloadable solution:

可下载解决方案中有两个项目:

  • The barcode library - written in C#
  • 条形码库 - 用C#编写

  • The test app - written in VB
  • 测试应用程序 - 用VB编写

I have successfully used the C# code in VS2008 against a JPG image with an extended (includes alpha chars) code 39 barcode.

我已成功使用VS2008中的C#代码对抗带有扩展(包括alpha字符)代码39条形码的JPG图像。

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!

您需要注册CodeProject才能下载代码,但这也是免费的 - 并且值得花时间,因为该网站上有很多优秀的代码!

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!

更新:顺便说一下,我只是看了Joachim Kerschbaumer在你的问题的另一个答案中提到的博客。绝对关注那个项目!它看起来像一个非常强大的解决方案如果它可以从繁忙的图像中读取那些倾斜的条形码,那么它可以做任何事情!

#2


7  

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.

我们开发了一个c#组件,它读取所有维度,旋转,质量等条形码的值。它尚未发布,但我们将在http://blog.lemqi.com上发布有关它的详细信息。它可能是免费的(也许是开源的)。但也许它还需要1-2周才能发布,因为我们之前必须重构代码。

#3


1  

I use the softek barcode toolkit - http://www.bardecode.com/

我使用softek条码工具包 - http://www.bardecode.com/

Works very well - $249 for single developer.

效果很好 - 单个开发人员249美元。

#1


4  

See the CodeProject article: Reading Barcodes from an Image - II.

请参阅CodeProject文章:从图像中读取条形码 - II。

The author (James) improves (and credits) a previously written VB library to decode barcodes from an image using only .NET code.

作者(James)改进(并归功于)以前编写的VB库,仅使用.NET代码解码图像中的条形码。

There are two projects in the downloadable solution:

可下载解决方案中有两个项目:

  • The barcode library - written in C#
  • 条形码库 - 用C#编写

  • The test app - written in VB
  • 测试应用程序 - 用VB编写

I have successfully used the C# code in VS2008 against a JPG image with an extended (includes alpha chars) code 39 barcode.

我已成功使用VS2008中的C#代码对抗带有扩展(包括alpha字符)代码39条形码的JPG图像。

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!

您需要注册CodeProject才能下载代码,但这也是免费的 - 并且值得花时间,因为该网站上有很多优秀的代码!

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!

更新:顺便说一下,我只是看了Joachim Kerschbaumer在你的问题的另一个答案中提到的博客。绝对关注那个项目!它看起来像一个非常强大的解决方案如果它可以从繁忙的图像中读取那些倾斜的条形码,那么它可以做任何事情!

#2


7  

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.

我们开发了一个c#组件,它读取所有维度,旋转,质量等条形码的值。它尚未发布,但我们将在http://blog.lemqi.com上发布有关它的详细信息。它可能是免费的(也许是开源的)。但也许它还需要1-2周才能发布,因为我们之前必须重构代码。

#3


1  

I use the softek barcode toolkit - http://www.bardecode.com/

我使用softek条码工具包 - http://www.bardecode.com/

Works very well - $249 for single developer.

效果很好 - 单个开发人员249美元。