6x5.png (6-by-5 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: { 3, 4, 3, 2, 2 }

energy[][]:
 240.18   225.59   302.27   159.43*  181.81   192.99  
 124.18   237.35   151.02   234.09   107.89*  159.67  
 111.10   138.69   228.10   133.07*  211.51   143.75  
 130.67   153.88   174.01*  284.01   194.50   213.53  
 179.82   175.49    70.06*  270.80   201.53   191.20  

distTo[][]:
 240.18   225.59   302.27   159.43*  181.81   192.99  
 349.78   462.94   310.45   393.52   267.32*  341.49  
 460.88   449.15   538.55   400.40*  478.83   411.07  
 579.81   603.02   574.40*  684.41   594.90   624.60  
 759.64   749.89   644.47*  845.21   796.42   786.09  

total energy of vertical seam = 644.467988

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

horizontal seam: { 2, 2, 1, 2, 1, 2 }

energy[][]:
 240.18   225.59   302.27   159.43   181.81   192.99  
 124.18   237.35   151.02*  234.09   107.89*  159.67  
 111.10*  138.69*  228.10   133.07*  211.51   143.75* 
 130.67   153.88   174.01   284.01   194.50   213.53  
 179.82   175.49    70.06   270.80   201.53   191.20  

distTo[][]:
 240.18   349.78   650.73   560.25   742.06   834.78  
 124.18   348.45   400.82*  634.91   641.79*  801.46  
 111.10*  249.80*  477.90   533.89*  745.40   785.53* 
 130.67   264.98   423.81   619.06   728.39   941.92  
 179.82   306.16   335.04   605.85   807.37   919.59  

total energy of horizontal seam = 785.531820

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