translationsmatchview.hpp 2.24 KB
Newer Older
1 2 3 4 5
#ifndef CVVISUAL_TRANLSATION_MATCH_VIEW
#define CVVISUAL_TRANLSATION_MATCH_VIEW

#include <vector>

Maksim Shabunin's avatar
Maksim Shabunin committed
6 7
#include "opencv2/core.hpp"
#include "opencv2/features2d.hpp"
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92

#include "../qtutil/matchview/matchmanagement.hpp"
#include "../qtutil/matchview/keypointmanagement.hpp"
#include "match_view.hpp"
namespace cvv
{
namespace view
{
/**
 * @brief this view shows the matches as tranlations line/arrows.
 *
 */

class TranslationMatchView : public MatchView
{

	Q_OBJECT
      public:
	/**
	 * @brief the constructor
	 * @param lefKeyPoints (queryindx) the keypoint from the left image
	 * @param rightKeyPoint (trainIdx/imIdx) the keypoints from the right
	 *Image
	 * @param matches the matches between the images
	 * @param usetrainIdx if true the trainIdx will be taken for
	 *rightKeyPoint if false
	 *	the imIdx will be taken
	 * @param parent the parent widget
	 */
	TranslationMatchView(std::vector<cv::KeyPoint> leftKeyPoints,
			     std::vector<cv::KeyPoint> rightKeyPoints,
			     std::vector<cv::DMatch> matches, cv::Mat leftIm,
			     cv::Mat rightIm, bool usetrainIdx = true,
			     QWidget *parent = nullptr);

	/**
	 * @brief Short constructor.
	 * @param call from which the data for the view is taken.
	 * @param parent of this QWidget.
	 */
	TranslationMatchView(const impl::MatchCall &call,
			     QWidget *parent = nullptr)
	    : TranslationMatchView{
		      call.keyPoints1(), call.keyPoints2(),
		      call.matches(),    call.img1(),
		      call.img2(),       call.usesTrainDescriptor(),
		      parent
}
	{}

	virtual std::vector<cv::DMatch> getMatchSelection() override
	{
		return matchManagment_->getCurrentSelection();
	}

	virtual std::vector<cv::KeyPoint> getKeyPointSelection()
	{
		return keyManagment_->getCurrentSelection();
	}

public slots:

	virtual void setMatchSelection(std::vector<cv::DMatch> selection)
	{
		matchManagment_->setSelection(selection);
	}

	virtual void setKeyPointSelection(std::vector<cv::KeyPoint> selection)
	{
		keyManagment_->setSelection(selection);
	}

private slots:

	void updateMousHoverOver(QPointF pt,QString str,bool){
		emit updateRightFoooter(QString("%1/%2 RGB:%3").arg(pt.x()).arg(pt.y()).arg(str));
	}

private:
	qtutil::MatchManagement *matchManagment_;
	qtutil::KeyPointManagement *keyManagment_;
};
}
}
#endif