« Time bounSyllabus for all sect | Main | Early forSyllabus for all sect »
January 27, 2006
A small eSyllabus for all sect
Hello all,
Michael Goulding noticed an error in two files today. The first is frmMain.cs, and the other is GrayBitmap.cs. The error occurs if you just calculate your gradients once at the beginning, instead of over and over again. Here are the two files--download them and use them if you need. Brad
My code includes both errors and works fine because I use a different method for getting the pixel weights. If you use the "GetPixelWeight(point P)" method in the Scissors abstract class then the weight will be calculated for you (correctly) every time. Also, the GetPixelGradient method in the GradientBitmap class works fine as well.
The error only occurs if you use the precomputed Gradient attribute in the GrayBitmap class. The problem is that the "set" method for Gradient attribute is missing. YOu'll want that method to be there.
Also, I noticed that the set method for the MaximumGradientValue attribute of the GradientBitmap class is missing as well. Easily fixed and had no impact on the correctness of my implementation because... The pixel weight is calculated as MaximumGradientValue - PixelGradient + 1. As long as the MaximumGradientValue is constant throughout the Dijkstra run, the relative order of the pixels sorted by weight will be the same. Because... X - 2 is less than X - 1 for all values of X. Mike.
Posted by bradleyMecham at January 27, 2006 06:08 PM
Comments
Post a comment
Thanks for signing in, . Now you can comment. (sign out)
(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)