Use cv.putext for status
This commit is contained in:
@@ -137,13 +137,15 @@ class Detector(abc.ABC):
|
|||||||
for det in self.detector:
|
for det in self.detector:
|
||||||
det.calibration_clear()
|
det.calibration_clear()
|
||||||
|
|
||||||
|
y_pos = 30
|
||||||
for det in self.detector:
|
for det in self.detector:
|
||||||
success, r_vec, t_vec = det.process(img)
|
success, r_vec, t_vec = det.process(img)
|
||||||
if success:
|
if success:
|
||||||
r_vec_obj, _ = to_board_pose_euler(r_vec, t_vec)
|
r_vec_obj, _ = to_board_pose_euler(r_vec, t_vec)
|
||||||
rot = [round(180.0 / math.pi * v, 1) for v in r_vec_obj]
|
rot = [round(180.0 / math.pi * v, 1) for v in r_vec_obj]
|
||||||
print("\r ", end='')
|
cv.putText(img, f"{det}: Tilt: {rot[0]:.1f}, Roll: {rot[1]:.1f}, Azimuth: {rot[2]:.1f}",
|
||||||
print(f"\r{det}: Tilt: {rot[0]:.1f}, Roll: {rot[1]:.1f}, Azimuth: {rot[2]:.1f}", end='')
|
(30, y_pos), cv.FONT_HERSHEY_SIMPLEX, 0.75, (0, 255, 0), 2)
|
||||||
|
y_pos += 30
|
||||||
|
|
||||||
img_scaled = cv.resize(img, dsize=None, fx=0.5, fy=0.5)
|
img_scaled = cv.resize(img, dsize=None, fx=0.5, fy=0.5)
|
||||||
cv.imshow('img', img_scaled)
|
cv.imshow('img', img_scaled)
|
||||||
|
|||||||
Reference in New Issue
Block a user