bugGNU Octave - Bugs: bug #44073, package image":...

 
 

bug #44073: package image": "regionprops" should also work on bwconncomp structure

Submitter:  Hartmut <hardy>
Submitted:  Fri 23 Jan 2015 10:00:14 AM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 09 Aug 2015 04:02:35 PM UTC, comment #3: 

The problem with dirty fixes or temporary workarounds is they have a tendency to become permanent.

I have already started the rewrite of regionprops which already supports a bwconncomp structure.  I have also implemented vectorized forms of some of the properties (but not all yet, so if you want to help with that...).

This will be part of the next minor release (probably 2.6).

Carnë Draug <carandraug>
Group Member
Wed 13 May 2015 10:59:01 AM UTC, comment #2: 

Could we meanwhile use this "dirty fix", as supplied by Sujay in his attached patch file?

This wouldn't stop anyone from making the function work faster lateron, and it would already make it work (for this special case) for the first time :)

Hartmut <hardy>
Wed 13 May 2015 08:19:54 AM UTC, comment #1: 

Yes, this is a known missing feature. But the point of using a bwconncomp is the work of getting the pixel indices out of the image has already been done.  This fix would indeed make regionprops would make it work but would be quite inefficient. Not only because of this but also because at the moment labelmatrix is also quite inefficient.

I have a plan to overhaul regionprops which includes implementing this. I hope I can do it over the summer.

Carnë Draug <carandraug>
Group Member
Fri 23 Jan 2015 10:00:14 AM UTC, original submission:  

Here is a short example skript:

pkg load image
clear
close all

bw = [1 0 1;1 0 0; 1 1 0];

cc = bwconncomp(bw);
L = labelmatrix(cc);

props = regionprops(L);  % works fine
props = regionprops(cc); % does not work


The reason for the error thrown by the last skript line is, that "regionprops" does not work on the output structure of "bwconncomp". It is not claimed by the Octave package documentation that it can do this, so far so good.

But the Matlab command "regionprops" works fine on the output structure of "bwconncomp". (See http://de.mathworks.com/help/images/ref/regionprops.html ). So it would be nice if the Octave version of the command could do this as well (for compatibility and convenience reasons.)

An easy solution to this might be, that the regionprops command just executes the labelmatrix command, once it realises that it has been given a bwconncomp structure.

Hartmut <hardy>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #33996:  bug44073patch.diff added by sujay (859B - text/x-patch - uploaded the patch. hope that i ve followed the guidelines properly.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by sujay (Updated the item)
  • -email is unavailable- added by hardy (Submitted the item)
  •  

    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 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-08-09 carandraug Open/ClosedOpen Closed
    2015-08-09 carandraug StatusNone Fixed
    2015-05-13 carandraug Release3.8.2 other
        Summarypackage 2image&quot;: &quot;regionprops&quot; should also work on bwconncomp structure package image": "regionprops" should also work on bwconncomp structure
    2015-05-13 sujay Attached File- Added bug44073patch.diff, #33996

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code