Not able to get RGB images from Nuitrack following the example

prova

GoodMorning, I am using Nuitrack in Android Studio with an Orbbec Astra . I would like to get the RGB images from the camera, but unfortunately the result is no good. The image seems split in 3 part, I am following the example in the nuitrack website.
{
void NuitrackGLSample::onNewRGBFrame(RGBFrame::Ptr frame) {

uint8_t* texturePtr = _textureBuffer;
const tdv::nuitrack::Color3* colorPtr = frame->getData();


__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "here in sendRGBImageToJava  -1 %d --- %d",
                    _width, _height);


int wStep = _width / frame->getCols();
int hStep = _height / frame->getRows();

__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "here in sendRGBImageToJava  0 %d --- %d",
                    hStep, wStep);


int imageR[240][320];
int imageG[240][320];
int imageB[240][320];


int nextVerticalBorder = hStep;

__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "here in sendRGBImageToJava  1 %d ",
                    nextVerticalBorder);

for (int i = 0; i < _height; ++i) {
    if (i == nextVerticalBorder) {
        nextVerticalBorder += hStep;
        colorPtr += frame->getCols();
    }
    int col = 0;
    int nextHorizontalBorder = wStep;
    for (int j = 0; j < _width; ++j) {
        if (j == nextHorizontalBorder) {
            ++col;
            nextHorizontalBorder += wStep;
        }
        //__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "here in sendRGBImageToJava  2 %d",(colorPtr+col));
        imageR[i][j] =(colorPtr + col)->red;
        imageG[i][j] =(colorPtr + col)->green;
        imageB[i][j] =(colorPtr + col)->blue;

       
    }
}
__android_log_print(ANDROID_LOG_ERROR, "TRACKERS", "here in sendRGBImageToJava  3 ");

nuitrack_jni.sendRGBImageToJava(imageR, imageG, imageB);

}
}

This is the code I use to get the 3 different channels.
Hope someone can help.

Hi deve,

It seems that you have a mistake in resolution width and height. Perhaps, you have to swap [240][320] to [320][240] or [i][j] to [j][i]. Please check these parts of your code.