octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #51724] image package: imregionalmax misbehave


From: Hartmut
Subject: [Octave-bug-tracker] [bug #51724] image package: imregionalmax misbehaves on float images
Date: Thu, 10 Aug 2017 14:23:11 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:54.0) Gecko/20100101 Firefox/54.0

URL:
  <http://savannah.gnu.org/bugs/?51724>

                 Summary: image package: imregionalmax misbehaves on float
images
                 Project: GNU Octave
            Submitted by: hardy
            Submitted on: Thu 10 Aug 2017 06:23:10 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 4.2.1
        Operating System: Any

    _______________________________________________________

Details:

Here is how to reproduce the behavior:


clear, close all
pkg load image

A = peaks ();
B = A ./ 100;

Armax = imregionalmax (A);
Brmax = imregionalmax (B);

sum_Armax = sum(Armax(:))
sum_Brmax = sum(Brmax(:))

sum_ABrmax_Matlab = 4


There are several problems with this:
* The output of imregionalmax (for float input images) depends on the absolute
size of the input. This should not happen.
* The output of imregionalmax is not the same as Matlab's output (which is
4).

This happens with current Octave (4.2.1) and image package release (2.6.1).

The underlying function imreconstruct seems to NOT be the problem. Because
when I run the Octave code of imregionalmax.m (at least the essential code
line) under Matlab (and thus use the Matlab implementation of imreconstruct),
then the wrong results (3 and 1) stay.

To me it seems that the current code of imregionalmax (i.e. "recon =
imreconstruct (img, img + 1)") is  only ment to be applied to integer valued
input images.

Maybe a possibility to calculate the same thing for float input images would
be "recon = imreconstruct (img, img + eps (im))". This little change made the
result of the above script Matlab compatible for me (i.e. 4 in both cases, and
also the same index positions in Armax and Brmax as in Matlab).




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?51724>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]