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

 
 

bug #50071: [octave forge] (image) bwfill(...,4) in Octave behaves like bwfill(...,8) in MATLAB and vice versa

Submitter:  None
Submitted:  Tue 17 Jan 2017 09:53:54 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  flawr Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * other
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Tue 20 Nov 2018 08:42:20 PM UTC, comment #8: 

pushed http://hg.code.sf.net/p/octave/image/rev/3952d75984d8
If there are no comments, I will close this bug report.

Avinoam Kalma <avinoam>
Group Member
Tue 13 Nov 2018 10:46:49 PM UTC, comment #7: 

Please review the updated patch

(file #45419)

Avinoam Kalma <avinoam>
Group Member
Mon 12 Nov 2018 01:37:02 AM UTC, comment #6: 

When I say "the bug is not that simple", I don't mean the actual fix which looks correct to me.  What is not simple is the implications of fixing this.

Also, since you are adding tests, would you mind adding a few more for the other usage (holes, a vector or c/r), different length c/r, and omitting the N argument (Matlab documentation states default of 8).

Carnë Draug <carandraug>
Group Member
Mon 12 Nov 2018 01:33:26 AM UTC, comment #5: 

The bug is really not that simple, and fixing this should come with a prominent note on the NEWS file and on the help text.

The issue is that the N value bwfill in Matlab specifies the connectivity of the foreground but act on the background. This is really not obvious and not how this type of functions usually work. Octave's implementation specifies the connectivity of the background and act on the background.

This function has been around since 2002 and such change is very much backwards incompatible. But I guess the change needs to be done for sake of Matlab compatibility.

Carnë Draug <carandraug>
Group Member
Sun 11 Nov 2018 10:01:30 PM UTC, comment #4: 

Indeed, bwfill is old and not recommneded, but it shouldn't have bugs.
Checking this and the OP is right.
A trivial patch attached.
Please review.


(file #45406)

Avinoam Kalma <avinoam>
Group Member
Fri 03 Mar 2017 08:24:21 PM UTC, comment #3: 

What Matlab version are you using?

The "bwfill" command does not seem to be supported for at least 10 years in Matlab: It's not mentioned on the Matlab help page https://de.mathworks.com/help/search.html?qdoc=bwfill&submitsearch=  and not on the release notes https://de.mathworks.com/help/images/release-notes.html?rntext=bwfill

Have you tried the imfill command instead? It should work fine in  current Matlab versions and also in Octave (since image package 2.6.0).

Note: Nevertheless it might be useful to change the Octave behavior of bwfill to match the behavior of the ancient Matlab bwfill, if it is really only about swapping a 4 with an 8.


Hartmut <hardy>
Wed 18 Jan 2017 12:58:30 PM UTC, comment #2: 

Adding package maintainer to CC list.

Markus Mützel <mmuetzel>
Group administrator
Tue 17 Jan 2017 09:56:48 PM UTC, comment #1: 

It seems I used the wrong markup for my code. I'm posting it again without the tags:

Compare the output of

img = [0,1,0;0,1,1;1,0,1]; bwfill(img,1,1,8)

and

img  = [0,1,0;0,1,1;1,0,1]; bwfill(img,1,1,4)

both in MATLAB and in Octave.

bwfill(img,1,1,8)

in Octave generates the same as

bwfill(img,1,1,4)

in MATLAB and vice versa. This is very confusing.

Anonymous
Tue 17 Jan 2017 09:53:54 PM UTC, original submission:  

Compare the output of

img = [0,1,0;0,1,1;1,0,1]; bwfill(img,1,1,8)
+verbatim+
and
+verbatim+
img  = [0,1,0;0,1,1;1,0,1]; bwfill(img,1,1,4)
+verbatim+
both in MATLAB and in Octave.
+verbatim+
bwfill(img,1,1,8)
+verbatim+
in Octave generates the same as
+verbatim+
bwfill(img,1,1,4)
+verbatim+
in MATLAB and vice versa. This is very confusing.

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #45419:  bug_50071_V2.patch added by avinoam (7KiB - application/octet-stream)
file #45406:  bug_50071.patch added by avinoam (924B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by avinoam (Updated the item)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by hardy (Posted a comment)
  • -email is unavailable- added by mmuetzel (Posted a comment)
  • -email is unavailable- added by mmuetzel
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 10 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-22 avinoam Open/ClosedOpen Closed
    2018-11-20 avinoam StatusPatch Submitted Fixed
    2018-11-13 avinoam Attached File- Added bug_50071_V2.patch, #45419
    2018-11-11 avinoam Attached File- Added bug_50071.patch, #45406
        StatusNone Patch Submitted
        Release4.0.3 other
        Operating SystemMicrosoft Windows Any
    2017-08-12 jwe SummaryOF image: bwfill(...,4) in Octave behaves like bwfill(...,8) in MATLAB and vice versa [octave forge] (image) bwfill(...,4) in Octave behaves like bwfill(...,8) in MATLAB and vice versa
    2017-01-18 mmuetzel Summarybwfill(...,4) in Octave behaves like bwfill(...,8) in MATLAB and vice versa OF image: bwfill(...,4) in Octave behaves like bwfill(...,8) in MATLAB and vice versa
        Carbon-Copy- Added carandraug

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code