zhaojiahai / aforge

Automatically exported from code.google.com/p/aforge
Other
0 stars 0 forks source link

Possible Type Improvement in CannyEdgeDetector.cs:182 #139

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I think you could slightly improve the speed of the Canny Edge Detector in 
Sources/Imaging/Filters/Edge%20Detectors/CannyEdgeDetector.cs

Line 182 reads "double gx, gy;".
Those variables could be switched to int without loss.
Just be sure to change line 231 to "double div = gy / (double)gx;".

Original issue reported on code.google.com by martin.d...@gmail.com on 27 Jun 2010 at 10:05

GoogleCodeExporter commented 8 years ago
Other remarks :
- At lines 313 "p=0" and 319 "for ( int x = startX; x < stopX; x++, dst++, p++ 
)" the variable p is iterated but not used in this last loop.
- The hysteresis in step 4 is does not follow 
http://www.pages.drexel.edu/~weg22/can_tut.html as one would expect from the 
documentation. Line 
330 reads "// check 8 neighboring pixels" although the expected algorithm would 
truly follow edges, as featured at 
http://fourier.eng.hmc.edu/e161/programs/canny/hysteresis.c 
Although the current hack is more efficient, it should be documented.

Original comment by martin.d...@gmail.com on 27 Jun 2010 at 12:13

GoogleCodeExporter commented 8 years ago
Will the suggestions ...

One thing to note. With tracking systems there is usually one simple rule - one 
issue per ticket. It makes it simpler to track, fix, etc. What if something can 
be done for next release, but something can not? Etc. 

Original comment by andrew.k...@gmail.com on 30 Jun 2010 at 9:16

GoogleCodeExporter commented 8 years ago
All Done.

Few minor improvements to CannyEdgeDetector:
1) changed from double to int type for those variable, which are really integer;
2) removed incrementing index variable, which is not used inside of a loop;
3) clarified documentation about hysteresis.

Committed in revision 1271. Will be released in version 2.1.3.

Thank you for your feedback.

Original comment by andrew.k...@gmail.com on 30 Jun 2010 at 9:46

GoogleCodeExporter commented 8 years ago

Original comment by andrew.k...@gmail.com on 1 Sep 2010 at 7:02