Skip to content

Commit

Permalink
fix: conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Udayraj123 committed Sep 29, 2024
2 parents 7d5a4d2 + 8244939 commit 54fce46
Show file tree
Hide file tree
Showing 54 changed files with 1,244 additions and 85 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ repos:
hooks:
- id: pytest-on-commit
name: Running single sample test
entry: python3 -m pytest -rfpsxEX --disable-warnings --verbose -k test_run_omr_marker_mobile
entry: python3 -m pytest -rfpsxEX --disable-warnings -vv -k test_run_omr_marker_mobile
language: system
pass_filenames: false
always_run: true
Expand All @@ -103,7 +103,7 @@ repos:
hooks:
- id: pytest-on-push
name: Running all tests before push...
entry: python3 -m pytest -rfpsxEX --disable-warnings --verbose --durations=3
entry: python3 -m pytest -rfpsxEX --disable-warnings -vv --durations=3
language: system
pass_filenames: false
always_run: true
Expand Down
3 changes: 2 additions & 1 deletion samples/2-omr-marker/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"display_image_dimensions": [
2400,
1800
]
],
"colored_outputs_enabled": true
}
}
Binary file added samples/2-omr-marker/reference.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions samples/2-omr-marker/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
40
],
"preProcessors": [
{
"name": "AutoRotate",
"options": {
"referenceImage": "reference.jpg"
}
},
{
"name": "CropOnMarkers",
"options": {
Expand Down
3 changes: 2 additions & 1 deletion samples/3-answer-key/bonus-marking-grouping/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
1682
],
"filter_out_multimarked_files": false,
"show_image_level": 0
"show_image_level": 0,
"colored_outputs_enabled": true
}
}
3 changes: 2 additions & 1 deletion samples/3-answer-key/using-image-grouping/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
1800
],
"show_image_level": 0,
"save_image_level": 0
"save_image_level": 0,
"colored_outputs_enabled": true
}
}
3 changes: 2 additions & 1 deletion samples/3-answer-key/using-image/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
1800,
2400
],
"show_image_level": 0
"show_image_level": 0,
"colored_outputs_enabled": true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions samples/Autorotating-samples/1-mobile-camera/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"outputs": {
"show_image_level": 0,
"show_colored_outputs": true
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
214 changes: 214 additions & 0 deletions samples/Autorotating-samples/1-mobile-camera/template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
{
"templateDimensions": [
1846,
1500
],
"bubbleDimensions": [
40,
40
],
"customLabels": {
"Roll": [
"Medium",
"roll1..9"
],
"q5": [
"q5_1",
"q5_2"
],
"q6": [
"q6_1",
"q6_2"
],
"q7": [
"q7_1",
"q7_2"
],
"q8": [
"q8_1",
"q8_2"
],
"q9": [
"q9_1",
"q9_2"
]
},
"preProcessors": [
{
"name": "CropPage",
"options": {
"morphKernel": [
15,
15
]
}
},
{
"name": "CropOnMarkers",
"options": {
"type": "FOUR_MARKERS",
"referenceImage": "omr_marker.jpg",
"tuningOptions": {
"marker_rescale_range": [
80,
120
]
},
"markerDimensions": [
35,
35
]
}
},
{
"name": "AutoRotate",
"options": {
"referenceImage": "reference.jpg"
}
}
],
"fieldBlocks": {
"Medium": {
"bubblesGap": 41,
"fieldType": "CUSTOM",
"bubbleValues": [
"E",
"H"
],
"direction": "vertical",
"fieldLabels": [
"Medium"
],
"labelsGap": 0,
"origin": [
170,
282
]
},
"Roll": {
"fieldType": "QTYPE_INT",
"fieldLabels": [
"roll1..9"
],
"bubblesGap": 46,
"labelsGap": 58,
"origin": [
225,
282
]
},
"Int_Block_Q5": {
"fieldType": "QTYPE_INT",
"fieldLabels": [
"q5_1",
"q5_2"
],
"bubblesGap": 46,
"labelsGap": 60,
"origin": [
903,
282
]
},
"Int_Block_Q6": {
"fieldType": "QTYPE_INT",
"fieldLabels": [
"q6_1",
"q6_2"
],
"bubblesGap": 46,
"labelsGap": 60,
"origin": [
1077,
282
]
},
"Int_Block_Q7": {
"fieldType": "QTYPE_INT",
"fieldLabels": [
"q7_1",
"q7_2"
],
"bubblesGap": 46,
"labelsGap": 60,
"origin": [
1240,
282
]
},
"Int_Block_Q8": {
"fieldType": "QTYPE_INT",
"fieldLabels": [
"q8_1",
"q8_2"
],
"bubblesGap": 46,
"labelsGap": 57,
"origin": [
1410,
282
]
},
"Int_Block_Q9": {
"fieldType": "QTYPE_INT",
"fieldLabels": [
"q9_1",
"q9_2"
],
"bubblesGap": 46,
"labelsGap": 57,
"origin": [
1580,
282
]
},
"MCQ_Block_Q1": {
"fieldType": "QTYPE_MCQ4",
"fieldLabels": [
"q1..4"
],
"bubblesGap": 59,
"labelsGap": 50,
"origin": [
121,
860
]
},
"MCQ_Block_Q10": {
"fieldType": "QTYPE_MCQ4",
"fieldLabels": [
"q10..13"
],
"bubblesGap": 59,
"labelsGap": 50,
"origin": [
121,
1195
]
},
"MCQ_Block_Q14": {
"fieldType": "QTYPE_MCQ4",
"fieldLabels": [
"q14..16"
],
"bubblesGap": 57,
"labelsGap": 50,
"origin": [
905,
860
]
},
"MCQ_Block_Q17": {
"fieldType": "QTYPE_MCQ4",
"fieldLabels": [
"q17..20"
],
"bubblesGap": 57,
"labelsGap": 50,
"origin": [
905,
1195
]
}
}
}
51 changes: 51 additions & 0 deletions samples/Autorotating-samples/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
### AutoRotate Plugin README

The AutoRotate plugin is designed to automatically rotate an image based on a reference image using template matching techniques. This README provides instructions on how to use the AutoRotate plugin with the provided JSON schema.

#### Configuration Options

- **name**: Specifies the name of the plugin. Must be set to `"AutoRotate"` for the configuration to be recognized as applying to AutoRotate.

- **options**: Object containing configuration options for AutoRotate.

- **referenceImage**: Relative path to the reference image used for template matching.

- **markerDimensions**: Dimensions of the reference image. This should be specified as an object containing two positive numbers (see `$def/two_positive_numbers` in your schema).

- **threshold**: Object defining the threshold parameters for the match score.

- **value**: Numeric threshold value. If the match score falls below this value, an error or warning may be triggered based on the `passthrough` setting.

- **passthrough**: Boolean indicating whether to pass through the image without rotation if the score is below the threshold (`true`) or to throw an warning (`false`) for an error

#### Example Configuration

```json
{
"name": "AutoRotate",

"options": {
"referenceImage": "./path/to/reference_image.png",

"markerDimensions": [100,150],

"threshold": {
"value": 100,

"passthrough": true
}
}
}
```

#### Notes

- Ensure that the `name` field is set to `"AutoRotate"` to activate the plugin.

- Provide the correct relative path (`referenceImage`) to your reference image.

- Adjust `markerDimensions` to match the dimensions of your reference image accurately.

- Configure `threshold` according to your application's requirements for acceptable match scores.

This README should guide you through configuring and using the AutoRotate plugin effectively with your JSON schema-based configuration files. Adjust parameters as necessary to achieve the desired automatic image rotation based on template matching with a reference image.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions samples/Autorotating-samples/bonus-marking-grouping/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"thresholding": {
"MIN_JUMP": 30
},
"outputs": {
"filter_out_multimarked_files": false,
"show_image_level": 0,
"show_preprocessors_diff": true
}
}
Loading

0 comments on commit 54fce46

Please sign in to comment.