EgoVideoStabilizer  1.0.0
image_reconstruction.cpp File Reference

Functions related with reconstruction of the image after application of the homography matrix to fill the whole frame boundaries. More...

Include dependency graph for image_reconstruction.cpp:

Functions

bool checkImageBoundaries (const cv::Mat &image, const cv::Rect &frame_boundaries)
 Function that verify if the image fill all the frame limite given by the rect boundaries. More...
 
bool checkImageBoundariesMask (const cv::Mat &image_mask, const cv::Rect &frame_boundaries)
 Function that verify if the image_mask fill all the frame limite given by the rect boundaries. More...
 
bool warpMaskCrop (const cv::Mat &image_to_warp, const cv::Mat &image_fixed, const cv::Mat &image_fixed_mask, cv::Mat &image_result, cv::Mat &image_result_mask)
 Function that warps the image_to_warp with the image image_fixed and save the result into de image_result and then the resut is cropped into the original image area. More...
 
bool warpMask (const cv::Mat &image_to_warp, const cv::Mat &image_fixed, const cv::Mat &image_fixed_mask, cv::Mat &image_result, cv::Mat &image_result_mask)
 Function that warps the image_to_warp with the image image_fixed and save the result into de image_result. More...
 
bool warp (const cv::Mat &image_to_warp, const cv::Mat &image_fixed, cv::Mat &image_result)
 Function that warps the image_to_warp with the image image_fixed and save the result into de image_result. More...
 
bool imageReconstruction (const cv::Mat &image, const int index, const EXPERIMENT &experiment_settings, const cv::Rect &frame_boundaries, cv::Mat &reconstructed_image)
 Function that reconstructs an image using panorama based on homography in a image sequence. More...
 
bool reconstructImage (const cv::Mat &image, const cv::Mat &homography_matrix, const int index, const EXPERIMENT &experiment_settings, const cv::Rect &drop_boundaries, const cv::Rect &frame_boundaries, cv::Mat &reconstructed_image)
 Function that reconstructs an image using panorama based on homography in a image sequence. More...
 

Detailed Description

Functions related with reconstruction of the image after application of the homography matrix to fill the whole frame boundaries.

Functions to check the frame boundaries. Warp images to increase the image area. Reconstruction the image using frame from the original video.

Function Documentation

bool checkImageBoundaries ( const cv::Mat &  image,
const cv::Rect &  frame_boundaries 
)

Function that verify if the image fill all the frame limite given by the rect boundaries.

Parameters
image- image that will be checked.
frame_boundaries- area where the image should fill.
Returns
bool true - if the image fill all the frame limit.
bool false - if the image does not fill all the frame limit.
Author
Michel Melo da Silva
Date
14/04/2016
bool checkImageBoundariesMask ( const cv::Mat &  image_mask,
const cv::Rect &  frame_boundaries 
)

Function that verify if the image_mask fill all the frame limite given by the rect boundaries.

Parameters
image_mask- mask of the image to be checked.
frame_boundaries- area where the image should fill.
Returns
bool true - if the image fill all the frame limit.
bool false - if the image does not fill all the frame limit.
Author
Michel Melo da Silva
Date
03/05/2016
bool imageReconstruction ( const cv::Mat &  image,
const int  index,
const EXPERIMENT experiment_settings,
const cv::Rect &  frame_boundaries,
cv::Mat &  reconstructed_image 
)

Function that reconstructs an image using panorama based on homography in a image sequence.

Parameters
image- image initial with homography transformation.
index- index of the initial image in the original video.
experiment_settings- object with the experiment settings.
frame_boundaries- limits of the frame that needs to be filled by the reconstructed image.
reconstructed_image- object to save the final reconstructed image.
Returns
bool true - if the frame was successful reconstructed filling all the frame limit.
bool false - if the frame was not successful reconstructed filling all the frame limit.
Author
Michel Melo da Silva
Date
14/04/2016
bool reconstructImage ( const cv::Mat &  image,
const cv::Mat &  homography_matrix,
const int  index,
const EXPERIMENT experiment_settings,
const cv::Rect &  drop_boundaries,
const cv::Rect &  frame_boundaries,
cv::Mat &  reconstructed_image 
)

Function that reconstructs an image using panorama based on homography in a image sequence.

Parameters
image- image initial without homography transformation.
homography_matrix- homography matrix that will be applied to the original image where the reconstruct will start.
index- index of the initial image in the original video.
experiment_settings- object with the experiment settings.
frame_boundaries- limits of the frame that needs to be filled by the reconstructed image.
reconstructed_image- object to save the final reconstructed image.
Returns
bool true - if the frame was successful reconstructed filling all the frame limit.
bool false - if the frame was not successful reconstructed filling all the frame limit.
Author
Michel Melo da Silva
Date
14/04/2016
bool warp ( const cv::Mat &  image_to_warp,
const cv::Mat &  image_fixed,
cv::Mat &  image_result 
)

Function that warps the image_to_warp with the image image_fixed and save the result into de image_result.

Parameters
image_to_warp- image to warp.
image_fixed- image fixed that will be in the first plane.
image_result- object to save the result image.
Returns
bool true - if the corner consistency is maintained after application of the homography matrix found to warp the image. It also returns false if is not found a homography matrix between the images.
bool false - if the consistency is not maintained after application of the homography matrix found to warp the image. In this case the imageResult is a simple copy of the imageFixed.
Author
Michel Melo da Silva
Date
14/11/2015
bool warpMask ( const cv::Mat &  image_to_warp,
const cv::Mat &  image_fixed,
const cv::Mat &  image_fixed_mask,
cv::Mat &  image_result,
cv::Mat &  image_result_mask 
)

Function that warps the image_to_warp with the image image_fixed and save the result into de image_result.

Parameters
image_to_warp- image to warp.
image_fixed- image fixed that will be in the first plane.
image_fixed_mask- mask of the fixed mask.
image_result- object to save the result image.
image_result_mask- objecto to save the mask of the result image.
Returns
bool true - if the corner consistency is maintained after application of the homography matrix found to warp the image. It also returns false if is not found a homography matrix between the images.
bool false - if the consistency is not maintained after application of the homography matrix found to warp the image. In this case the imageResult is a simple copy of the imageFixed.
Author
Michel Melo da Silva
Date
20/04/2016
bool warpMaskCrop ( const cv::Mat &  image_to_warp,
const cv::Mat &  image_fixed,
const cv::Mat &  image_fixed_mask,
cv::Mat &  image_result,
cv::Mat &  image_result_mask 
)

Function that warps the image_to_warp with the image image_fixed and save the result into de image_result and then the resut is cropped into the original image area.

Parameters
image_to_warp- image to warp.
image_fixed- image fixed that will be in the first plane.
image_fixed_mask- mask of the fixed mask.
image_result- object to save the result image.
image_result_mask- objecto to save the mask of the result image.
Returns
bool true - if the corner consistency is maintained after application of the homography matrix found to warp the image. It also returns false if is not found a homography matrix between the images.
bool false - if the consistency is not maintained after application of the homography matrix found to warp the image. In this case the imageResult is a simple copy of the imageFixed.
Author
Michel Melo da Silva
Date
03/05/2016