Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | Friends
pano::Projector Class Reference

#include <Projector.h>

List of all members.

Public Member Functions

void projectMat (const cv::Mat &m, cv::Mat &outimage, int filltype=cv::BORDER_TRANSPARENT, const cv::Scalar &value=cv::Scalar())
 Projector ()
 Projector (const cv::Size &output_size, float theta_range=2 *CV_PI, float phi_range=CV_PI)
void setSRandK (const cv::Size &inputsz, const cv::Mat &R, const cv::Mat &K)
 Sets up the projector to remap based on the given R and K. Call this before calling any of the member project functions.
 ~Projector (void)

Static Public Member Functions

static cv::Mat createHomogSphrCoords (const cv::Size &sphere_size=cv::Size(200, 200), float theta_range=2 *CV_PI, float phi_range=CV_PI)
static cv::Mat createSphericalCoords (const cv::Size &sphere_size=cv::Size(200, 200), float theta_range=2 *CV_PI, float phi_range=CV_PI)
static void createSphericalCoords (const cv::Size &sphere_size, float theta_0, float theta_1, float phi_0, float phi_1, cv::Mat &spherical_coords)
static void getSphereGMap (const cv::Mat &K, const cv::Mat &G, cv::Mat &remap1, cv::Mat &remap2, const cv::Mat &homog_sphr_coords, const cv::Size &output_size)
static void getSphereMask (const cv::Mat &onezies, const cv::Mat &remap1, const cv::Mat &remap2, cv::Mat &mask)
static void getSphereRMap (const cv::Mat &K, const cv::Mat &R, cv::Mat &remap1, cv::Mat &remap2, const cv::Mat &spherical_points, const cv::Size &output_size)
static void getSphereRMapMask (const cv::Mat &K, const cv::Mat &R, cv::Mat &remap, cv::Mat &mask, const cv::Mat &spherical_points, cv::Mat &tm)
static void projectImage (const cv::Mat &image, const cv::Mat &remap1, const cv::Mat &remap2, cv::Mat &outputimage, int filltype=cv::BORDER_TRANSPARENT, const cv::Scalar &border_value=cv::Scalar())

Static Private Member Functions

static void getSphereGMap (const cv::Mat &K, const cv::Mat &G, cv::Mat &remap1, cv::Mat &remap2, const cv::Mat &homog_sphr_coords, const cv::Size &output_size, std::vector< cv::Mat > &working_mats)
static void getSphereRMap (const cv::Mat &K, const cv::Mat &R, cv::Mat &remap1, cv::Mat &remap2, const cv::Mat &spherical_points, const cv::Size &output_size, std::vector< cv::Mat > &working_mats)

Private Attributes

cv::Size input_image_sz
cv::Mat K
cv::Mat Kinv
cv::Size outimage_size
cv::Mat R
cv::Mat remap1
cv::Mat remap2
cv::Mat spherical_coords
std::vector< cv::Mat > working_mats

Friends

class SparseProjector

Detailed Description

Definition at line 9 of file Projector.h.


Constructor & Destructor Documentation

Definition at line 18 of file Projector.h.

pano::Projector::Projector ( const cv::Size &  output_size,
float  theta_range = 2 * CV_PI,
float  phi_range = CV_PI 
)
Parameters:
output_sizesize of final spherical projection image width = 2 pi height = pi center pixel is 0,0 essentially, with x going from -pi to pi and y going from -pi/2 to pi/2 ???TODO:define direction of y

Definition at line 288 of file Projector.cpp.

Definition at line 295 of file Projector.cpp.


Member Function Documentation

static cv::Mat pano::Projector::createHomogSphrCoords ( const cv::Size &  sphere_size = cv::Size(200, 200),
float  theta_range = 2 *CV_PI,
float  phi_range = CV_PI 
) [static]

Like createSphereicalCoords but with row of 1's appended so 4x4 matrices can operate on it

cv::Mat pano::Projector::createSphericalCoords ( const cv::Size &  sphere_size = cv::Size(200,200),
float  theta_range = 2 * CV_PI,
float  phi_range = CV_PI 
) [static]
Parameters:
sphere_size
theta_rangethe longitudinal range of the spherical cooridinates produced
phi_rangethe latitudinal range of the coords produced
Returns:
a Mat(sphere_size, cv::DataType<cv::Point3d>::type) where every point in the mat lies on the unit sphere, in the lat long ranges specified. So to go from spherical coorinate (theta,phi) to (x,y,z) just look in the mat.at(phi,theta) cv::Point3d& point = sphere.at<cv::Point3d> (phi, theta)

Definition at line 216 of file Projector.cpp.

