MantisBT - ITK
View Issue Details
0009431ITKpublic2009-08-17 06:562010-10-21 12:31
Charl Botha 
Bradley Lowekamp 
normalmajoralways
closedfixed 
 
 
0009431: CannyEdgeDetectionImageFilter gives different output for same parameters and input after repeated runs
In short, the canny filter's behaviour changes depending on whether it has been freshly instantiated or whether it has been used with a different parameter setting before. Setting the threshold back to a previous value after having executed the filter with different values will yield incorrect results.

Running the attached Python script on Insight/Testing/Data/Input/cthead1.png yields 4 images on disc, of which canny_t0.png and canny_t0_after.png should be identical, as they are using the same thresholds, and otherwise identical parameters. However, they are wildly different, see the attached images.
No tags attached.
? CannyEdgeDetectionImageFilter_repeat_bug.py (1,102) 2009-08-17 06:56
https://public.kitware.com/Bug/file/2414/CannyEdgeDetectionImageFilter_repeat_bug.py
png canny_t0.png (10,986) 2009-08-17 06:57
https://public.kitware.com/Bug/file/2415/canny_t0.png
png

png canny_t0_after.png (15,670) 2009-08-17 06:57
https://public.kitware.com/Bug/file/2416/canny_t0_after.png
png
Issue History
2009-08-17 06:56Charl BothaNew Issue
2009-08-17 06:56Charl BothaFile Added: CannyEdgeDetectionImageFilter_repeat_bug.py
2009-08-17 06:57Charl BothaFile Added: canny_t0.png
2009-08-17 06:57Charl BothaFile Added: canny_t0_after.png
2009-08-17 07:57Bradley LowekampNote Added: 0017143
2009-08-17 08:05Charl BothaNote Added: 0017144
2009-08-17 08:20Bradley LowekampNote Added: 0017145
2009-08-17 08:20Bradley LowekampNote Edited: 0017145
2009-08-17 10:05Bradley LowekampNote Added: 0017148
2009-08-17 10:14Luis IbanezProject@1@ => ITK
2009-08-17 10:14Luis IbanezStatusnew => assigned
2009-08-17 10:14Luis IbanezAssigned To => Bradley Lowekamp
2009-08-17 10:35Bradley LowekampStatusassigned => confirmed
2009-08-18 14:41Bradley LowekampNote Added: 0017156
2009-08-18 14:41Bradley LowekampStatusconfirmed => resolved
2009-08-18 14:41Bradley LowekampResolutionopen => fixed
2010-10-21 12:31Gabe HartStatusresolved => closed

Notes
(0017143)
Bradley Lowekamp   
2009-08-17 07:57   
I have a patch for this bug, but it is a VTK category so I can't assign it to myself.
(0017144)
Charl Botha   
2009-08-17 08:05   
Argh, my default category is VTK and I didn't see that when I submitted this bug. Is there someone that can fix it? I'm not able to change it AFAICS.

Great that you have a fix for this!!
(0017145)
Bradley Lowekamp   
2009-08-17 08:20   
submitted patch:

http://public.kitware.com/cgi-bin/viewcvs.cgi/Code/BasicFilters/itkCannyEdgeDetectionImageFilter.txx?revision=1.56&root=Insight&view=markup [^]

(0017148)
Bradley Lowekamp   
2009-08-17 10:05   
added test:

http://public.kitware.com/cgi-bin/viewcvs.cgi/Testing/Code/BasicFilters/CMakeLists.txt.diff?cvsroot=Insight&r1=1.392&r2=1.393 [^]
http://public.kitware.com/cgi-bin/viewcvs.cgi/Testing/Code/BasicFilters/itkBasicFiltersTests.cxx.diff?cvsroot=Insight&r1=1.123&r2=1.124 [^]
http://public.kitware.com/cgi-bin/viewcvs.cgi/Testing/Code/BasicFilters/itkCannyEdgeDetectionImageFilterTest2.cxx?cvsroot=Insight&rev=1.1&view=markup [^]
(0017156)
Bradley Lowekamp   
2009-08-18 14:41   
the submitted patch passed on all nightly builds