Comments (7)
The previous code didn't really do barcode detection. I've added a new
DetectBarcode
class to the barcode library and used it in ReadBarJ. I believe you will find
performance is much better. ReadBarJ will show the area of the image it
detected the
barcode and also outline the approximate barcode edges with green lines. I
updated
the source tree and also uploaded a new JAR file for ReadBarJ.
Original comment by [email protected]
on 27 Jun 2008 at 8:15
from jjil.
I created a larger monochrome version of barcodeEAN.png (see attached
barcode_clean.png image). All pixels
are 0x000000 or 0xFFFFFF. Each bar is exactly 3, 6, 9, or 12 pixels wide. The
total width of the barcode is
285 pixels, centered within a 640 x 480 image with 0xFFFFFF background.
The output from the latest J2SE build is "The barcode could not be read". The
debug images look correct (see
attachments); and the cYLeft, cYRight, wSlopeLeft, and wSlopeRight values
passed to
BarcodeReaderEan13.Decode() look good. szCode is estimated as 8269992866737,
4084483768866,
5003443366630, and 1906153945336. Estimated offsets seem good, so it appears
there may be a bug in
estimating the left and right codes? Or maybe my image is just too perfect
whereas the correlations expect
more randomness?
Original comment by [email protected]
on 1 Jul 2008 at 9:42
Attachments:
from jjil.
Reattaching the image I created, which didn't upload correctly the first time.
Original comment by [email protected]
on 1 Jul 2008 at 9:45
Attachments:
from jjil.
-BarcodeReaderEan13.java line 800-803:
// estimate position of the middle of the barcode
// this will be the position of the second 0 in the
// string "0101010"
int dMidOffset =
It seems from the code that the string should be "1010101" where dMidOffset
estimates the position of the second 1 (the first black bar in the "01010"
center guard pattern)? At
least this is what the code estimates (x=187 in my attached cropped.png). Or
is the intention to estimate the left edge of the center guard pattern?
-BarcodeReaderEan13.java line 813-816:
// estimate position of the right of the barcode.
// this will be the position of the second 0 in the
// string "1010000"
int dRightOffset =
It appears the code actually estimates the position of the first 0 (x=328 in my
attached cropped.png). Is this intentional, or should it be matching the
second 0 as suggested in the
comment?
Original comment by [email protected]
on 1 Jul 2008 at 11:04
from jjil.
Narrowed the problem down to the following code from BarcodeReaderEan13.java
(lines 1386-1393):
private byte[] Stretch(byte[] bInput, int dLeft, int dRight, int dTargetWidth) {
int dWidth = dRight - dLeft;
byte[] bResult;
if (dWidth % dTargetWidth == 0) {
bResult = new byte[dTargetWidth];
System.arraycopy(bInput, dLeft, bResult, 0, dTargetWidth);
return bResult;
}
in the case that (dWidth % dTargetWidth == 0), we should be creating a byte
Array of width dWidth rather
than dTarget width. The current code truncates the array at the target width
when the original data may have
been a multiple of the target width.
Original comment by [email protected]
on 1 Jul 2008 at 11:47
from jjil.
For the sake of completeness, the fix is (BarcodeReaderEan13.java lines
1390-1391):
bResult = new byte[dWidth];
System.arraycopy(bInput, dLeft, bResult, 0, dWidth);
Original comment by [email protected]
on 1 Jul 2008 at 11:53
from jjil.
Thanks, hansomli. I've made the change you suggested to the code and have given
you
credit. The code now reads the 'original.png' image correctly. Please verify if
you
have time.
Original comment by [email protected]
on 18 Jul 2008 at 1:47
- Changed state: Fixed
from jjil.
Related Issues (20)
- May I know revision number of stable version?
- JJIL on Windows Mobile in C# (CSharp) HOT 3
- FaceDetect with J2SE application on lena.pgm does not work HOT 1
- Not Compatible with Current SDK HOT 2
- Svn checkout does not compiled on netbeans
- Precomputed filter values in Gray8GaussHoriz.java and Gray8GaussSmoothVert.java are wrong
- How to use library
- Cannot run ReadBarJ071808
- face detection example, realtime and otherwise HOT 1
- Gray8HistEq and signed byte convention
- Is it possible to fill polygons with JJIL?
- Error trying to build android project HOT 3
- RgbImageJ2se.toDisplay has threading issues
- Error in eclipse
- Image Filters
- Can't run Haar2j2Me.exe HOT 1
- need cascade files
- [deleted issue]
- [deleted issue]
- Move project to Github
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jjil.