[Top][All Lists]

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

[Octave-patch-tracker] [patch #9407] image package: new function houghpe

From: Hartmut
Subject: [Octave-patch-tracker] [patch #9407] image package: new function houghpeaks.m
Date: Tue, 1 Aug 2017 15:57:39 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

Follow-up Comment #4, patch #9407 (project octave):

Thanks for your review, Avinoam:

1. good

2. thanks

3. I will leave those coding style issues to Carne. The coding guideline of
the image package (in the file HACKING) doesn't say anything about this.

4. Yes, hough.m is still slightly Matlab incompatible. But I double checked,
and it turned out that the different results you have observed here, ARE
mostly really due to houghpeaks.m and not due to hough.m! Further
investigation (using a saved csv file with the Matlab H result of peaks.m to
debug the Octave function) showed that Matlab deletes the (593,136) value of
H, therefore it gives the third peak (at 310,46) instead of the second one
that Octave gives. This lead to the conclusion that Matlab uses a slightly
bigger nhood for the peak deletion as my current Octave implementation. I am
pretty sure that my current Octave implementation is doing what the Matlab
help page says (size H = 723,180 -> divided by 50 gives 14.46 and 3.6 -> next
bigger odd integer is 15 and 5. But Matlab seems to use 17 and 5.) So I have
created a new version of my houghpeaks.m that also increases the nhood by 1
for half of the possible size values. (So their documentation is wrong here,
or it is a Matlab bug I would say.) Nevertheless this new version of
houghpeaks.m is now more Matlab compatible. All test still pass, Avinoams
example from comment #3 now also gives Matlab compatible results, and this is
added as a new test. (Slight differences of +-1 in the peak positions are
really due to  hough.m and not to houghpeaks.m).

The result of this houghpeaks.m on Avinoams example in comment #3 now is:
P =

   586   136
   311    46
   596   136
   523   104
   374    46

But if you use the Matlab result of hough(I) (e.g. via csv export) as input to
this Octave function houghpeaks.m then the result is 100% Matlab compatible,

You can find my new version of houghpeaks.m here:


and also attached (as file V4) to this bug report.

(file #41385)

Additional Item Attachment:

File name: houghpeaks_V4.m                Size:10 KB


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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