Skip to content

Free Motion Capture for Everyone πŸ’€βœ¨

TypeScript

Merge branch 'endurance/dev_branch' of C:\Users\jonma\Dropbox\GitKrakenRepos\freemocap with conflicts.

Jonc9b19db77ccc
diff --git a/src/core_processor/board_detection/detect.py b/src/core_processor/board_detection/detect.py
index cfa31d01..eeaa1cbe 100644
--- a/src/core_processor/board_detection/detect.py
+++ b/src/core_processor/board_detection/detect.py
@@ -9,6 +9,9 @@ from aiomultiprocess.types import Queue
from src.core_processor.processor import ImagePayload
+from rich import inspect
+
+
aruco_dict = cv2.aruco.Dictionary_get(cv2.aruco.DICT_4X4_250)
charuco_length = 7
charuco_width = 5
@@ -27,16 +30,20 @@ class BoardDetection:
async def process(self, queue: Queue):
logger = logging.getLogger(__name__)
while True:
- message: ImagePayload = ImagePayload(frames=[])
+ message = None
try:
message = queue.get(timeout=1) # type: ImagePayload
except Exception as e:
pass
+ print('got message from the queue')
if not message:
continue
- for f in message.frames:
+ frames = message.frames
+
+ for f in frames:
+ print(f'got image of shape {f.image.shape}')
charuco_corners, charuco_ids, aruco_square_corners, aruco_square_ids = self.detect_charuco_board(f.image)
cv2.polylines(f.image, np.int32([charuco_corners]), True, (0,100,255), 2)
cv2.imshow(str(f.port_number), f.image)
@@ -44,6 +51,7 @@ class BoardDetection:
if exit_key == 27:
break
+
def detect_charuco_board(self, image):
"""
Charuco base pose estimation.
diff --git a/src/core_processor/processor.py b/src/core_processor/processor.py
index 8c141a75..d2b7f7ca 100644
--- a/src/core_processor/processor.py
+++ b/src/core_processor/processor.py
@@ -15,6 +15,7 @@ def create_opencv_cams():
cv_cams = [
OpenCVCamera(port_number=webcam.port_number)
for webcam in raw_webcam_obj
+ if int(webcam.port_number) < 3
]
for cv_cam in cv_cams:
cv_cam.connect()
@@ -47,12 +48,12 @@ class CameraCaptureProcess:
cv_cams = create_opencv_cams()
_queue = queue
_logger = logging.getLogger(__name__)
-
+ _logger.info("Beginning Camera Capture Process")
while True:
image_list: List[FramePayload] = []
for cv_cam in cv_cams:
success, image, timestamp = cv_cam.get_next_frame()
-
+
if not success:
continue
if image is None:
@@ -64,7 +65,8 @@ class CameraCaptureProcess:
timestamp=timestamp
)
)
+
_queue.put(
ImagePayload(frames=image_list)
)
- _logger.info("Im printing stuff")
+