static void pano::Projector::createSphericalCoords ( const cv::Size &  sphere_size,
float  theta_0,
float  theta_1,
float  phi_0,
float  phi_1,
cv::Mat &  spherical_coords 
) [static]
void pano::Projector::getSphereGMap ( const cv::Mat &  K,
const cv::Mat &  G,
cv::Mat &  remap1,
cv::Mat &  remap2,
const cv::Mat &  homog_sphr_coords,
const cv::Size &  output_size 
) [static]

create forward and backward maps to send and image described by calibration matrix K into spherical coords. Image is treated as lying on the sphere with flat distribution of rads per pixel. G is 4x4 matrix.

Definition at line 24 of file Projector.cpp.

void pano::Projector::getSphereGMap ( const cv::Mat &  K,
const cv::Mat &  G,
cv::Mat &  remap1,
cv::Mat &  remap2,
const cv::Mat &  homog_sphr_coords,
const cv::Size &  output_size,
std::vector< cv::Mat > &  working_mats 
) [static, private]

Definition at line 125 of file Projector.cpp.

void pano::Projector::getSphereMask ( const cv::Mat &  onezies,
const cv::Mat &  remap1,
const cv::Mat &  remap2,
cv::Mat &  mask 
) [static]

Definition at line 264 of file Projector.cpp.

void pano::Projector::getSphereRMap ( const cv::Mat &  K,
const cv::Mat &  R,
cv::Mat &  remap1,
cv::Mat &  remap2,
const cv::Mat &  spherical_points,
const cv::Size &  output_size 
) [static]

create a remap matrix that is the size of the output image

Parameters:
Kcamera calibration matrix
Rthe rotation to calc the remap matrix - identity means the center pixel of the output image, or the vector (0,0,1)
remap1out parameter, that will hold a matrix of size given by the projector of outimage see the opencv documentation for remap http://opencv.willowgarage.com/documentation/cpp/geometric_image_transformations.html?highlight=remap#remap
remap2out parameter, these are both necessary to pass to the project image function. the remap1 and remap2 are generated using the cv::convertMaps function, for fixed point math, supposedly faster intended use of the remapMat matrix, this will leave outliers alone(transparent) cv::remap(img, outputimge, remapMat, cv::Mat(), cv::INTER_LINEAR);

to get a

Definition at line 16 of file Projector.cpp.

void pano::Projector::getSphereRMap ( const cv::Mat &  K,
const cv::Mat &  R,
cv::Mat &  remap1,
cv::Mat &  remap2,
const cv::Mat &  spherical_points,
const cv::Size &  output_size,
std::vector< cv::Mat > &  working_mats 
) [static, private]

Definition at line 104 of file Projector.cpp.

void pano::Projector::getSphereRMapMask ( const cv::Mat &  K,
const cv::Mat &  R,
cv::Mat &  remap,
cv::Mat &  mask,
const cv::Mat &  spherical_points,
cv::Mat &  tm 
) [static]

Definition at line 30 of file Projector.cpp.

void pano::Projector::projectImage ( const cv::Mat &  image,
const cv::Mat &  remap1,
const cv::Mat &  remap2,
cv::Mat &  outputimage,
int  filltype = cv::BORDER_TRANSPARENT,
const cv::Scalar &  border_value = cv::Scalar() 
) [static]

Definition at line 273 of file Projector.cpp.

void pano::Projector::projectMat ( const cv::Mat &  m,
cv::Mat &  outimage,
int  filltype = cv::BORDER_TRANSPARENT,
const cv::Scalar &  value = cv::Scalar() 
)

Definition at line 318 of file Projector.cpp.

void pano::Projector::setSRandK ( const cv::Size &  inputsz,
const cv::Mat &  R,
const cv::Mat &  K 
)

Sets up the projector to remap based on the given R and K. Call this before calling any of the member project functions.

Definition at line 310 of file Projector.cpp.


Friends And Related Function Documentation

friend class SparseProjector [friend]

Definition at line 10 of file Projector.h.


Member Data Documentation

cv::Size pano::Projector::input_image_sz [private]

Definition at line 12 of file Projector.h.

cv::Mat pano::Projector::K [private]

Definition at line 11 of file Projector.h.

cv::Mat pano::Projector::Kinv [private]

Definition at line 11 of file Projector.h.

cv::Size pano::Projector::outimage_size [private]

Definition at line 12 of file Projector.h.

cv::Mat pano::Projector::R [private]

Definition at line 15 of file Projector.h.

cv::Mat pano::Projector::remap1 [private]

Definition at line 14 of file Projector.h.

cv::Mat pano::Projector::remap2 [private]

Definition at line 14 of file Projector.h.

Definition at line 13 of file Projector.h.

std::vector<cv::Mat> pano::Projector::working_mats [private]

Definition at line 16 of file Projector.h.


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


pano_core
Author(s): Ethan Rublee
autogenerated on Mon Oct 6 2014 08:04:39