intel / ros2_grasp_library

https://intel.github.io/ros2_grasp_library
Apache License 2.0
186 stars 43 forks source link

PoseEstimator::imageCB_ARUCO does not use refined corner #69

Closed atinfinity closed 4 years ago

atinfinity commented 4 years ago

The PoseEstimator::imageCB_ARUCO uses cv::aruco::refineDetectedMarkers to refine detected corners. But, this method does not use refined corner.

std::vector<std::vector<cv::Point2f>> corners;
cv::aruco::detectMarkers(cv_ptr->image, dictionary, corners, ids);

if (ids.size() > 0)
{
  cv::Mat imageColor;
  cv::cvtColor(cv_ptr->image, imageColor, cv::COLOR_GRAY2RGB);
  std::vector<std::vector<cv::Point2f>> rejectedCorners;
  cv::aruco::refineDetectedMarkers(cv_ptr->image, board, corners, ids, rejectedCorners, camera_matrix_,
                                   dist_coeffs_);
  cv::aruco::drawDetectedMarkers(imageColor, corners, ids);

  // Estimate the pose of aruco board
  cv::Vec3d rvect, tvect;
  int valid = cv::aruco::estimatePoseBoard(corners, ids, board, camera_matrix_, dist_coeffs_, rvect, tvect);
atinfinity commented 4 years ago

Sorry, I misunderstood. I closed this issue.