|
Blender V4.3
|
#include <SteerableViewMap.h>
Public Member Functions | |
| SteerableViewMap (uint nbOrientations=4) | |
| SteerableViewMap (const SteerableViewMap &iBrother) | |
| virtual | ~SteerableViewMap () |
| virtual void | Reset () |
| double * | AddFEdge (FEdge *iFEdge) |
| double | ComputeWeight (const Vec2d &dir, uint iNOrientation) |
| uint | getSVMNumber (Vec2f dir) |
| uint | getSVMNumber (uint id) |
| void | buildImagesPyramids (GrayImage **steerableBases, bool copy=false, uint iNbLevels=4, float iSigma=1.0f) |
| float | readSteerableViewMapPixel (uint iOrientation, int iLevel, int x, int y) |
| float | readCompleteViewMapPixel (int iLevel, int x, int y) |
| uint | getNumberOfPyramidLevels () const |
| uint | getNumberOfOrientations () const |
| void | saveSteerableViewMap () const |
Protected Member Functions | |
| void | Clear () |
| void | Build () |
Protected Attributes | |
| map< uint, double * > | _mapping |
| uint | _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 36 of file SteerableViewMap.h.
| Freestyle::SteerableViewMap::SteerableViewMap | ( | uint | nbOrientations = 4 | ) |
Definition at line 33 of file SteerableViewMap.cpp.
References _bound, _directions, _nbOrientations, Build(), cos(), and M_PI.
| Freestyle::SteerableViewMap::SteerableViewMap | ( | const SteerableViewMap & | iBrother | ) |
Definition at line 51 of file SteerableViewMap.cpp.
References _bound, _directions, _imagesPyramids, _mapping, and _nbOrientations.
|
virtual |
Definition at line 66 of file SteerableViewMap.cpp.
References Clear().
Adds a FEdge to steerable VM. Returns the nbOrientations weights corresponding to the FEdge contributions to the nbOrientations directional maps.
Definition at line 111 of file SteerableViewMap.cpp.
References _mapping, _nbOrientations, ComputeWeight(), Freestyle::Id::getFirst(), Freestyle::FEdge::getId(), Freestyle::VecMat::Vec< T, N >::norm(), norm(), Freestyle::FEdge::orientation2d(), Freestyle::VecMat::Vec3< T >::x(), and Freestyle::VecMat::Vec3< T >::y().
Referenced by Freestyle::Controller::ComputeSteerableViewMap().
|
protected |
Definition at line 44 of file SteerableViewMap.cpp.
References _imagesPyramids, and _nbOrientations.
Referenced by Reset(), and SteerableViewMap().
| void Freestyle::SteerableViewMap::buildImagesPyramids | ( | GrayImage ** | steerableBases, |
| bool | copy = false, | ||
| uint | 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 177 of file SteerableViewMap.cpp.
References _imagesPyramids, _nbOrientations, and copy().
Referenced by Freestyle::Controller::ComputeSteerableViewMap().
|
protected |
Definition at line 71 of file SteerableViewMap.cpp.
References _imagesPyramids, _mapping, and _nbOrientations.
Referenced by Reset(), and ~SteerableViewMap().
Compute the weight of direction dir for orientation iNOrientation
Definition at line 98 of file SteerableViewMap.cpp.
References _bound, _directions, _nbOrientations, cos(), and fabs().
Referenced by AddFEdge(), and getSVMNumber().
|
inline |
Returns the number of orientations
Definition at line 128 of file SteerableViewMap.h.
References _nbOrientations.
Referenced by Freestyle::Controller::displayDensityCurves().
| uint Freestyle::SteerableViewMap::getNumberOfPyramidLevels | ( | ) | const |
Returns the number of levels in the pyramids
Definition at line 221 of file SteerableViewMap.cpp.
References _imagesPyramids, and Freestyle::ImagePyramid::getNumberOfLevels().
Referenced by Freestyle::Controller::displayDensityCurves().
Returns the number of the SVM to which a FEdge belongs most.
Definition at line 158 of file SteerableViewMap.cpp.
References _mapping, _nbOrientations, and w().
Returns the number of the SVM to which a direction belongs to.
| dir | The direction |
Definition at line 138 of file SteerableViewMap.cpp.
References _nbOrientations, ComputeWeight(), Freestyle::VecMat::Vec< T, N >::norm(), norm(), and w().
Referenced by Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()().
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 216 of file SteerableViewMap.cpp.
References _nbOrientations, and readSteerableViewMapPixel().
Referenced by Freestyle::Functions0D::GetViewMapGradientNormF0D::operator()(), Freestyle::Functions0D::ReadCompleteViewMapPixelF0D::operator()(), and Freestyle::ContextFunctions::ReadCompleteViewMapPixelCF().
| float Freestyle::SteerableViewMap::readSteerableViewMapPixel | ( | uint | 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 195 of file SteerableViewMap.cpp.
References _imagesPyramids, G, G_DEBUG_FREESTYLE, Freestyle::ImagePyramid::height(), Freestyle::ImagePyramid::pixel(), v, and Freestyle::ImagePyramid::width().
Referenced by Freestyle::Controller::displayDensityCurves(), Freestyle::Functions0D::ReadSteerableViewMapPixelF0D::operator()(), Freestyle::Functions1D::GetSteerableViewMapDensityF1D::operator()(), readCompleteViewMapPixel(), and Freestyle::ContextFunctions::ReadDirectionalViewMapPixelCF().
|
virtual |
Resets everything
Definition at line 92 of file SteerableViewMap.cpp.
References Build(), and Clear().
Referenced by Freestyle::Canvas::Clear(), Freestyle::Controller::ComputeSteerableViewMap(), and Freestyle::Canvas::Erase().
| void Freestyle::SteerableViewMap::saveSteerableViewMap | ( | ) | const |
for debug purposes
Definition at line 229 of file SteerableViewMap.cpp.
References _imagesPyramids, _nbOrientations, ImBuf::byte_buffer, Freestyle::c, ImBufByteBuffer::data, ImBuf::ftype, Freestyle::ImagePyramid::getLevel(), Freestyle::ImagePyramid::getNumberOfLevels(), Freestyle::FrsImage::height(), Freestyle::ImagePyramid::height(), IB_rect, IMB_allocImBuf(), IMB_FTYPE_PNG, IMB_saveiff(), int, Freestyle::GrayImage::pixel(), Freestyle::FrsImage::width(), Freestyle::ImagePyramid::width(), Freestyle::x, and y.
Referenced by Freestyle::Controller::saveSteerableViewMapImages().
|
protected |
Definition at line 45 of file SteerableViewMap.h.
Referenced by ComputeWeight(), SteerableViewMap(), and SteerableViewMap().
Definition at line 46 of file SteerableViewMap.h.
Referenced by ComputeWeight(), SteerableViewMap(), and SteerableViewMap().
|
protected |
Definition at line 42 of file SteerableViewMap.h.
Referenced by Build(), buildImagesPyramids(), Clear(), getNumberOfPyramidLevels(), readSteerableViewMapPixel(), saveSteerableViewMap(), and SteerableViewMap().
Definition at line 40 of file SteerableViewMap.h.
Referenced by AddFEdge(), Clear(), getSVMNumber(), and SteerableViewMap().
|
protected |
Definition at line 41 of file SteerableViewMap.h.
Referenced by AddFEdge(), Build(), buildImagesPyramids(), Clear(), ComputeWeight(), getNumberOfOrientations(), getSVMNumber(), getSVMNumber(), readCompleteViewMapPixel(), saveSteerableViewMap(), SteerableViewMap(), and SteerableViewMap().