From 894fa2dc09912bd67c1e0ffec2835a99b81c0532 Mon Sep 17 00:00:00 2001
From: Sergi Hernandez Juan <shernand@iri.upc.edu>
Date: Wed, 4 Aug 2021 19:50:55 +0200
Subject: [PATCH] Modified also the camera matrix (K) with the new image
 center.

---
 src/image_roi_alg_node.cpp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/image_roi_alg_node.cpp b/src/image_roi_alg_node.cpp
index d079d86..51051d4 100644
--- a/src/image_roi_alg_node.cpp
+++ b/src/image_roi_alg_node.cpp
@@ -90,6 +90,7 @@ void ImageRoiAlgNode::image_in_callback(const sensor_msgs::Image::ConstPtr& msg,
   new_info.height=roi_rect.height;
   new_info.width=roi_rect.width;
   new_info.P[6]=roi_rect.height/2.0;
+  new_info.K[5]=roi_rect.height/2.0;
   this->image_out_Image_msg_.height=roi_rect.height;
   this->image_out_Image_msg_.width=roi_rect.width;
   this->image_out_publisher_.publish(this->image_out_Image_msg_,new_info);
-- 
GitLab