pyopengl-users Mailing List for PyOpenGL (Page 39)
Brought to you by:
mcfletch
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(81) |
Oct
(41) |
Nov
(55) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(34) |
Feb
(3) |
Mar
(16) |
Apr
(5) |
May
(10) |
Jun
(13) |
Jul
(24) |
Aug
(14) |
Sep
(14) |
Oct
(9) |
Nov
(10) |
Dec
(16) |
2003 |
Jan
(25) |
Feb
(59) |
Mar
(9) |
Apr
(21) |
May
(54) |
Jun
(4) |
Jul
(16) |
Aug
(19) |
Sep
(19) |
Oct
(15) |
Nov
(13) |
Dec
(22) |
2004 |
Jan
(19) |
Feb
(8) |
Mar
(20) |
Apr
(16) |
May
(13) |
Jun
(18) |
Jul
(18) |
Aug
(14) |
Sep
(24) |
Oct
(47) |
Nov
(20) |
Dec
(10) |
2005 |
Jan
(23) |
Feb
(31) |
Mar
(11) |
Apr
(29) |
May
(18) |
Jun
(7) |
Jul
(11) |
Aug
(12) |
Sep
(8) |
Oct
(4) |
Nov
(11) |
Dec
(7) |
2006 |
Jan
(7) |
Feb
(8) |
Mar
(15) |
Apr
(3) |
May
(8) |
Jun
(25) |
Jul
(19) |
Aug
(3) |
Sep
(17) |
Oct
(27) |
Nov
(24) |
Dec
(9) |
2007 |
Jan
(6) |
Feb
(43) |
Mar
(33) |
Apr
(8) |
May
(20) |
Jun
(11) |
Jul
(7) |
Aug
(8) |
Sep
(11) |
Oct
(22) |
Nov
(15) |
Dec
(18) |
2008 |
Jan
(14) |
Feb
(6) |
Mar
(6) |
Apr
(37) |
May
(13) |
Jun
(17) |
Jul
(22) |
Aug
(16) |
Sep
(14) |
Oct
(16) |
Nov
(29) |
Dec
(13) |
2009 |
Jan
(7) |
Feb
(25) |
Mar
(38) |
Apr
(57) |
May
(12) |
Jun
(32) |
Jul
(32) |
Aug
(35) |
Sep
(10) |
Oct
(28) |
Nov
(16) |
Dec
(49) |
2010 |
Jan
(57) |
Feb
(37) |
Mar
(22) |
Apr
(15) |
May
(45) |
Jun
(25) |
Jul
(32) |
Aug
(7) |
Sep
(13) |
Oct
(2) |
Nov
(11) |
Dec
(28) |
2011 |
Jan
(35) |
Feb
(39) |
Mar
|
Apr
(25) |
May
(32) |
Jun
(17) |
Jul
(29) |
Aug
(10) |
Sep
(26) |
Oct
(9) |
Nov
(28) |
Dec
(4) |
2012 |
Jan
(24) |
Feb
(47) |
Mar
(4) |
Apr
(8) |
May
(9) |
Jun
(6) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(28) |
Nov
(2) |
Dec
(2) |
2013 |
Jan
(11) |
Feb
(3) |
Mar
(4) |
Apr
(38) |
May
(15) |
Jun
(11) |
Jul
(15) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(3) |
Dec
(14) |
2014 |
Jan
(24) |
Feb
(31) |
Mar
(28) |
Apr
(16) |
May
(7) |
Jun
(6) |
Jul
(1) |
Aug
(10) |
Sep
(10) |
Oct
(2) |
Nov
|
Dec
|
2015 |
Jan
(6) |
Feb
(5) |
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(1) |
Aug
(1) |
Sep
(2) |
Oct
(1) |
Nov
(19) |
Dec
|
2016 |
Jan
(6) |
Feb
(1) |
Mar
(7) |
Apr
|
May
(6) |
Jun
|
Jul
(3) |
Aug
(7) |
Sep
|
Oct
(2) |
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
(6) |
Mar
(8) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2018 |
Jan
(9) |
Feb
(1) |
Mar
|
Apr
|
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(6) |
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(7) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Kolja K. <kol...@av...> - 2010-03-11 11:19:51
|
Hmm, my post bounced. Let me try again... sorry, if this causes a duplicate! Dan, Ian, Greg, Thanks for your answers. I still have to look into the best way to do my resizable vertex array, but other than that I am probably going to follow Greg's advice and go with the transposed matrices, as well as using homogeneous coordinates throughout... I guess I wasn't too clear on the column-major vs. row-major topic. To elaborate, if I do (in C++) glLoadIdentity(); glTranslatef(1.0f, 2.0f, 3.0f); float elems[16]; glGetFloatv(GL_MODELVIEW_MATRIX, elems); The returned array reads [1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 1.0 0.0 1.0 2.0 3.0 1.0]. Following the Red Book, this represents a matrix in column-major layout, i.e. 1.0 0.0 0.0 1.0 0.0 1.0 0.0 2.0 0.0 0.0 1.0 3.0 0.0 0.0 0.0 1.0 Thus, vectors are transformed by multiplying from the right: v' = A*v. This would also be how transformations in a GLSL shader are written down. In PyOpenGL, doing the same thing, the resulting matrix is transposed: elems = glGetFloatv(GL_MODELVIEW_MATRIX) results in: [[ 1. 0. 0. 0.] [ 0. 1. 0. 0.] [ 0. 0. 1. 0.] [ 1. 2. 3. 1.]] So, I have to use a row vector and multiply from the left. Likewise for matrix-matrix multiplications. As a PyOpenGL newbie, this is quite surprising to me. Seems like the python code is cleanest when I accept this behavior - just have to be extra careful when exchanging code with other projects using the other convention. Actually, having mentioned shaders - when I pass a matrix to a shader, am I guessing right it will be the transpose of the python matrix? -Kolja -----Original Message----- From: Dan Helfman [mailto:Dan...@no...] Sent: Tuesday, March 09, 2010 7:14 PM To: Kolja Kaehler Cc: pyo...@li... Subject: Re: [PyOpenGL-Users] best way to set up matrices and vertex arrays? Kolja Kaehler wrote: > Does anyone here have some advice for me on these matters? Maybe I am > just missing "the obvious way" to organize these things. Hi Kolja, I haven't had any problems using NumPy's row-major arrays with PyOpenGL. For instance if you have a row-major NumPy array of dtype [ ( "x", np.float32 ), ( "y", np.float32 ) ], you can pass the array directly to PyOpenGL by putting it in a vertex buffer object and then using glVertexPointer( 2, gl.GL_FLOAT, 0, None ) to tell GL to expect 2 floats for each vertex. The same principle works for 3D as well. And if you'd like to store several pieces of NumPy array data together, then you can just use a recarray, and then pass an individual "member" array to PyOpenGL at any point you want. Perhaps you can give an example of what you're trying to do where the row-major/column-major distinction gets in the way? There really isn't a good way to dynamically grow a vertex array with NumPy. Some options are: * Use numpy.resize(), which just returns a new, larger array copy. * Use numpy.ndarray.resize(), which can only resize if there are no other references to the array. * Accumulate and grow with a data structure other than a NumPy array, and then convert to a NumPy array when you're done growing. Some candidates are a Python list (slow), or if you're willing to use Cython or C, then accumulate in a C array with realloc() for growing. I haven't really used NumPy matrices, so I'll let someone else comment on that one. Dan |
From: Ian M. <geo...@gm...> - 2010-03-11 00:16:58
|
I've been trying to install mencoder for a while--for some reason, the command line doesn't recognize "mencoder" as a program. I thought I installed it properly. Ideas? Thanks, Ian |
From: Greg E. <gre...@ca...> - 2010-03-09 23:36:58
|
Kolja Kaehler wrote: > - Row-major vs. column-major matrices. With the default > row-major layout used by numpy, I always have to pass in matrices as the > transpose of what I expect. I found out I can create numpy arrays with > ‘F’ order, but I still have to transpose matrices I get back from > PyOpenGL, it seems. You might like to consider just working with the transposed arrays as they are. Thinking about this recently, I realised that the OpenGL order may actually be more convenient for some things, such as transforming an array of vertices. With a transposed matrix, you can do A*M, where A is an n-by-4 array. With a non-transposed matrix, you would have to do M*A and transpose A into a 4-by-n array. > - What’s a good way to build a dynamically growing vertex > array? ... Currently, I am setting up an array with > shape(n,3) and concatenate another array of length 3 to it. ... I > believe it’s always making a copy. Yes, that will be horribly inefficient. I would build up a list of vertices first, and then convert the whole list to an array in one go. > To transform a 3D vector with a 4x4 matrix, I have to append an > extra 1.0 element, do the multiplication, and then slice off the 4^th > element again. Another way is to work with 4-element vectors throughout. -- Greg |
From: Ian M. <geo...@gm...> - 2010-03-09 20:45:59
|
On Tue, Mar 9, 2010 at 2:58 AM, Kolja Kaehler <kol...@av...>wrote: > - My hope was to avoid having to do my own 3D-vector- and > matrix-classes for doing linear algebra, and just use numpy’s abilities. It > turns out that this is not always so effortless – e.g. to multiply a matrix > with a vector from the right, I have to make sure it’s a column vector. To > transform a 3D vector with a 4x4 matrix, I have to append an extra 1.0 > element, do the multiplication, and then slice off the 4th element again. > Looks like it would be cleaner to write out the whole matrix/vector > multiplication by hand. > Scale and rotate matrices need only be 3x3 matrices. Translation matrices, which must be 4x4, can instead be expressed as simple addition: e.g., vertex_array += array([1,2,6]) You might also want to consider keeping your vertices as vec4s--that's how OpenGL stores vertices interally, even if you only define the x and y, or the x,y, and z coordinates. You may also consider using OpenGL's own matrix system. It's technically deprecated--but it's still an awes Ian |
From: Dan H. <Dan...@no...> - 2010-03-09 18:14:08
|
Kolja Kaehler wrote: > Does anyone here have some advice for me on these matters? Maybe I am > just missing “the obvious way” to organize these things. Hi Kolja, I haven't had any problems using NumPy's row-major arrays with PyOpenGL. For instance if you have a row-major NumPy array of dtype [ ( "x", np.float32 ), ( "y", np.float32 ) ], you can pass the array directly to PyOpenGL by putting it in a vertex buffer object and then using glVertexPointer( 2, gl.GL_FLOAT, 0, None ) to tell GL to expect 2 floats for each vertex. The same principle works for 3D as well. And if you'd like to store several pieces of NumPy array data together, then you can just use a recarray, and then pass an individual "member" array to PyOpenGL at any point you want. Perhaps you can give an example of what you're trying to do where the row-major/column-major distinction gets in the way? There really isn't a good way to dynamically grow a vertex array with NumPy. Some options are: * Use numpy.resize(), which just returns a new, larger array copy. * Use numpy.ndarray.resize(), which can only resize if there are no other references to the array. * Accumulate and grow with a data structure other than a NumPy array, and then convert to a NumPy array when you're done growing. Some candidates are a Python list (slow), or if you're willing to use Cython or C, then accumulate in a C array with realloc() for growing. I haven't really used NumPy matrices, so I'll let someone else comment on that one. Dan |
From: Cata <cat...@gm...> - 2010-03-09 11:59:30
|
It is ok now . I see where is the error ... See my result : http://img121.imageshack.us/img121/9318/gluttest.png -- My sites: http://catalin-festila.blogspot.com -about me http://tv.free-tutorials.org - video tutorials http://python-catalin.blogspot.com - my python blog |
From: Kolja K. <kol...@av...> - 2010-03-09 11:10:35
|
Hi all, I've recently discovered PyOpenGL and am quite happy with this package (kudos to the authors!). It's just great for prototyping on different platforms. I keep struggling with how I should best represent vertex data and matrices, though. Here are some of my favorite problems: - Row-major vs. column-major matrices. With the default row-major layout used by numpy, I always have to pass in matrices as the transpose of what I expect. I found out I can create numpy arrays with 'F' order, but I still have to transpose matrices I get back from PyOpenGL, it seems. - What's a good way to build a dynamically growing vertex array? Sort of the equivalent of a std::vector<Vec3f> in C++, with struct Vec3f { float p[3]; }. Currently, I am setting up an array with shape(n,3) and concatenate another array of length 3 to it. It looks horrible in code (sorry, I can't remember the syntax right now), and I believe it's always making a copy. - My hope was to avoid having to do my own 3D-vector- and matrix-classes for doing linear algebra, and just use numpy's abilities. It turns out that this is not always so effortless - e.g. to multiply a matrix with a vector from the right, I have to make sure it's a column vector. To transform a 3D vector with a 4x4 matrix, I have to append an extra 1.0 element, do the multiplication, and then slice off the 4th element again. Looks like it would be cleaner to write out the whole matrix/vector multiplication by hand. Does anyone here have some advice for me on these matters? Maybe I am just missing "the obvious way" to organize these things. Thanks, -Kolja |
From: Daniel B. <dan...@so...> - 2010-03-08 12:31:46
|
Hello the PyOpenGL community, Firstly, let me introduce myself. I'm Daniel Barbeau, a developer of the OpenAlea (http://openalea.gforge.inria.fr/), a software from the VirtualPlants INRIA team (http://www-sop.inria.fr/teams/virtualplants). We use Python as a development and integration language and we have many (direct or indirect) dependencies on other Python modules. With the 3.0.1 release of PyOpenGL, our deployment system started to raise errors when resolving dependencies to PyOpenGL. The *.exe was downloaded but the installation failed. Finally we discovered that the windows installer of the the 3.0.1 version created a egg-info file for Python 2.5 even if it was Python 2.6 that was selected for installation. We quickly repackaged PyOpenGL for python 2.6, you can find it here: http://gforge.inria.fr/frs/download.php/26622/PyOpenGL-3.0.1.win32.exe The repackaging is a quick fix to get our software working again, so I hope you can find the correct solution. Thanks, Daniel Barbeau |
From: Ian M. <geo...@gm...> - 2010-03-01 08:27:18
|
At a guess, anything that might be wrong could be the result of your using an orthographic projection. If you're drawing in 3D, you usually want a perspective matrix. Please try to be more specific with what your problem is. |
From: Cata <cat...@gm...> - 2010-03-01 08:13:40
|
I try to use gluQuadricTexture(g, GL_TRUE) . This is my code : import os import sys import pygame from pygame import * from OpenGL.GL import * from OpenGL.GLU import * from OpenGL.GLUT import * import Image import numpy g= None texture=None def init_display(w, h): pygame.display.set_mode( (w,h) , pygame.OPENGL | pygame.DOUBLEBUF ) glViewport(0, 0, w, h) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) glLight(GL_LIGHT0, GL_POSITION,(0.5,0.5,-1.5, 0)) glMatrixMode(GL_PROJECTION); glLoadIdentity(); gluOrtho2D(-1, 1, -1, 1); glMatrixMode(GL_MODELVIEW); def draw(): glClearColor(0.0, 0.0, 0.0, 1.0) glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) glColor(0,1,0) try: img = Image.open('13.jpg') except NameError: print "Error load texture" img_data = numpy.array(list(img.getdata()), numpy.int8) texture=glGenTextures(1); glBindTexture(GL_TEXTURE_CUBE_MAP, texture); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR) glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, img.size[0], img.size[1], 0, GL_RGB, GL_UNSIGNED_BYTE, img_data) glPushMatrix(); glEnable(GL_TEXTURE_2D) g=gluNewQuadric() gluQuadricNormals(g, GLU_SMOOTH) gluQuadricTexture(g, GL_TRUE) gluQuadricOrientation(g,GLU_OUTSIDE) gluCylinder(g,0.1,0.1,0.2,8,1) glPopMatrix(); pygame.display.flip() def main(): pygame.init() glutInit() init_display(800, 600) while 1: event=pygame.event.poll () draw() if event.type is KEYDOWN: if event.key is K_ESCAPE: sys.exit(0) main() Is nothing in my scene ... What is wrong with my code ? Thank you . -- My sites: http://tv.free-tutorials.org - video tutorials http://python-catalin.blogspot.com - my python blog |
From: Miriam E. <mi...@mi...> - 2010-02-28 20:46:06
|
Oops. I just realised I misread your question. Sorry. You were looking for a way to turn images into a movie format. The easiest, most flexible way I know of is using mencoder. It usually comes with mplayer. http://www.mplayerhq.hu Here is how I've encoded an avi from a directory full of jpg images I rendered using Blender: mencoder "mf://*.jpg" -mf fps=25 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell The mf:// prefix refers to multiple files in the current directory. I haven't used mencoder with tiff files, but I expect that so long as you have the libtiff library it would probably work. Here is the relevant part of the mplayer manual: 13.8. Encoding from multiple input image files (JPEG, PNG, TGA, etc.) MEncoder is capable of creating movies from one or more JPEG, PNG, TGA, or other image files. With simple framecopy it can create MJPEG (Motion JPEG), MPNG (Motion PNG) or MTGA (Motion TGA) files. Explanation of the process: 1. MEncoder decodes the input image(s) with libjpeg (when decoding PNGs, it will use libpng). 2. MEncoder then feeds the decoded image to the chosen video compressor (DivX4, Xvid, FFmpeg msmpeg4, etc.). Examples. The explanation of the -mf option is in the man page. Creating an MPEG-4 file from all the JPEG files in the current directory: mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi Creating an MPEG-4 file from some JPEG files in the current directory: mencoder mf://frame001.jpg,frame002.jpg -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi Creating an MPEG-4 file from explicit list of JPEG files (list.txt in current directory contains the list of files to use as source, one per line): mencoder mf://@list.txt -mf w=800:h=600:fps=25:type=jpg -ovc lavc -lavcopts vcodec=mpeg4:mbd=2:trell -oac copy -o output.avi You can mix different types of images, regardless of the method you use - individual filenames, wildcard or file with list - provided of course they have the same dimensions. So you can e.g. take title frame from PNG file, and then put a slideshow of your JPEG photos. Creating a Motion JPEG (MJPEG) file from all the JPEG files in the current directory: mencoder mf://*.jpg -mf w=800:h=600:fps=25:type=jpg -ovc copy -oac copy -o output.avi Creating an uncompressed file from all the PNG files in the current directory: mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc raw -oac copy -o output.avi Note Width must be integer multiple of 4, it is a limitation of the RAW RGB AVI format. Creating a Motion PNG (MPNG) file from all the PNG files in the current directory: mencoder mf://*.png -mf w=800:h=600:fps=25:type=png -ovc copy -oac copy -o output.avi Creating a Motion TGA (MTGA) file from all the TGA files in the current directory: mencoder mf://*.tga -mf w=800:h=600:fps=25:type=tga -ovc copy -oac copy -o output.avi Larry Cuba wrote: > Anyone using PyOpenGL for animation? > i'm using PIL to write out 'frame buffer grabs' to Tif files. > > Now i need a utility (with a command line mode) to combine > Tifs into a movie file: mpeg or quicktime or AVI, etc. > > i thought VideoMach was my best bet, but it's > not taking an input filename on the command line > like it's supposed to and > the /Log option (to create a log for debugging) > causes a crash. (a bad sign). > > any suggestions? > > thanks. > > Larry C. > www.well.com/user/cuba > > > > > > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > -- If you don't have any failures then you're not trying hard enough. - Dr. Charles Elachi, director of NASA's Jet Propulsion Laboratory ----- Website: http://miriam-english.org Blog: http://miriam_e.livejournal.com |
From: Nicolas R. <Nic...@lo...> - 2010-02-26 20:23:35
|
ImageMagick "convert" command or "ffmpeg" may be what you're looking for. Nicolas On Feb 26, 2010, at 19:14 , Larry Cuba wrote: > > Anyone using PyOpenGL for animation? > i'm using PIL to write out 'frame buffer grabs' to Tif files. > > Now i need a utility (with a command line mode) to combine > Tifs into a movie file: mpeg or quicktime or AVI, etc. > > i thought VideoMach was my best bet, but it's > not taking an input filename on the command line > like it's supposed to and > the /Log option (to create a log for debugging) > causes a crash. (a bad sign). > > any suggestions? > > thanks. > > Larry C. > www.well.com/user/cuba > > > > > > > > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users |
From: Ian M. <geo...@gm...> - 2010-02-26 19:14:25
|
I used Animation Shop Pro (an old program that only loads 16 images at a time). I'd like to know a better solution too. It's probably not a PyOpenGL-specific question, though. |
From: Larry C. <cu...@we...> - 2010-02-26 18:42:17
|
Anyone using PyOpenGL for animation? i'm using PIL to write out 'frame buffer grabs' to Tif files. Now i need a utility (with a command line mode) to combine Tifs into a movie file: mpeg or quicktime or AVI, etc. i thought VideoMach was my best bet, but it's not taking an input filename on the command line like it's supposed to and the /Log option (to create a log for debugging) causes a crash. (a bad sign). any suggestions? thanks. Larry C. www.well.com/user/cuba |
From: Virgil S. <vs...@it...> - 2010-02-26 14:39:06
|
On 26-Feb-2010 13:17, Gijs wrote: > Hello Virgil, > > You do know that recovering 3D coordinates from 2D images is not > something you can *just* do. I know Gijs. I happened to have some actual experience in this area (using the DLT method). > Getting 3D coordinates from an object using multiple cameras is hard > enough if there is no extra information available. However, using > software like artoolkit along with PyARTK bindings for artoolkit, > allows you to detect a tag in an image. ARToolkit is able to give you > an OpenGL matrix which decribes everything you need to put the camera > in the correct virtual position. You can use this to augment the image > with 3D objects that are positioned in the same way as they would be > in the real world. Actually, I am interested in autocalibration, in which camera images from multiple views of the same scene, and of course, some "extra information" as you mention, is available (e.g. edges of buildings, etc.) can be used to recover the structure of the scene. > > Without any extra information on what you have/need, it's quite hard > to say if this would suit your needs though. Yes, I know Gijs. This is the raison d'étre for posting this message. I hope that this user list is appropriate for such a question. Thanks Gijs for your concerns. --V. Stokes > > Regards, Gijs > > On 2/26/10 11:38 , Virgil Stokes wrote: >> I would appreciate it if someone could direct me to a Python user or >> link that could provide information on the following: >> >> Autocalibration of a camera for recovery of 3D coordinates from >> multiple 2D images >> >> *with the constraint that the code is based on Python* [of course :-)] >> >> --Thank you, >> V. Stokes >> >> >> ------------------------------------------------------------------------------ >> Download Intel® Parallel Studio Eval >> Try the new software tools for yourself. Speed compiling, find bugs >> proactively, and fine-tune applications for parallel performance. >> See why Intel Parallel Studio got high marks during beta. >> http://p.sf.net/sfu/intel-sw-dev >> >> >> _______________________________________________ >> PyOpenGL Homepage >> http://pyopengl.sourceforge.net >> _______________________________________________ >> PyOpenGL-Users mailing list >> PyO...@li... >> https://lists.sourceforge.net/lists/listinfo/pyopengl-users >> > |
From: Virgil S. <vs...@it...> - 2010-02-26 14:30:41
|
On 26-Feb-2010 13:37, Andrew Wilson wrote: > Take a quick look at OpenCV, they have camera calibration with python > bindings. > Andrew > > On Fri, Feb 26, 2010 at 5:38 AM, Virgil Stokes <vs...@it... > <mailto:vs...@it...>> wrote: > > I would appreciate it if someone could direct me to a Python user > or link that could provide information on the following: > > Autocalibration of a camera for recovery of 3D coordinates from > multiple 2D images > > *with the constraint that the code is based on Python* [of course :-)] > > --Thank you, > V. Stokes > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > I was wrong Andrew! I found what I believe to be a Python OpenCV which includes some classes/functions for calibration. http://opencv.willowgarage.com/documentation/python/camera_calibration_and_3d_reconstruction.html I am not sure that it can handle the type of autocalibration that I am interested in doing; but, it will be a good start. Thanks for reminding of this great package --- OpenCV. --V |
From: Andrew W. <and...@gm...> - 2010-02-26 14:26:37
|
Take a quick look at OpenCV, they have camera calibration with python bindings. Andrew On Fri, Feb 26, 2010 at 5:38 AM, Virgil Stokes <vs...@it...> wrote: > I would appreciate it if someone could direct me to a Python user or link > that could provide information on the following: > > Autocalibration of a camera for recovery of 3D coordinates from > multiple 2D images > > *with the constraint that the code is based on Python* [of course :-)] > > --Thank you, > V. Stokes > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > |
From: Virgil S. <vs...@it...> - 2010-02-26 14:22:47
|
On 26-Feb-2010 13:37, Andrew Wilson wrote: > Take a quick look at OpenCV, they have camera calibration with python > bindings. I will do this Andrew --- thanks. I did look at OpenCV a few years ago, but if I remember correctly it was not written in Python. But, I will check again. --V. Stokes > Andrew > > On Fri, Feb 26, 2010 at 5:38 AM, Virgil Stokes <vs...@it... > <mailto:vs...@it...>> wrote: > > I would appreciate it if someone could direct me to a Python user > or link that could provide information on the following: > > Autocalibration of a camera for recovery of 3D coordinates from > multiple 2D images > > *with the constraint that the code is based on Python* [of course :-)] > > --Thank you, > V. Stokes > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > <mailto:PyO...@li...> > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > > |
From: Gijs <in...@bs...> - 2010-02-26 12:49:25
|
Hello Virgil, You do know that recovering 3D coordinates from 2D images is not something you can *just* do. Getting 3D coordinates from an object using multiple cameras is hard enough if there is no extra information available. However, using software like artoolkit along with PyARTK bindings for artoolkit, allows you to detect a tag in an image. ARToolkit is able to give you an OpenGL matrix which decribes everything you need to put the camera in the correct virtual position. You can use this to augment the image with 3D objects that are positioned in the same way as they would be in the real world. Without any extra information on what you have/need, it's quite hard to say if this would suit your needs though. Regards, Gijs On 2/26/10 11:38 , Virgil Stokes wrote: > I would appreciate it if someone could direct me to a Python user or > link that could provide information on the following: > > Autocalibration of a camera for recovery of 3D coordinates from > multiple 2D images > > *with the constraint that the code is based on Python* [of course :-)] > > --Thank you, > V. Stokes > > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > > > _______________________________________________ > PyOpenGL Homepage > http://pyopengl.sourceforge.net > _______________________________________________ > PyOpenGL-Users mailing list > PyO...@li... > https://lists.sourceforge.net/lists/listinfo/pyopengl-users > |
From: Virgil S. <vs...@it...> - 2010-02-26 10:38:54
|
I would appreciate it if someone could direct me to a Python user or link that could provide information on the following: Autocalibration of a camera for recovery of 3D coordinates from multiple 2D images *with the constraint that the code is based on Python* [of course :-)] --Thank you, V. Stokes |
From: Ian M. <geo...@gm...> - 2010-02-21 04:56:46
|
Hah--I fixed it! Turns out, the problem was the card--specifically the error reporting option. Because my current display control panel didn't have the error reporting option, I installed a previous display driver, which also installs a version of the display control panel that includes the error reporting option. I then turned error reporting *off*, which actually turns it on. Well then. Thanks! -Ian |
From: Craig B. <cd...@gm...> - 2010-02-17 18:16:18
|
Hm, seems like that would only make a difference if I were running main.exe from a dir other than dist, which I was not. I can try it out this evening, but I'm not optimistic. On Wed, Feb 17, 2010 at 09:55, Dan Helfman <Dan...@no...> wrote: > Craig Berry wrote: >> >> Okay, neither of the provided recipe variants worked. >> >> I have this at the top of my main.py, the main module: >> >> import sys >> sys.path.insert(0, '.') > > You might try something like this instead: > > # See http://www.py2exe.org/index.cgi/WhereAmI > if hasattr( sys, "frozen" ): > if sys.frozen == "windows_exe": > main_dir = os.path.dirname( > unicode( sys.executable, sys.getfilesystemencoding() ) > ) > sys.path.append( main_dir ) > os.chdir( main_dir ) > else: > sys.path.insert( 0, "." ) > > Dan > > -- Craig Berry - http://www.cine.net/~cberry/ "Lots of things in the universe don’t solve any problems, and nevertheless exist." -- Sean Carroll |
From: Dan H. <Dan...@no...> - 2010-02-17 17:55:54
|
Craig Berry wrote: > Okay, neither of the provided recipe variants worked. > > I have this at the top of my main.py, the main module: > > import sys > sys.path.insert(0, '.') You might try something like this instead: # See http://www.py2exe.org/index.cgi/WhereAmI if hasattr( sys, "frozen" ): if sys.frozen == "windows_exe": main_dir = os.path.dirname( unicode( sys.executable, sys.getfilesystemencoding() ) ) sys.path.append( main_dir ) os.chdir( main_dir ) else: sys.path.insert( 0, "." ) Dan |
From: Rod <rod...@gm...> - 2010-02-17 04:06:35
|
> Thanks, Jef and Dan. I'm a bit perturbed that this is so messy; it > has the smell of something that will break every time the slightest > change happens to any of the involved components. I'm wondering > whether Python is really suited to production OpenGL use, which is > sad, as I've really been enjoying working in it. matplotlib has a function get_py2exe_datafiles(), so that one can use this in the setup.py file to get all the necessary extra files. import matplotlib as mpl data_files= mpl.get_py2exe_datafiles() setup(name="WRView", windows=["WRReader.py"], options = {"py2exe" : { "dll_excludes": ["MSVCP90.dll"] } }, data_files = data_files, } I'm just wondering if the same sort of approach could be done for PyOpenGL |
From: Craig B. <cd...@gm...> - 2010-02-17 03:40:35
|
Okay, neither of the provided recipe variants worked. I have this at the top of my main.py, the main module: import sys sys.path.insert(0, '.') import OpenGL.GL import OpenGL.GLU import OpenGL.GLUT from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * And here is my setup.py: from distutils.core import setup import py2exe, os, sys setup(windows=['main.py'], options={"py2exe": {"includes": ["ctypes", "logging"], "excludes": ["OpenGL"], } } ) if sys.platform.startswith( "win" ) and "py2exe" in sys.argv: # See http://www.py2exe.org/index.cgi/PyOpenGL import OpenGL import shutil print "*** copy PyOpenGL module ***" opengl_dir = os.path.dirname( OpenGL.__file__ ) try: # Since the ignore keyword was introduced in Python 2.6, include a # fall-back for Python 2.5. try: shutil.copytree( opengl_dir, os.path.join( "dist", "OpenGL" ), ignore = shutil.ignore_patterns( "*.py", "*.pyc", "GLUT", "Tk" ) ) except TypeError: shutil.copytree( opengl_dir, os.path.join( "dist", "OpenGL" ) ) except WindowsError, error: if not "already exists" in str( error ): raise When I run "python setup.py py2exe", the output includes this: The following modules appear to be missing ['OpenGL.GL', 'OpenGL.GLU', 'OpenGL.GLUT'] ...which is confusing, as that's why I did the imports in main.py shown above. But anyway, the dist dir gets created, and the OpenGL package is copied into it as expected. But when I run dist\main.exe, I get an error popup pointing me at main.exe.log, which has these contents: Traceback (most recent call last): File "main.py", line 6, in <module> import OpenGL.platform.win32 ImportError: No module named OpenGL.platform.win32 Traceback (most recent call last): File "main.py", line 6, in <module> ImportError: No module named OpenGL.platform.win32 Traceback (most recent call last): File "main.py", line 6, in <module> import OpenGL.GL ImportError: No module named OpenGL.GL Traceback (most recent call last): File "main.py", line 6, in <module> ImportError: No module named OpenGL.GL Ideas, please? -- Craig Berry - http://www.cine.net/~cberry/ "Lots of things in the universe don’t solve any problems, and nevertheless exist." -- Sean Carroll |