first commit
This commit is contained in:
15
debug_boxes.py
Normal file
15
debug_boxes.py
Normal file
@@ -0,0 +1,15 @@
|
||||
"""Debug: save each detected box ROI as separate image."""
|
||||
import cv2
|
||||
import numpy as np
|
||||
import os
|
||||
from test_detect import find_boxes
|
||||
|
||||
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
image = cv2.imread(os.path.join(BASE_DIR, "test.png"))
|
||||
|
||||
boxes = find_boxes(image)
|
||||
for i, box in enumerate(boxes):
|
||||
roi = box["roi"]
|
||||
path = os.path.join(BASE_DIR, f"debug_box_{i}.png")
|
||||
cv2.imwrite(path, roi)
|
||||
print(f"Box {i}: bbox={box['bbox']}, area={box['area']}, saved to {path}")
|
||||
Reference in New Issue
Block a user