Some small updates.

This commit is contained in:
Daniel
2025-02-03 17:19:02 +01:00
parent b41380b033
commit 3eb7696e31
4 changed files with 12 additions and 9 deletions

View File

@ -67,4 +67,4 @@ services:
- DISPLAY
- QT_X11_NO_MITSHM=1
- "PYTHONUNBUFFERED=1"
command: /bin/bash -i -c 'sleep 2 && export ROS_DOMAIN_ID=18 && ros2 run image_view image_view --ros-args --remap image:=/camera01/img_with_pose -p autosize:=True -p window_name:=MyImage'
command: /bin/bash -i -c 'sleep 2 && export ROS_DOMAIN_ID=18 && ros2 run image_view image_view --ros-args --remap image:=/camera01/img_with_pose -p autosize:=True -p window_name:=MyPoseImage'

View File

@ -1,5 +1,4 @@
import json
import os
import sys
import threading
import time
@ -13,10 +12,6 @@ from rclpy.qos import QoSHistoryPolicy, QoSProfile, QoSReliabilityPolicy
from sensor_msgs.msg import Image
from std_msgs.msg import String
filepath = os.path.dirname(os.path.realpath(__file__)) + "/"
sys.path.append(filepath + "../../../../scripts/")
import utils_pipeline
from skelda import utils_view
# ==================================================================================================
@ -36,13 +31,21 @@ lock = threading.Lock()
# ==================================================================================================
def bayer2rgb(bayer):
img = cv2.cvtColor(bayer, cv2.COLOR_BayerBG2RGB)
return img
# ==================================================================================================
def callback_images(image_data):
global last_input_image, lock
# Convert into cv images from image string
if image_data.encoding == "bayer_rggb8":
bayer_image = bridge.imgmsg_to_cv2(image_data, "bayer_rggb8")
color_image = utils_pipeline.bayer2rgb(bayer_image)
color_image = bayer2rgb(bayer_image)
elif image_data.encoding == "mono8":
gray_image = bridge.imgmsg_to_cv2(image_data, "mono8")
color_image = cv2.cvtColor(gray_image, cv2.COLOR_GRAY2RGB)

View File

@ -689,7 +689,7 @@ std::tuple<std::vector<cv::Mat>, std::vector<cv::Mat>> TriangulatorInternal::pro
const cv::Mat &body3D = bodies3D[i];
// Extract coordinates
const cv::Mat points3d = body3D.colRange(0, 3);
const cv::Mat &points3d = body3D.colRange(0, 3);
// Project from world to camera coordinate system
cv::Mat xyz = (points3d - T_repeated) * R_transposed;

View File

@ -60,7 +60,7 @@ std::vector<cv::Mat> load_images(json &item)
}
// Convert image format to Bayer encoding to simulate real camera input
// This also resulted in notably better MPJPE results in most cases, presumbly since the
// This also resulted in notably better MPJPE results in most cases, presumably since the
// demosaicing algorithm from OpenCV is better than the default one from the cameras
for (size_t i = 0; i < images.size(); i++)
{