Hi Robert,

> Do you want your camera views to appear on screen, or is it purely for the purposes of snapping images? My main purpose is to snap images. But it would be nice to have an extra window like the one I attached here (see window.jpg in attachmant).

> Do you just want to snap and image once or once per frame?
Once per frame.

> I'm afraid I know nothing of opencv IPLImages.  Could you elaborate?
When I have the snapshots in an osg::Image, I can make an IPLImage with opencv functions cvCreateImage and cvSetImageData, so that's not the problem.

So I just need a way to snap images once per frame from each camera.

Thx,
Goran
P.S.

So far I used the following:
Producer::CameraConfig * cameraConfig,
Producer::Camera for the cameras
camera->setProjectionRectangle(..) for each camera
cameraConfig->addCamera("name",camera) for each camera
Producer::RenderSurface * renderSurface
renderSurface->setWindowRectangle(..)
camera->setRenderSurface(renderSurface) for each camera
...
then used osg::Matrixd to set the rotation and translation for each camera
...
osgProducer::Viewer viewer(cameraConfig)
...
while(!viewer.done()){
...
Producer::Camera* camera = viewer.getCameraConfig()->findCamera("name");
camera->setViewByMatrix( ( Producer::Matrix(inverseMatrix.ptr()) ) * Producer::Matrix::rotate( -M_PI/2.0, 1, 0, 0 ) );
for each camera
...
}



Robert Osfield schrieb:
Hi Goran,

Do you want your camera views to appear on screen, or is it purely for the purposes of snapping images? Do you just want to snap and image once or once per frame?

I'm afraid I know nothing of opencv IPLImages.  Could you elaborate?

Robert.


On 9/20/06, *Goran Tusek* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi Robert,

    thank you for the fast reply.

    > I'm not really sure what you are after though, could you explain
    what
    you are trying to do from a higher level?

    1.) I would like to place multiple cameras (>4) manually, so the
    cameras
    are evenly distributed in space and pointing to a center point
    where an
    Cal3D character stands.
    2.) Then render to an image from each camera. So I can create opencv
    IPLImages....

    I have allready done 1.), but I used Producer::Camera (I'm new in
    OSG)

    Thx,
    Goran

    Robert Osfield schrieb:
    > Hi Goran,
    >
    > Producer has support for pbuffer RenderSurfaces, but not support
    for FBO.
    >
    > FBO support is provide via osg::CameraNode, and you can't create an
    > FBO without a graphis context, so you do at least need to create a
    > RenderSurface first, then within its graphics context run the
    OSG with
    > the camera node.
    >
    > The easist option is to just create a number viewer, and add a FBO
    > CameraNode to it.
    >
    > I'm not really sure what you are after though, could you explain
    what
    > you are trying to do from a higher level?
    >
    > Robert.
    >
    > On 9/20/06, *Goran Tusek* < [EMAIL PROTECTED]
    <mailto:[EMAIL PROTECTED]>
    > <mailto:[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>> wrote:
    >
    >     Hi osg-users,
    >
    >     It would be great if someone could give me a hint what to do
    about the
    >     following:
    >
    >     I have code with
    >     Producer::Camera (, Producer::CameraConfig,  osgProducer::Viewer
    >     viewer(myCameraConfig)...)
    >
    >     and need the Producer::Camera's to render to Image,
    >     like in the osgprerender.cpp exsample:
    >
    >     osg::CameraNode* camera = new osg::CameraNode;
    >     ...
    >     // tell the camera to use OpenGL frame buffer object where
    supported.
> camera->setRenderTargetImplementation(osg::CameraNode::FRAME_BUFFER_OBJECT);

    >
    >     osg::Image* image = new osg::Image;
    >     //image->allocateImage(tex_width, tex_height, 1, GL_RGBA,
    >     GL_UNSIGNED_BYTE);
    >     image->allocateImage(tex_width, tex_height, 1, GL_RGBA,
    GL_FLOAT);
    >
    >     // attach the image so its copied on each frame.
    >     camera->attach(osg::CameraNode::COLOR_BUFFER, image);
    >     ....
    >
    >
    >     Any suggestions? Thx,
    >     Goran
    >
    >
    >     _______________________________________________
    >     osg-users mailing list
    >     [email protected]
    <mailto:[email protected]> <mailto:
    [email protected] <mailto:[email protected]>>
    >     http://openscenegraph.net/mailman/listinfo/osg-users
    >     < http://openscenegraph.net/mailman/listinfo/osg-users>
    >     http://www.openscenegraph.org/
    >
    >
    >
    >
    ------------------------------------------------------------------------

    >
    > _______________________________________________
    > osg-users mailing list
    > [email protected] <mailto:[email protected]>
    > http://openscenegraph.net/mailman/listinfo/osg-users
    > http://www.openscenegraph.org/



    _______________________________________________
    osg-users mailing list
    [email protected] <mailto:[email protected]>
    http://openscenegraph.net/mailman/listinfo/osg-users
    http://www.openscenegraph.org/



------------------------------------------------------------------------

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

<<attachment: window.jpg>>

begin:vcard
fn:Goran Tusek
n:Tusek;Goran
org;quoted-printable:;Institut f=C3=BCr Prozessrechentechnik, Automation und Robotik (IPR)
email;internet:[EMAIL PROTECTED]
title;quoted-printable:Universit=C3=A4t Karlsruhe (TH)
x-mozilla-html:FALSE
version:2.1
end:vcard

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to