4x6.png (4-by-6 image)

The energy[][] matrix gives the dual-gradient energy of each pixel.

The distTo[][] matrix gives the energy of the minimum energy path from
a pixel in the top-most row (or left-most column) to each pixel.

The asterisks denote the minimum energy vertical (or horizontal) seam.

-----------------------------------------------------

vertical seam: { 0, 0, 1, 1, 0, 1 }

energy[][]:
 241.26*  262.86   218.08   219.32  
 130.86*  275.66   173.21   332.31  
 286.21   173.21*  321.01   211.20  
 201.53   171.80*  195.63   310.70  
 127.53*  270.93   188.15   189.61  
 316.45   176.88*  326.63   248.93  

distTo[][]:
 241.26*  262.86   218.08   219.32  
 372.12*  493.75   391.30   550.40  
 658.33   545.33*  712.30   602.49  
 746.86   717.13*  740.97   913.19  
 844.66*  988.06   905.28   930.57  
1161.11  1021.54* 1231.91  1154.21  

total energy of vertical seam = 1021.537911

-----------------------------------------------------

horizontal seam: { 4, 3, 4, 4 }

energy[][]:
 241.26   262.86   218.08   219.32  
 130.86   275.66   173.21   332.31  
 286.21   173.21   321.01   211.20  
 201.53   171.80*  195.63   310.70  
 127.53*  270.93   188.15*  189.61* 
 316.45   176.88   326.63   248.93  

distTo[][]:
 241.26   393.72   611.81   696.60  
 130.86   406.52   477.28   809.60  
 286.21   304.07   620.33   688.48  
 201.53   299.33*  494.96   798.17  
 127.53*  398.46   487.47*  677.08* 
 316.45   304.41   631.04   736.40  

total energy of horizontal seam = 677.079478

-----------------------------------------------------
