473,498 Members | 1,648 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[OpenCV] Extract en recognize barcode from image file.

Hi there!!!

I've been working on recognizing EAN barcodes from images. Yes it's
about recognizing barcodes from images but from bars not from the
digit with the help of OCR software but with "Open Computer Vision
library" (OpenCV).
I haven't been successful yet.

Here is my idea at how I should do it :
- Image capture
- Grays levels
- Binarize image
- Search the angle with Hough Transform
- Rotate the image using the found angle.
- Average of several lines for the color of the bars
- Convert to binary digit
- Convert in decimal

(I'm unable to show the lines found with Hough Transform anyway ...
><)
I can rotate the image and all.

I don't have the slighest idea at how to do to extract the rectangular
zone of the barcode and then averaging the lines.

Then, I have problems with some barcodes with some reflections, some
bars won't be continue bars so ... it inputs errors and dunno how to
correct it (how to reform correctly the bar since some point are
presents).

Here what I have for now :
http://img527.imageshack.us/img527/4...codeuo0.th.jpg
http://img525.imageshack.us/img525/1...rayseq3.th.jpg
http://img153.imageshack.us/img153/4...rizexb6.th.jpg
http://img398.imageshack.us/img398/6...tatesz3.th.jpg

I would like to post the source code but it's more than 100 lines ...
When my problem is resolved, I think I'll contribute to the community
by giving out the sources for recognizing a barcode from image.

Help would be much appreciate.

Thank you

Kurapix

P.S. : Sorry for my bad english
Apr 10 '08 #1
4 11971
On 11 avr, 00:30, kura...@gmail.com wrote:
Hi there!!!

I've been working on recognizing EAN barcodes from images. Yes it's
about recognizing barcodes from images but from bars not from the
digit with the help of OCR software but with "Open Computer Vision
library" (OpenCV).
I haven't been successful yet.

Here is my idea at how I should do it :
- Image capture
- Grays levels
- Binarize image
- Search the angle with Hough Transform
- Rotate the image using the found angle.
- Average of several lines for the color of the bars
- Convert to binary digit
- Convert in decimal

(I'm unable to show the lines found with Hough Transform anyway ...><)

I can rotate the image and all.

I don't have the slighest idea at how to do to extract the rectangular
zone of the barcode and then averaging the lines.

Then, I have problems with some barcodes with some reflections, some
bars won't be continue bars so ... it inputs errors and dunno how to
correct it (how to reform correctly the bar since some point are
presents).

Here what I have for now :http://img527.imageshack.us/img527/4...tatesz3.th.jpg

I would like to post the source code but it's more than 100 lines ...
When my problem is resolved, I think I'll contribute to the community
by giving out the sources for recognizing a barcode from image.

Help would be much appreciate.

Thank you

Kurapix

P.S. : Sorry for my bad english
Wooops.

For the pictures, remove .th in the links to have real size pictures
(taken from a webcam).
Apr 10 '08 #2
On 10 Apr 2008 at 22:30, ku*****@gmail.com wrote:
I've been working on recognizing EAN barcodes from images. Yes it's
about recognizing barcodes from images but from bars not from the
digit with the help of OCR software but with "Open Computer Vision
library" (OpenCV).
[snip]
I don't have the slighest idea at how to do to extract the rectangular
zone of the barcode and then averaging the lines.

Then, I have problems with some barcodes with some reflections, some
bars won't be continue bars so ... it inputs errors and dunno how to
correct it (how to reform correctly the bar since some point are
presents).
[snip]
I would like to post the source code but it's more than 100 lines ...
When my problem is resolved, I think I'll contribute to the community
by giving out the sources for recognizing a barcode from image.
That sounds like an interesting and worthwhile project, but probably a
very challenging one. It's hard to say anything useful without the
source code - for sure there'll be people here who'll be interested to
have a look at it, and probably some experts who'll be able to give you
good advice, so why not post the code, or put it on a website and post a
link?

Apr 10 '08 #3
On 11 avr, 00:47, Antoninus Twink <nos...@nospam.invalidwrote:
On 10 Apr 2008 at 22:30, kura...@gmail.com wrote:
I've been working on recognizing EAN barcodes from images. Yes it's
about recognizing barcodes from images but from bars not from the
digit with the help of OCR software but with "Open Computer Vision
library" (OpenCV).
[snip]
I don't have the slighest idea at how to do to extract the rectangular
zone of the barcode and then averaging the lines.
Then, I have problems with some barcodes with some reflections, some
bars won't be continue bars so ... it inputs errors and dunno how to
correct it (how to reform correctly the bar since some point are
presents).
[snip]
I would like to post the source code but it's more than 100 lines ...
When my problem is resolved, I think I'll contribute to the community
by giving out the sources for recognizing a barcode from image.

That sounds like an interesting and worthwhile project, but probably a
very challenging one. It's hard to say anything useful without the
source code - for sure there'll be people here who'll be interested to
have a look at it, and probably some experts who'll be able to give you
good advice, so why not post the code, or put it on a website and post a
link?
I'm far from being a master.
My code is really not good since I've coded this quite fast since I
was in a hurry at the time I wrote it.

It doesn't really do anything but it's a good starting point I hope.

I'm not promising anything about it because I don't forcefully have
the time but I'll try as usual ;) .

It would be great if people who want to contribute send their patch to
me (I didn't set up a versionning system since it's a SMALL project).

Here it is : http://www.savefile.com/files/1496871

Have fun

Kurapix
Apr 11 '08 #4
On Apr 10, 3:47*pm, Antoninus Twink <nos...@nospam.invalidwrote:
That sounds like an interesting and worthwhile project, but probably a
very challenging one.
I'd give my boss a four day estimate to have this code complete, put
through basic tests and ready for beta testing by the QA team.
Apr 11 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
8635
by: Roger Withnell | last post by:
I would like to check that an image file, selected by a user using fileUpload, is within certain parameters (width, height, filesize) and to display the image file so that the user can see the...
11
9549
by: Parrot | last post by:
Is there any routine I can call to reduce the size of an image file after uploading a file from a client. I am looking to reduce file sizes programmatically using C# in my web page after uploading....
7
2893
by: sonnystarks | last post by:
Page construction in progress: http://www.sdisplay.info/test/ Firefox does not recognize background image referred to on styles.css IE sees it with no problem. What is the problem? Thanx,
5
2055
by: bizt | last post by:
Hi, I have a PHP program on my webspace that I use to upload images. As the images are about 500KB each, I would like to create a preview thumbnail image with smaller image dimensions than the...
13
2372
by: NickName | last post by:
"For the vision impaired, SVG offers tremendous potential for interactive Internet mapping applications as discussed by Gardner and Bulatov (2001).". Now, here's an SVG file with fair/medium...
0
1201
by: Ashwini Bomble | last post by:
Hello, I want to read a barcode image from pdf/tiff file. how it can be done using .net imaging toolset. -Ashwini
1
1724
by: leela mn | last post by:
Hi Guys, Is there anyway to extract the text content from an image file using c#?
1
3059
by: veer | last post by:
Hi i am making a program in which i want to extract data from html file . Actually there are two dates on html file i want to extract these dates but the main probleum is that these dates are...
2
10079
by: defn noob | last post by:
from Tkinter import * import os master = Tk() w = Canvas(master, width=800, height=600) print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg') im = PhotoImage(file =...
6
1812
by: mfaisalwarraich | last post by:
hi every body, i am using the following code to upload an image. it directly jumps to the error message please tell me what im doing wrong here. <form name="myform"...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4595
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.