# opentl::modelprojection::ContourSampler Class Reference

Class for doing object feature visability checks in the context of a OpenGL scene with all targets displayed. More...

Inherits opentl::core::util::ParameterContainer.

List of all members.

## Classes
struct | ShapeData_t
| Structure for storing object model related shape appearance data required for fast contour sampling. More...
## Public Types
## Public Member Functions
| ContourSampler (const ObjModelPtrVector &objModels, opentl::modelprojection::Warp &warp, opentl::modelprojection::GLScene &scene, int camIdx)
| Constructor.
void | generatePointQueryList (GLuint &listId, const std::vector< opentl::core::cvdata::ShapeAppearance::Point * > &points, const std::vector< double * > *colors=NULL)
| Function to generate OpenGL point query list.
opentl::core::cvdata::VisContourSamplePts * | getContourData (int targetId=0)
void | init ()
| Initialization.
int | lineQuery ()
| Occlusion query for lines (NOT PRECISE: A SEGMENT CAN BE PARTIALLY VISIBLE!).
int | pointQuery (GLuint queryListId, const std::vector< opentl::core::cvdata::ShapeAppearance::Point * > &points, std::vector< bool > &visPoints)
| Occlusion query for points (GOOD).
void | sampleContourDebugOutput (void)
void | sampleVisContourPoints (const std::vector< boost::shared_ptr< opentl::core::State > > &states, const ObjModelPtrVector &objModels)
| Sample visible contour points for all given state hypothesis (=targets) rendered into a single scene.
void | setupQuery (int n)
| Generate the occlusion query.
void | warpScreen (const boost::shared_ptr< opentl::core::State > &state, int targetIdx)
| Warp contour points from body to screen, and update normals and Jacobians.
virtual | ~ContourSampler ()
| Destructor.

## Detailed Description

Class for doing object feature visability checks in the context of a OpenGL scene with all targets displayed.

Author:
  E. Roth <eroth@mytum.de>

## Member Enumeration Documentation

enum opentl::modelprojection::ContourSampler::OfflineParameters

Enumerator:

  construct_loadShaderCodeFromFile | Load shader code from files or embedded strings.
  construct_sampleSilhouetteEdgesOnly | Sample points on silhouette edges only.
  construct_MaxSamplePointsPerTarget | Maximum visible edge sample points per target.
  OFFLINE_COUNT |

enum opentl::modelprojection::ContourSampler::OnlineParameters

Enumerator:

  sample_computeScreenPointJacobians | Compute screen space jacobians for contour points.
  sample_discardBackgroundEdgeWithinPixelRange | Discard edges with larger depth while within this pixel range. Feature can be disabled by setting value to 0.
  sample_thetaDegRidge | If internal angle (deg) of two adjacent polygon faces is smaller, a ridge edge is detected.
  sample_thetaDegValley | If external angle (deg) of two adjacent polygon faces is smaller, a valley edge is detected.
  ONLINE_COUNT |

## Constructor & Destructor Documentation

opentl::modelprojection::ContourSampler::ContourSampler | ( | const ObjModelPtrVector & | objModels,
|  | opentl::modelprojection::Warp & | warp,
|  | opentl::modelprojection::GLScene & | scene,
|  | int | camIdx |
| ) |  |  |

Constructor.

Parameters:

  | objModels | reference to object models
  | warp | Pointer to warp instance.
  | scene | Pointer to GLScene instance
  | camIdx | camera index.

virtual opentl::modelprojection::ContourSampler::~ContourSampler | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

void opentl::modelprojection::ContourSampler::generatePointQueryList | ( | GLuint & | listId,
|  | const std::vector< opentl::core::cvdata::ShapeAppearance::Point * > & | points,
|  | const std::vector< double * > * | colors = `NULL` |
| ) |  |  |

Function to generate OpenGL point query list.

opentl::core::cvdata::VisContourSamplePts* opentl::modelprojection::ContourSampler::getContourData | ( | int | targetId = `0` | ) | `[inline]`

void opentl::modelprojection::ContourSampler::init | ( |  | ) | `[virtual]`

Initialization.

Implements opentl::core::util::ParameterContainer.

int opentl::modelprojection::ContourSampler::lineQuery | ( |  | ) |

Occlusion query for lines (NOT PRECISE: A SEGMENT CAN BE PARTIALLY VISIBLE!).

int opentl::modelprojection::ContourSampler::pointQuery | ( | GLuint | queryListId,
|  | const std::vector< opentl::core::cvdata::ShapeAppearance::Point * > & | points,
|  | std::vector< bool > & | visPoints |
| ) |  |  |

Occlusion query for points (GOOD).

void opentl::modelprojection::ContourSampler::sampleContourDebugOutput | ( | void |  | ) |

void opentl::modelprojection::ContourSampler::sampleVisContourPoints | ( | const std::vector< boost::shared_ptr< opentl::core::State > > & | states,
|  | const ObjModelPtrVector & | objModels |
| ) |  |  |

Sample visible contour points for all given state hypothesis (=targets) rendered into a single scene.

Parameters:

  | states | vector of targets
  | objModels | reference to object models

void opentl::modelprojection::ContourSampler::setupQuery | ( | int | n | ) |

Generate the occlusion query.

void opentl::modelprojection::ContourSampler::warpScreen | ( | const boost::shared_ptr< opentl::core::State > & | state,
|  | int | targetIdx |
| ) |  |  |

Warp contour points from body to screen, and update normals and Jacobians.

Parameters:

  | state | State
  | targetIdx | State index, within the contour data structure