Leaper Vision Toolkit
Data Structures | Enumerations
LPVMLLib Module Reference

LPV Machine learning Library, provides classes for classification/detection/inspection tasks that involves machine learning technology. More...

Data Structures

interface  ILClassifier
 This interface provide functionalities of the machine learning based image classification. More...
 
interface  ILFeature
 This interface provide functionalities of the image features, which is used for feature extraction from image in machine learning technology. More...
 
interface  ILModel
 This interface provide functionalities of the machine learning model. More...
 
interface  ILParameterized
 This interface provide parameterized interface for the machine learning feature and model objects. More...
 
interface  ILSample
 This interface represents a sample instance, which usually contains an image and an optional region object. More...
 
interface  ILSampleDatabase
 This interface represents a sample database for training and testing sample organization and management. More...
 
class  LClassifier
 
class  LFeature
 
class  LModel
 
class  LSample
 
class  LSampleDatabase
 

Enumerations

enum  LPVConductivity { LPVConductPMG1 = 0 , LPVConductPMG2 = 1 , LPVConductWeickert = 2 , LPVConductCharbonnier = 3 }
 This enumeration represents the type of the conductivity coefficient used in AKAZE feature. More...
 
enum  LPVFeatureType {
  LPVFeatureReserved = 0 , LPVFeatureORB = 1 , LPVFeatureHOG = 2 , LPVFeatureAKAZE = 3 ,
  LPVFeaturePixelByPixel = 4 , LPVFeatureSIFT = 5 , LPVFeatureHaar = 6 , LPVFeatureShape = 7 ,
  LPVFeatureNewBrief = 8 , LPVFeatureGGCM = 9 , LPVFeatureIntegralHist = 10 , LPVFeatureMLP = 11
}
 This enumeration represents the type of feature extracted from the image. More...
 
enum  LPVKNNDistance {
  LPVKNNDistanceEuclidean = 0 , LPVKNNDistanceManhattan = 1 , LPVKNNDistanceMax = 2 , LPVKNNDistanceHistIntersection = 3 ,
  LPVKNNDistanceHellinger = 4 , LPVKNNDistanceChiSquare = 5
}
 This enumeration represents the distance calculation method used in KNN model for measuring the similarity between samples. More...
 
enum  LPVKNNMatchAlgo {
  LPVKNNMatchBruteForce = 0 , LPVKNNMatchKDTree = 1 , LPVKNNMatchKmeans = 2 , LPVKNNMatchComposite = 3 ,
  LPVKNNMatchHierarchical = 4 , LPVKNNMatchAuto = 5
}
 This enumeration represents the algorithm for the nearest searching used in KNN model. More...
 
enum  LPVKNNWeight { LPVKNNWeightByDistance = 0 , LPVKNNWeightUniformed = 1 }
 This enumeration represents the weighting method for KNN model to voting the final result label from K neighbors. More...
 
enum  LPVMLPActivationFunction { LPVMLPActivationSigmoidSym = 1 , LPVMLPActivationGaussian = 2 , LPVMLPActivationReLU = 3 , LPVMLPActivationLeakyReLU = 4 }
 This enumeration represents the activation function used in the MLP model. More...
 
enum  LPVMLPTrainMethod { LPVMLPTrainMethodBackprop = 0 , LPVMLPTrainMethodRProp = 1 }
 This enumeration represents the training method used in the MLP model. More...
 
enum  LPVModelType {
  LPVModelReserved = 0 , LPVModelKNN = 1 , LPVModelSVM = 2 , LPVModelRF = 3 ,
  LPVModelMLP = 4
}
 This enumeration represents the type of machine learning model. More...
 
enum  LPVPixelValueType { LPVPixelValueGray = 0 , LPVPixelValueGrayNorm = 1 , LPVPixelValueBinary = 2 , LPVPixelValueFraction = 3 }
 This enumeration represents the type of the pixel value used in the PixelByPixel feature. More...
 
enum  LPVProjectionType { LPVProjectionNone = 0 , LPVProjectionHorizontal = 1 , LPVProjectionVertical = 2 , LPVProjectionHorizontalAndVertical = 3 }
 This enumeration represents the type of the projection used in the PixelByPixel feature. More...
 
enum  LPVSampleType { LPVSampleTrain = 1 , LPVSampleTest = 2 }
 This enumeration represents the type of the sample instance. More...
 
enum  LPVShapeType { LPVShapeKPDistrib = 0 , LPVShapeContext = 1 , LPVShapeBoth = 2 }
 This enumeration represents the type of the shape feature. More...
 
enum  LPVSVMKernel { LPVSVMKernelLinear = 0 , LPVSVMKernelPolynomial = 1 , LPVSVMKernelRBF = 2 , LPVSVMKernelSigmoid = 3 }
 This enumeration represents the type of the kernel used in the SVM model. More...
 
