Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   does anyone know how to use libjeg from within memory in python (http://www.velocityreviews.com/forums/t701397-does-anyone-know-how-to-use-libjeg-from-within-memory-in-python.html)

Chris Colbert 10-13-2009 09:51 AM

does anyone know how to use libjeg from within memory in python
 
Say I use python to talk to a wireless webcamera that delivers images
via http requests.

I request an image and read it into a buffer, but the image is in jpeg format.

I would like to convert this to a simple RGB format buffer to pass to
numpy. Has anyone managed this using libjpeg or any other lib?

Cheers!

Chris

Stefan Behnel 10-13-2009 10:04 AM

Re: does anyone know how to use libjeg from within memory in python
 
Chris Colbert wrote:
> Say I use python to talk to a wireless webcamera that delivers images
> via http requests.
>
> I request an image and read it into a buffer, but the image is in jpeg format.
>
> I would like to convert this to a simple RGB format buffer to pass to
> numpy. Has anyone managed this using libjpeg or any other lib?


According to the docs, the stdlib jpeg module has been removed in Py3:

http://docs.python.org/library/jpeg.html

But since you are processing images anyway, what about using an image
processing library like PIL or ImageMagick?

Stefan

Chris Colbert 10-13-2009 10:25 AM

Re: does anyone know how to use libjeg from within memory in python
 
Heh, for whatever reason, your post is dated earlier than my response,
but wasn't here when I sent mine. But yeah, PIL worked.

On Tue, Oct 13, 2009 at 12:04 PM, Stefan Behnel <stefan_ml@behnel.de> wrote:
> Chris Colbert wrote:
>> Say I use python to talk to a wireless webcamera that delivers images
>> via http requests.
>>
>> I request an image and read it into a buffer, but the image is in jpeg format.
>>
>> I would like to convert this to a simple RGB format buffer to pass to
>> numpy. Has anyone managed this using libjpeg or any other lib?

>
> According to the docs, the stdlib jpeg module has been removed in Py3:
>
> http://docs.python.org/library/jpeg.html
>
> But since you are processing images anyway, what about using an image
> processing library like PIL or ImageMagick?
>
> Stefan
> --
> http://mail.python.org/mailman/listinfo/python-list
>


Ned Deily 10-13-2009 08:22 PM

Reply Delays
 
In article
<7f014ea60910130325n34156771r7f79eed588eaa018@mail .gmail.com>,
Chris Colbert <sccolbert@gmail.com> wrote:

> Heh, for whatever reason, your post is dated earlier than my response,
> but wasn't here when I sent mine. [...]


It's not always obvious but this "forum" is multiplexed in several
places. It's available as a Usenet newsgroup (comp.lang.python), as a
mailing list from python.org
(http://mail.python.org/mailman/listinfo/python-list), as a Google
group, and in various formats from consolidators like gmane.org
(http://dir.gmane.org/gmane.comp.python.general). All of those
"channels" are bi-directional so there are often latency delays while a
reply from one channel pushes its way upstream and back out to the
various other channels. Sometimes those latencies are really long when
one channel gets a little slow. So, if a fast moving thread, replies
will often cross in the pipeline, adding another level of confusion
("Didn't they read first before posting??"). It's sort of amazing that
it all works as well as it does.

--
Ned Deily,
nad@acm.org



All times are GMT. The time now is 02:17 PM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57