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

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

[Octave-bug-tracker] [bug #52933] [octave-forge] (image) regionprops Per


From: Avinoam Kalma
Subject: [Octave-bug-tracker] [bug #52933] [octave-forge] (image) regionprops Perimeter returns Matlab incompatible results
Date: Sat, 27 Jan 2018 12:05:07 -0500 (EST)
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36

Follow-up Comment #8, bug #52933 (project octave):

@Hartmut, thanks for your review.
My answers:

* Indeed, this line line should be removed.
* The definition of CHAIN_CODE can be anywhere before the loop.
* When there is a single pixel, np is 2, because the first and the last pixel
in the list are the same.
* Yes, I will add "perimeterold".
* I will add some relevant tests
* Yes, I have found this problem too, and the solution I have found is


      if (chain_code_change(1) != 0 && chain_code_change(end) != 0)
      # do not count first point twice  
        corners--;
      end


Becuase the first and the last pixels in the boundary are the same, and are
counted as two corners. BUT, please see my final note below
* I waited for a revew to make a changeset. I will preper it.

Thanks again for your code review.

Final Note: Checking more elaborate cases, I have found that in many cases
there is NO Matlab compatibilty. Matlab documentation does not reveal what
exactly they are doing, so I used the decription in 
http://www.crisluengo.net/index.php/archives/310 which is not Matlab official
documentation, but describes something which is similar to what Matlab is
doing. Until there will be a more detailed description, this is what I can
use.

    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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