Udayraj123 / OMRChecker

Evaluate OMR sheets fast and accurately using a scanner 🖨 or your phone 🤳.
MIT License
751 stars 311 forks source link

[Bug] Using only top level bubble dimensions. #139

Closed easyktk closed 1 year ago

easyktk commented 1 year ago

Describe the bug Hello, I'm making a template, I have two different sizes of circles in the test (one for roll, the other for the answer). When I try to specify "bubbleDimensions" inside a block, it displays (python main.py --setLayout) smaller blocks that are specified in the global option.

{
  "pageDimensions": [
    2550,
    3300
  ],
  "bubbleDimensions": [
    36,
    36
  ],
  "preProcessors": [
    {
      "name": "CropOnMarkers",
      "options": {
        "relativePath": "omr/omr_marker.jpg",
        "sheetToMarkerWidthRatio": 17
      }
    }
  ],
  "fieldBlocks": {
    "Roll_no": {
      "fieldType": "QTYPE_INT",
      "origin": [1650, 825],
      "fieldLabels": ["r1..9"],
      "bubblesGap": 69,
      "labelsGap": 61
    },
    "q01block": {
      "bubbleDimensions": [
        65,
        65
      ],
      "fieldType": "QTYPE_MCQ4",
      "origin": [
        260,
        1720
      ],
      "bubblesGap": 83,
      "labelsGap": 74,
      "fieldLabels": ["q1..9"]
    }
  }
}

To Reproduce Steps to reproduce the behaviour:

  1. Use sample 'any'
  2. Command(s) used: python3 main.py --setLayout
  3. Bubble dimensions are drawn incorrectly

Expected behaviour That the size will correspond to that specified in the block

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Udayraj123 comment:

I'm trying to reproduce your issue... The --setLayout option seems to show incorrect bubble dimensions while during actual evaluation it is using correct bubble dimensions When printing the bubble dimensions in the creation code, it does recognize it correctly, meaning that the template schema is fine...

edit: No it's using only top level bubble dimensions. I'll raise a fix soon