bugGNU Octave - Bugs: bug #39701, regionprops centroid property...

 
 

bug #39701: regionprops centroid property swaps coordinates sometimes

Submitter:  Cristian <r41nm4n>
Submitted:  Mon 05 Aug 2013 02:18:39 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Incorrect Result
Status:  None Assigned to:  andy1978
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * GNU/Linux
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Post a Comment

Add a New Comment Rich Markup
   

Discussion

Tue 06 Aug 2013 04:00:58 PM UTC, comment #2: 

I've pushed the patch with rev ab0ac77d350b to octave-image.
Regards, Andy

Andreas Weber <andy1978>
Group Member
Tue 06 Aug 2013 11:25:38 AM UTC, comment #1: 

Dear Cristian,
thank you for reporting this bug.

I've attached a patch to fix this but it will take some time until a new release of the package "octave-image" will be made.

Regards, Andy

(file #28771)

Andreas Weber <andy1978>
Group Member
Mon 05 Aug 2013 02:18:39 PM UTC, original submission:  

With octave 3.7.5, package image 2.0.0, built on Debian testing, the function regionprops gives unexpected results with the property centroid. Four cases follow: the first and the third are correct, the second and the fourth seem not:


    a = [0 0 1];
    c = regionprops(a, 'centroid')
    %        c =
    %          scalar structure containing the fields:
    %            Centroid =
    %               3   1
    % Correct.

    a = [0 1 1];
    c = regionprops(a, 'centroid')
    %        c =
    %          scalar structure containing the fields:
    %            Centroid =
    %               1   1   2   3
    %
    % Expected result: 2.5    1

    a = [0 0 1; 0 0 0];
    c = regionprops(a, 'centroid')
    %        c =
    %          scalar structure containing the fields:
    %            Centroid =
    %               3   1
    % Correct.

    a = [0 1 1; 0 0 0];
    c = regionprops(a, 'centroid')
    %        c =
    %          scalar structure containing the fields:
    %            Centroid =
    %               1.00000   2.50000
    %
    % Expected result: 2.5    1



Cristian <r41nm4n>

 

Attached Files

Attached Files

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

Attach Files:
   
   
Comment:
   

 

Dependencies

This item does not depend on any other items.

No items depend on this one.

 

Mail Notification Carbon-Copy List

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

    Votes

    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.

     

    History

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-08-06 andy1978 Open/ClosedOpen Closed
    2013-08-06 andy1978 Attached File- Added bug_39701_regionprops_centroid.patch, #28771
        Assigned toNone andy1978
    2013-08-05 r41nm4n Carbon-Copy- Added r41nm4n

    Back to the top

    Powered by Savane 3.16-ed84.
    Corresponding source code