One-channel classification experiments

Read in training and test images

{d1, d2, s1, s2} = ReadSplitImages[TrainingFile, TrainingDirectory] ; trn = ReadWholeImage[TrainingFile, WholeImageDirectory] ; tst = ReadWholeImage[TestFile, WholeImageDirectory] ;

Show training and test images

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

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

Compute one-dimensional pdfs and corresponding error on 1d color channels

p1r = ComputePDF1D[d1, Red] ; p1g = ComputePDF1D[d1, Green] ; p1b = ComputePDF1D[d1, Blue] ; & ... 371; p2r = ComputePDF1D[d2, Red] ; p2g = ComputePDF1D[d2, Green] ; p2b = ComputePDF1D[d2, Blue] ;

pl1 = ShowTwoGaussianPDFs1D[p1r, p2r, {0, 255}, x, FrameTicksNone, nS] ; pl2 = ShowTwo ... 2754;None, nS] ; pl3 = ShowTwoGaussianPDFs1D[p1b, p2b, {0, 255}, x, FrameTicksNone, nS] ;

errors = {ExpectedError1D[p1r, p2r, x], ExpectedError1D[p1g, p2g, x], ExpectedError1D[p1b, p2b ... FrameTicks {None, Automatic, None, Automatic}, GridLines {None, Automatic}, nS] ;

Show one-dimensional pdfs

Show[GraphicsArray[{{pl1, pl2}, {pl3, pl4}}], ImageSize400] ;

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

Classify training and test image

cr1 = ClassifyImage1D[trn, ComputeDecisionBoundary1D[p1r, p2r, x], Red] ; cg1 = ClassifyImage1 ... p1g, p2g, x], Green] ; cb1 = ClassifyImage1D[trn, ComputeDecisionBoundary1D[p1b, p2b, x], Blue] ;

cr2 = ClassifyImage1D[tst, ComputeDecisionBoundary1D[p1r, p2r, x], Red] ; cg2 = ClassifyImage1 ... p1g, p2g, x], Green] ; cb2 = ClassifyImage1D[tst, ComputeDecisionBoundary1D[p1b, p2b, x], Blue] ;

Show classification results

Show[GraphicsArray[{{trn, cr1}, {cg1, cb1}}], ImageSize400] ;

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

Show[GraphicsArray[{{tst, cr2}, {cg2, cb2}}], ImageSize400] ;

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


Created by Mathematica  (September 8, 2003)