Log in or register to post comments

the camera does not show

October 11, 2010 - 5:03am #1

Hi,

I have a problem trying to show the camera.
I do the tracking and show the glview but over a black background.

I thought that maybe it was because the glview wasn't transparent,
but not. Because if I quit the glview also the camera is not shown.

I am using the same function that as in examples. (startcamera)

Some one can help me.

Thanks in advance.

the camera does not show

August 31, 2018 - 10:01am #11

#netpcvnn can  you please send me the exemple, it would not work with me.

 

i'm using Cloud Reco and the targets get scanned successuly. but with a black backgound ( No camera preview) 

please help

the camera does not show

July 10, 2013 - 5:56am #10

Thank you!

I have got it working. 

the camera does not show

July 10, 2013 - 5:42am #9

I would leave the configureVideoBackground() where it is in native code, i.e.:

- _updateRendering() (this is already called from Java when there is an update of the screen size, for instance when you rotate the device, see ImageTargetsRenderer.java)

- _startCamera(), which is called from ImageTargets.java when needed (start, resume)

the camera does not show

July 10, 2013 - 3:27am #8

AlessandroB wrote:

if you also want to render from Java (with OpenGL), this should be possible provided that you follow the rendering logic implemented in the ImageTargets sample, and in particular:

- in your Renderer.onSurfaceChanged(), be sure to call the native function _updateRendering() (which will call the configureVideoBackground() function)

- in your Renderer.onDrawFrame(), be sure to call the native function _renderFrame() in CPP, in which function you will call the following:

 

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

     // Get the state from QCAR and mark the beginning of a rendering section

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

    // Explicitly render the Video Background

    QCAR::Renderer::getInstance().drawVideoBackground();

    // Call back to your Java code to do Java-OpenGL rendering

    // ...

   //Then call end

   QCAR::Renderer::getInstance().end();

 

Also, the configureVideoBackground() native function should also be called when you start your camera (see ImageTargets.java)

I have the same problem. I have done exactly the same the instruction. I'm still not sure with " the configureVideoBackground() native function should also be called when you start your camera (see ImageTargets.java)". How can we do this because I see the configureVideoBackground() method is already located in startCamera in native code?

Thanks you!

the camera does not show

December 10, 2012 - 2:27am #7

Hi mgrin,

if you also want to render from Java (with OpenGL), this should be possible provided that you follow the rendering logic implemented in the ImageTargets sample, and in particular:

- in your Renderer.onSurfaceChanged(), be sure to call the native function _updateRendering() (which will call the configureVideoBackground() function)

- in your Renderer.onDrawFrame(), be sure to call the native function _renderFrame() in CPP, in which function you will call the following:

 

    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

     // Get the state from QCAR and mark the beginning of a rendering section

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

    // Explicitly render the Video Background

    QCAR::Renderer::getInstance().drawVideoBackground();

    // Call back to your Java code to do Java-OpenGL rendering

    // ...

   //Then call end

   QCAR::Renderer::getInstance().end();

 

Also, the configureVideoBackground() native function should also be called when you start your camera (see ImageTargets.java)

 

 

 

 

 

the camera does not show

December 6, 2012 - 2:27am #6

Hi,

Is the problem solved? Because I have the same issue...

the camera does not show

December 6, 2012 - 2:26am #5

Hi,

Is the problem solved? Because I have the same issue...

Re: the camera does not show

October 13, 2010 - 6:27am #4

This might be easiest to debug if you can send us some sample code. If it's possible, zip up your project and send it to this email address:

The startCamera function isn't responsible for rendering the camera image. You need to use the QCAR::Renderer::getInstance().begin() and QCAR::Renderer::getInstance().end() functions to signal QCAR to render the camera image in the background. Another approach is to render the camera image yourself; you can get the pixel buffer from the State object (first get the Frame and then the Image object).

- Kim

Re: the camera does not show

October 13, 2010 - 6:03am #3

I already tried the sample code and it worked. I do the renderer in the java side, I only take from the the cpp side the ModelView Matrix.

I don't understand why if I can make the tracker work, when I am calling to configurevideobackground, the background is black.

thanks in advance.

October 11, 2010 - 6:12am #2

Start by running one of the sample applications (e.g. ImageTargets) without modifying the code. Does the camera view show up? If not, make sure you are using one of the supported devices.

If the camera works fine for the samples, I suggest copying the ImageTargets project and using it as a starting point for your own rendering.

The easiest way to render the camera image using the SDK is to wrap your own rendering with the Renderer begin and end calls:

QCAR::Renderer::getInstance().begin();

QCAR::Renderer::getInstance().end();

The Renderer takes care of merging your content with the camera image. See ImageTargets.cpp for an example.

- Kim

Log in or register to post comments