* Implements decoding of the ITF format.\r
* </p>\r
*<p>\r
- * "ITF" stands for Interleaved Two of Five. This Reader will scan an arbritary\r
- * ITF length barcode. The checksum is optional and is not applied by this\r
- * Reader. The user of the decoded value will have to apply a checksum if\r
+ * "ITF" stands for Interleaved Two of Five. This Reader will scan ITF barcode with 6, 10 or 14 digits. \r
+ * The checksum is optional and is not applied by this Reader. The consumer of the decoded value will have to apply a checksum if\r
* required.\r
* </p>\r
* \r
* information.\r
* </p>\r
* \r
- * @author kevin.osullivan@sita.aero\r
+ * @author kevin.osullivan@sita.aero, SITA Lab.\r
*/\r
public class ITFReader extends AbstractOneDReader {\r
\r
\r
String resultString = result.toString();\r
/**\r
- * To avoid false positives with 2D barcodes, make\r
- * an assumption that the decoded string must be at least 6 digits.\r
+ * To avoid false positives with 2D barcodes (and other patterns), make\r
+ * an assumption that the decoded string must be 6, 10 or 14 digits.\r
*/\r
- if (resultString.length() < 6 || resultString.length() % 2 == 1)\r
+ if ((resultString.length() != 6 && resultString.length() != 10 && resultString.length() != 14) || \r
+ resultString.length() % 2 == 1)\r
throw ReaderException.getInstance();\r
\r
return new Result(resultString,\r
return startPattern;\r
}\r
\r
- /**\r
- * \r
- * \r
- */\r
/**\r
* \r
* The start & end patterns must be pre/post fixed by a quiet zone. This\r
// Unable to find the necessary number of quiet zone pixels.\r
throw ReaderException.getInstance();\r
}\r
- \r
- if (i>this.narrowLineWidth*20)\r
- {\r
- // The distance from the image edge to the start of the quiet zone \r
- // is twice the size of the quiet zone. \r
- // This is unrealistic as the barcode should mostly fill the camera viewfinder.\r
- // This implies that this is a false positive.\r
- throw ReaderException.getInstance();\r
- }\r
}\r
\r
/**\r