Analysis and testing #2 (4 clusters per band)

Level of quantization

Select level of quantization (1, 2, 3, 4, 5, 6)

vqlevel = 2 ;

Pick corresponding VQ codebook and histograms

centroids = centroidsAll[[vqlevel]] ; hist = histAll[[vqlevel]] ;

Visualize centroids by band

The graphics below illustrate the centroids by band (HL1, LH1, HH1, HL2, LH2, HH2) down the columns.

VisualizeCentroids[#, ImageSize500] & /@ centroids ;

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

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

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

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

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

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

Visualize histograms

The graphics below illustrate the histogram over the VQ codebooks by band (HL1, LH1, HH1, HL2, LH2, HH2) down the columns.

colors = {Red, Green, Blue, Orange} ;

BarChart[Sequence @@ #, BarStylecolors, BarEdgeStylecolors, FrameTrue, ImageSize500] & /@ hist ;

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

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

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

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

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

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

Visualize test images

Define test image data

testPos1 = {1, 1} ; testPos2 = {160, 320} ; testOffset = {4, 4} ;

Visualize test image data

testData = TakeMatrix[#, testPos1, testPos2] & /@ texImages ; testVis = BlockMatrix[Partition[testData, 2]] ; ShowImage[testVis] ;

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

Compute all test image probabilities

Define filter (same as used during training)

db4 = DaubechiesFilter[4] ;

Compute probabilities for all test images and all histogram models

time1 = AbsoluteTime[] ; probs = AnalyzeOneImage[#, testOffset, db4, centroids, hist, bandMap] & /@ testData ; AbsoluteTime[] - time1

230.496328

Visualize individual histogram classifications of test images

The graphics below illustrate the classification of each test image by band (HL1, LH1, HH1, HL2, LH2, HH2) down the columns.

results = Map[VisualizeResults[#, colors, DisplayFunctionIdentity] &, probs, {2}] ;

gresults = Map[Last, results, {2}] ; gimages = ShowImage[#, 1, 255, 0, DisplayFunction ... lts]], ImageSize640, DisplayFunction$DisplayFunction, GraphicsSpacing0] ;

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

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

Visualize overall classifications of test images

resultsCombined = Map[VisualizeResults[Times @@ #, colors, DisplayFunctionIdentity] &, probs] ;

gresultsCombined = Map[Last, resultsCombined] ; gimages = ShowImage[#, 1, 255, 0, DisplayFunct ... ined], ImageSize640, DisplayFunction$DisplayFunction, GraphicsSpacing0] ;

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

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

Summary of percent correct classification

By band (1 - HL1, 2 - LH1, 3 - HH1, 4 - HL2, 5 - LH2, 6 - HH3)

correctbyband = Table[Map[First, results, {2}][[j, i, j]], {j, 1, Length[testData]}, {i, 1, Le ... lecolors, FrameTrue, GridLines {None, Automatic}, ImageSize400] ;

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

Overall bands and overall correct classification percentage

correctoverall = Table[Map[First, resultsCombined][[i, i]], {i, 1, Length[testData]}] ; BarCha ... lors, BarEdgeStylecolors, FrameTrue, ImageSize400] ; Mean[correctoverall]

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

87.5219


Created by Mathematica  (February 16, 2004)