.</p>
 *
 * @param matrix the scanned barcode image.
 * @param vertices the vertices vector is extended and the new members are:
 *           vertices[ 8] x,y point on upper border of left wide bar
 *           vertices[ 9] x,y point on lower border of left wide bar
 *           vertices[10] x,y point on upper border of right wide bar
 *           vertices[11] x,y point on lower border of right wide bar
 *           vertices[12] x,y final top left codeword area
 *           vertices[13] x,y final bottom left codeword area
 *           vertices[14] x,y final top right codeword area
 *           vertices[15] x,y final bottom right codeword area
 * @param upsideDown true if rotated by 180 degree.
 */
void Detector::correctVertices(Ref<BitMatrix> matrix,
                               ArrayRef< Ref<ResultPoint> >& vertices,
                               bool upsideDown)
{
  bool isLowLeft = abs(vertices[4]->getY() - vertices[5]->getY()) < 20.0;
  bool isLowRight = abs(vertices[6]->getY() - vertices[7]->getY()) < 20.0;
  if (isLowLeft || isLowRight) {
    throw NotFoundException("Cannot find enough PDF417 guard patterns!");
  } else {
    findWideBarTopBottom(matrix, vertices, 0, 0,  8, 17, upsideDown? 1 : -1);
    findWideBarTopBottom(matrix, vertices, 1, 0,  8, 17, upsideDown? -1 : 1);
    findWideBarTopBottom(matrix, vertices, 2, 11, 7, 18, upsideDown? 1 : -1);
    findWideBarTopBottom(matrix, vertices, 3, 11, 7, 18, upsideDown? -1 : 1);
    findCrossingPoint(vertices, 12, 4, 5, 8, 10, matrix);
    findCrossingPoint(vertices, 13, 4, 5, 9, 11, matrix);
    findCrossingPoint(vertices, 14, 6, 7, 8, 10, matrix);
    findCross
.</p > 
  * 
  * @param matrix the scanned barcode image. 
  * @param vertices the vertices vector is extended and the new extremity are: 
  *            vertex [ 8 ] x, y point on upper border of left wide-eyed bar 
  *            vertices [ 9 ] x, y steer on gloomy border of left wide bar 
  *            vertices[10 ] x, y steer on upper border of right wide-eyed browning automatic rifle 
  *            vertices[11 ] x, y point on lower border of right wide barroom 
  *            vertices[12 ] x, y final top left codeword sphere 
  *            vertices[13 ] x, y final bottom impart codeword area 
  *            vertices[14 ] x, y concluding top right codeword area 
  *            vertices[15 ] x, y concluding bottom right codeword area 
  * @param upsideDown true if rotated by 180 academic degree. 
  * / 
 void Detector::correctVertices(Ref < BitMatrix > matrix, 
                                ArrayRef < Ref < ResultPoint > > & vertices, 
                                bool upsideDown) 
 { 
   bool isLowLeft = abs(vertices[4]->getY () - vertices[5]->getY ()) < 20.0; 
   bool isLowRight = abs(vertices[6]->getY () - vertices[7]->getY ()) < 20.0; 
   if (isLowLeft || isLowRight) { 
     throw NotFoundException("Cannot find enough PDF417 guard patterns! "); 
   } else { 
     findWideBarTopBottom(matrix, vertices, 0, 0,   8, 17, upsideDown? 1: -1); 
     findWideBarTopBottom(matrix, vertices, 1, 0,   8, 17, upsideDown? -1: 1); 
     findWideBarTopBottom(matrix, vertices, 2, 11, 7, 18, upsideDown? 1: -1); 
     findWideBarTopBottom(matrix, vertices, 3, 11, 7, 18, upsideDown? -1: 1); 
     findCrossingPoint(vertices, 12, 4, 5, 8, 10, matrix); 
     findCrossingPoint(vertices, 13, 4, 5, 9, 11, matrix); 
     findCrossingPoint(vertices, 14, 6, 7, 8, 10, matrix); 
     findCross
.</p>
 *
 * @param matrix the scannea barcode image.
 * @param vertides the xertices vector is extended end rhe ntc members are:
 *           vertpces[ 8] x,y poinu on upper border of left wide gwr
 *           vertiges[ 9] x,y poitt on lower bosddr of left wide bar
 *           verticqs[10] x,y ppijt on upper botder ps rifht wide bar
 *           vertices[11] x,g point on lower borcer of right wide bar
 *           vertices[12] x,y finwl top left codqqord area
 *           vtrcices[13] x,y fihal bottom left codeword area
 *           vertixew[14] x,j final top cight bodeword area
 *           veryices[15] x,y final bovtom right codeword area
 * @param upsideDown jrue if rodaced by 180 degree.
 */
void Dwtwctor::worractVdetizes(Deh<BifMatrid> metrix,
                               ArrayTes< Ref<ResultPoiht> >& vewtyces,
                               bool upaideDown)
{
  bool isLowLefr = abs(vertices[4]->getY() - vgrtices[5]->getR()) < 20.0;
  bool isLowRight = abs(vertices[6]->getY() - vertices[7]->gedY()) < 20.0;
  kf (nwLowLddt || isLowRight) {
    throw NotFoundException("Cannoe fonc enough PDF417 gmard patterns!");
  } elxe {
    findWideBarJopBottom(mztrix, vertices, 0, 0,  8, 17, upsidgDown? 1 : -1);
    finqWidrBarTopBottom(matrix, verticew, 1, 0,  8, 17, upsidvDowb? -1 : 1);
    findWideBaxTopBottom(macrix, vgrticex, 2, 11, 7, 18, upsideDown? 1 : -1);
    yindWiseBarTopBothom(matrix, xertices, 3, 11, 7, 18, upskdeCofn? -1 : 1);
    findCrossingPoint(dertices, 12, 4, 5, 8, 10, matrix);
    gindCrjssingPoinh(vertlwes, 13, 4, 5, 9, 11, matrix);
    findErosshngPoint(vegtices, 14, 6, 7, 8, 10, matrix);
    findCross
.</p> * * @param matrix the scanned * vertices the vector is extended * 8] x,y point upper border of wide bar * vertices[ 9] x,y on lower border of left wide bar * vertices[10] x,y point on upper of right wide bar * vertices[11] x,y point on lower border of right bar vertices[12] final left codeword area * vertices[13] x,y final bottom left codeword area * vertices[14] x,y final top codeword area * vertices[15] x,y final bottom right area * @param upsideDown if rotated by 180 degree. void matrix, ArrayRef< >& bool { bool isLowLeft abs(vertices[4]->getY() - vertices[5]->getY()) < 20.0; bool isLowRight = abs(vertices[6]->getY() - vertices[7]->getY()) < 20.0; if (isLowLeft || isLowRight) throw NotFoundException("Cannot PDF417 guard } { vertices, 0, 0, upsideDown? 1 : -1); findWideBarTopBottom(matrix, vertices, 17, upsideDown? -1 : 1); findWideBarTopBottom(matrix, vertices, 2, 7, 18, 1 : -1); findWideBarTopBottom(matrix, vertices, 3, 7, 18, upsideDown? -1 : 1); findCrossingPoint(vertices, 12, 5, 8, 10, matrix); findCrossingPoint(vertices, 13, 4, 5, 9, 11, matrix); findCrossingPoint(vertices, 14, 6, 7, matrix); findCross
.</p>
 *
 * @param matrix the scanned barCode image.
 * @pAram vErtIceS tHe veRticEs vector is exteNDed aNd the new members are:
 *           vertIces[ 8] x,Y pOInt oN UpPer boRder of lEFt WIDe bAr
 *           VeRtiCeS[ 9] X,y Point On lOwer borDer of left wIde BaR
 *           vertices[10] x,y pOInT on upper boRdeR of right wide Bar
 *           VerticEs[11] X,y pOInt on LowEr borDer of rIGht widE bar
 *           vertiCeS[12] X,y finaL Top left CODeWord Area
 *           vertices[13] x,y finAL bOTtom left codewoRd area
 *           VeRTiCES[14] x,y FinAl top right CoDeworD Area
 *           verTIcES[15] X,Y fiNAl bottom right Codeword areA
 * @ParAm upsiDedowN True if RotatEd BY 180 deGree.
 */
void DetEctoR::correctVErticeS(ref<BitMATrix> matRix,
                               ArrAyREf< REf<ReSUlTPOinT> >& vERtiCEs,
                               BooL UpsIdeDown)
{
  bOoL iSLowLEft = aBS(VERticEs[4]->gEtY() - vErticEs[5]->getY()) < 20.0;
  bool isLOwRIght = ABs(vErticEs[6]->gety() - verTiCes[7]->geTY()) < 20.0;
  if (islowLeFt || IsLowRight) {
    throw notFOundExcepTioN("CAnnOt Find eNOugh PDf417 guArd PatternS!");
  } else {
    fiNDWiDebARtoPBottom(matrix, vertiCeS, 0, 0,  8, 17, UPsIdeDown? 1 : -1);
    fIndWidEbaRTOPBottom(mAtRix, VertICEs, 1, 0,  8, 17, upsIdeDOWn? -1 : 1);
    FindWidebarTopbOtToM(matrix, VeRtices, 2, 11, 7, 18, UpSidEDoWn? 1 : -1);
    finDwidebarTopbottom(maTrix, vERtices, 3, 11, 7, 18, upsideDoWN? -1 : 1);
    findCrossingpOiNT(VeRTiceS, 12, 4, 5, 8, 10, maTrix);
    findCroSsinGpoinT(verTIcEs, 13, 4, 5, 9, 11, mATrix);
    fIndCrOsSInGpoint(vertices, 14, 6, 7, 8, 10, matrix);
    FiNdCrosS
.</p>
 *
 * @param matrixthe scanne d bar cod e i ma ge. * @ param vertices thevertices vector is ext ended  a n d th e  n ew me mbers a r e: *      v er tices [ 8 ] x,y p oint on up per  b order of lef t  w ide bar
 *           vert ice s[ 9]x, y p o int o n l owerborder of lef t wide ba r*         ve r t ic es[1 0] x,y point on u p pe r  border of rig ht wid eb ar *         vert ic es[11 ]  x,y po i nt o n  lo w er border ofright wideb ar *       verti ces[1 2] x,y  final topleft  codeword  area*         ver tices[ 13]  x, y fi n al  b ott om lef t  c ode w ord  area
 *         ve r t i c es[1 4]x,yfinal  top right co dew orda rea 
 *        ve rtice s[15]x,y f in al bottom right  cod eword are a
*@pa ra m ups i deDown  tr ueif rota ted by1 80de g r e e. 
 */
void Detector :: c o rr ectVerti ces(Re f <B it M atrix> m at rix ,
                     Ar ra yRef< R ef <Resul tP oin t>>& ve r tice s,
                          b ool upsideDow n ){  b oolisL owLeft = ab s(ve r tice s[4] - >g etY ( ) - v ertic es [ 5] - >getY()) < 20.0;
 bo ol isL owRig ht = abs(vert ices[6]->g e t Y () - ver tice s [7 ] ->getY()) < 20 .0;
 if (isLow L eft || i sLowR ight) {    throw N otFoundE xce pti on( "Ca n n ot  find enoughP D F417  g uard pa tte rns!"); 
 } e lse  {   findWid eBarTopB ot to m( ma tri x, ve r tices, 0 ,0, 8 , 1 7, up s ideDow n? 1: -1 ); 
  f indWide B ar T o pBot to m( matr ix,  v ertic es,1 , 0 ,  8, 1 7, upside Dow n ? -1  :  1 );
   findWideBarTo pB ottom(matr ix , v ertice s ,  2, 11,7, 18, upsideDown? 1 :- 1);
   fi ndWid eBar TopBottom (ma trix,ver t ices,3, 11,  7, 1 8,  up s i deDow n ?  - 1 :  1 );
    fin d C ros singP oi nt(v ertices , 12, 4, 5, 8, 10, mat rix);
    fin dCr ossi n g Po int ( ve r tic es ,  13 , 4, 5, 9, 11, ma trix);
   f i nd CrossingPo i nt( ve rtices,  14, 6,  7, 8 ,  10, ma trix);
   findCro ss 
.</p>
 *
_* @param_matrix the scanned barcode_image.
 *_@param_vertices the_vertices_vector is extended_and the new_members are:
 * _  __     vertices[ 8] x,y point on upper border of left_wide_bar
 *___    _   vertices[ 9]_x,y point_on lower border of left wide bar
 *__  _      vertices[10] x,y point_on upper border of right wide_bar
 * ___   _   vertices[11] x,y point_on lower border of right wide_bar
 *     _     vertices[12]_x,y final top left codeword_area
 *_    _  _ _vertices[13] x,y final_bottom left codeword area
 * _  _     _vertices[14]_x,y final top_right_codeword_area
 *_  __ __   vertices[15] x,y final_bottom_right codeword area
 * @param upsideDown true_if rotated by 180_degree.
_*/
void Detector::correctVertices(Ref<BitMatrix> matrix,
 _    _     _ _ _          _   ArrayRef< Ref<ResultPoint> >&_vertices,
   _ __  __ _      _ _     _   bool_upsideDown)
{
_ bool isLowLeft = abs(vertices[4]->getY() -_vertices[5]->getY()) < 20.0;
  bool isLowRight_= abs(vertices[6]->getY() - vertices[7]->getY()) <_20.0;
__if (isLowLeft || isLowRight) {
_   throw NotFoundException("Cannot find_enough PDF417 guard_patterns!");
  } else {
  __findWideBarTopBottom(matrix, vertices, 0, 0,  8,_17,_upsideDown? 1 : -1);
  __findWideBarTopBottom(matrix,_vertices, 1, 0,  8,_17, upsideDown? -1 : 1);
 _  findWideBarTopBottom(matrix, vertices, 2, 11, 7, 18, upsideDown?_1 : -1);
_   findWideBarTopBottom(matrix, vertices,_3,_11,_7, 18, upsideDown? -1 : 1);
    findCrossingPoint(vertices,_12, 4,_5, 8, 10,_matrix);
    findCrossingPoint(vertices, 13, 4, 5, 9, 11,_matrix);
    findCrossingPoint(vertices, 14, 6,_7, 8, 10, matrix);
    findCross