EgoVideoStabilizer
1.0.0
|
Header functions for the sequence_processing.cpp. More...
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <omp.h>
#include <armadillo>
#include <opencv2/core/core.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/nonfree/nonfree.hpp>
#include <opencv2/calib3d/calib3d.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include "definitions/experiment_struct.h"
#include "file_operations.h"
Go to the source code of this file.
Functions | |
bool | findIntermediateHomographyMatrix (const int d, const int D, const int N, const cv::Mat &frame_i, const cv::Mat &frame_master_pre, const cv::Mat &frame_master_pos, cv::Mat &homography_matrix_result) |
Function that calculates the homography matrix that leave the frame_i to the intermediate plan between the plans of frame_master_pre and frame_master_pre with relation of the distance between them. More... | |
bool | findIntermediateHomographyMatrix (const int d, const int D, const int N, const cv::Mat &frame_i, const std::vector< cv::KeyPoint > &keypoints_master_pre, const std::vector< cv::KeyPoint > &keypoints_master_pos, const cv::Mat &descriptors_master_pre, const cv::Mat &descriptors_master_pos, cv::Mat &homography_matrix_result) |
Function that calculates the homography matrix that leave the frame_i to the intermediate plan between the frames related to the previous and posterior master, with respect to the distance between them. More... | |
bool | findIntermediateHomographyMatrix (const float s, const float S, const cv::Mat &frame_i, const std::vector< cv::KeyPoint > &keypoints_master_pre, const std::vector< cv::KeyPoint > &keypoints_master_pos, const cv::Mat &descriptors_master_pre, const cv::Mat &descriptors_master_pos, cv::Mat &homography_matrix_result) |
Function that calculates the homography matrix that leave the frame_i to the intermediate plan between the frames related to the previous and posterior master, with respect to the distance between them. More... | |
int | selectNewFrame (const int d, const int D, const int N, const int index, const int index_previous, const int index_posterior, const std::vector< cv::KeyPoint > &keypoints_master_pre, const std::vector< cv::KeyPoint > &keypoints_master_pos, const cv::Mat &descriptors_master_pre, const cv::Mat &descriptors_master_pos, const cv::Rect &crop_area, const EXPERIMENT &experiment_settings, cv::Mat &new_frame) |
Function that selects a new frame in the original video using the values of semantic information of the transition from the frame_src to the frame_dst calculted by MATLAB and saved in a CSV file, the area ratio of the iamge after apply the homography transformation and the RANSCAC inliers from the previous and posterior frames that compose the reduced video. More... | |
int | selectNewFrame (const float s, const float S, const int index, const int index_previous, const int index_posterior, const std::vector< cv::KeyPoint > &keypoints_master_pre, const std::vector< cv::KeyPoint > &keypoints_master_pos, const cv::Mat &descriptors_master_pre, const cv::Mat &descriptors_master_pos, const cv::Rect &crop_area, const EXPERIMENT &experiment_settings, cv::Mat &new_frame) |
Function that selects a new frame in the original video using the values of semantic information of the transition from the frame_src to the frame_dst calculted by MATLAB and saved in a CSV file, the area ratio of the iamge after apply the homography transformation and the RANSCAC inliers from the previous and posterior frames that compose the reduced video. More... | |
Header functions for the sequence_processing.cpp.
bool findIntermediateHomographyMatrix | ( | const int | d, |
const int | D, | ||
const int | N, | ||
const cv::Mat & | frame_i, | ||
const cv::Mat & | frame_master_pre, | ||
const cv::Mat & | frame_master_pos, | ||
cv::Mat & | homography_matrix_result | ||
) |
Function that calculates the homography matrix that leave the frame_i to the intermediate plan between the plans of frame_master_pre and frame_master_pre with relation of the distance between them.
d | - distance between the current frame and the previous master frame. |
D | - distance between previous master frame and the posterior master frame. |
N | - size of the segments. |
frame_i | - current image. |
frame_master_pre | - image of the previous master frame. |
frame_master_pos | - image of the posterior master frame. |
homography_matrix_result | - object to save the result homography matrix. |
bool
true - if there is enough points in both images and good matches between them to find a homography matrix. bool
false
- if there is not enough points in both images or good matches between them to find a homography matrix.d | - distance between the current frame and the previous master frame. |
D | - distance between previous master frame and the posterior master frame. |
N | - size of the segments. |
frame_i | - current frame. |
frame_master_pre | - image of the previous master frame. |
frame_master_pos | - image of the posterior master frame. |
homography_matrix_result | - object to save the result homography matrix. |
bool
true - if there is enough points in both images and good matches between them to find a homography matrix. bool
false
- if there is not enough points in both images or good matches between them to find a homography matrix.bool findIntermediateHomographyMatrix | ( | const int | d, |
const int | D, | ||
const int | N, | ||
const cv::Mat & | frame_i, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pre, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pos, | ||
const cv::Mat & | descriptors_master_pre, | ||
const cv::Mat & | descriptors_master_pos, | ||
cv::Mat & | homography_matrix_result | ||
) |
Function that calculates the homography matrix that leave the frame_i to the intermediate plan between the frames related to the previous and posterior master, with respect to the distance between them.
d | - distance between the current frame and the previous master frame. |
D | - distance between previous master frame and the posterior master frame. |
N | - size of the segments. |
frame_i | - current frame. |
keypoints_master_pre | - keypoints of the previous master. |
keypoints_master_pos | - keypoints of the posterior master. |
descriptors_master_pre | - descriptors of the previous master. |
descriptors_master_pos | - descriptors of the posterior master. |
homography_matrix_result | - object to save the result homography matrix. |
bool
true - if there is enough points in both images and good matches between them to find a homography matrix. bool
false
- if there is not enough points in both images or good matches between them to find a homography matrix.bool findIntermediateHomographyMatrix | ( | const float | s, |
const float | S, | ||
const cv::Mat & | frame_i, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pre, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pos, | ||
const cv::Mat & | descriptors_master_pre, | ||
const cv::Mat & | descriptors_master_pos, | ||
cv::Mat & | homography_matrix_result | ||
) |
Function that calculates the homography matrix that leave the frame_i to the intermediate plan between the frames related to the previous and posterior master, with respect to the distance between them.
d | - frame shift value between the previous master frame and the current frame. |
D | - frame shift between previous master frame and the posterior master frame. |
frame_i | - current frame. |
keypoints_master_pre | - keypoints of the previous master. |
keypoints_master_pos | - keypoints of the posterior master. |
descriptors_master_pre | - descriptors of the previous master. |
descriptors_master_pos | - descriptors of the posterior master. |
homography_matrix_result | - object to save the result homography matrix. |
bool
true - if there is enough points in both images and good matches between them to find a homography matrix. bool
false
- if there is not enough points in both images or good matches between them to find a homography matrix.s | - frame shift value between the previous master frame and the current frame. |
S | - frame shift between previous master frame and the posterior master frame. |
frame_i | - current frame. |
keypoints_master_pre | - keypoints of the previous master. |
keypoints_master_pos | - keypoints of the posterior master. |
descriptors_master_pre | - descriptors of the previous master. |
descriptors_master_pos | - descriptors of the posterior master. |
homography_matrix_result | - object to save the result homography matrix. |
bool
true - if there is enough points in both images and good matches between them to find a homography matrix. bool
false
- if there is not enough points in both images or good matches between them to find a homography matrix.int selectNewFrame | ( | const int | d, |
const int | D, | ||
const int | N, | ||
const int | index, | ||
const int | index_previous, | ||
const int | index_posterior, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pre, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pos, | ||
const cv::Mat & | descriptors_master_pre, | ||
const cv::Mat & | descriptors_master_pos, | ||
const cv::Rect & | crop_area, | ||
const EXPERIMENT & | experiment_settings, | ||
cv::Mat & | new_frame | ||
) |
Function that selects a new frame in the original video using the values of semantic information of the transition from the frame_src to the frame_dst calculted by MATLAB and saved in a CSV file, the area ratio of the iamge after apply the homography transformation and the RANSCAC inliers from the previous and posterior frames that compose the reduced video.
d | - distance between the current frame and the previous master frame. |
D | - distance between previous master frame and the posterior master frame. |
N | - size of the segments. |
index | - index of the frame that will be replaced. |
index_previous | - index of the last frame in the reduced video. |
index_posterior | - index of the next frame in the reduced video. |
image_master_previous | - image with the master previous |
image_master_posterior | - image with the master posterior |
crop_area | - crop area of the video. |
experiment_settings | - experiment settings struct. |
new_frame | - image that will receive the new selected frame. |
int
- returns the index of the new selected frame.int selectNewFrame | ( | const float | s, |
const float | S, | ||
const int | index, | ||
const int | index_previous, | ||
const int | index_posterior, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pre, | ||
const std::vector< cv::KeyPoint > & | keypoints_master_pos, | ||
const cv::Mat & | descriptors_master_pre, | ||
const cv::Mat & | descriptors_master_pos, | ||
const cv::Rect & | crop_area, | ||
const EXPERIMENT & | experiment_settings, | ||
cv::Mat & | new_frame | ||
) |
Function that selects a new frame in the original video using the values of semantic information of the transition from the frame_src to the frame_dst calculted by MATLAB and saved in a CSV file, the area ratio of the iamge after apply the homography transformation and the RANSCAC inliers from the previous and posterior frames that compose the reduced video.
s | - frame shift value between the previous master frame and the current frame. |
S | - frame shift between previous master frame and the posterior master frame. |
index | - index of the frame that will be replaced. |
index_previous | - index of the last frame in the reduced video. |
index_posterior | - index of the next frame in the reduced video. |
image_master_previous | - image with the master previous |
image_master_posterior | - image with the master posterior |
crop_area | - crop area of the video. |
experiment_settings | - experiment settings struct. |
new_frame | - image that will receive the new selected frame. |
int
- returns the index of the new selected frame.