#include <Projector.h>
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 |
Definition at line 9 of file Projector.h.
| pano::Projector::Projector | ( | ) | [inline] |
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 |
||
| ) |
| output_size | size 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.
| pano::Projector::~Projector | ( | void | ) |
Definition at line 295 of file Projector.cpp.
| 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] |
| sphere_size | |
| theta_range | the longitudinal range of the spherical cooridinates produced |
| phi_range | the latitudinal range of the coords produced |
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
| K | camera calibration matrix |
| R | the rotation to calc the remap matrix - identity means the center pixel of the output image, or the vector (0,0,1) |
| remap1 | out 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 |
| remap2 | out 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.
friend class SparseProjector [friend] |
Definition at line 10 of file Projector.h.
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.
cv::Mat pano::Projector::spherical_coords [private] |
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.