Simd Library Documentation.

Home | Release Notes | Download | Documentation | Issues | GitHub
ShiftingDetector Class Reference

The ShiftingDetector class estimates shift between current and background images. More...

Public Member Functions

def __init__ (self, background=Simd.Image(), levelCount=4, textureType=Simd.ShiftDetectorTexture.Gray, differenceType=Simd.ShiftDetectorDifference.Abs)
 Creates a new ShiftDetector. More...
 
def __del__ (self)
 Releases shift detector context.
 
def SetBackground (self, background=Simd.Image, levelCount=4)
 Sets background image in shift detector and recreates internal structures if it needs. More...
 
bool Estimate (self, Simd.Image current, [int, int] initShift, [int, int] maxShift, hiddenAreaPenalty=0.0, regionAreaMin=25)
 Estimates shift of current image relative to background image. More...
 
[int, int] GetShift (self)
 Gets shift estimated before by function Simd.ShiftingDetector.Estimate. More...
 
[float, float] GetRefinedShift (self)
 Gets refined shift estimated before by function Simd.ShiftingDetector.Estimate. More...
 
float GetStability (self)
 Gets stability of shift estimation estimated before by function Simd.ShiftingDetector.Estimate. More...
 
float GetCorrelation (self)
 Gets the best correlation between current image and background estimated before by function Simd.ShiftingDetector.Estimate. More...
 

Detailed Description

The ShiftingDetector class estimates shift between current and background images.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  background = Simd.Image(),
  levelCount = 4,
  textureType = Simd.ShiftDetectorTexture.Gray,
  differenceType = Simd.ShiftDetectorDifference.Abs 
)

Creates a new ShiftDetector.

Parameters
background- A background image.
levelCount- the number of levels in the internal image pyramids used to find shift.
textureType- type of textures used to detect shift (see Simd.ShiftDetectorTexture).
differenceType- type of correlation functions used to detect shift (see Simd.ShiftDetectorDifference).

Member Function Documentation

◆ SetBackground()

def SetBackground (   self,
  background = Simd.Image,
  levelCount = 4 
)

Sets background image in shift detector and recreates internal structures if it needs.

Parameters
background- A background image.
levelCount- the number of levels in the internal image pyramids used to find shift.

◆ Estimate()

bool Estimate (   self,
Simd.Image  current,
[int, int]  initShift,
[int, int]  maxShift,
  hiddenAreaPenalty = 0.0,
  regionAreaMin = 25 
)

Estimates shift of current image relative to background image.

Parameters
current- A current image.
initShift- an initial shift X and Y position.
maxShift- maximal possible shift alogn X and Y axex.
hiddenAreaPenalty- a parameter used to restrict searching of the shift at the border of background image.
regionAreaMin- a parameter used to set minimal area of region use for shift estimation.

◆ GetShift()

[int, int] GetShift (   self)

Gets shift estimated before by function Simd.ShiftingDetector.Estimate.

Returns
estimated shift value.

◆ GetRefinedShift()

[float, float] GetRefinedShift (   self)

Gets refined shift estimated before by function Simd.ShiftingDetector.Estimate.

Returns
refined shift value.

◆ GetStability()

float GetStability (   self)

Gets stability of shift estimation estimated before by function Simd.ShiftingDetector.Estimate.

Returns
stability of shift estimation.

◆ GetCorrelation()

float GetCorrelation (   self)

Gets the best correlation between current image and background estimated before by function Simd.ShiftingDetector.Estimate.

Returns
the best correlation between current image and background.