Blender  V3.3
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Freestyle::SteerableViewMap Class Reference

#include <SteerableViewMap.h>

Public Member Functions

 SteerableViewMap (unsigned int nbOrientations=4)
 
 SteerableViewMap (const SteerableViewMap &iBrother)
 
virtual ~SteerableViewMap ()
 
virtual void Reset ()
 
doubleAddFEdge (FEdge *iFEdge)
 
double ComputeWeight (const Vec2d &dir, unsigned iNOrientation)
 
unsigned getSVMNumber (Vec2f dir)
 
unsigned getSVMNumber (unsigned id)
 
void buildImagesPyramids (GrayImage **steerableBases, bool copy=false, unsigned iNbLevels=4, float iSigma=1.0f)
 
float readSteerableViewMapPixel (unsigned iOrientation, int iLevel, int x, int y)
 
float readCompleteViewMapPixel (int iLevel, int x, int y)
 
unsigned int getNumberOfPyramidLevels () const
 
unsigned int getNumberOfOrientations () const
 
void saveSteerableViewMap () const
 

Protected Member Functions

void Clear ()
 
void Build ()
 

Protected Attributes

map< unsigned int, double * > _mapping
 
unsigned _nbOrientations
 
ImagePyramid ** _imagesPyramids
 
double _bound
 
vector< Vec2d_directions
 

Detailed Description

This class checks for every FEdge in which steerable it belongs and stores the mapping allowing to retrieve this information from the FEdge Id.

Definition at line 34 of file SteerableViewMap.h.

Constructor & Destructor Documentation

◆ SteerableViewMap() [1/2]

Freestyle::SteerableViewMap::SteerableViewMap ( unsigned int  nbOrientations = 4)

Definition at line 29 of file SteerableViewMap.cpp.

References KDL::cos(), M_PI, and KDL::sin().

◆ SteerableViewMap() [2/2]

Freestyle::SteerableViewMap::SteerableViewMap ( const SteerableViewMap iBrother)

Definition at line 47 of file SteerableViewMap.cpp.

References _bound, _directions, _imagesPyramids, _mapping, and _nbOrientations.

◆ ~SteerableViewMap()

Freestyle::SteerableViewMap::~SteerableViewMap ( )
virtual

Definition at line 62 of file SteerableViewMap.cpp.

Member Function Documentation

◆ AddFEdge()

double * Freestyle::SteerableViewMap::AddFEdge ( FEdge iFEdge)

Adds a FEdge to steerable VM. Returns the nbOrientations weights corresponding to the FEdge contributions to the nbOrientations directional maps.

Definition at line 108 of file SteerableViewMap.cpp.

References Freestyle::Id::getFirst(), Freestyle::FEdge::getId(), id, norm(), Freestyle::VecMat::Vec< T, N >::norm(), Freestyle::FEdge::orientation2d(), Freestyle::VecMat::Vec3< T >::x(), and Freestyle::VecMat::Vec3< T >::y().

Referenced by Freestyle::Controller::ComputeSteerableViewMap().

◆ Build()

void Freestyle::SteerableViewMap::Build ( )
protected

Definition at line 40 of file SteerableViewMap.cpp.

◆ buildImagesPyramids()

void Freestyle::SteerableViewMap::buildImagesPyramids ( GrayImage **  steerableBases,
bool  copy = false,
unsigned  iNbLevels = 4,
float  iSigma = 1.0f 
)

Builds _nbOrientations+1 pyramids of images from the _nbOrientations+1 base images of the steerable viewmap.

Parameters
steerableBasesThe _nbOrientations+1 images constituting the basis for the steerable pyramid.
copyIf false, the data is not duplicated, and Canvas deals with the memory management of these _nbOrientations+1 images. If true, data is copied, and it's up to the caller to delete the images.
iNbLevelsThe number of levels desired for each pyramid. If iNbLevels == 0, the complete pyramid is built.
iSigmaThe sigma that will be used for the gaussian blur

Definition at line 174 of file SteerableViewMap.cpp.

References copy().

Referenced by Freestyle::Controller::ComputeSteerableViewMap().

◆ Clear()

void Freestyle::SteerableViewMap::Clear ( )
protected

Definition at line 67 of file SteerableViewMap.cpp.

◆ ComputeWeight()

double Freestyle::SteerableViewMap::ComputeWeight ( const Vec2d dir,
unsigned  iNOrientation 
)

Compute the weight of direction dir for orientation iNOrientation

Definition at line 95 of file SteerableViewMap.cpp.

References KDL::acos(), KDL::cos(), and fabs().

◆ getNumberOfOrientations()

unsigned int Freestyle::SteerableViewMap::getNumberOfOrientations ( ) const
inline

