bugGNU Octave - Bugs: bug #45333, image package: grayhresh fails if...


bug #45333: image package: grayhresh fails if input doesn't have different values

Submitted by:  Carnë Draug <carandraug>
Submitted on:  Tue Jun 16 18:10:56 2015  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Inaccurate Result
Status: FixedAssigned to: Carnë Draug <carandraug>
Originator Name: Open/Closed: Closed
Release: devOperating System: Any

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)

Tue Jun 6 20:46:26 2017, comment #10:

There is another problem with graythresh:
running the tests with Otsu in Matlab, the thresh is 114.5, and not 115, so the test should be:

To get Matlab results, the "ceil" in line 235 should be removed.

Avinoam Kalma <avinoam>
Project Member
Mon Jun 5 21:10:33 2017, comment #9:

There is still a minor problem in a corner case:

In Matlab the answer is zero.
The problem is in the line:

thresh{1} = double (thresh{1}) / (numel (ihist) - 1);

since numel(ihist) is 1

Avinoam Kalma <avinoam>
Project Member
Sun Apr 23 20:34:40 2017, comment #8:

Done http://hg.code.sf.net/p/octave/image/rev/37e9f3f3e1c8

Carnë Draug <carandraug>
Project MemberIn charge of this item.
Sun Apr 23 18:00:22 2017, comment #7:

Another typo:

img_max = 65535 in line 171, but img_max is not used elsewhere.

Avinoam Kalma <avinoam>
Project Member
Wed Apr 12 16:41:25 2017, comment #6:

> It seems that few semicolons have disappeared.

Ups. I put them back now


Carnë Draug <carandraug>
Project MemberIn charge of this item.
Wed Apr 12 14:13:55 2017, comment #5:

@Carnë: Thanks for the fix.
It seems that few semicolons have disappeared.

Avinoam Kalma <avinoam>
Project Member
Wed Apr 12 13:27:33 2017, comment #4:

I am not sure why you were using `!isfinite` when the problem is that `max (bcv)` returned NaN. I used isnan which is clearer. Also, I put the check earlier and avoided computing threshold and goodness in such case.


Carnë Draug <carandraug>
Project MemberIn charge of this item.
Thu Dec 8 17:36:22 2016, comment #3:


Please review the cs in comment #2

Avinoam Kalma <avinoam>
Project Member
Wed Aug 19 08:20:56 2015, comment #2:

cs attached. Please review

(file #34676)

Avinoam Kalma <avinoam>
Project Member
Wed Jun 17 05:57:42 2015, comment #1:

The correction should be something like

near the end of function otsu

Avinoam Kalma <avinoam>
Project Member
Tue Jun 16 18:10:56 2015, original submission:


For Matlab compatibility, such corner case should return a value of zero.

Carnë Draug <carandraug>
Project MemberIn charge of this item.


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

Attach File(s):

Attached Files
file #34676:  bug45333.cs added by avinoam (703B - text/plain)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by avinoam
  • -unavailable- added by avinoam (Posted a comment)
  • -unavailable- added by carandraug (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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed Apr 12 13:27:33 2017carandraugStatusPatch Submitted=>Fixed
    Mon Mar 6 05:11:57 2017avinoamStatusNone=>Patch Submitted
    Thu Dec 8 17:36:22 2016avinoamCarbon-Copy-=>Added -unavailable-
    Wed Aug 19 08:20:56 2015avinoamAttached File-=>Added bug45333.cs, #34676

    Back to the top

    Powered by Savane 3.1-cleanup1