Hello,<br>
<br>
I need some guidance on a path to take.&nbsp; I am working on a little
image processing package written in Python for a class I teach in
Remote Sensing.<br>
<br>
>From other posts in other mail lists, I have been encouraged to look at
gdal for loading a multi-band image file into numpy, process it, then
write it out to an image format.<br>
<br>
I am using Python 2.4, gdal-python-13.win32-py2.4 that I installed from
the .exe and numpy-1.0.2.win32-py2.4 from the exe and python image
library 1.1.6win32-py2.4.&nbsp; All of these have been installed
correctly.&nbsp; I would have installed the 1.4.1 version of gdal, but
I did not see an .exe and when I tried to follow the instructions for
changing the path and the gdal_data environment variable, the import
gdal was not recognized, so I chose a .exe that seemed to work.<br>
<br>
On this note, I attempted to follow the basic tutorial for loading an
image file.&nbsp; (I tried a multi-band .TIF and ERDAS Imagine
file).&nbsp; The message I received was--<br>
<br>
img = gdal.gdal.Open(&#39;c:\\nate\\remote_sensing\\pyth_img_test.tif&#39;, GA_ReadOnly)<br>
AttributeError: &#39;module&#39; object has no attribute &#39;gdal&#39;<br>
<br>
Here is my code below just for testing the reading of a multi-band
image file to then load it into a numpy array.&nbsp; From here I want
to do some pixel by pixel processing.<br>
<br>
-----------------------------<br>
<br>
import Image, numpy, gdal, sys, os<br>
<br>
img = gdal.Open(&#39;c:\\nate\\remote_sensing\\pyth_img_test.tif&#39;, GA_ReadOnly)<br>
<br>
A = numpy.asarray(img)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #Convert the image to a numpy array<br>
<br>
print A.shape<br>
print A.size<br>
print &quot;Num Rows: &quot; + str(A.shape[0])<br>
print &quot;Num Cols: &quot; + str(A.shape[1])<br>
print &quot;Num bands: &quot; + str(A.ndim)<br>
<br>
<br>
------------------------------------<br>
<br>
I also saw on the threads to access the FWTools, which I have loaded
and they seem to have slightly different methods of use.&nbsp; My goal
is to create a little image processing package that I can give out to
students to work with multi-band imagery and do some of the things that
FWTools has or OpenEV has, but it a little more intuitive and can
process more than 3 bands of imagery.&nbsp; Plus some of the
documentation for some of the functions in FWTools or OpenEV does not
exist or the functions are a little cumbersome to use.&nbsp; I am also
thinking about what will be required by the student to load in order to
use my python image processing application.&nbsp; I want this to be
straight forward too...so if I am having difficulty with loading
libraries, having to change path variables, etc, then this is too much
for the novie Remote Sensing student.&nbsp; I am not into compiliing my
own libraries and will be pushing my programming limits with writing
C++, binding python to c++ code, etc.&nbsp; I do have some programming
experience with C++.&nbsp; I was in an algorithms class about 10 yrs
ago while in grad school programming many of the remote sensing
algorthims....the problem was they were running under OS/2 and were
limited to the old ERDAS .LAN format.<br>
<br>
I would appreciate some help in getting the image to read in a numpy
array as well as any feedback on re-directing my efforts if there is
something that I can tap into (such as FWTools libraries, OpenEV
libraries).&nbsp; It seems that Frank has put alot of this together in
different places, I am just trying to get some of what is out there
more combined to work on multi-band imagery and RADAR (TIF, ERDAS
Imagine files).<br>
<br>
Thanks for any help.<br>
<br>
Nate<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br clear="all"><br>-- <br><a href="http://www.jenningsplanet.com">http://www.jenningsplanet.com</a>