Provide tools to track the presence of a target. More...
#include <target.h>
Public Member Functions | |
bool | detect (cv::Mat cam_descriptors, std::vector< cv::KeyPoint > &cam_keypoints, std::vector< cv::DMatch > &good_matches, std::vector< int > &idxs_to_remove, std::vector< cv::Point2f > &target_coord) |
void | draw (cv::Mat cam_img, std::vector< cv::KeyPoint > cam_keypoints, std::vector< cv::DMatch > good_matches, cv::Mat &img_matches) |
bool | init (const std::string relative_path) |
initializer | |
void | position (std::vector< cv::KeyPoint > cam_keypoints, std::vector< cv::DMatch > good_matches, std::vector< cv::Point2f > &coord) |
This method computes the position of the target on the camera image. | |
Target () | |
Constructor. | |
~Target () | |
Destructor. | |
Private Attributes | |
std::vector< cv::Point2f > | centerAndCorners |
target keypoints descriptors | |
cv::Mat | descriptors |
keypoints detected on the target picture | |
cv::Mat | image |
std::vector< cv::KeyPoint > | keypoints |
Picture of the target as read at $TARGET_RELPATH$. | |
cv::FlannBasedMatcher | matcher |
Target::Target | ( | ) |
Constructor.
wrapper object to the FLANN library to perform matching with the video pictures
Definition at line 19 of file target.cpp.
Target::~Target | ( | ) |
Destructor.
Definition at line 26 of file target.cpp.
bool Target::detect | ( | cv::Mat | cam_descriptors, |
std::vector< cv::KeyPoint > & | cam_keypoints, | ||
std::vector< cv::DMatch > & | good_matches, | ||
std::vector< int > & | idxs_to_remove, | ||
std::vector< cv::Point2f > & | target_coord | ||
) |
This method detects the target in a given picture
[in] | cam_descriptors | The desciptors of keypoints in camera picture |
[in] | cam_keypoints | The coordinates of keypoints in camera picture |
[out] | good_matches | The good matches between the target picture and the camera picture, in OpenCV format |
[out] | idxs_to_remove | A list of indexes of keypoints on the target |
[out] | target_coord | The coordinates if the target is detected |
[in] | pose | (#ifdef DEBUG_PROJECTION) Pose of the drone estimated with |
[in] | image_cam | (#ifdef DEBUG_TARGET) image matrix (OpenCV format) |
Definition at line 75 of file target.cpp.
void Target::draw | ( | cv::Mat | cam_img, |
std::vector< cv::KeyPoint > | cam_keypoints, | ||
std::vector< cv::DMatch > | good_matches, | ||
cv::Mat & | img_matches | ||
) |
This method draws a green frame to indicate the detected target
[in] | cam_img | image matrix (OpenCV format) |
Definition at line 230 of file target.cpp.
bool Target::init | ( | const std::string | relative_path | ) |
initializer
Definition at line 30 of file target.cpp.
void Target::position | ( | std::vector< cv::KeyPoint > | cam_keypoints, |
std::vector< cv::DMatch > | good_matches, | ||
std::vector< cv::Point2f > & | coord | ||
) |
This method computes the position of the target on the camera image.
Definition at line 273 of file target.cpp.
std::vector< cv::Point2f > Target::centerAndCorners [private] |
cv::Mat Target::descriptors [private] |
cv::Mat Target::image [private] |
std::vector< cv::KeyPoint > Target::keypoints [private] |
cv::FlannBasedMatcher Target::matcher [private] |