Public Member Functions | Private Member Functions | Private Attributes | List of all members
stitcher::FisheyeStitcher Class Reference

#include <fisheye_stitcher.hpp>

Public Member Functions

 FisheyeStitcher (int width, int height, float in_fovd, bool enb_light_compen, bool enb_refine_align, bool save_unwarped, std::string map_path)
 
cv::Mat stitch (const cv::Mat &image1, const cv::Mat &image2)
 single frame stitching More...
 
 ~FisheyeStitcher ()
 

Private Member Functions

cv::Mat blend (const cv::Mat &left_img, const cv::Mat &right_img_aligned)
 Blending aligned images. More...
 
cv::Mat blendLeft (const cv::Mat &bg1, const cv::Mat &bg2)
 Ramp blending on the left patch. More...
 
cv::Mat blendRight (const cv::Mat &bg1, const cv::Mat &bg2)
 Ramp blending on the right patch. More...
 
cv::Mat compenLightFO (const cv::Mat &in_img)
 Fisheye Light Fall-off Compensation. More...
 
void createBlendMask ()
 Create binary mask for blending. More...
 
std::tuple< std::vector< cv::Point2f >, std::vector< cv::Point2f > > createControlPoints (const cv::Point2f &matchLocLeft, const cv::Point2f &matchLocRight, const int row_start, const int row_end, const int p_wid, const int p_x1, const int p_x2, const int p_x2_ref)
 Construct control points for affine2D. More...
 
void createMask ()
 Mask creation for cropping image data inside the FOVD circle. More...
 
cv::Mat deform (const cv::Mat &in_img)
 Rigid Moving Least Squares Interpolation. More...
 
cv::Point2f findMatchLoc (const cv::Mat &Ref, const cv::Mat &Tmpl, const std::string &img_window, const bool disable_display)
 Adaptive Alignment: Norm XCorr. More...
 
std::tuple< double, double > fish2Eqt (const double x_dest, const double y_dest, const double W_rad)
 Convert fisheye-vertical to equirectangular (reference: Panotool) More...
 
void fish2Map ()
 Map 2D fisheye image to 2D projected sphere. More...
 
void genScaleMap ()
 Fisheye Light Fall-off Compensation: Scale_Map Construction. More...
 
void init ()
 
cv::Mat unwarp (const cv::Mat &in_img)
 Fisheye Unwarping. More...
 

Private Attributes

cv::Mat m_binary_mask
 
std::vector< int > m_blend_post
 
cv::Mat m_cir_mask
 
bool m_disable_light_compen
 
bool m_enb_light_compen
 
bool m_enb_refine_align
 
int m_hd
 
int m_hd2
 
int m_hs
 
int m_hs2
 
int m_hs_org
 
float m_in_fovd
 
cv::Mat m_inner_cir_mask
 
float m_inner_fovd
 
std::string m_map_path
 
cv::Mat m_map_x
 
cv::Mat m_map_y
 
cv::Mat m_mls_map_x
 
cv::Mat m_mls_map_y
 
bool m_save_unwarped
 
cv::Mat m_scale_map
 
int m_wd
 
int m_wd2
 
int m_ws
 
int m_ws2
 
int m_ws_org
 

Detailed Description

Definition at line 62 of file fisheye_stitcher.hpp.

Constructor & Destructor Documentation

stitcher::FisheyeStitcher::FisheyeStitcher ( int  width,
int  height,
float  in_fovd,
bool  enb_light_compen,
bool  enb_refine_align,
bool  save_unwarped,
std::string  map_path 
)

Definition at line 38 of file fisheye_stitcher.cpp.

stitcher::FisheyeStitcher::~FisheyeStitcher ( )

Definition at line 65 of file fisheye_stitcher.cpp.

Member Function Documentation

cv::Mat stitcher::FisheyeStitcher::blend ( const cv::Mat &  left_img,
const cv::Mat &  right_img_aligned 
)
private

Blending aligned images.

Parameters
left_imgleft unwarped image
right_img_alignedaligned right image
returnblended image

Definition at line 693 of file fisheye_stitcher.cpp.

cv::Mat stitcher::FisheyeStitcher::blendLeft ( const cv::Mat &  bg1,
const cv::Mat &  bg2 
)
private

Ramp blending on the left patch.

Parameters
bg1first patch
bg2second patch
returnblended patch

Definition at line 645 of file fisheye_stitcher.cpp.

cv::Mat stitcher::FisheyeStitcher::blendRight ( const cv::Mat &  bg1,
const cv::Mat &  bg2 
)
private

Ramp blending on the right patch.

Parameters
bg1first patch
bg2second patch
returnblended patch

Definition at line 598 of file fisheye_stitcher.cpp.

cv::Mat stitcher::FisheyeStitcher::compenLightFO ( const cv::Mat &  in_img)
private

Fisheye Light Fall-off Compensation.

Parameters
in_imgLFO-uncompensated image
returnLFO-compensated image

Definition at line 313 of file fisheye_stitcher.cpp.

void stitcher::FisheyeStitcher::createBlendMask ( )
private

Create binary mask for blending.

Update member masks.

Definition at line 340 of file fisheye_stitcher.cpp.

std::tuple< std::vector< cv::Point2f >, std::vector< cv::Point2f > > stitcher::FisheyeStitcher::createControlPoints ( const cv::Point2f &  matchLocLeft,
const cv::Point2f &  matchLocRight,
const int  row_start,
const int  row_end,
const int  p_wid,
const int  p_x1,
const int  p_x2,
const int  p_x2_ref 
)
private

