5x6.png (5-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: { 2, 2, 2, 3, 2, 1 }

energy[][]:
 317.73   317.31   187.12*  364.06   305.11  
 172.73   300.07   265.33*  289.67   174.51  
 143.26   311.94    94.36*  309.61   184.07  
 240.18   295.49   312.36   193.36*  311.42  
 309.23   264.36   216.49*  299.43   279.17  
 346.86   166.32*  228.10   306.70   257.44  

distTo[][]:
 317.73   317.31   187.12*  364.06   305.11  
 490.04   487.19   452.45*  476.79   479.62  
 630.44   764.39   546.80*  762.05   660.85  
 870.63   842.29   859.16   740.16*  972.27  
1151.52  1106.65   956.65* 1039.59  1019.33  
1453.51  1122.97* 1184.75  1263.34  1276.77  

total energy of vertical seam = 1122.965447

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

horizontal seam: { 2, 3, 2, 3, 2 }

energy[][]:
 317.73   317.31   187.12   364.06   305.11  
 172.73   300.07   265.33   289.67   174.51  
 143.26*  311.94    94.36*  309.61   184.07* 
 240.18   295.49*  312.36   193.36*  311.42  
 309.23   264.36   216.49   299.43   279.17  
 346.86   166.32   228.10   306.70   257.44  

distTo[][]:
 317.73   490.04   630.44   994.50  1127.88  
 172.73   443.33   708.65   822.77   997.27  
 143.26*  455.20   533.10*  842.70   910.52* 
 240.18   438.74*  751.10   726.45* 1037.87  
 309.23   504.54   655.23   954.66  1005.63  
 346.86   475.55   703.66   961.93  1212.10  

total energy of horizontal seam = 910.519156

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