"We offer new support options and therefor the forums are now in read-only mode! Please check out our Support Center for more information." - Vuforia Engine Team

Image width problem when tracking pixel buffer image

Hi,

I'm trying to track image from pixel buffer (C API), according to this guide: [quote]https://library.vuforia.com/objects/image-targets-api-overview

You can also choose to create an Image Target Observer from an image pixel buffer. To do this, the VuImageTargetBufferConfig needs to be configured with a pixelBuffer, bufferFormat, bufferSize, and targetName.[/quote]

my code: VuImageTargetBufferConfig imageTargetBufferConfig = vuImageTargetBufferConfigDefault(); imageTargetBufferConfig.pixelBuffer = bitmap; imageTargetBufferConfig.bufferFormat = VU_IMAGE_PIXEL_FORMAT_RGBA8888; imageTargetBufferConfig.bufferSize.data[0] = 3498; // bytes per row from AndroidBitmapInfo imageTargetBufferConfig.bufferSize.data[1] = 2266; // image height in pixels imageTargetBufferConfig.targetName = "mytarget"; VuImageTargetBufferCreationError creationError; if (vuEngineCreateImageTargetObserverFromBufferConfig(mEngine, &mObjectObserver, &imageTargetBufferConfig, &creationError) != VU_SUCCESS) {     LOG("Error creating image target observer: 0x%02x", creationError);     mShowErrorCallback("Error creating image target observer");     return false; }

produces error:

E/AR: Target width must be positive I/Vuforia: Error creating image target observer: 0x07

i'm trying to add target width to VuImageTargetBufferConfig:

imageTargetBufferConfig.targetWidth = 1.0f; // i tried various values

getting new error:

E/AR: Unable to set the RuntimeImageSource. The target width cannot be 0 or smaller. A/libc: Fatal signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 0x7c8b98e000 in tid 14989 (DefaultDispatch), pid 14643 (app)

Could you give me some hints, or provide some examples of tracking image from pixel buffer? Having this error with 10.3.2 and 10.4.4 versions of vuforia SDK

Hey,

 

It could be that your buffer size is not correct. Should be a multiplier of 4 (4 bytes per pixel for RGB8888).

 

 

Kind regards,

Patrick Scheper

Technical Community Manager

intertad

Thu, 02/10/2022 - 15:38

In reply to by pscheper

Thanks for the answer

It turned out that I was not passing the pixelBuffer correctly. When i converted it to char array, it worked