Two-channel classification experiments

Show training and test images

Show[GraphicsArray[{{trn, tst}, {s2, s1}}], ImageSize400] ;

[Graphics:../HTMLFiles/index_33.gif]

Visualize two-channel color distributios of training image

RG plane

gd1 = PlotData2D[{#[[1]], #[[2]]} & /@ d1 //N, pr, style1, nS] ; gd2 = PlotData2D[{#[[1]], #[[2]]} & /@ d2 //N, pr, style2, nS] ; distRG = Show[gd1, gd2, FrameTicksNone, yS] ;

[Graphics:../HTMLFiles/index_35.gif]

RB plane

gd1 = PlotData2D[{#[[1]], #[[3]]} & /@ d1 //N, pr, style1, nS] ; gd2 = PlotData2D[{#[[1]], #[[3]]} & /@ d2 //N, pr, style2, nS] ; distRB = Show[gd1, gd2, FrameTicksNone, yS] ;

[Graphics:../HTMLFiles/index_37.gif]

GB plane

gd1 = PlotData2D[{#[[2]], #[[3]]} & /@ d1 //N, pr, style1, nS] ; gd2 = PlotData2D[{#[[2]], #[[3]]} & /@ d2 //N, pr, style2, nS] ; distGB = Show[gd1, gd2, FrameTicksNone, yS] ;

[Graphics:../HTMLFiles/index_39.gif]

Compute two-dimensional pdfs and corresponding error on 2d color channel combinations

p1rg = gaussian[{#[[1]], #[[2]]} & /@ d1 //N, {x, y}] ; p1rb = gaussian[{#[[1]], #[[3]]} & ... ], #[[3]]} & /@ d2 //N, {x, y}] ; p2gb = gaussian[{#[[2]], #[[3]]} & /@ d2 //N, {x, y}] ;

Show two-dimensional pdfs (skip)

ShowTwoGaussianPDFs[p1rg, p2rg, {{0, 255}, {0, 255}}, x, y, ImageSize400] ;

[Graphics:../HTMLFiles/index_42.gif]

ShowTwoGaussianPDFs[p1rb, p2rb, {{0, 255}, {0, 255}}, x, y, ImageSize400] ;

[Graphics:../HTMLFiles/index_44.gif]

ShowTwoGaussianPDFs[p1gb, p2gb, {{0, 255}, {0, 255}}, x, y, ImageSize400] ;

[Graphics:../HTMLFiles/index_46.gif]

Show decision regions

RG plane

decRG = ShowTwoClassificationRegions[p1rg, p2rg, pr, x, y, classColors, False, AxesFal ... rue, FrameTicksNone, nS] ; Show[GraphicsArray[{{decRG, distRG}}], ImageSize400] ;

[Graphics:../HTMLFiles/index_48.gif]

RB plane

decRB = ShowTwoClassificationRegions[p1rb, p2rb, pr, x, y, classColors, False, AxesFal ... rue, FrameTicksNone, nS] ; Show[GraphicsArray[{{decRB, distRB}}], ImageSize400] ;

[Graphics:../HTMLFiles/index_50.gif]

RB plane

decGB = ShowTwoClassificationRegions[p1gb, p2gb, pr, x, y, classColors, False, AxesFal ... rue, FrameTicksNone, nS] ; Show[GraphicsArray[{{decGB, distGB}}], ImageSize400] ;

[Graphics:../HTMLFiles/index_52.gif]

Compute expected error

errors = {ExpectedError2D[p1rg, p2rg, x, y], ExpectedError2D[p1rb, p2rb, x, y], ExpectedError2 ... e}, FrameTicks {None, Automatic, None, Automatic}, GridLines {None, Automatic}] ;

[Graphics:../HTMLFiles/index_54.gif]

Classify training and test image

crg1 = ClassifyImage2D[trn, p1rg, p2rg, {Red, Green}] ; crb1 = ClassifyImage2D[trn, p1rb, p2rb, {Red, Blue}] ; cgb1 = ClassifyImage2D[trn, p1gb, p2gb, {Green, Blue}] ;

crg2 = ClassifyImage2D[tst, p1rg, p2rg, {Red, Green}] ; crb2 = ClassifyImage2D[tst, p1rb, p2rb, {Red, Blue}] ; cgb2 = ClassifyImage2D[tst, p1gb, p2gb, {Green, Blue}] ;

Show classification results

Show[GraphicsArray[{{trn, crg1}, {crb1, cgb1}}], ImageSize400] ;

[Graphics:../HTMLFiles/index_58.gif]

Show[GraphicsArray[{{tst, crg2}, {crb2, cgb2}}], ImageSize400] ;

[Graphics:../HTMLFiles/index_60.gif]


Created by Mathematica  (September 8, 2003)