Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > does anyone know how to use libjeg from within memory in python

Reply
Thread Tools

does anyone know how to use libjeg from within memory in python

 
 
Chris Colbert
Guest
Posts: n/a
 
      10-13-2009
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
 
Reply With Quote
 
 
 
 
Stefan Behnel
Guest
Posts: n/a
 
      10-13-2009
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
 
Reply With Quote
 
 
 
 
Chris Colbert
Guest
Posts: n/a
 
      10-13-2009
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 <(E-Mail Removed)> 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
>

 
Reply With Quote
 
Ned Deily
Guest
Posts: n/a
 
      10-13-2009
In article
<7f014ea60910130325n34156771r7f79eed588eaa018@mail .gmail.com>,
Chris Colbert <(E-Mail Removed)> 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,
http://www.velocityreviews.com/forums/(E-Mail Removed)

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Does anyone Know Anyone at Maas Rowe I can talk to channing28270@gmail.com Computer Support 3 07-05-2006 08:27 AM
Does anyone know why Safari browser does not submit on enter key. zazzaron@cox.net HTML 1 12-20-2005 07:50 PM
LOOK! i just want to know does anyone know... Simon Egginton Javascript 3 07-26-2004 08:11 PM
Does anyone know of a place in Auckland that does XBOX upgrades? Rats NZ Computing 1 07-26-2003 08:07 AM



Advertisments