IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Sift Class Reference

Uses SIFT feature points with descriptors as an object representation. More...

Inheritance diagram for Sift:
Inheritance graph
[legend]
Collaboration diagram for Sift:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, tau=10, theThreshMatch=0.5)
 
def compare (self, piece_A, piece_B)
 
def process (self, piece)
 
def score (self, yA, yB)
 
- Public Member Functions inherited from MatchSimilar
def __init__ (self, theParams=CfgSimilar())
 
- Public Member Functions inherited from Matcher
tuple[float, np.ndarray] estimateAffineMatch (self, piece_A, piece_B)
 Estimate the rigid affine transform that aligns piece A to piece B. More...
 
def extractFeature (self, piece)
 Process raw puzzle piece data to obtain encoded description of piece. More...
 
"Matcher" fit (self, groups, list[str]|None labels=None)
 Given raw data regarding expected element instances, identify model to differentiate them if possible for this matcher type. More...
 
"Matcher" fitFromImageSegmented (self, Irgb, Iseg, hasLabs=False)
 Given an image and a segmentation, generate fit. More...
 
def solveMatchedPuzzle (self, puzzle, sol)
 

Static Public Member Functions

def kpFeaExtract (piece)
 
- Static Public Member Functions inherited from Matcher
tuple[np.ndarray, np.ndarray] pcaFrame (piece)
 Estimate a signed PCA frame from a puzzle piece's foreground pixels. More...
 

Public Attributes

 tau
 
 theThreshMatch
 
- Public Attributes inherited from Matcher
 params
 

Detailed Description

Uses SIFT feature points with descriptors as an object representation.

It is not perfect for smaller objects with few features, but it does a good
enough job to work as a first pass.  If better is needed, this serves as a
baseline from which to understand the properties of the object set.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  tau = 10,
  theThreshMatch = 0.5 
)
@brief  Constructor for the puzzle piece sift class.

@param[in]  tau             Threshold param to determine similarity for SIFT feature.
@param[in]  theThreshMatch  The threshold to determine match (0-1).

Member Function Documentation

◆ compare()

def compare (   self,
  piece_A,
  piece_B 
)
@brief  Compare between two passed puzzle piece data.
        See https://opencv24-python-tutorials.readthedocs.io/en/latest/py_tutorials/py_feature2d/py_matcher/py_matcher.html
        and https://scikit-image.org/docs/dev/auto_examples/transform/plot_matching.html

Args:
    piece_A: A template instance saving a piece's info.
    piece_B: A template instance saving a piece's info.

Returns:
    Comparison result & rotation angle(degree) & other params.

Reimplemented from MatchSimilar.

◆ kpFeaExtract()

def kpFeaExtract (   piece)
static
@brief  Compute sift features from the raw puzzle data.

Args:
    piece: A template instance saving a piece's info.

Returns:
    kp: The sift keypoints.
    des: The sift descriptor.

◆ process()

def process (   self,
  piece 
)
@brief  Process the puzzle piece.

Returns:
    The processed feature.

◆ score()

def score (   self,
  yA,
  yB 
)
@brief  Compute the score between two passed puzzle piece data.

Args:
    yA: A template instance saving a piece's info.
    yB: A template instance saving a piece's info.

Returns:
    distance: The distance between the two passed puzzle piece data.

Reimplemented from Matcher.

Member Data Documentation

◆ tau

tau

◆ theThreshMatch

theThreshMatch

The documentation for this class was generated from the following file: