helppyFormex - Support: sr #108275, how to convert a canvas into a...

 
 

sr #108275: how to convert a canvas into a numpy array ?

Submitted by:  francesco <francio>
Submitted on:  Tue 26 Mar 2013 01:00:09 PM UTC  
 
Category:  GUI Priority:  5 - Normal
Severity:  3 - Normal Privacy:  Public
Assigned to:  None Open/Closed:  Open
Operating System:  None

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 26 Mar 2013 02:53:46 PM UTC, comment #1: 

You can grab the image as in gui/image.py and then convert it ot a numpy array:

  qim = pf.canvas.grabFrameBuffer()
  from plugins.imagearray import image2numpy
  ar = image2numpy(qim)

Or you can directly use an OpenGL call:
(see http://www.opengl.org/sdk/docs/man/xhtml/glReadPixels.xml)

  from OpenGL import GL
  ar = Gl.glReadPixels(....)

Benedict Verhegghe <bverheg>
Project Administrator
Tue 26 Mar 2013 01:00:09 PM UTC, original submission:  

I want to convert the canvas view directly into a numpy array or a Qimagewithout saving it first as an image. I am currently using
gui.image.saveImage(fn)
and I then load the image and convert it using image2numpy.
Is there a way to do it direclty?

francesco <francio>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bverheg (Posted a comment)
  • -email is unavailable- added by francio (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    No changes have been made to this item

    Back to the top


    Powered by Savane 3.5