docs: function computeDimension(topLeft, topRight, bottomLeft, matrix) {
          const moduleSize = (sum(countBlackWhiteRun(topLeft, bottomLeft, matrix, 5)) / 7 + // Divide by 7 since the ratio is 1:1:3:1:1
              sum(countBlackWhiteRun(topLeft, topRight, matrix, 5)) / 7 +
              sum(countBlackWhiteRun(bottomLeft, topLeft, matrix, 5)) / 7 +
              sum(countBlackWhiteRun(topRight, topLeft, matrix, 5)) / 7) / 4;
          if (moduleSize < 1) {
              throw new Error("Invalid module size");
          }
          const topDimension = Math.round(distance(topLeft, topRight) / moduleSize);
          const sideDimension = Math.round(distance(topLeft, bottomLeft) / moduleSize);
          let dimension = Math.floor((topDimension + sideDimension) / 2) + 7;
          switch (dimension % 4) {
              case 0:
                  dimension++;
                  break;
              case 2:
                  dimension--;
                  break;
          }
          return { dimension, moduleSize };
      }