M Sobel: Difference between revisions

From Cpre584
Jump to navigation Jump to search
Mjpatter (talk | contribs)
No edit summary
Mjpatter (talk | contribs)
No edit summary
Line 14: Line 14:
This algorithm also dynamically scales the output, so the highest value after the Sobel Operator has been applied becomes 255 (maxval), and the rest are scaled appropriately.  From what I've observed, this tends to make the output images a little darker than other implementations, but they also are smoother.  My implementation seems fairly similar to GIMP's use of the Sobel operator, as can be seen in the following screenshots.
This algorithm also dynamically scales the output, so the highest value after the Sobel Operator has been applied becomes 255 (maxval), and the rest are scaled appropriately.  From what I've observed, this tends to make the output images a little darker than other implementations, but they also are smoother.  My implementation seems fairly similar to GIMP's use of the Sobel operator, as can be seen in the following screenshots.


[[Image:Initial.png]]
[[Image:Initial.png]] [[Image:MySobel.png]] [[Image:GimpSobel.png]]
[[Image:MySobel.png]] [[Image:GimpSobel.png]]


The original image followed by the output of my Sobel operator followed by the output of GIMP's Sobel filter.


gimp output
I also tested it on Convey to make sure it worked there as well, and it did.
 
my program output.
 
 
results (test on my laptop and convey)


== Software Optimization ==
== Software Optimization ==
link to code, makefile, results (test on my laptop and convey)
I then did some simple optimizations in software to make sure the output did not change.





Revision as of 19:52, 29 February 2012

Initial Software

Currently I have the software hosted at the following link on github: https://github.com/mjpatter88/SobelEdgeDetection

The code can be found here: https://github.com/mjpatter88/SobelEdgeDetection/blob/master/sobel.c

The makefile can be found here: https://github.com/mjpatter88/SobelEdgeDetection/blob/master/Makefile


This software supports both ppm (color) and pgm (black and white) images. In the case when the input image is a color image, each pixel is converted to gray scale before the Sobel operator is applied.

This algorithm also dynamically scales the output, so the highest value after the Sobel Operator has been applied becomes 255 (maxval), and the rest are scaled appropriately. From what I've observed, this tends to make the output images a little darker than other implementations, but they also are smoother. My implementation seems fairly similar to GIMP's use of the Sobel operator, as can be seen in the following screenshots.

The original image followed by the output of my Sobel operator followed by the output of GIMP's Sobel filter.

I also tested it on Convey to make sure it worked there as well, and it did.

Software Optimization

I then did some simple optimizations in software to make sure the output did not change.


Software Simulation

link to code (c code, assembly, software sim c++), results.


Hardware

link to code, results, timing analysis