Log in or register to post comments

How to access current image?

August 1, 2011 - 11:22am #1

Can't find a way to get QCAR::Image from Camera instance?

Re: How to access current image?

August 3, 2011 - 2:26am #4

Within the Image object documentation look for the method getFormat() returning enum type QCAR::PIXEL_FORMAT, which specifies the following pixel encoding types.

UNKNOWN_FORMAT - Unknown format - default pixel type for undefined images
RGB565 - A color pixel stored in 2 bytes using 5 bits for red, 6 bits for green and 5 bits for blue
RGB888 - A color pixel stored in 3 bytes using 8 bits each
GRAYSCALE - A grayscale pixel stored in one byte.
YUV - A color pixel stored in 12 or more bits using Y, U and V planes

Re: How to access current image?

August 2, 2011 - 2:11pm #3

Thanks a lot for your response.

The image held by frame is a color image or b&w? I got buffer width and height 480 and 360 respectively and 720 as stride? It means there are two bytes per pixel?

Thanks again for your help.

Re: How to access current image?

August 2, 2011 - 7:52am #2
stridefrodo wrote:

Can't find a way to get QCAR::Image from Camera instance?

In the Open GL view of your app, there'll be a call back:

// *** QCAR will call this method on a single background thread ***
- (void)renderFrameQCAR

Within the call back the state is retrieved when initialising the QCAR
render stage:

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

From which the Image object can be accessed, thus:

QCAR::Frame frame = state.getFrame();
if (frame.getNumImages() >http://ar.qualcomm.at/node/2000666>getWidth();
int height = image->getHeight();
NSLog(@"Area = %d", width * height);
}

The properties in the Image object allow you to identify the image in the set.

The API section of the Qualcomm AR website documents this under
QCAR::Renderer, QCAR::Status, QCAR::Frame and QCAR::Image.

There is a similar thread in the Android forum with some alternate solutions from ksiva:

https://ar.qualcomm.at/arforums/showthread.php?t=666

Log in or register to post comments