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

energy[][]:
 212.11   174.62*  175.13  
 283.29   294.32   173.45* 
 354.33   236.17   199.07* 
 194.42   325.15   166.88* 
 232.09   251.36*  309.88  
 320.38   279.64   241.34* 
 185.98   237.05   214.15* 

distTo[][]:
 212.11   174.62*  175.13  
 457.91   468.95   348.07* 
 812.25   584.24   547.14* 
 778.66   872.29   714.03* 
1010.75   965.38* 1023.90  
1285.76  1245.02  1206.72* 
1431.00  1443.77  1420.87* 

total energy of vertical seam = 1420.871702

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

horizontal seam: { 0, 0, 1 }

energy[][]:
 212.11*  174.62*  175.13  
 283.29   294.32   173.45* 
 354.33   236.17   199.07  
 194.42   325.15   166.88  
 232.09   251.36   309.88  
 320.38   279.64   241.34  
 185.98   237.05   214.15  

distTo[][]:
 212.11*  386.73*  561.86  
 283.29   506.43   560.18* 
 354.33   430.59   629.66  
 194.42   519.57   597.48  
 232.09   445.78   755.66  
 320.38   465.61   664.37  
 185.98   423.03   637.18  

total energy of horizontal seam = 560.178311

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