bugGNU Octave - Bugs: bug #38464, image: regionprops misses some...

 
 

bug #38464: image: regionprops misses some pixels?

Submitted by:  Juan Pablo Carbajal <juanpi>
Submitted on:  Mon Mar 4 18:54:08 2013  
 
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: DuplicateAssigned to: None
Originator Name: juanpiOpen/Closed: Closed
Release: 3.6.4Operating System: GNU/Linux

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

(Jump to the original submission Jump to the original submission)

Sun Nov 3 05:40:45 2013, comment #7:

So I took a closer look to this, compared with Matlab and Octave's image package old and development release and swapping the order on the call to plot. The bug is fixed now (it's a duplicate of bug #39701).

The code in the original submission is wrong. Even in Matlab is wrong, the coordinates are swapped. If they are fixed as suggested on comment #4, then it works in Matlab. I'm guessing the reason why they were swapped to start with is because of bug #39701 (now fixed) that caused regionprops to soemtimes return the Centroid coordinates swap (and in the attached image it was doing it for most of the objects) so swapping was actually trying to fix it (but then the correct ones were wrong).

Current version of the Octave package (cset 939332b5142e) works fine and I don't see any object being missed. If I undo cset ab0ac77d350b (which fixed bug #39701) then I get a big mess. Swapping back the coordinates to the wrong order, it plots the circle on most of the centroid coordinates and looks like it's missing some objects but in reality it's just drawing them in other places. The ones being drawn correctly (the majority) are actually the ones with the wrong coordinates that regionprops was swapping.

Closing as duplicate.

Carnë Draug <carandraug>
Project Member
Sun Nov 3 03:27:07 2013, comment #6:

@Carne,

Can you try the code on the original submission and see what is the problem there? Maybe is an issue that wasn't correctly identified.

Juan Pablo Carbajal <juanpi>
Sat Nov 2 20:36:26 2013, comment #5:

@JuanPi

So Matlab also misses some of the points?

No. Matlab's bwlabel doesn't miss any of the points, and neither does Octave. The bwlabel function will label any non-zero pixel in the image with a positive number. We can confirm that it does not miss any of the points with the following:

While the bwlabel function has changed since this report, the above still returns true when using the lblNodes variable present on the bwlabel_miss.mat file.

It is possible that bwlabel may be labeling two separate objects as being the same, but it's certainly not missing any pixel.

Carnë Draug <carandraug>
Project Member
Sat Nov 2 17:02:55 2013, comment #4:

The script in the "original submission" shows an image and plots which are bsed on data in bwlabel_miss.mat.

"lblNodes" in bwlabel_miss.mat shows no error and
"data" is missing. If I create nodes with a current regionprops from hg sources it includes all regions.

Please mention that there is an error in your script:
When generating

and plotting nodes with

x and y is swapped. I I use your original script and change x/y:

all regions are shown.

Andreas Weber <andy1978>
Project Member
Sat Nov 2 15:06:41 2013, comment #3:

So Matlab also misses some of the points?

Running the script i the original submission still generates a quite disappointing result.

Juan Pablo Carbajal <juanpi>
Fri Nov 1 16:58:34 2013, comment #2:

I just compared against the results that Matlab gives when using bwlabel, and the bug is (was?) definitely not in our bwlabel.

Carnë Draug <carandraug>
Project Member
Fri Nov 1 13:41:55 2013, comment #1:

I tired your test with an image development build from 3.10.2013

and I see all regions. Perhaps this http://sourceforge.net/p/octave/image/ci/ab0ac77d350bb005869498833fbb4427dc4fc933/tree/inst/regionprops.m?diff=b2e168a18d4b443870198eabf6dcfc3de239ba54 changeset fixed it. Can you check your test with the hg sources of image?

Regards, Andy

Andreas Weber <andy1978>
Project Member
Mon Mar 4 18:54:08 2013, original submission:

Execute the following script (fiel with data attached)

You see that some nodes are not plotted. The matrix lblNodes (also in the file) and the matrix nodes were generated with the following script

Apparently bwlabel nodes misses some of the pixels.
I checked that regionpropos is giving the correct result with other images.

Juan Pablo Carbajal <juanpi>

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #27565:  bwlabel_miss.mat added by juanpi (158kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by andy1978 (Posted a comment)
  • -unavailable- added by juanpi (Submitted the item)
  •  

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sun Nov 3 05:40:45 2013carandraugStatusNone=>Duplicate
      Open/ClosedOpen=>Closed
    Fri Nov 1 16:58:34 2013carandraugSummaryIMAGE: bwlabel misses some pixels?=>image: regionprops misses some pixels?
    Mon Mar 4 18:54:08 2013juanpiAttached File-=>Added bwlabel_miss.mat, #27565

    Back to the top


    Powered by Savane 3.1-cleanup