handleElementDetections (detections, row, elem, fase=1) {
      let detection
      let cellItem
      let criteria

      const assignColumn = (detection) => {
        if (!this.rows[row]) {
          this.rows[row] = []
        }
        if (!this.rows[row][detection.col]) {
          this.rows[row][detection.col] = []
        }
        cellItem = new CellItem({
          props: elem,
          ratio: detection.ratio
        })
        this.rows[row][detection.col].push(cellItem)
      }

      if (detections.length === 1) {
        detection = detections[0]
        if (
          detection &&
          detection.ratio > Constants.TABLE_COLUMN_DETECTION_RATIO_OF_CONFIDENCE
        ) {
          assignColumn(detection)
        } else {
          if (fase!==2) {
            this.pushUndetected(row, elem)
          } else {
            assignColumn(detection)
          }
        }
      } else if (detections.length === 0) {
        if (fase!==2) {
          this.pushUndetected(row, elem)
        } else {
          // detect nearest column
        }
      } else {
        // more than 1 detection
        if (fase!==2) {
          this.pushUndetected(row, elem)
        } else {
          let maxDetection
          detections.forEach(detection => {
            if (maxDetection === undefined || detection.ratio > maxDetection.ratio) {
              maxDetection = detection
            }
          })
          assignColumn(maxDetection)
        }
      }
    }
/**
     *
     * @param {Number} fase on higher iteration assume the column
     *
     */
@param {Number} fase on higher iteration assume the column
@param { Number } fase on higher iteration assume the column
handleElementDetections (detections, row, elem, fase=1) {
      let detection
      let cellItem
      let criteria
      const assignColumn = (detection) => {
        if (!this.rows[row]) {
          this.rows[row] = []
        }
        if (!this.rows[row][detection.col]) {
          this.rows[row][detection.col] = []
        }
        cellItem = new CellItem({
          props: elem,
          ratio: detection.ratio
        })
        this.rows[row][detection.col].push(cellItem)
      }
      if (detections.length === 1) {
        detection = detections[0]
        if (
          detection &&
          detection.ratio > Constants.TABLE_COLUMN_DETECTION_RATIO_OF_CONFIDENCE
        ) {
          assignColumn(detection)
        } else {
          if (fase!==2) {
            this.pushUndetected(row, elem)
          } else {
            assignColumn(detection)
          }
        }
      } else if (detections.length === 0) {
        if (fase!==2) {
          this.pushUndetected(row, elem)
        } else {
        }
      } else {
        if (fase!==2) {
          this.pushUndetected(row, elem)
        } else {
          let maxDetection
          detections.forEach(detection => {
            if (maxDetection === undefined || detection.ratio > maxDetection.ratio) {
              maxDetection = detection
            }
          })
          assignColumn(maxDetection)
        }
      }
    }
handleElementDetections ( detections , row , elem , fase = 1 ) { let detection let cellItem let criteria const assignColumn = ( detection ) => { if ( ! this . rows [ row ] ) { this . rows [ row ] = [ ] } if ( ! this . rows [ row ] [ detection . col ] ) { this . rows [ row ] [ detection . col ] = [ ] } cellItem = new CellItem ( { props : elem , ratio : detection . ratio } ) this . rows [ row ] [ detection . col ] . push ( cellItem ) } if ( detections . length === 1 ) { detection = detections [ 0 ] if ( detection && detection . ratio > Constants . TABLE_COLUMN_DETECTION_RATIO_OF_CONFIDENCE ) { assignColumn ( detection ) } else { if ( fase !== 2 ) { this . pushUndetected ( row , elem ) } else { assignColumn ( detection ) } } } else if ( detections . length === 0 ) { if ( fase !== 2 ) { this . pushUndetected ( row , elem ) } else { } } else { if ( fase !== 2 ) { this . pushUndetected ( row , elem ) } else { let maxDetection detections . forEach ( detection => { if ( maxDetection === undefined || detection . ratio > maxDetection . ratio ) { maxDetection = detection } } ) assignColumn ( maxDetection ) } } }
@param {Number} fase on higher iteration assume the column
@param { Number } fase on higher iteration assume the column
// detect nearest column // more than 1 detection