octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #46099] image package: edge(I, 'canny') gives


From: Hartmut
Subject: [Octave-bug-tracker] [bug #46099] image package: edge(I, 'canny') gives very bad quality results
Date: Thu, 01 Oct 2015 20:31:41 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:41.0) Gecko/20100101 Firefox/41.0

URL:
  <http://savannah.gnu.org/bugs/?46099>

                 Summary: image package: edge(I,'canny') gives very bad
quality results
                 Project: GNU Octave
            Submitted by: hardy
            Submitted on: Do 01 Okt 2015 20:31:40 GMT
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.0.0
        Operating System: Any

    _______________________________________________________

Details:

Here is a simple script to show the behavior. It uses the file
"cannysample.png" to be reproducible (attached to this post, it has only a
noisy blob in the center). This happens with the latest Octave (4.0.0) and
image package (2.4.0):


clear, close all;
I = imread('cannysample.png');
imshow(I);

sigma = 5;
thresholds = [];
[BW, t] = edge(I, 'Canny', thresholds, sigma);
t
figure, imshow(BW);
imwrite(BW, 'result_canny.png');


Running this script in Octave will give the attached result
"Octave_result_canny.png". If you run the very same script in Matlab (R2013b)
you will get the attached image "ML2013b_result_canny.png". In recent Matlab
versions the behavior of the Canny edge detektor was changed, therefor I also
run Matlab with the parameter "canny_old" instead of "canny", the resulting
image can be seen in "ML2013b_result_canny_old.png".

I observe the following:
* The Matlab result (with 'canny' as well as with 'canny_old') gives a CLOSED
contour without any missing pieces.
* The Octave result gives a similar contour, but it has several missing
pieces. 

The missing pieces in the contour make the Octave result much harder to use in
the following steps during image processing, it is not a "closed contour". So
you cannot -for example- just go ahead and fill all holes in the binary image
to get the regions.

This bug does not only happen with this particular test image, it occurs
reproducibly for all similar images as well. I just used a test image here, to
make the behavior reproducible.

This is NOT only a compatibility isssue compared to Matlab. The Canny edge
detector in general has as one of its useful features, to usually return
connected chains of edge pixels, but the Octave implementation of it does NOT
do this very well. This is not nice, because the Canny algorithm is one of the
most used edge detection algorithms.

Even when I try to optimize the parameter (sigma and the two thresholds) for
the Canny algorithm, I cannot make the resulting contour much better. It is
often impossible to get a closed contour as a result, even with manual fine
tuning.

Another observation (that may or may not be connected to the described issue):
I think I have never seen that changing the lower threshold for hysterises
thresholding changes anything in the results. This leads me to the suspicion
that there might be something wrong with the hysterises thresholding in the
file nonmax_supress.cc .





    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Do 01 Okt 2015 20:31:40 GMT  Name: cannysample.png  Size: 10kB   By:
hardy

<http://savannah.gnu.org/bugs/download.php?file_id=35024>
-------------------------------------------------------
Date: Do 01 Okt 2015 20:31:40 GMT  Name: Octave_result_canny.png  Size: 339B  
By: hardy

<http://savannah.gnu.org/bugs/download.php?file_id=35025>
-------------------------------------------------------
Date: Do 01 Okt 2015 20:31:40 GMT  Name: ML2013b_result_canny.png  Size: 362B 
 By: hardy

<http://savannah.gnu.org/bugs/download.php?file_id=35026>
-------------------------------------------------------
Date: Do 01 Okt 2015 20:31:40 GMT  Name: ML2013b_result_canny_old.png  Size:
320B   By: hardy

<http://savannah.gnu.org/bugs/download.php?file_id=35027>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46099>

_______________________________________________
  Nachricht gesendet von/durch Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]