python's performance

Bill Mill bill.mill at gmail.com
Thu Sep 29 17:19:17 EDT 2005


> On 9/29/05, James Hu <jhu at metrigenix.com> wrote:
> > Hi,
> >
> > I used python and PIL to capture image from a digital camera,
> > It seems like it took more than 1 second to capture a 1280x1024 image,
> > however, the demo capturing application from the company (coded by VB)
> > took only .2s or less for one image with the same size.
> > Don't know why python and PIL is so slow, any idea to improve the
> > performance? Thanks a lot!
> >
> > James
> >
> > --
> > http://mail.python.org/mailman/listinfo/python-list
> >
>
> Bill Mill <bill.mill at gmail.com> wrote:
> You've gotta framinate your capacitor to speed it up.
>
> (Translated: With no information about your camera, memory card, type
> of connection, platform, method of access, version of python, version
> of PIL, or code, how in the world could I help you to diagnose your
> loosely-specified problem? Ask something that's answerable, and we'll
> try to help you.)
>
> Peace
> Bill Mill
> bill.mill at gmail.com
>

On 9/29/05, James Hu <jhu at metrigenix.com> wrote:
> Thanks for your fast reply.
>
> Camera, HAMAMATSU C4742-95-12G04, IEEE1394-based,
>         Can capture frame at 8.8/s at full resolution 1344X1024
> Memory: 512M
> Platform: Win2K and DELL 2.0GHz P4
> Python 2.4
> PIL: 1.15
>
> Have u been used such camera with PIL before?
>
> im_1= Image.fromstring("I", datasize, buf, 'raw', 'I;16')
>
> Your help would be greatly appreciated!
>
> James
>

Where do datasize and buf come from? Have you profiled your
application to make sure that it is the Image.fromstring line which is
slowing down your code? (If you don't know how to profile, just ask)

Peace
Bill Mill
bill.mill at gmail.com



More information about the Python-list mailing list