Advice for imaging

Tom Harris tomh at optiscan.com
Tue Aug 21 21:17:35 EDT 2001


Hi,

I have to do some quick prototyping on some image processing algorithms. The
requirements are to read in a large 16 bit per pixel image, do stuff to it
in various ways, and then compute various metrics on the result. The purpose
of this is to optimise an algorithm. I have libraries  for accessing and
loading/saving the images already written in C++.

Last time I had to do this I wrote simple command line wrappers in C to call
my libraries and write out images in a simple format (in fact it was
Poskanser bitmap, which is the simplest image format ever). Then wrote more
command line tools in C to try out the algorithms, and scripted the whole
mess with Perl and bash.

Now, however, I have learnt Python and there has got to be a better way
(especially as I can no longer understand what my Perl code did, or why or
how). I can see that using SWIG to wrap my libraries so that I can call them
from Python will be easy, but I am not sure quite what is the Pythonic way
of accessing an image (my lib represents an image as a pointer to the start
of a buffer together with methods to determine width, height, padding, etc. 
I looked at the Python Imaging Library but unfortunately it does not appear
to support 16 bit pixel images. 
Since speed is not really an issue, I was thinking in terms of a simple
class that is attached to an image that is able to iterate over it in
various ways, and get/set pixel values.

Advice?

 Tom Harris, Software Engineer
 Optiscan Imaging, 15-17 Normanby Rd, Notting Hill, Melbourne, Vic 3168,
Australia
 email tomh at optiscan.com     ph +61 3 9538 3333  fax +61 3 9562 7742

This email may contain confidential information. If you have received this
email in error, please delete it immediately,and inform us of the mistake by
return email. Any form of reproduction, or further dissemination of this
email is strictly prohibited.
Also, please note that opinions expressed in this email are those of the
author, and are not necessarily those of Optiscan Pty Ltd






More information about the Python-list mailing list