Darwin
1.10(beta)
|
Learns a PatchMatchGraph by iteratively performing search moves over the space of matches. More...
Public Member Functions | |
drwnPatchMatchGraphLearner (drwnPatchMatchGraph &graph) | |
construct an object to optimize the given patch match graph | |
void | initialize () |
randomly initialize matches for all active images (keeps existing matches unless an improvement is found) More... | |
virtual void | initialize (unsigned imgIndx) |
randomly initialize matches for a given image | |
void | rescore () |
rescore matches if scoring function or features have changed (e.g., greyscale to rgb) | |
void | update () |
perform one edge update iteration (including enrichment and exhuastive) on all active images | |
virtual void | update (unsigned imgIndx) |
perform one edge update iteration (excluding enrichment) on a single image | |
Static Public Attributes | |
static double | SEARCH_DECAY_RATE = 0.5 |
decay rate during search in range [0, 1) | |
static int | FORWARD_ENRICHMENT_K = 3 |
forward enrichment search depth | |
static bool | DO_INVERSE_ENRICHMENT = true |
perform inverse enrichment | |
static bool | DO_LOCAL_SEARCH = true |
run neighbourhood search on dirty pixels | |
static bool | DO_EXHAUSTIVE = false |
run exhustive search on random pixel | |
static drwnPatchMatchTransform | ALLOWED_TRANSFORMATIONS = DRWN_PM_TRANSFORM_NONE |
allowable patch transformations | |
static double | TOP_VAR_PATCHES = 1.0 |
initialize all patches below this with only one match | |
Protected Member Functions | |
void | cacheImageFeatures () |
void | cacheImageFeatures (unsigned imgIndx) |
caches features for given image pyramid | |
virtual void | cacheImageFeatures (unsigned imgIndx, const cv::Mat &baseImg) |
caches features for given image pyramid using given base image | |
int | appendCIELabFeatures (const cv::Mat &img, cv::Mat &features, int nChannel=0) const |
helper functions for feature computation More... | |
int | appendVerticalFeatures (const cv::Mat &img, cv::Mat &features, int nChannel=0) const |
int | appendEdgeFeatures (const cv::Mat &img, cv::Mat &features, int nChannel=0) const |
int | appendTextonFilterFeatures (const cv::Mat &img, cv::Mat &features, int nChannel=0) const |
bool | propagate (const drwnPatchMatchNode &u, bool bDirection) |
propagate good matches from patch u to its neighbours (returns true if a better match was found) | |
bool | search (const drwnPatchMatchNode &u) |
random exponentially decaying neighbourhood search for patch pixIndx in image imgIndx (returns true if a better match was found) | |
bool | local (const drwnPatchMatchNode &u) |
local neighbourhood search around patch pixIndx in image imgIndx (returns true if a better match was found) | |
virtual bool | enrichment () |
enrichment: inverse (from target to source) and forward (from source to target's target) (returns true if a better match was found) | |
bool | exhaustive (const drwnPatchMatchNode &u) |
exhaustive search for best match across entire graph — use sparingly (returns true if a better match was found) | |
virtual float | scoreMatch (const drwnPatchMatchNode &u, const drwnPatchMatchNode &v, const drwnPatchMatchTransform &xform, float maxValue=DRWN_FLT_MAX) const |
match scoring function (maxValue allows for early termination) | |
cv::Point | mapPatch (const cv::Point &p, int imgIndx, int srcScale, int dstScale) const |
map a patch from one image pyramid level to another | |
Protected Attributes | |
drwnPatchMatchGraph & | _graph |
the graph that is being learned | |
vector< vector< cv::Mat > > | _features |
image features indexed by (image, pyramid level) | |
Learns a PatchMatchGraph by iteratively performing search moves over the space of matches.
|
protected |
helper functions for feature computation
|
protected |
void drwnPatchMatchGraphLearner::initialize | ( | ) |
randomly initialize matches for all active images (keeps existing matches unless an improvement is found)