Re: I'm interested in porting 1 barcode scanner java code to C++ for iOS

37 views
Skip to first unread message

Patrick

unread,
Jun 15, 2012, 6:12:32 AM6/15/12
to zx...@googlegroups.com
I've checked the UPC barcodes classes, and they look pretty similar so far. I've just noticed the MAX_AVG_VARIANCE constant is different. Is there a specific reason for it ?

      enum {MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR) * 420/1000};


In java code is 480/1000.


On Friday, June 15, 2012 10:30:58 AM UTC+2, Patrick wrote:
I'm interested in porting 1 barcode scanner java code to C++ for iOS, but could you give me some help telling me what needs to be ported ?
Checking for code differences takes quite long...

Thanks

Sean Owen

unread,
Jun 15, 2012, 7:43:14 AM6/15/12
to zx...@googlegroups.com
Java has been retuned over time. I don't know if the same values are optimal for the older port in C++, and different iOS characteristics. You can try changing them and seeing what happens to the tests.

Steven Parkes

unread,
Jun 15, 2012, 9:42:31 AM6/15/12
to Patrick, zx...@googlegroups.com
On Jun 15, 2012, at 1:30 AM, Patrick wrote:

> I'm interested in porting 1 barcode scanner java code to C++ for iOS, but could you give me some help telling me what needs to be ported ?
> Checking for code differences takes quite long…

The two choices currently are do a line-by-line diff or do a wholesale report.

Steven Parkes

unread,
Jun 15, 2012, 9:44:27 AM6/15/12
to Patrick, zx...@googlegroups.com
On Jun 15, 2012, at 3:12 AM, Patrick wrote:

> I've checked the UPC barcodes classes, and they look pretty similar so far. I've just noticed the MAX_AVG_VARIANCE constant is different. Is there a specific reason for it ?
>
> enum {MAX_AVG_VARIANCE = (unsigned int) (PATTERN_MATCH_RESULT_SCALE_FACTOR) * 420/1000};
>
> In java code is 480/1000.

At this point, since the 1D codes don't have anyone maintaining them, I think you can assume the C++ code should be modified to match the Java code.

The gold-standard for what works and what doesn't is equivalence when running on the black box tests.

Steven Parkes

unread,
Jun 15, 2012, 9:51:01 AM6/15/12
to Patrick Diviacco, zx...@googlegroups.com

On Jun 15, 2012, at 6:47 AM, Patrick Diviacco wrote:

> Could you give me more info about the black box test ?
> Should I port the blackboxtest.java file to C++ in order to execute it ?

There's a script called blackboxtest.sh in the cpp directory.

Patrick

unread,
Jun 18, 2012, 9:53:56 AM6/18/12
to zx...@googlegroups.com, Patrick Diviacco
I've run the test and I don't manage to run it correctly. I've modified the sh file to change the paths to the image files, but still it doesn't work. For each image I get:

blackboxtest.sh: command substitution: line 35: unexpected EOF while looking for matching `"'
blackboxtest.sh: command substitution: line 36: syntax error: unexpected end of file
-e FAILED
   Expected: 9780446579803
   Detected: 
-n Processing: core/test/data/blackbox/ean13-5/16.png ... 

What am I doing wrong ?
Thanks

Steven Parkes

unread,
Jun 18, 2012, 3:21:06 PM6/18/12
to Patrick, zx...@googlegroups.com, Patrick Diviacco
What OS? Which shell?

It works okay for me on OS X using bash and, with some bad output due to echo options, with /bin/sh.
Reply all
Reply to author
Forward
0 new messages