class
BlockMatchingBlock matching tracking of an image stream.
Contents
2D block matching on the GPU. Input is a stream of input images, output is a stream of images with 2 channels giving the x,y motion of each pixel.
Base classes
- class ProcessObject
- Abstract base class for all process objects.
Public static functions
- static auto stringToMetric(std::string name) -> MatchingMetric
Public functions
- auto create(int blockSize, int searchSize, MatchingMetric metric, bool forwardBackwardTracking, int timeLag) -> std::shared_ptr<BlockMatching>
- Create instance.
- void setMatchingMetric(MatchingMetric type)
- void setBlockSize(int size)
- void setSearchSize(int size)
- void setIntensityThreshold(float value)
- void setTimeLag(int timeLag)
- void setForwardBackwardTracking(bool forwardBackward)
- void setRegionOfInterest(Vector2i offset, Vector2i size)
- void loadAttributes() override
Private functions
- void execute() override
Function documentation
static MatchingMetric fast:: BlockMatching:: stringToMetric(std::string name)
Parameters | |
---|---|
name | |
Returns | MatchingMetric |
Convert string of metric to type
std::shared_ptr<BlockMatching> fast:: BlockMatching:: create(int blockSize,
int searchSize,
MatchingMetric metric,
bool forwardBackwardTracking,
int timeLag)
Create instance.
Parameters | |
---|---|
blockSize | Must be odd. |
searchSize | Must be odd. |
metric | Similarity metric to use |
forwardBackwardTracking | Do forward-backward tracking and take average of the two. Will be slover. |
timeLag | How many frames to skip when comparing. Default is 1, comarping frame t vs frame t-1. |
Returns | instance |
void fast:: BlockMatching:: setMatchingMetric(MatchingMetric type)
Parameters | |
---|---|
type |
Select which matching metric to use
void fast:: BlockMatching:: setBlockSize(int size)
Parameters | |
---|---|
size |
Set size of the blocks to match. Has to be odd
void fast:: BlockMatching:: setSearchSize(int size)
Parameters | |
---|---|
size |
Set size of search grid around x,y. Has to be odd
void fast:: BlockMatching:: setIntensityThreshold(float value)
Parameters | |
---|---|
value |
Set an intensity threshold, do not do block matching on pixels where the mean of the block is below this threhsold.
void fast:: BlockMatching:: setTimeLag(int timeLag)
Parameters | |
---|---|
timeLag |
Set time lag of block matching. A time lag of 2 will use frame t, and t-2 for block matching. Default is 1
void fast:: BlockMatching:: setForwardBackwardTracking(bool forwardBackward)
Parameters | |
---|---|
forwardBackward |
Set whether to use forward-backward tracking or not. Disabled by default.
void fast:: BlockMatching:: setRegionOfInterest(Vector2i offset,
Vector2i size)
Parameters | |
---|---|
offset | from origin to start the ROI in pixels |
size | of the ROI in pixels |
Set a region of interest (ROI) to run the block matching in.