Hi all,
sorry for spamming this mailinglist but i feel that i need to share my frustration with you all ;)
Also i have changed the subject of this topic to something more appropriate.

As i mentioned in my previous post:

client = playerc_client(None, 'localhost', 6665)
cam = playerc_camera(client, 0)
if cam.subscribe(PLAYERC_OPEN_MODE) != 0:
  raise Exception(playerc_error_str())
if client.read() == None:
  raise Exception(playerc_error_str())

img = cv.CreateImageHeader((cam.width,cam.height), cv.IPL_DEPTH_8U, cam.bpp/8)
cv.SetData(img, cam.image, cam.image_count)
cv.ShowImage ('Camera', img)

------------
It Errors on the last line and gives:
TypeError: IplImage argument 'image' has no data


Note that i can save frames from the camera with "cam.save('frame.ppm')" in worst case we can save every frame to file and then read them... but we think this wont be very efficient.

This morning i thought/hoped that i had found the solution for my problem when looking at this:
http://sourceforge.net/tracker/?func=detail&atid=433166&aid=1817970&group_id=42445

However none of the two examples works for me:
import array
im_array = array.array('B') #array of unsigned byte
im_array.fromstring(cam.image[:cam.image_count])

Creating a PIL image object is similar:

import Image
im = Image.new('RGB',(cam.width,cam.height))
im.fromstring(cam.image[:cam.image_count])

Both examples gives me same error on:
 im_array.fromstring(cam.image[:cam.image_count])
and on:
  im.fromstring(cam.image[:cam.image_count])

The error message is:
TypeError: 'SwigPyObject' object is unsubscriptable

Any ideas on how to fix this?

Im beginning to suspect that it might be a problem with the swig bindings:
In python documentation for PyBuffer_FromMemory:
PyObject* PyBuffer_FromMemory(void *ptr, Py_ssize_t size)
But in: libplayerc/bindings/python/playerc.i 

%typemap(out) uint8_t [ANY]
{
   $result = PyBuffer_FromMemory((void*)$1,sizeof(uint8_t)*$1_dim0);
}

could the problem be that "sizeof(uint8_t)*$1_dim0" be of type Py_ssize_t ?
Any suggestions or ideas on how to resolve this problem is greatly appreciated!
Im part of a group of students at Uppsala University, Sweden ... we have decided to use the Python bindings ... and it would be nice to get this working for us.

Kind regards
/Torbjörn