Construct control points for affine2D.

Parameters
movingPointsreturn match points of template on reference
fixedPointsreturn match points of template on template

Definition at line 546 of file fisheye_stitcher.cpp.

void stitcher::FisheyeStitcher::createMask ( )
private

Mask creation for cropping image data inside the FOVD circle.

Update member m_cir_mask (circular mask), inner_cir_mask (circular mask for the inner circle).

Definition at line 172 of file fisheye_stitcher.cpp.

cv::Mat stitcher::FisheyeStitcher::deform ( const cv::Mat &  src)
private

Rigid Moving Least Squares Interpolation.

Parameters
srcsource image
returndeformed image

Definition at line 203 of file fisheye_stitcher.cpp.

cv::Point2f stitcher::FisheyeStitcher::findMatchLoc ( const cv::Mat &  Ref,
const cv::Mat &  Tmpl,
const std::string img_window,
const bool  disable_display 
)
private

Adaptive Alignment: Norm XCorr.

Parameters
Refreference image
Tmpltemplate image
returnmatching location

Definition at line 489 of file fisheye_stitcher.cpp.

std::tuple< double, double > stitcher::FisheyeStitcher::fish2Eqt ( const double  x_dest,
const double  y_dest,
const double  W_rad 
)
private

Convert fisheye-vertical to equirectangular (reference: Panotool)

Definition at line 88 of file fisheye_stitcher.cpp.

void stitcher::FisheyeStitcher::fish2Map ( )
private

Map 2D fisheye image to 2D projected sphere.

Parameters
map_xmap for x element.
map_ymap for y element.

Update member grid maps m_map_x, m_map_y

Definition at line 128 of file fisheye_stitcher.cpp.

void stitcher::FisheyeStitcher::genScaleMap ( )
private

Fisheye Light Fall-off Compensation: Scale_Map Construction.

Parameters
R_pfeverse profile model
Update member m_scale_map

Definition at line 219 of file fisheye_stitcher.cpp.

void stitcher::FisheyeStitcher::init ( )
private

Definition at line 436 of file fisheye_stitcher.cpp.

cv::Mat stitcher::FisheyeStitcher::stitch ( const cv::Mat &  in_img_L,
const cv::Mat &  in_img_R 
)

single frame stitching

Parameters
in_img_Lleft image
in_img_Rright image
returnstitched image

Definition at line 795 of file fisheye_stitcher.cpp.

cv::Mat stitcher::FisheyeStitcher::unwarp ( const cv::Mat &  src)
private

Fisheye Unwarping.

Unwarp source fisheye -> 360x180 equirectangular

Definition at line 75 of file fisheye_stitcher.cpp.

Member Data Documentation

cv::Mat stitcher::FisheyeStitcher::m_binary_mask
private

Definition at line 121 of file fisheye_stitcher.hpp.

std::vector<int> stitcher::FisheyeStitcher::m_blend_post
private

Definition at line 122 of file fisheye_stitcher.hpp.

cv::Mat stitcher::FisheyeStitcher::m_cir_mask
private

Definition at line 119 of file fisheye_stitcher.hpp.

bool stitcher::FisheyeStitcher::m_disable_light_compen
private

Definition at line 113 of file fisheye_stitcher.hpp.

bool stitcher::FisheyeStitcher::m_enb_light_compen
private

Definition at line 112 of file fisheye_stitcher.hpp.

bool stitcher::FisheyeStitcher::m_enb_refine_align
private

Definition at line 114 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_hd
private

Definition at line 106 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_hd2
private

Definition at line 109 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_hs
private

Definition at line 103 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_hs2
private

Definition at line 105 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_hs_org
private

Definition at line 100 of file fisheye_stitcher.hpp.

float stitcher::FisheyeStitcher::m_in_fovd
private

Definition at line 110 of file fisheye_stitcher.hpp.

cv::Mat stitcher::FisheyeStitcher::m_inner_cir_mask
private

Definition at line 120 of file fisheye_stitcher.hpp.

float stitcher::FisheyeStitcher::m_inner_fovd
private

Definition at line 111 of file fisheye_stitcher.hpp.

std::string stitcher::FisheyeStitcher::m_map_path
private

Definition at line 116 of file fisheye_stitcher.hpp.

cv::Mat stitcher::FisheyeStitcher::m_map_x
private

Definition at line 117 of file fisheye_stitcher.hpp.

cv::Mat stitcher::FisheyeStitcher::m_map_y
private

Definition at line 118 of file fisheye_stitcher.hpp.

cv::Mat stitcher::FisheyeStitcher::m_mls_map_x
private

Definition at line 124 of file fisheye_stitcher.hpp.

cv::Mat stitcher::FisheyeStitcher::m_mls_map_y
private

Definition at line 125 of file fisheye_stitcher.hpp.

bool stitcher::FisheyeStitcher::m_save_unwarped
private

Definition at line 115 of file fisheye_stitcher.hpp.

cv::Mat stitcher::FisheyeStitcher::m_scale_map
private

Definition at line 123 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_wd
private

Definition at line 107 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_wd2
private

Definition at line 108 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_ws
private

Definition at line 102 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_ws2
private

Definition at line 104 of file fisheye_stitcher.hpp.

int stitcher::FisheyeStitcher::m_ws_org
private

Definition at line 101 of file fisheye_stitcher.hpp.


The documentation for this class was generated from the following files:


jsk_perception
Author(s): Manabu Saito, Ryohei Ueda
autogenerated on Mon May 3 2021 03:03:28