|
From: | Theresa Bullard |
Subject: | Re: new to octave - need help with running user-defined function files |
Date: | Fri, 10 Mar 2006 19:27:09 -0800 |
How do I set up or change my .bash_profile or .bashrc? Where would these files be located? I do not see them in the home directory. What would I change in these files?You will not see your .bash_profile or .bashrc files in terminal because they are hidden unless you do ls –a to show all files.
The only essential lines in my .bash_profile (used by Terminal, as I recall) or .bashrc (used by xterm, as I recall) are...
export GNUTERM=aquaThese set the graphics display to AquaTerm. Change aqua to x11 if you are using X11. It shouldn’t matter which terminal you use because photo type images will open in as .bmp files in the Apple Preview application. To edit the .bash files, I suggest getting TextWrangler or Smultron (free downloads) if you don’t already have one of these. If you’re a UNIX person, you could use vi or emacs.
export DISPLAY=:0.0
Do I need to do a batch compile of these functions to get them integrated into Octave? If so, how do I do that here?If they are all .m scripts, you do not need to compile them.
You have several options regarding how to locate the image processing files for use. First, as you have discovered below, you can cd into the directory where the image processing files reside, copy your data to the same directory, and everything should work.
Octave looks first in the local directory, and then (in your case) in /usr/local for the files to use. Second, you could install the image processing files in a directory in the same directory tree in /usr/local where the octave-forge routines are located. That’s how I have the digital signal processing library from Stearns and David installed.
Third, you could create a .octaverc file that adds the image processing directory to your octave load path, as you originally thought. I’m sure people on this list could help you do that.
I am able to use the built-in octave functions, although in attempting to use some of the image functions as a basic step before even trying the computer vision functions from Kovesi, I cannot seem to access the image files. I have cd’ed into the directory the image files are stored in, and they are recognized as being in IMAGEPATH, but then I get the following error trying to use imreadThis looks to me like an internal octave-forge error from (perhaps) reading a locally created scratch file. (The .jpg extension should be OK.) You can look at imread.m by copying it from /usr/local/ to an unprotected location like ~ after you find it (In Terminal: find . -name image.m –print). Anyone else got any ideas?
octave:2> file_in_path(IMAGEPATH, 'gray_image.jpg')
ans = /Users/tvb/usr/local/share/octave/2.1.71/imagelib/gray_image.jpg
octave:3> im1 = imread('gray_image.jpg')
error: could not read file: /var/tmp/oct-EHDvjn
error: evaluating if command near line 189, column 4
error: called from `imread' in file `/usr/local/share/octave/2.1.71/site/m/octave-forge/image/imread.m'
error: evaluating assignment expression near line 3, column 5
octave:3>
I’ve tried loadimage(‘gray_image.img’) also, but perhaps my file format is not right even though it seemed like it was what Octave was asking for based on the online manual. I have Graphical Converter, so I tried to convert from .jpg to .img and .ppm which seemed to be the file formats that Octave can work with. My preference would be to just use jpg’s and from seeing some of the other threads, it looks like this should be possible.
I do know that octave relies on ImageMagick for some image input/output, but I don’t know how much of ImageMagick is included with the HPC download.
[Prev in Thread] | Current Thread | [Next in Thread] |