Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

image_node_b exception #8

Open
lishuaijielsj opened this issue Jan 14, 2021 · 5 comments
Open

image_node_b exception #8

lishuaijielsj opened this issue Jan 14, 2021 · 5 comments

Comments

@lishuaijielsj
Copy link

定义投影函数

void project(cv::Point2f& pt, cv::Mat const& K)                                                                                                                                                        
 {                                                                                                                                                                                                      
     pt.x = K.at<float>(0, 0) * pt.x + K.at<float>(0, 2);                                                                                                                                               
     pt.y = K.at<float>(1, 1) * pt.y + K.at<float>(1, 2);                                                                                                                                               
 }   

cv::Point startPoint = cv::Point(line_feature_msg->channels[3].values[i], line_feature_msg->channels[4].values[i]);

在image_node_b.cpp 64行需要进行投影, 并且起止点的存储位置也需要修改, 否则会抛exception

cv::Point2f startPoint = cv::Point2f(line_feature_msg->points[i].x, line_feature_msg->points[i].y);                                                                                            
project(startPoint, K_);                                                                                                                                                                       
cv::Point2f endPoint = cv::Point2f(line_feature_msg->channels[1].values[i], line_feature_msg->channels[2].values[i]);                                                                          
project(endPoint, K_);   
@JaySlamer
Copy link

我猜测代码中linefeature_tracker_node的版本是一个早期版本,只发布了归一化坐标。应该存在一个更晚期的版本,将linefeature的startpoint和endpoint的像素坐标发布在channels[3]、channels[4]、channels[5]、channels[6].
@cnqiangfu

@cnqiangfu
Copy link
Owner

我猜测代码中linefeature_tracker_node的版本是一个早期版本,只发布了归一化坐标。应该存在一个更晚期的版本,将linefeature的startpoint和endpoint的像素坐标发布在channels[3]、channels[4]、channels[5]、channels[6].
@cnqiangfu

您说的对,谢谢。

@YoungHaulk
Copy link

定义投影函数

void project(cv::Point2f& pt, cv::Mat const& K)                                                                                                                                                        
 {                                                                                                                                                                                                      
     pt.x = K.at<float>(0, 0) * pt.x + K.at<float>(0, 2);                                                                                                                                               
     pt.y = K.at<float>(1, 1) * pt.y + K.at<float>(1, 2);                                                                                                                                               
 }   

cv::Point startPoint = cv::Point(line_feature_msg->channels[3].values[i], line_feature_msg->channels[4].values[i]);

在image_node_b.cpp 64行需要进行投影, 并且起止点的存储位置也需要修改, 否则会抛exception

cv::Point2f startPoint = cv::Point2f(line_feature_msg->points[i].x, line_feature_msg->points[i].y);                                                                                            
project(startPoint, K_);                                                                                                                                                                       
cv::Point2f endPoint = cv::Point2f(line_feature_msg->channels[1].values[i], line_feature_msg->channels[2].values[i]);                                                                          
project(endPoint, K_);   

Successfully solved the problem, thanks!

@Yan-0-0-Ye
Copy link

我定义了重投影函数,并添加了
cv::Point2f startPoint = cv::Point2f(line_feature_msg->points[i].x, line_feature_msg->points[i].y);
project(startPoint, K_);
cv::Point2f endPoint = cv::Point2f(line_feature_msg->channels[1].values[i], line_feature_msg->channels[2].values[i]);
project(endPoint, K_);
并将 下面两行注释了
cv::Point startPoint = cv::Point(line_feature_msg->channels[3].values[i], line_feature_msg->channels[4].values[i]);
cv::Point endPoint = cv::Point(line_feature_msg->channels[5].values[i], line_feature_msg->channels[6].values[i]);

而且yaml文件我也改成了绝对路径,但是还没能解决tricking图像不显示的问题

@huyating99
Copy link

感谢,问题解决

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants