bugGNU Octave - Bugs: bug #50188, [octave forge] (image) poly2mask...

 
 

bug #50188: [octave forge] (image) poly2mask does incompatible rounding

Submitted by:  Hartmut <hardy>
Submitted on:  Mon 30 Jan 2017 08:07:25 PM UTC  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.2.0Operating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 30 Jan 2017 11:37:53 PM UTC, comment #1:

There is an (still imperfect) fix for this bug in patch #9244 (inside the function rp_convex_image). It might be a starting point to generate a proper solution for this bug.

Hartmut <hardy>
Mon 30 Jan 2017 08:07:25 PM UTC, original submission:

This happens with the current image-2.6.1 package and Octave 4.2.0.

The current Octave implementation of poly2mask.m rounds its polygon input values to the nearest integer (and correctly says so in its documentation).

In contrast, the Matlab implementation of poly2mask.m also uses fractional input values, and does some 5-by-5 subsampling of pixels. See the Matlab documentation: https://de.mathworks.com/help/images/ref/poly2mask.html#f6-465457

As a result the output values between the Octave and the Matlab version of poly2mask are different.

Here is some typical code that shows the difference, and can be used for implementing an improved version of Octave's poly2mask:

The current output of Octave is:

(I hit this bug while implementing a new feature in regionprops.m. I will probably work around this bug in regionprops, to not introduce more dependencies of patches. This means that a future fix to this bug could have a look what's been done in regionprops.m for the 'ConvexImage' calculation.)

Hartmut <hardy>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by jwe (Updated the item)
  • -unavailable- added by hardy (Submitted the item)
  • -unavailable- added by hardy (add people to cc who care about the image package)
  • -unavailable- added by hardy (add people to cc who care about the image package)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 3 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 12 Aug 2017 07:12:29 PM UTCjweSummaryimage package: poly2mask does incompatible rounding=>[octave forge] (image) poly2mask does incompatible rounding
    Mon 30 Jan 2017 08:07:25 PM UTChardyCarbon-Copy-=>Added avinoam
      Carbon-Copy-=>Added carandraug

    Back to the top


    Powered by Savane 3.1-cleanup1