fix colors
This commit is contained in:
@@ -103,13 +103,13 @@ def detect_checks_and_notes(output_dir):
|
||||
actions.append(box)
|
||||
# It's checked, so we mask this area out for manual notes
|
||||
# Expand mask slightly to catch sloppy ticks
|
||||
mask_draw.rectangle([x1-5, y1-5, x2+5, y2+5], fill=0)
|
||||
mask_draw.rectangle([x1-15, y1-15, x2+15, y2+15], fill=0)
|
||||
else:
|
||||
mask_draw.rectangle([x1-2, y1-2, x2+2, y2+2], fill=0)
|
||||
|
||||
if box["type"] == "score" and box["value"] == 0.0:
|
||||
# Mask the whole line
|
||||
mask_draw.rectangle([0, y1-5, ref_img.width, y2+5], fill=0)
|
||||
mask_draw.rectangle([0, y1-10, ref_img.width, y2+10], fill=0)
|
||||
|
||||
# --- Extraction Phase ---
|
||||
|
||||
@@ -290,6 +290,8 @@ def apply_actions_and_regenerate(root_dir, data, student_id, actions, notes_laye
|
||||
full_img.save(os.path.join(output_dir, "Concat.jpg"))
|
||||
print(f" Saved regenerated Concat.jpg")
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print("Usage: python reading_annotations.py <Dir>")
|
||||
|
||||
Reference in New Issue
Block a user