I see. For doing that, you don't want VPython. It can render 3D images
constructed by code, writing the positions of boxes, spheres, lines
and so; but it cannot process images, at least as far as I know.
For processing images the best library I know is Matplotlib. Here is a
tutorial: http://matplotlib.sourceforge.net/users/image_tutorial.html.
It imports the image as a matrix, in which each element represents a
pixel, and it is, or a number from 0 (black) to 1 (white) , or a list
of three elements (RGB). Starting from that, you can work, well in a
more compact way treating it like matrices, or in a more elementary
way element by element.
As a footnote, Matplotlib works natively only with png, but if you
have PIL installed, it can open any other file exactly in the same
way.
Also, I am thinking in another way to work. GIMP is actually a GUI for
a tool that you could program to do what you want. I haven't tried it,
so I cannot tell you more.
I hope it helps.
David.
On Tue, Jun 22, 2010 at 6:14 AM, Alec Bennett <wry...@gm...> wrote:
> I have two pictures shot from slightly different angles, and I'm trying to
> process them into a 3d anaglyph image.
>
> I wound up finding this bit of code:
>
> http://www.mail-archive.com/pyt...@py.../msg86685.html
>
> Seems to be working nicely, though I have no idea what exactly is happening
> in the code, so I can't fine tune the results. I don't have the two cameras
> I'm using mounted yet so I can't really guage how much of a 3d effect I'm
> getting. But with my cameras pointed very imprecisely, I'm getting somewhat
> decent results.
>
> Its my understanding that to get a good 3d anaglyph effect, the cameras need
> to be mounted very very carefully, exactly mimicking the distance of human
> eyes.
>
>
>
>
>
|