|
Blender
V2.93
|
#include <SteerableViewMap.h>
Public Member Functions | |
| SteerableViewMap (unsigned int nbOrientations=4) | |
| SteerableViewMap (const SteerableViewMap &iBrother) | |
| virtual | ~SteerableViewMap () |
| virtual void | Reset () |
| double * | AddFEdge (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 |
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 48 of file SteerableViewMap.h.
| Freestyle::SteerableViewMap::SteerableViewMap | ( | unsigned int | nbOrientations = 4 | ) |
Definition at line 43 of file SteerableViewMap.cpp.
References KDL::cos(), M_PI, and KDL::sin().
| Freestyle::SteerableViewMap::SteerableViewMap | ( | const SteerableViewMap & | iBrother | ) |
Definition at line 61 of file SteerableViewMap.cpp.
References _bound, _directions, _imagesPyramids, _mapping, and _nbOrientations.
|
virtual |
Definition at line 76 of file SteerableViewMap.cpp.
Adds a FEdge to steerable VM. Returns the nbOrientations weights corresponding to the FEdge contributions to the nbOrientations directional maps.
Definition at line 122 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().
|
protected |
Definition at line 54 of file SteerableViewMap.cpp.
| 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.
| steerableBases | The _nbOrientations+1 images constituting the basis for the steerable pyramid. |
| copy | If 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. |
| iNbLevels | The number of levels desired for each pyramid. If iNbLevels == 0, the complete pyramid is built. |
| iSigma | The sigma that will be used for the gaussian blur |
Definition at line 188 of file SteerableViewMap.cpp.
References copy().
Referenced by Freestyle::Controller::ComputeSteerableViewMap().
|
protected |
Definition at line 81 of file SteerableViewMap.cpp.
Compute the weight of direction dir for orientation iNOrientation
Definition at line 109 of file SteerableViewMap.cpp.
References KDL::acos(), KDL::cos(), and fabs().
|
inline |
Returns the number of orientations
Definition at line 140 of file SteerableViewMap.h.
Referenced by Freestyle::Controller::displayDensityCurves().
| unsigned int Freestyle::SteerableViewMap::getNumberOfPyramidLevels | ( | ) | const |
Returns the number of levels in the pyramids
Definition at line 232 of file SteerableViewMap.cpp.
Referenced by Freestyle::Controller::displayDensityCurves().
| unsigned Freestyle::SteerableViewMap::getSVMNumber | ( | unsigned | id | ) |
| unsigned Freestyle::SteerableViewMap::getSVMNumber | ( | Vec2f | dir | ) |
Returns the number of the SVM to which a direction belongs to.
| dir | The direction |
Definition at line 149 of file SteerableViewMap.cpp.
References norm(), Freestyle::VecMat::Vec< T, N >::norm(), and w().
Referenced by Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()().
| 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 227 of file SteerableViewMap.cpp.
References Freestyle::x, and y.
Referenced by Freestyle::Functions0D::ReadCompleteViewMapPixelF0D::operator()(), Freestyle::Functions0D::GetViewMapGradientNormF0D::operator()(), and Freestyle::ContextFunctions::ReadCompleteViewMapPixelCF().
| 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.
| iOrientation | the 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 |
| iLevel | The level of the pyramid we want to read |
| x | The abscissa of the desired pixel specified in level0 coordinate system. The origin is the lower left corner. |
| y | The ordinate of the desired pixel specified in level0 coordinate system. The origin is the lower left corner. |
Definition at line 206 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().
|
virtual |
Resets everything
Definition at line 103 of file SteerableViewMap.cpp.
Referenced by Freestyle::Controller::ComputeSteerableViewMap().
| void Freestyle::SteerableViewMap::saveSteerableViewMap | ( | ) | const |
for debug purposes
Definition at line 240 of file SteerableViewMap.cpp.
References Freestyle::c, ImBuf::ftype, Freestyle::FrsImage::height(), IB_rect, IMB_allocImBuf(), IMB_FTYPE_PNG, IMB_saveiff(), Freestyle::GrayImage::pixel(), ImBuf::rect, Freestyle::FrsImage::width(), Freestyle::x, and y.
Referenced by Freestyle::Controller::saveSteerableViewMapImages().
|
protected |
Definition at line 57 of file SteerableViewMap.h.
Referenced by SteerableViewMap().
Definition at line 58 of file SteerableViewMap.h.
Referenced by SteerableViewMap().
|
protected |
Definition at line 54 of file SteerableViewMap.h.
Referenced by SteerableViewMap().
|
protected |
Definition at line 52 of file SteerableViewMap.h.
Referenced by SteerableViewMap().
|
protected |
Definition at line 53 of file SteerableViewMap.h.
Referenced by SteerableViewMap().