enum  LPVSVMType { LPVSVMTypeCSupport = 0 , LPVSVMTypeNuSupport = 1 }
 This enumeration represents the type of the SVM model. More...
 

Detailed Description

LPV Machine learning Library, provides classes for classification/detection/inspection tasks that involves machine learning technology.

This library provides classes for machine learning tasks. To include the definitions of the library's classes, use the following directive:

Example Code

C++ Snippets: MLClassification.cpp
C# Snippets: MLClassification.cs

Enumeration Type Documentation

◆ LPVConductivity

This enumeration represents the type of the conductivity coefficient used in AKAZE feature.

For all the equations below, \( dL \) is the first order image derivative, \( k \) is the contrast factor.

Enumerator
LPVConductPMG1 

Perona & Malik G1: \( \exp{(-dL^2 / k^2)} \)

LPVConductPMG2 

Perona & Malik G2: \( 1 / (1 + dL^2 / k^2) \)

LPVConductWeickert 

Weickert: \( -3.315 / (dL^2 / k^2)^4 \)

LPVConductCharbonnier 

Charbonnier: \( 1 / \sqrt{(1 + dL^2 / k^2)} \)

◆ LPVFeatureType

This enumeration represents the type of feature extracted from the image.

Enumerator
LPVFeatureReserved 

Not-initialized feature.

LPVFeatureORB 

ORB(Oriented FAST and Rotated BRIEF) feature. Combines the FAST keypoint detector with the rotation-aware BRIEF descriptor, produces binary features that are fast to extract and match. Commonly used for real-time object detection, image matching and visual odometry.

LPVFeatureHOG 

HOG(Histogram of Oriented Gradients) feature. Builds the histogram of local gradient directions in cells, which is robust to illumination change. Commonly used for pedestrian detection and general object detection.

LPVFeatureAKAZE 

AKAZE(Accelerated-KAZE) feature. Detects keypoints in the nonlinear scale space built with fast explicit diffusion, and is rotation invariant. Commonly used for feature matching, image stitching and 3D reconstruction.

LPVFeaturePixelByPixel 

Pixel-by-pixel feature. Every pixel of the uniformed sample image is taken as one dimension of the feature vector, so the spatial gray information of the sample is fully kept. Commonly used for defect inspection and small-sample classification that rely on texture or gray details.

LPVFeatureSIFT 

SIFT(Scale-Invariant Feature Transform) feature. Detects keypoints across the scale space and describes them with local gradient statistics, invariant to scale, rotation and illumination change. Commonly used for image matching, stitching, recognition and 3D reconstruction.

LPVFeatureHaar 

Haarlike feature. Describes the local gray difference with rectangular Haar-like templates of various scales, which can be computed fast with the integral image. Commonly used for face detection and boosting-based object detection.

LPVFeatureShape 

Shape feature. Describes the sample shape with the shape context and the distribution of keypoints, capturing both local and global geometry. Commonly used for shape matching and classification of irregular or hollow parts.

LPVFeatureNewBrief 

NewBrief feature. A binary descriptor of local image patches based on intensity comparisons, fast to compute and to match with the Hamming distance. Commonly used for feature matching and image retrieval.

LPVFeatureGGCM 

GGCM(Gray-Gradient Co-occurrence Matrix) feature. Statistics of the co-occurrence of gray levels and gradient values, which reflects the texture property of the image. Commonly used for texture analysis and surface defect classification.

LPVFeatureIntegralHist 

IntegralHist(Integral Histogram) feature. Computes the histogram of any rectangular region in constant time from an integral histogram. Commonly used for region-based texture and color statistics in object detection.

LPVFeatureMLP 

MLP feature. The feature vector produced by an ANN(MLP) network, which maps the raw sample to a compact learned representation. Commonly used for classification with learned features.

◆ LPVKNNDistance

This enumeration represents the distance calculation method used in KNN model for measuring the similarity between samples.

For all the equations below, x and y is the two feature vectors of the two samples to compare, i is for the ith value.

Enumerator
LPVKNNDistanceEuclidean 

Euclidean(L2): \( \sum{(x_i - y_i)^2} \)

LPVKNNDistanceManhattan 

Manhattan(L1): \( \sum{|x_i - y_i|} \)

LPVKNNDistanceMax 

Maximum: \( \max{|x_i - y_i|} \) Only works with BruteForce or K-Means or Hierarchical matching

LPVKNNDistanceHistIntersection 

Histogram Intersection: \( \sum{\min{(x_i, y_i)}} \)

LPVKNNDistanceHellinger 