Returns the number of orientations

Definition at line 126 of file SteerableViewMap.h.

Referenced by Freestyle::Controller::displayDensityCurves().

◆ getNumberOfPyramidLevels()

unsigned int Freestyle::SteerableViewMap::getNumberOfPyramidLevels ( ) const

Returns the number of levels in the pyramids

Definition at line 218 of file SteerableViewMap.cpp.

Referenced by Freestyle::Controller::displayDensityCurves().

◆ getSVMNumber() [1/2]

unsigned Freestyle::SteerableViewMap::getSVMNumber ( unsigned  id)

Returns the number of the SVM to which a FEdge belongs most.

Parameters
idThe First element of the Id struct of the FEdge we're interested in.

Definition at line 155 of file SteerableViewMap.cpp.

References w().

◆ getSVMNumber() [2/2]

unsigned Freestyle::SteerableViewMap::getSVMNumber ( Vec2f  dir)

Returns the number of the SVM to which a direction belongs to.

Parameters
dirThe direction

Definition at line 135 of file SteerableViewMap.cpp.

References norm(), Freestyle::VecMat::Vec< T, N >::norm(), and w().

Referenced by Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()().

◆ readCompleteViewMapPixel()

float Freestyle::SteerableViewMap::readCompleteViewMapPixel ( int  iLevel,
int  x,
int  y 
)

Reads a pixel in the one of the level of the pyramid containing the images of the complete ViewMap. Returns a value between 0 and 1. Equivalent to : readSteerableViewMapPixel(nbOrientations, x, y)

Definition at line 213 of file SteerableViewMap.cpp.

References Freestyle::x, and y.

Referenced by Freestyle::Functions0D::ReadCompleteViewMapPixelF0D::operator()(), Freestyle::Functions0D::GetViewMapGradientNormF0D::operator()(), and Freestyle::ContextFunctions::ReadCompleteViewMapPixelCF().

◆ readSteerableViewMapPixel()

float Freestyle::SteerableViewMap::readSteerableViewMapPixel ( unsigned  iOrientation,
int  iLevel,
int  x,
int  y 
)

Reads a pixel value in one of the VewMap density steerable pyramids. Returns a value between 0 and 1.

Parameters
iOrientationthe number telling which orientation we need to check. There are _nbOrientations+1 oriented ViewMaps: 0 -> the ViewMap containing every horizontal lines 1 -> the ViewMap containing every lines whose orientation is around PI/4 2 -> the ViewMap containing every vertical lines 3 -> the ViewMap containing every lines whose orientation is around 3PI/4 4 -> the complete ViewMap
iLevelThe level of the pyramid we want to read
xThe abscissa of the desired pixel specified in level0 coordinate system. The origin is the lower left corner.
yThe ordinate of the desired pixel specified in level0 coordinate system. The origin is the lower left corner.

Definition at line 192 of file SteerableViewMap.cpp.

References G, G_DEBUG_FREESTYLE, Freestyle::ImagePyramid::height(), Freestyle::ImagePyramid::pixel(), v, Freestyle::ImagePyramid::width(), Freestyle::x, and y.

Referenced by Freestyle::Controller::displayDensityCurves(), Freestyle::Functions0D::ReadSteerableViewMapPixelF0D::operator()(), Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()(), and Freestyle::ContextFunctions::ReadDirectionalViewMapPixelCF().

◆ Reset()

void Freestyle::SteerableViewMap::Reset ( )
virtual

Resets everything

Definition at line 89 of file SteerableViewMap.cpp.

Referenced by Freestyle::Controller::ComputeSteerableViewMap().

◆ saveSteerableViewMap()

void Freestyle::SteerableViewMap::saveSteerableViewMap ( ) const

Member Data Documentation

◆ _bound

double Freestyle::SteerableViewMap::_bound
protected

Definition at line 43 of file SteerableViewMap.h.

Referenced by SteerableViewMap().

◆ _directions

vector<Vec2d> Freestyle::SteerableViewMap::_directions
protected

Definition at line 44 of file SteerableViewMap.h.

Referenced by SteerableViewMap().

◆ _imagesPyramids

ImagePyramid** Freestyle::SteerableViewMap::_imagesPyramids
protected

Definition at line 40 of file SteerableViewMap.h.

Referenced by SteerableViewMap().

◆ _mapping

map<unsigned int, double *> Freestyle::SteerableViewMap::_mapping
protected

Definition at line 38 of file SteerableViewMap.h.

Referenced by SteerableViewMap().

◆ _nbOrientations

unsigned Freestyle::SteerableViewMap::_nbOrientations
protected

Definition at line 39 of file SteerableViewMap.h.

Referenced by SteerableViewMap().


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