help-octave
[Top][All Lists]
Advanced

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

Re: Image search path?


From: Alasdair McAndrew
Subject: Re: Image search path?
Date: Fri, 6 Feb 2015 10:06:58 +1100

Thank you!  I've got it working now.  I think what initially confused me is that although a full command:

x = imread('debian-logo.png');

will work, tab completion of image names doesn't work, except for images in the home directory.  What I need now is some way of indexing all the images from all directories so that tab completion works!

On Fri, Feb 6, 2015 at 1:21 AM, Mike Miller <address@hidden> wrote:
On Fri, Feb 06, 2015 at 00:36:07 +1100, Alasdair McAndrew wrote:
> I understand that "addpath" can be set up in .octaverc to add directories
> of commands to Octave.  But how do I search for images?
>
> I've tried using "IMAGE_PATH" in my .octaverc, and indeed when I call
> "dump_prefs()" the paths are all listed.  But "imread" from the image
> package can't find images in these directories.
>
> How can I add directories that are searchable by imread?

Are you setting IMAGE_PATH to a pathsep-delimited list of directories
appropriate to your OS? This works for me:

  octave:1> IMAGE_PATH (".")
  octave:2> x = imread ("debian-logo.png");
  warning: your version of GraphicsMagick limits images to 8 bits per pixel
  error: imread: cannot find debian-logo.png
  error: called from:
  error:   /usr/share/octave/3.8.2/m/image/private/__imread__.m at line 56, column 5
  error:   /usr/share/octave/3.8.2/m/image/private/imageIO.m at line 66, column 26
  error:   /usr/share/octave/3.8.2/m/image/imread.m at line 107, column 30
  octave:2> IMAGE_PATH (strjoin ({".", "/usr/share/pixmaps"}, pathsep));
  octave:3> x = imread ("debian-logo.png");
  octave:4> size (x)
  ans =

     48   48    3


--
mike



--
http://www.facebook.com/alasdair.mcandrew https://plus.google.com/+AlasdairMcAndrew/posts https://www.linkedin.com/pub/alasdair-mcandrew/a/178/108 https://twitter.com/amca01 http://numbersandshapes.net

reply via email to

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