Porting help... Programming Software Development by Tech B …" // from http://gpwiki.org/index.php/LoadBMPCpp #include "fdlib.h" void main(int argc, char *argv[]) { int i… ctypes help Programming Software Development by Tech B …" // from http://gpwiki.org/index.php/LoadBMPCpp #include "fdlib.h" void main(int argc, char *argv[]) { int i… Re: ctypes help Programming Software Development by Tech B … I do is: [CODE] form ctypes import * fd = windll.LoadLibrary('fdlib.dll') import Image im = Image.open('test.bmp') #test.bmp… Re: ctypes help Programming Software Development by Tech B … it, after a week of google. [inlinecode]fd = cdll.LoadLibrary('fdlib.dll')[/inlinecode] "cdll is for importing functions which use… Re: Porting help... Programming Software Development by Mahnaum …" // from http://gpwiki.org/index.php/LoadBMPCpp #include "fdlib.h" void main(int argc, char *argv[]) { int i… Re: Face recognition Programming Software Development by Tech B ….kyb.mpg.de/bs/people/kienzle/facedemo/facedemo.htm"]fdlib.dll[/URL] [*]Pygame [/LIST] [CODE] #Face Detection Real-Time #supports… clear screen os.system('color 02') fd = cdll.LoadLibrary("fdlib.dll") #dll found at http://www.kyb.mpg.de… Re: Face recognition Programming Software Development by Tech B … clear screen os.system('color 02') fd = cdll.LoadLibrary("fdlib.dll") #dll found at http://www.kyb.mpg.de… Re: Face recognition Programming Software Development by toofan0909 ….system('color 02') os.system('cls') fd = cdll.LoadLibrary("fdlib.dll") #dll found at http://www.kyb.mpg.de… Re: Porting help... Programming Software Development by harryhaaren Hey, What your asking is quite hard to accomplish. Is there no possibility to do all of your program in Python? It seems that would make life a lot easier for you.. Can I advise the Python Imaging Library ([URL="http://www.pythonware.com/products/pil/#pil117"](link here)[/URL] if you dont want to duplicate work. Hope this seems a good… Re: ctypes help Programming Software Development by vegaseat Your assumption about [B]graydata[/B] is probably correct if you just follow [B]GetImg()[/B] and [B]pImage[/B] in header file [B]loadbmp.h[/B] Are you passing [B]graydata[/B] in as a pointer? Re: ctypes help Programming Software Development by Tech B I'm not sure what a pointer is, but I'm passing it as it is after: [CODE] i = 0 while i < 307200: #size of image (640*480) graydata[i] = c_ubyte(gl[i]) #gl = list of grayscale values i += 1 [/CODE] I just read something about pointers on google, would something like this work? [CODE] graydata = ctypes.cast(graydata, ctypes.POINTER(ctypes.… Re: ctypes help Programming Software Development by Tech B I tried [inlinecode]graydata = cast(graydata, POINTER(c_ubyte))[/inlinecode] and [inlinecode]fd.fdlib_detectfaces(byref(graydata), w, h, threshold)[/inlinecode] and still get the same error. Re: ctypes help Programming Software Development by The_Kernel I don't think you can just dump a python array into the dll's function. Try initializing graydata like this: [code] graydata_type = ctypes.c_ubyte * (w * h) graydata = graydata_type()[/code] Re: ctypes help Programming Software Development by Tech B I do initialize it. [CODE] graydata = c_ubyte * (640*480) graydata = graydata() [/CODE] I figured that out when I assigned it the values: [CODE] i = 0 while i < 307200: #size of image (640*480) graydata[i] = c_ubyte(gl[i]) #gl = list of grayscale values i += 1 [/CODE] Re: ctypes help Programming Software Development by The_Kernel without you posting your code it's hard to know that <hint, hint> Re: Porting help... Programming Software Development by Tech B I got it working. I used pythons ctypes. I used PIL also to convert RGB to grayscale. I think i have a snippet floating around the python forums.