Closed nlyubova closed 9 years ago
I wonder if you know why the texture of the coke.obj model used in the Tutorials does not appear during training when I turn on LINEMOD_VIZ_IMG... Relevant code (for visualization):
#if LINEMOD_VIZ_IMG
// Display the rendered image
if (*visualize_)
{
cv::namedWindow("Rendering");
if (!image.empty()) {
cv::imshow("Rendering", image);
cv::waitKey(1);
}
}
#endif
I would like to use texture (including color) to improve detection of some objects...
Alberto.
In line 212 of linemod_train.cpp, addTemplate() might return -1. This turns the indexes of the poses of the templates saved in the database out of sync with the id of the detected objects. This typically shows up in rviz as not properly oriented object detections. To correct the problem I suggest changing this peace of code:
detector_->addTemplate(sources, "object1", mask);
// Also store the pose of each template
Rs_->push_back(cv::Mat(R));
Ts_->push_back(cv::Mat(T));
distances_->push_back(distance);
Ks_->push_back(cv::Mat(K));
to that one:
int template_in = detector_->addTemplate(sources, "object1", mask);
if (template_in == -1)
{
// Delete the status
for (size_t j = 0; j < status.str().size(); ++j)
std::cout << '\b';
continue;
}
// Also store the pose of each template
Rs_->push_back(cv::Mat(R));
Ts_->push_back(cv::Mat(T));
distances_->push_back(distance);
Ks_->push_back(cv::Mat(K));
Alberto.
@nlyubova any input on the comments ?
Great! Thank's. Alberto.