Mercurial > hg > octave-image
changeset 900:23e93653e1e5
maint: Periodic merge of stable to default.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Mon, 06 Oct 2014 19:49:32 +0100 |
parents | f34897bc944f (current diff) 2d9c2bd49177 (diff) |
children | fd72bb9e1e9f |
files | COPYING DESCRIPTION NEWS src/configure.ac |
diffstat | 22 files changed, 133 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/.hgignore +++ b/.hgignore @@ -11,9 +11,15 @@ (^|/)octave-core$ (^|/).*\.tar\.gz$ +## Files generated automatically by autoconf and the configure script (^|/)aclocal\.m4$ (^|/)configure$ (^|/)autom4te\.cache($|/) +(^|/)config\.log$ +(^|/)config\.status$ + +## Generated from config.h.in by configure +(^|/)src/config\.h$ # e.g. doc/faq/OctaveFAQ.info # doc/interpreter/octave.info-4
--- a/.hgtags +++ b/.hgtags @@ -33,3 +33,4 @@ dbe605c10a08046e56b025926d1c3ec08136d952 snapshot-2.1.1 b0977102e7f65a2b220b07e46b64486b5ccfbc35 release-2.2.0 fabc22044c6b7f1c19af0f1942cfc4c18e90280e release-2.2.1 +d3ec45cd866015133d8254e8491a6f1e0f905d99 release-2.2.2
--- a/COPYING +++ b/COPYING @@ -77,6 +77,8 @@ inst/imdither.m GPLv3+ inst/imdivide.m GPLv3+ inst/imfilter.m GPLv3+ +inst/imgradient.m GPLv3+ +inst/imgradientxy.m GPLv3+ inst/imhist.m GPLv3+ inst/imlincomb.m GPLv3+ inst/immaximas.m MIT
--- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Name: Image Version: 2.3.0 -Date: 2014-03-08 +Date: 2014-10-06 Author: various authors -Maintainer: Carnë Draug <carandraug+dev@gmail.com> +Maintainer: Carnë Draug <carandraug@octave.org> Title: Image Processing Description: The Octave-forge Image package provides functions for processing images.
--- a/NEWS +++ b/NEWS @@ -47,6 +47,19 @@ im2uint8 im2uint16 + + Summary of important user-visible changes for image 2.2.2 (2014/10/06): +------------------------------------------------------------------------- + + ** Multiple documentation fixes for compatibility with new versions of + Texinfo. + + ** Fix error with imcrop when image was all zeros. + + ** Fix endless loop in bwdist when using the quasi-euclidean method in + x86 systems. + + Summary of important user-visible changes for image 2.2.1 (2014/03/08): -------------------------------------------------------------------------
--- a/inst/bwconncomp.m +++ b/inst/bwconncomp.m @@ -23,20 +23,24 @@ ## non-zero value. The output @var{cc} is a structure with information about ## each object; ## -## @table @qcode -## @item "Connectivity" +## @table @asis +## @item @qcode{"Connectivity"} ## The connectivity used in the boundary tracing. This may be different from ## the input argument, e.g., if @var{conn} is defined as a matrix of 1s and ## size 3x3, the @qcode{"Connectivity"} value will still be 8. -## @item "ImageSize" +## +## @item @qcode{"ImageSize"} ## The size of the matrix @var{bw}. -## @item "NumObjects" +## +## @item @qcode{"NumObjects"} ## The number of objects in the image @var{bw}. -## @item "PixelIdxList" +## +## @item @qcode{"PixelIdxList"} ## A cell array with linear indices for each element of each object in @var{bw} ## A cell array containing where each element corresponds to an object in @var{BW}. ## Each element is represented as a vector of linear indices of the boundary of ## the given object. +## ## @end table ## ## Element connectivity @var{conn}, to define the size of objects, can be
--- a/inst/col2im.m +++ b/inst/col2im.m @@ -27,14 +27,14 @@ ## Blocks are assumed to be from one of two types as defined by ## @var{block_type} (defaults to @qcode{"sliding"}): ## -## @table @qcode -## @item "distinct" +## @table @asis +## @item @qcode{"distinct"} ## Each column of @var{B} is assumed to be distinct blocks, with no ## overlapping elements, of size @var{block_size}, to rebuild a matrix of ## size @var{A_size}. Any padding that may have been required to form ## @var{B} from a matrix of @var{A_size}, is removed accordingly. ## -## @item "sliding" +## @item @qcode{"sliding"} ## This reshapes @var{B} into a matrix of size ## @code{@var{A_size} - @var{block_size} +1}. Sliding blocks are most useful ## to apply a sliding window filter with functions that act along columns. @@ -44,6 +44,7 @@ ## will be less blocks to account to borders, so if @var{block_size} is the ## same in both @code{col2im} and @code{im2col}, @var{A_size} can be the size ## out the ouput from @code{im2col}. +## ## @end table ## ## Blocks are assumed to have been from a matrix, the same direction elements
--- a/inst/colfilt.m +++ b/inst/colfilt.m @@ -31,13 +31,13 @@ ## ## Blocks can be of two different types as defined by the string @var{block_type}: ## -## @table @qcode -## @item "distinct" +## @table @asis +## @item @qcode{"distinct"} ## Each block is completely distinct from the other, with no overlapping ## elements. @var{func} must return a matrix of exactly the same size as ## its input. ## -## @item "sliding" +## @item @qcode{"sliding"} ## Each possible block of size @var{block_size} inside @var{A} is used. ## @var{func} should act along the column dimension (be a column ## compression function) and return a vector of length equal to the
--- a/inst/im2col.m +++ b/inst/im2col.m @@ -34,13 +34,13 @@ ## The sampling can be performed in two different ways as defined by ## @var{block_type} (defaults to @qcode{"sliding"}): ## -## @table @qcode -## @item "distinct" +## @table @asis +## @item @qcode{"distinct"} ## Each block is completely distinct from the other, with no overlapping ## elements. The matrix @var{A} is padded as required with a value of 0 ## (or 1 for non-integer indexed images). ## -## @item "sliding" +## @item @qcode{"sliding"} ## A single block slides across @var{A} without any padding. ## ## While this can be used to perform sliding window operations such as maximum
--- a/inst/iradon.m +++ b/inst/iradon.m @@ -14,8 +14,7 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @defun @var{recon} = iradon (@var{proj}, @var{theta}, @var{interp}, @ -## @var{filter}, @var{scaling}, @var{output_size}) +## @deftypefn {Function File} {@var{recon} =} iradon (@var{proj}, @var{theta}, @var{interp}, @var{filter}, @var{scaling}, @var{output_size}) ## ## Performs filtered back-projection on the projections in @var{proj} ## to reconstruct an approximation of the original image. @@ -46,11 +45,11 @@ ## guarantee that the reconstructed image will be exactly the same ## size as the original. ## -## @defunx [@var{recon}, @var{filt}] = iradon (...) +## @end deftypefn +## @deftypefn {Function File} {[@var{recon}, @var{filt}] =} iradon (@dots{}) ## ## This form also returns the filter frequency response in the vector ## @var{filt}. -## @end defun ## ## Performs filtered back-projection in order to reconstruct an ## image based on its projections. @@ -64,12 +63,17 @@ ## space. This is the back-projection part. ## ## Usage example: +## ## @example +## @group ## P = phantom (); ## projections = radon (P, 1:179); ## reconstruction = iradon (filtered_projections, 1:179, 'Spline', 'Hann'); ## figure, imshow (reconstruction, []) +## @end group ## @end example +## +## @end deftypefn function [recon, filt] = iradon (proj, theta, interp, filter, scaling, output_size)
--- a/inst/isbw.m +++ b/inst/isbw.m @@ -15,8 +15,8 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} isbw (@var{img}) -## @deftypefnx {Function File} isbw (@var{img}, @var{logic}) +## @deftypefn {Function File} {} isbw (@var{img}) +## @deftypefnx {Function File} {} isbw (@var{img}, @var{logic}) ## Return true if @var{img} is a black and white image. ## ## A variable can be considered a black and white image if it is a
--- a/inst/isgray.m +++ b/inst/isgray.m @@ -15,7 +15,7 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} isgray (@var{img}) +## @deftypefn {Function File} {} isgray (@var{img}) ## Return true if @var{img} is an indexed image. ## ## A variable can be considered a grayscale image if it is a non-sparse
--- a/inst/isind.m +++ b/inst/isind.m @@ -15,7 +15,7 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} isind (@var{img}) +## @deftypefn {Function File} {} isind (@var{img}) ## Return true if @var{img} is an indexed image. ## ## A variable can be considered an indexed image if it is a non-sparse
--- a/inst/isrgb.m +++ b/inst/isrgb.m @@ -16,7 +16,7 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @deftypefn {Function File} {@var{bool} = } isrgb (@var{img}) +## @deftypefn {Function File} {} isrgb (@var{img}) ## Return true if @var{img} is a RGB image. ## ## A variable can be considered a RGB image if it is a non-sparse
--- a/inst/montage.m +++ b/inst/montage.m @@ -179,13 +179,35 @@ p = inputParser (); p.FunctionName = "montage"; - p = p.addParamValue ("DisplayRange", [], @(x) isnumeric (x) && any (numel (x) == [0 2])); - p = p.addParamValue ("Indices", 1:nImg, @(x) isindex (x, nImg)); - p = p.addParamValue ("Size", [NaN NaN], @(x) isnumeric (x) && numel (x) == 2); - p = p.addParamValue ("MarginWidth", 0, @(x) isnumeric (x) && isscalar (x)); - p = p.addParamValue ("MarginColor", getrangefromclass (images)(2), @(x) isnumeric (x) && any (numel (x) == [1 3])); - p = p.addParamValue ("BackgroundColor", getrangefromclass (images)(1), @(x) isnumeric (x) && any (numel (x) == [1 3])); - p = p.parse (varargin{:}); + + ## FIXME: inputParser was first implemented in the general package in the + ## old @class type which allowed for a very similar interface to + ## Matlab. classdef was implemented in the upcoming 4.2 release, + ## which enabled inputParser to be implemented exactly the same and + ## it is now part of Octave core. To prevent issues while all this + ## versions are available, we check if the inputParser being used + ## is in a @inputParser directory. + ## + ## Remove all this checks once we are no longer dependent on Octave + ## versions older than 4.2. + + if (strfind (which ("inputParser"), ["@inputParser" filesep "inputParser.m"])) + p = p.addParamValue ("DisplayRange", [], @(x) isnumeric (x) && any (numel (x) == [0 2])); + p = p.addParamValue ("Indices", 1:nImg, @(x) isindex (x, nImg)); + p = p.addParamValue ("Size", [NaN NaN], @(x) isnumeric (x) && numel (x) == 2); + p = p.addParamValue ("MarginWidth", 0, @(x) isnumeric (x) && isscalar (x)); + p = p.addParamValue ("MarginColor", getrangefromclass (images)(2), @(x) isnumeric (x) && any (numel (x) == [1 3])); + p = p.addParamValue ("BackgroundColor", getrangefromclass (images)(1), @(x) isnumeric (x) && any (numel (x) == [1 3])); + p = p.parse (varargin{:}); + else + p.addParamValue ("DisplayRange", [], @(x) isnumeric (x) && any (numel (x) == [0 2])); + p.addParamValue ("Indices", 1:nImg, @(x) isindex (x, nImg)); + p.addParamValue ("Size", [NaN NaN], @(x) isnumeric (x) && numel (x) == 2); + p.addParamValue ("MarginWidth", 0, @(x) isnumeric (x) && isscalar (x)); + p.addParamValue ("MarginColor", getrangefromclass (images)(2), @(x) isnumeric (x) && any (numel (x) == [1 3])); + p.addParamValue ("BackgroundColor", getrangefromclass (images)(1), @(x) isnumeric (x) && any (numel (x) == [1 3])); + p.parse (varargin{:}); + endif ## remove unecessary images images = images(:,:,:,p.Results.Indices);
--- a/inst/padarray.m +++ b/inst/padarray.m @@ -33,36 +33,44 @@ ## The values used in the padding can either be a scalar value @var{padval}, or ## the name of a specific @var{pattern}. Available patterns are: ## -## @table @samp -## @item "zeros" (default) +## @table @asis +## @item @qcode{"zeros"} (default) ## Pads with the value 0 (same as passing a @var{padval} of 0). This is the ## default. -## @item "circular" +## +## @item @qcode{"circular"} ## Pads with a circular repetition of elements in @var{A} (similar to ## tiling @var{A}). -## @item "replicate" +## +## @item @qcode{"replicate"} ## Pads replicating the values at the border of @var{A}. -## @item "symmetric" +## +## @item @qcode{"symmetric"} ## Pads with a mirror reflection of @var{A}. -## @item "reflect" +## +## @item @qcode{"reflect"} ## Same as "symmetric", but the borders are not used in the padding. Because ## of this, it is not possible to pad singleton dimensions. +## ## @end table ## ## By default, padding is done in both directions. To change this, ## @var{direction} can be one of the following values: ## -## @table @samp -## @item "both" (default) +## @table @asis +## @item @qcode{"both"} (default) ## Pad each dimension before the first element of @var{A} the number ## of elements defined by @var{padsize}, and the same number again after ## the last element. This is the default. -## @item "pre" +## +## @item @qcode{"pre"} ## Pad each dimension before the first element of @var{A} the number of ## elements defined by @var{padsize}. -## @item "post" +## +## @item @qcode{"post"} ## Pad each dimension after the last element of @var{A} the number of ## elements defined by @var{padsize}. +## ## @end table ## ## @seealso{cat, flipdim, resize, prepad, postpad}
--- a/inst/rho_filter.m +++ b/inst/rho_filter.m @@ -14,7 +14,7 @@ ## this program; if not, see <http://www.gnu.org/licenses/>. ## -*- texinfo -*- -## @defun {@var{filtered} =} rho_filter (@var{proj}, @var{type}, @var{scaling}) +## @deftypefn {Function File} {@var{filtered} =} rho_filter (@var{proj}, @var{type}, @var{scaling}) ## ## Filters the parallel ray projections in the columns of @var{proj}, ## according to the filter type chosen by @var{type}. @var{type} @@ -33,13 +33,12 @@ ## The window function is compressed accordingly, to avoid an abrupt ## truncation of the frequency response. ## -## @defunx {[@var{filtered}, @var{filter}] =} rho_filter (...) +## @end deftypefn +## @deftypefn {Function File} {[@var{filtered}, @var{filter}] =} rho_filter (@dots{}) ## ## This form also returns the frequency response of the filter in ## the vector @var{filter}. ## -## @end defun -## ## Performs rho filtering on the parallel ray projections provided. ## ## Rho filtering is performed as part of the filtered back-projection @@ -79,6 +78,8 @@ ## reconstruction = iradon (filtered_projections, 1, 'linear', 'none'); ## figure, imshow (reconstruction, []) ## @end example +## +## @end deftypefn function [filtered_proj, filt] = rho_filter (proj, type, scaling)
--- a/src/__boundary__.cc +++ b/src/__boundary__.cc @@ -25,8 +25,8 @@ DEFUN_DLD(__boundary__, args, nargout, "-*- texinfo -*-\n\ -@deftypefn {Loadable Function} {@var{b} = } boundary(@var{region})\n\ -@deftypefnx {Loadable Function} {@var{b} = } boundary(@var{region}, @var{conn})\n\ +@deftypefn {Loadable Function} {} boundary(@var{region})\n\ +@deftypefnx {Loadable Function} {} boundary(@var{region}, @var{conn})\n\ Trace the boundary of an object in a binary image.\n\ \n\ @code{boundary} computes the exterior clockwise boundary of the single \
--- a/src/__spatial_filtering__.cc +++ b/src/__spatial_filtering__.cc @@ -333,26 +333,33 @@ @var{domain}. The following values of @var{method} are supported.\n\ \n\ @table @asis\n\ -@item \"ordered\"\n\ +@item @qcode{\"ordered\"}\n\ Perform ordered filtering. The output in a pixel is the @math{n}th value of a\n\ sorted list containing the elements of the neighbourhood. The value of @math{n}\n\ is given in the @var{arg} argument. The corresponding user interface is available\n\ in @code{ordfilt2} and @code{ordfiltn}.\n\ -@item \"std\"\n\ +\n\ +@item @qcode{\"std\"}\n\ Compute the local standard deviation. The corresponding user interface is available\n\ in @code{stdfilt}.\n\ -@item \"entropy\"\n\ +\n\ +@item @qcode{\"entropy\"}\n\ Compute the local entropy. The corresponding user interface is available\n\ in @code{entropyfilt}.\n\ -@item \"range\"\n\ +\n\ +@item @qcode{\"range\"}\n\ Compute the local range of the data. The corresponding user interface is\n\ available in @code{rangefilt}.\n\ -@item \"min\"\n\ +\n\ +@item @qcode{\"min\"}\n\ Computes the smallest value in a local neighbourheed.\n\ -@item \"max\"\n\ +\n\ +@item @qcode{\"max\"}\n\ Computes the largest value in a local neighbourheed.\n\ -@item \"encoded sign of difference\"\n\ +\n\ +@item @qcode{\"encoded sign of difference\"}\n\ NOT IMPLEMENTED (local binary patterns style)\n\ +\n\ @end table\n\ @seealso{ordfilt2}\n\ @end deftypefn\n\
--- a/src/bwfill.cc +++ b/src/bwfill.cc @@ -38,6 +38,7 @@ -*- texinfo -*-\n\ @deftypefn {Loadable Function} {[@var{bw2}, @var{idx}] =} bwfill(@var{bw1}, @var{c}, @var{r}, @var{n})\n\ Perform a flood-fill operation on the binary image @var{bw1}.\n\ +\n\ The flood-filling starts in the pixel (@var{r}, @var{c}). If @var{r} and @var{c}\n\ are vectors of the same length, each pixel pair (@var{r}(i), @var{c}(i)) will\n\ be a starting point for a flood-fill operation.\n\ @@ -46,7 +47,9 @@ \n\ The output is the processed image @var{bw2} and the indexes of the filled\n\ pixels @var{idx}\n\ -@deftypefnx{Loadable Function} {[@var{bw2}, @var{idx}] =} bwfill(@var{bw1}, \"holes\", @var{n})\n\ +\n\ +@end deftypefn\n\ +@deftypefn {Loadable Function} {[@var{bw2}, @var{idx}] =} bwfill(@var{bw1}, \"holes\", @var{n})\n\ If the string \"holes\" is given instead of starting points for the flood-fill\n\ operation, the function finds interior holes in @var{bw1} and fills them.\n\ @end deftypefn\n\
--- a/src/imerode.cc +++ b/src/imerode.cc @@ -385,7 +385,7 @@ The size of the result is determined by the optional @var{shape} argument\n\ which takes the following values:\n\ \n\ -@table @samp\n\ +@table @asis\n\ @item @qcode{\"same\"} (default)\n\ Return image of the same size as input @var{im}.\n\ \n\ @@ -699,7 +699,7 @@ The size of the result is determined by the optional @var{shape} argument\n\ which takes the following values:\n\ \n\ -@table @samp\n\ +@table @asis\n\ @item @qcode{\"same\"} (default)\n\ Return image of the same size as input @var{im}.\n\ \n\
--- a/src/nonmax_supress.cc +++ b/src/nonmax_supress.cc @@ -38,13 +38,14 @@ DEFUN_DLD(nonmax_supress,args,nargout,"\ -*- texinfo -*-\n\ -@deftypefn {Loadable Function} nonmax_supress (@var{Es}, @var{Eo})\n\ +@deftypefn {Loadable Function} {} nonmax_supress (@var{Es}, @var{Eo})\n\ Performs non-maximum supression on the given edge data. \ @var{Es} is a matrix containing the edge strength (the length of \ the gradient), and @var{Eo} is the edge normal orientation (the \ direction of the gradient).\n\ \n\ -@deftypefnx {Loadable Function} nonmax_supress (@var{Es}, @var{Eo},\ +@end deftypefn\n\ +@deftypefn {Loadable Function} {} nonmax_supress (@var{Es}, @var{Eo},\ @var{low}, @var{high} )\n\ Performs non-maximum supression and hysteresis thresholdong, using \ @var{low} and @var{high} as thresholds.\n\