C# Class SetVision.Vision.ContourAnalyzer

Inheritance: ICardDetector
Afficher le fichier Open project: LoyVanBeek/SetVision Class Usage Examples

Méthodes publiques

Méthode Description
AnalyzeNode ( ContourNode cardNode ) : ContourNode>.KeyValuePair
DrawContours ( ContourNode node, Byte>.Image canvas ) : void
DrawContours ( ContourNode node, Byte>.Image canvas, System color ) : void
FindBestColoredPixel ( Byte>.Image image, Byte>.Image &debug ) : Point
FindMostOccuringColor ( Byte>.Image image, int step ) : CardColor
GiveCards ( ContourNode tree ) : ContourNode>>.IEnumerable
IsCard ( ContourNode node ) : bool
IsDiamond ( ContourNode node ) : bool
IsOval ( ContourNode node ) : bool
IsSquiggle ( ContourNode node ) : bool
LocateCards ( Byte>.Image table, Settings settings ) : Point>.Dictionary

LocateCards works by analyzing the contours in the image. For instance, the Diamond in Set is a polygon with exactly 4 vertices. The Oval has no such features yet. The Squiggle is not convex, but concave and has edges in a 'right bend', instead of only 'left bends' All these shapes are inside the contour of a (white) card, which is a rounded square. Cards may also be the (only) exterior boundaries

Private Methods

Méthode Description
AssignAverageColors ( ContourNode node, Settings settings ) : void
AssignColor ( ContourNode node, Byte>.Image image, Settings settings ) : void
AssignColors ( ContourNode tree, Byte>.Image image, Settings settings ) : void
AssignFill ( ContourNode node ) : void
AssignFills ( ContourNode tree ) : void
AssignImage ( ContourNode node, Byte>.Image image, bool setROI ) : void
AssignImages ( ContourNode tree, Byte>.Image image, bool setROI ) : void
AssignShape ( ContourNode node ) : void
AssignShapes ( ContourNode tree ) : void
ClassifyBgr ( Bgr col ) : CardColor
ClassifyBgr2 ( Bgr col ) : CardColor
ClassifyHsv ( Hsv hsv ) : CardColor
ColorDistance ( Bgr a, Bgr b ) : double
ColorDistance ( Hsv a, Hsv b ) : double
DetermineFill ( ContourNode cardNode ) : Fill
ExtractContourImage ( Byte>.Image image, Contour contour, Byte>.Image &mask ) : Byte>.Image
FilterNode ( ContourNode node ) : void
FilterTree ( ContourNode tree ) : void
RecognizeColor ( ContourNode node, Settings settings ) : CardColor
isDashed ( ContourNode inner ) : bool
isGray ( Bgr col, double range ) : bool

Check if R, G and B are closer than range together

Method Details

AnalyzeNode() public static méthode

public static AnalyzeNode ( ContourNode cardNode ) : ContourNode>.KeyValuePair
cardNode ContourNode
Résultat ContourNode>.KeyValuePair

DrawContours() public static méthode

public static DrawContours ( ContourNode node, Byte>.Image canvas ) : void
node ContourNode
canvas Byte>.Image
Résultat void

DrawContours() public static méthode

public static DrawContours ( ContourNode node, Byte>.Image canvas, System color ) : void
node ContourNode
canvas Byte>.Image
color System
Résultat void

FindBestColoredPixel() public static méthode

public static FindBestColoredPixel ( Byte>.Image image, Byte>.Image &debug ) : Point
image Byte>.Image
debug Byte>.Image
Résultat Point

FindMostOccuringColor() public static méthode

public static FindMostOccuringColor ( Byte>.Image image, int step ) : CardColor
image Byte>.Image
step int
Résultat CardColor

GiveCards() public static méthode

public static GiveCards ( ContourNode tree ) : ContourNode>>.IEnumerable
tree ContourNode
Résultat ContourNode>>.IEnumerable

IsCard() public static méthode

public static IsCard ( ContourNode node ) : bool
node ContourNode
Résultat bool

IsDiamond() public static méthode

public static IsDiamond ( ContourNode node ) : bool
node ContourNode
Résultat bool

IsOval() public static méthode

public static IsOval ( ContourNode node ) : bool
node ContourNode
Résultat bool

IsSquiggle() public static méthode

public static IsSquiggle ( ContourNode node ) : bool
node ContourNode
Résultat bool

LocateCards() public méthode

LocateCards works by analyzing the contours in the image. For instance, the Diamond in Set is a polygon with exactly 4 vertices. The Oval has no such features yet. The Squiggle is not convex, but concave and has edges in a 'right bend', instead of only 'left bends' All these shapes are inside the contour of a (white) card, which is a rounded square. Cards may also be the (only) exterior boundaries
public LocateCards ( Byte>.Image table, Settings settings ) : Point>.Dictionary
table Byte>.Image An image displaying the table with the Set cards
settings Settings
Résultat Point>.Dictionary