Log in or register to post comments

QCR query regarding camera frames capture

September 13, 2011 - 8:39am #1

Hi,

Can i know any API's present to get the real frames from the camera.

In virtual buttons sample code, how can i change the background image color. Am able to chnage the teapot color, so please help me out to change the background image color.
any API's present for that ?

Thanks

Mahesh

Re: QCR query regarding camera frames capture

September 14, 2011 - 9:23pm #4

There isn't any built in mechanism for changing the color of the background camera image. You could grab the Image using the method above and modify the pixels yourself, create an OpenGL texture, and render it each frame.

You can disable our rendering of the camera image by setting config.mEnabled to false in the configureVideoBackground method.

- Kim

Re: QCR query regarding camera frames capture

September 13, 2011 - 8:26pm #3

thanks for your reply sir..

i meant background image is camera image

is it possible to change the color of background camera image?
what is the APIs to use for that?

-Mahes

Re: QCR query regarding camera frames capture

September 13, 2011 - 4:34pm #2

You can get the camera image pixel buffer from the Image class. Take a look at the APIs for the Image, Frame, and State classes. Here's the general idea on how to use them:

QCAR::State state = QCAR::Renderer::getInstance().begin();

QCAR::Frame frame = state.getFrame();
for (int i = 0; i < frame.getNumImages(); i++)
{
    const QCAR::Image *qcarImage = frame.getImage(i);
    if (qcarImage->getFormat() == QCAR::RGB888)
    {
        // do something with the image
    }
}

You can register for different image formats using the setFrameFormat method:

QCAR::setFrameFormat(QCAR::RGB888, true);
Quote:

In virtual buttons sample code, how can i change the background image color.

I'm not sure what you mean by the background image, the camera or the trackable? In general you use OpenGL ES for rendering. See the sample code in the renderFrame method (e.g. in ImageTargets.cpp).

- Kim

Log in or register to post comments