From 13d597dd3ce8366b11537901223fa9f16963ae87 Mon Sep 17 00:00:00 2001 From: Théo de la Hogue Date: Mon, 24 Apr 2023 17:35:35 +0200 Subject: Ignoring places out of field. --- src/argaze/ArUcoMarkers/ArUcoScene.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/argaze/ArUcoMarkers/ArUcoScene.py b/src/argaze/ArUcoMarkers/ArUcoScene.py index f5660dc..70ce236 100644 --- a/src/argaze/ArUcoMarkers/ArUcoScene.py +++ b/src/argaze/ArUcoMarkers/ArUcoScene.py @@ -613,7 +613,7 @@ class ArUcoScene(): cv.line(frame, tuple(axisPoints[3].ravel()), tuple(axisPoints[0].ravel()), (n,n,f), 6) # X (red) cv.line(frame, tuple(axisPoints[3].ravel()), tuple(axisPoints[1].ravel()), (n,f,n), 6) # Y (green) cv.line(frame, tuple(axisPoints[3].ravel()), tuple(axisPoints[2].ravel()), (f,n,n), 6) # Z (blue) - + # Draw place placePoints = (T + numpy.float32([R.dot([-l, -l, 0]), R.dot([l, -l, 0]), R.dot([l, l, 0]), R.dot([-l, l, 0])])).reshape(-1, 3) placePoints, _ = cv.projectPoints(placePoints, self._rotation, self._translation, numpy.array(K), numpy.array(D)) @@ -624,8 +624,6 @@ class ArUcoScene(): cv.line(frame, tuple(placePoints[2].ravel()), tuple(placePoints[3].ravel()), (f,f,f), 3) cv.line(frame, tuple(placePoints[3].ravel()), tuple(placePoints[0].ravel()), (f,f,f), 3) - except cv.error as e: - - print('ArUcoScene.draw_places: ', e) - print('T: ', T) - print('R: ', R) + # Ignore errors due to out of field places: their coordinate are larger than int32 limitations. + except cv.error: + pass -- cgit v1.1