Hellinger: \( \sum{(\sqrt{x_i} - \sqrt{y_i})^2} \)

LPVKNNDistanceChiSquare 

Chi-Square: \( \sum{((x_i - y_i)^2/(x_i + y_i))} \text{ for } x_i + y_i > 0 \)

◆ LPVKNNMatchAlgo

This enumeration represents the algorithm for the nearest searching used in KNN model.

Enumerator
LPVKNNMatchBruteForce 

The naive Brute-Force algorithm, aka. searching one-by-one, used for small dataset.

LPVKNNMatchKDTree 

The samples are organized and searched in several KD-Trees.

LPVKNNMatchKmeans 

The samples are organized via K-Means algorithm.

LPVKNNMatchComposite 

Composite with KD-Tree and K-Means

LPVKNNMatchHierarchical 

The samples are organized via hierarchical clustering

LPVKNNMatchAuto 

The samples are organized via auto-tuned indexing

◆ LPVKNNWeight

This enumeration represents the weighting method for KNN model to voting the final result label from K neighbors.

Enumerator
LPVKNNWeightByDistance 

The voting is weight by the similarity distance between the sample and prediction feature.

LPVKNNWeightUniformed 

Each neighbor has the same weight

◆ LPVMLPActivationFunction

This enumeration represents the activation function used in the MLP model.

Enumerator
LPVMLPActivationSigmoidSym 

Symmetric sigmoid activation function

LPVMLPActivationGaussian 

Gaussian activation function

LPVMLPActivationReLU 

ReLU(Rectified Linear Unit) activation function

LPVMLPActivationLeakyReLU 

LeakyReLU activation function

◆ LPVMLPTrainMethod

This enumeration represents the training method used in the MLP model.

Enumerator
LPVMLPTrainMethodBackprop 

The back-propagation algorithm

LPVMLPTrainMethodRProp 

The RProp(resilient back-propagation) algorithm

◆ LPVModelType

This enumeration represents the type of machine learning model.

Enumerator
LPVModelReserved 

Not-initialized model.

LPVModelKNN 

KNN(K-Nearest Neighbors) model.

LPVModelSVM 

SVM(Support Vector Machine) model.

LPVModelRF 

RF(Random Forest) model.

LPVModelMLP 

MLP(Multi-Layer Perceptron) model.

◆ LPVPixelValueType

This enumeration represents the type of the pixel value used in the PixelByPixel feature.

Enumerator
LPVPixelValueGray 

The gray value in 0 ~ 1

LPVPixelValueGrayNorm 

The gray value normalized with maximum scaling to 0 ~ 1

LPVPixelValueBinary 

The binary value after auto-thresholding, bigger pixels report 1, otherwise report 0.
If a region is available, the region's mask is used as the source; if the region is using a soft mask, a floating value between 0 ~ 1 is reported.

LPVPixelValueFraction 

The fraction of foreground pixels after auto-thresholding

◆ LPVProjectionType

This enumeration represents the type of the projection used in the PixelByPixel feature.

Enumerator
LPVProjectionNone 

No projection

LPVProjectionHorizontal 

Horizontal projection, report the average of each row

LPVProjectionVertical 

Vertical projection, report the average of each column

LPVProjectionHorizontalAndVertical 

Horizontal and vertical projection, report the average of each row and column

◆ LPVSampleType

This enumeration represents the type of the sample instance.

Enumerator
LPVSampleTrain 

The sample instance in train set which is used for training

LPVSampleTest 

The sample instance in test set which is used for testing

◆ LPVShapeType

This enumeration represents the type of the shape feature.

Enumerator
LPVShapeKPDistrib 

Keypoint distribution based

LPVShapeContext 

Shape context based

LPVShapeBoth 

Both keypoint distribution and shape context

◆ LPVSVMKernel

This enumeration represents the type of the kernel used in the SVM model.

For all the equations below, x and y is the two feature vectors of the two samples to compare, g, c and n are numeric parameters.

Enumerator
LPVSVMKernelLinear 

Linear: \( x^Ty \)

LPVSVMKernelPolynomial 

Polynomial: \( (g \cdot x^Ty + c)^n \)

LPVSVMKernelRBF 

RBF: \( \exp{(-g \cdot |x - y|^2)} \)

LPVSVMKernelSigmoid 

Sigmoid: \( \tanh{(g \cdot x^Ty + c)} \)

◆ LPVSVMType

enum LPVSVMType

This enumeration represents the type of the SVM model.

Enumerator
LPVSVMTypeCSupport 

C-SVM, C-support vector machine, uses the C parameter to optimize the strength of the regularization.

LPVSVMTypeNuSupport 

Nu-SVM, Nu-support vector machine, uses the Nu parameter to control the number of support vectors