IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
All Classes Namespaces Files Functions Variables Modules Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Edge Class Reference

Puzzle piece edge based comparison. More...

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

Public Member Functions

def __init__ (self, tau_shape=100, tau_color=400)
 
def compare (self, piece_A, piece_B, method='type')
 Compare between two passed puzzle piece data. More...
 
def process (self, piece, method=None)
 
def score (self, piece_A, piece_B, method='type')
 
- Public Member Functions inherited from MatchDifferent
def __init__ (self, theParams=CfgDifferent())
 Constructor for the difference matcher class. More...
 
def compare (self, piece_A, piece_B)
 Compare two puzzle pieces. More...
 
- Public Member Functions inherited from Matcher
def score (self, piece_A, piece_B)
 Compute the score between two passed puzzle piece data. More...
 
def solveMatchedPuzzle (self, puzzle, sol)
 

Static Public Member Functions

def colorFeaExtract (piece, feaLength=300)
 
def extractFeature (piece, method=None)
 

Public Attributes

 tau_color
 
 tau_shape
 
- Public Attributes inherited from Matcher
 params
 

Detailed Description

Puzzle piece edge based comparison.

Note
Not sure if properly integrated into current code-base. [2024/10/20 - PAV]
Todo:
Need to confirm that works. [2024/10/20 - PAV]

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  tau_shape = 100,
  tau_color = 400 
)
@brief  Constructor for the puzzle piece edge class.
150 for lab space/400 for RGB space.
Args:
    tau_shape: The threshold for the shape feature.
    tau_color: The threshold for the color feature.

Member Function Documentation

◆ colorFeaExtract()

def colorFeaExtract (   piece,
  feaLength = 300 
)
static
@brief Extract the edge color feature from an input image of the edge.

Args:
    edge: An EdgeDes instance.
    feaLength: The resized feature vector length setting.

Returns:
    colorFeaResizeList: The resized feature vector.

◆ compare()

def compare (   self,
  piece_A,
  piece_B,
  method = 'type' 
)

Compare between two passed puzzle piece data.

Parameters
[in]piece_ATemplate instance with a piece's info.
[in]piece_BTemplate instance with a piece's info.
[in]methodComparison method to use.
Returns
The comparison result (True/False).

◆ extractFeature()

def extractFeature (   piece,
  method = None 
)
static
@brief  Extract the edge shape feature from an input image of the edge.

Args:
    edge: An EdgeDes instance.
    method: The comparison method, we have two modes: type or shape coords.

Returns:
    shapeFeaList: The list of teh shape feature.

Reimplemented from Matcher.

◆ process()

def process (   self,
  piece,
  method = None 
)
@brief  Compute features from the data.

Args:
    piece: A puzzle piece instance.
    method: The method option.

Returns:
    The shape & color feature vectors.

◆ score()

def score (   self,
  piece_A,
  piece_B,
  method = 'type' 
)
@brief  Compute the score between two passed puzzle piece data.

Args:
    piece_A: A template instance saving a piece's info.
    piece_B: A template instance saving a piece's info.
    method: We use some built-in functions in similaritymeasures
    (pcm/frechet_dist/area_between_two_curves/curve_length_measure/dtw)
    or just the types of the edges.

Returns:
    distance_shape: The shape distance between the two passed data.
    distance_color: The color distance between the two passed data.

Member Data Documentation

◆ tau_color

tau_color

◆ tau_shape

tau_shape

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