[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-patch-tracker] [patch #9077] image package: new function imfill.
From: |
Carnë Draug |
Subject: |
[Octave-patch-tracker] [patch #9077] image package: new function imfill.m |
Date: |
Thu, 11 Aug 2016 00:14:42 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0 |
Follow-up Comment #8, patch #9077 (project octave):
After looking at it, I believe I can add the support for nd arrays myself
afterwards without much trouble.
Some points:
* you don't need to do:
if islogical (I)
mask = uint8 (I);
else
mask = I;
endif
you can leave mask as logical. The issue is on assigning the value of -Inf
later, but you can check for the class at that point and set it to false if
it's logical, -Inf otherwise. By the way you already have the text for each
step right before the first step. So don't repeat them, each line already
matches one step.
* during input check, if (nargin == 1 .... && islogical (I)) you give an
error. Should it not throw an error always or is matlab not interactive for
grayscale images at all?
* you can start with if nargin < 1 || nargin > 3 . Use print_usage instead of
an error message for this type of failure.
* what does Matlab do if any of the locations is outside of the image? And can
you add a test for that?
* Can you add a test with concentric rings? And images with 1 and 2 rows
only?
* a minor improvement on code:
## don't write:
marker(2:rows(marker)-1, 2:columns(marker)-1) = -Inf;
## write
marker(2:end-1, 2:end-1) = -Inf;
There's some other coding guidelines that would be nice to follow but I can
adjust them myself later.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?9077>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Hartmut, 2016/08/09
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Carnë Draug, 2016/08/09
- Message not available
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Carnë Draug, 2016/08/09
- Message not available
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Hartmut, 2016/08/10
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Hartmut, 2016/08/10
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m,
Carnë Draug <=
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Hartmut, 2016/08/11
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Hartmut, 2016/08/11
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Carnë Draug, 2016/08/14
- Message not available
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Carnë Draug, 2016/08/16
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Carnë Draug, 2016/08/16
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Hartmut, 2016/08/17
- [Octave-patch-tracker] [patch #9077] image package: new function imfill.m, Carnë Draug, 2016/08/17