[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #51976] [octave forge] (image) Unit tests for
From: |
Rafael Laboissiere |
Subject: |
[Octave-bug-tracker] [bug #51976] [octave forge] (image) Unit tests for im2bw fail randomly |
Date: |
Sun, 10 Sep 2017 08:32:30 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 |
URL:
<http://savannah.gnu.org/bugs/?51976>
Summary: [octave forge] (image) Unit tests for im2bw fail
randomly
Project: GNU Octave
Submitted by: rlaboiss
Submitted on: Sun 10 Sep 2017 12:32:29 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: other
Operating System: Any
_______________________________________________________
Details:
These two unit tests in im2bw.m fail randomly:
%!test
%! im = [((randn(10)/10)+.3) ((randn(10)/10)+.7)];
%! assert (im2bw (im, "Otsu"), im2bw (im, graythresh (im(:), "Otsu")))
%! assert (im2bw (im, "moments"), im2bw (im, graythresh (im(:), "moments")))
%!test
%! im = [((randn(10)/10)+.3) ((randn(10)/10)+.7)];
%! im = reshape (im, [10 10 1 2]);
%! assert (im2bw (im, "Otsu"), im2bw (im, graythresh (im(:), "Otsu")))
%! assert (im2bw (im, "moments"), im2bw (im, graythresh (im(:), "moments")))
The reason is because, sometimes, the values in the matrix im are negative or
greater than 1.0, what makes it a non-valid image.
The patch attached below fixes the problem.
_______________________________________________________
File Attachments:
-------------------------------------------------------
Date: Sun 10 Sep 2017 12:32:29 PM UTC Name: im2bw-unit-test.patch Size: 822B
By: rlaboiss
<http://savannah.gnu.org/bugs/download.php?file_id=41774>
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?51976>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #51976] [octave forge] (image) Unit tests for im2bw fail randomly,
Rafael Laboissiere <=