EgoVideoStabilizer  1.0.0
homography.h
Go to the documentation of this file.
1 //
4 // SemanticFastForward_EPIC@ECCVW is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // SemanticFastForward_JVCI is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with SemanticFastForward_EPIC@ECCVW. If not, see <http://www.gnu.org/licenses/>.
16 //
18 
26 #ifndef HOMOGRAPHY_H
27 #define HOMOGRAPHY_H
28 
29 #include <stdio.h>
30 #include <iostream>
31 
32 #include <opencv2/core/core.hpp>
33 #include <opencv2/features2d/features2d.hpp>
34 #include <opencv2/highgui/highgui.hpp>
35 #include <opencv2/nonfree/nonfree.hpp>
36 #include <opencv2/calib3d/calib3d.hpp>
37 #include <opencv2/imgproc/imgproc.hpp>
38 
39 #include "definitions/define.h"
40 
48  };
49 
65 bool findHomographyMatrix ( const cv::Mat &image_src , const cv::Mat &image_dst , cv::Mat &homography_matrix, cv::Mat &ransac_mask ) ;
66 
81 bool findHomographyMatrix ( const cv::Mat &image_src , const cv::Mat &image_dst , cv::Mat &homography_matrix ) ;
82 
100 bool findHomographyMatrix( const std::vector<cv::KeyPoint> &keypoints_image_src, const std::vector<cv::KeyPoint> &keypoints_image_dst,
101  const cv::Mat &descriptors_image_src, const cv::Mat &descriptors_image_dst,
102  cv::Mat &homography_matrix, cv::Mat &ransac_mask );
103 
120 bool findHomographyMatrix(const std::vector<cv::KeyPoint> &keypoints_image_src, const std::vector<cv::KeyPoint> &keypoints_image_dst,
121  const cv::Mat &descriptors_image_src, const cv::Mat &descriptors_image_dst,
122  cv::Mat &homography_matrix);
123 
138 bool applyHomographyMatrix ( const cv::Mat &image_src , const cv::Mat &homography_matrix , cv::Mat &image_result ) ;
139 
157 bool checkHomographyConsistency ( const std::vector<cv::Point2f> img_corners , const cv::Mat &homography_matrix ) ;
158 
175 bool checkHomographyConsistency ( const std::vector<cv::Point2f> new_img_corners );
176 
190 double getAreaRatio ( const cv::Mat& image_src, const cv::Mat& homography_matrix, const cv::Rect& frame_limits );
191 
204 HomogCoverage getHomogCoverage ( const cv::Mat& image_src, const cv::Mat& homography_matrix, const cv::Rect& drop_area, const cv::Rect& crop_area);
205 
216 void getKeypointsAndDescriptors( const cv::Mat &image, std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors );
217 
218 #endif // HOMOGRAPHY_H
HomogCoverage
The HomogCoverage enum.
Definition: homography.h:44
Definition: homography.h:45
void getKeypointsAndDescriptors(const cv::Mat &image, std::vector< cv::KeyPoint > &keypoints, cv::Mat &descriptors)
Function that gets the keypoints and describe an image in order to avoid unnecessary computations for...
Definition: homography.cpp:604
double getAreaRatio(const cv::Mat &image_src, const cv::Mat &homography_matrix, const cv::Rect &frame_limits)
Function that calculates the loss(%) of the homography transformation in a ROI.
Definition: homography.cpp:523
It covers the drop area, but doesn&#39;t cover the crop area.
Definition: homography.h:47
HomogCoverage getHomogCoverage(const cv::Mat &image_src, const cv::Mat &homography_matrix, const cv::Rect &drop_area, const cv::Rect &crop_area)
Function that calculates the loss(%) of the homography transformation in a ROI.
Definition: homography.cpp:556
bool checkHomographyConsistency(const std::vector< cv::Point2f > img_corners, const cv::Mat &homography_matrix)
Function that checks if after made the homography transformation the corner consistency is maintained...
Definition: homography.cpp:463
bool applyHomographyMatrix(const cv::Mat &image_src, const cv::Mat &homography_matrix, cv::Mat &image_result)
Function that apply homography matrix in a given image.
Definition: homography.cpp:400
It can&#39;t cover neither the drop area nor the crop area.
Definition: homography.h:46
bool findHomographyMatrix(const cv::Mat &image_src, const cv::Mat &image_dst, cv::Mat &homography_matrix, cv::Mat &ransac_mask)
Function that find the homography matrix that leave the imageSrc to the plan of the imageDst...
Definition: homography.cpp:48
Macros used in the code relate with debug/view flags and usual values.