<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>fixtures/cart_edges.png</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,14 +1,14 @@
 class EdgeDetector
-  VERBOSE=false
+  VERBOSE=true
   
   # Use Prewitt Edge Detection
   Y_MASK = [[-1, 0, 1],
             [-1, 0, 1],
             [-1, 0, 1]]
 
-  X_MASK = [[ 1,  1,  1],
-            [ 0,  0,  0],
-            [-1, -1, -1]]
+  X_MASK = [[ -1, -1, -1],
+            [  0,  0,  0],
+            [  1,  1,  1]]
 
   MAX_MAGNITUDE = begin
     QuantumRange
@@ -71,7 +71,7 @@ class EdgeDetector
         if column == 0 || row == 0 || column == @img.right || row == @img.bottom
           magnitude = MAX_MAGNITUDE
         else
-          # for the 8 surrounding pixels to x,y, apply the filter value and add to the xsum
+          # for the 8 surrounding pixels to x,y, apply the filter
           [-1,0,1].each do |x_offset|
             [-1,0,1].each do |y_offset|
 
@@ -85,7 +85,7 @@ class EdgeDetector
             end
           end
           
-          magnitude = xsum.abs + ysum.abs
+          magnitude = Math.sqrt(xsum * xsum + ysum * ysum)
         end
 
         magnitude = [magnitude, MAX_MAGNITUDE].min # cap at MAX_MAGNITUDE</diff>
      <filename>lib/seamcarver/edge_detector.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,7 @@ describe EdgeDetector do
     ed = EdgeDetector.new(@fixtures_path + &quot;/cart_gray.jpg&quot;)
     edges = ed.detect_edges
     
-    edges.should nearly_equal_image(@fixtures_path + &quot;/cart_edges.jpg&quot;)
+    edges.should nearly_equal_image(@fixtures_path + &quot;/cart_edges.png&quot;)
   end
   
   it &quot;should only accept grayscale images for edge detection&quot; do</diff>
      <filename>spec/edge_detector_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>fixtures/cart_edges.jpg</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>8b51e700bafed256dadf6ea45dbe8e79c1ad99d8</id>
    </parent>
  </parents>
  <author>
    <name>Cory</name>
    <email>cory.forsyth@gmail.com</email>
  </author>
  <url>http://github.com/bantic/image_labs/commit/bf5ce26a31be2cbf8bd6512fb3737139378e05e9</url>
  <id>bf5ce26a31be2cbf8bd6512fb3737139378e05e9</id>
  <committed-date>2009-03-22T14:43:58-07:00</committed-date>
  <authored-date>2009-03-22T14:43:58-07:00</authored-date>
  <message>Fixed Prewitt x-mask kernel and changed edge detection to use Math.sqrt</message>
  <tree>89cf9078efcfc577ee70432863e39175055db9ef</tree>
  <committer>
    <name>Cory</name>
    <email>cory.forsyth@gmail.com</email>
  </committer>
</commit>
