Resizing Images of VideoPlayer

Hi Community,

I’m trying to resize the picture of a video (small) to the size of the webcam (kinect) (big) picture.

I switched from pure OpenCV to OF because I first just used a webcam and then needed to work with a kinect and I wasn’t able to get the Kinect running with pure OpenCV.
In openCV the code looked like this:

            if(!frameVideo.empty()){
            resize(frameVideo, frameVideo, Size(frameCap.cols, frameCap.rows), 0, 0, INTER_CUBIC);
            
            // Row
            for(int row = 0; row < frameCap.rows; row++)
            {
                // Column
                for(int column = 0; column < frameCap.cols; column++)
                {
                    if(frameVideo.at<Vec3b>(row, column)[1] < 50 || (frameVideo.at<Vec3b>(row, column)[0] >= 100 && frameVideo.at<Vec3b>(row, column)[2] >= 100))
                    {
                        frameCap.at<Vec3b>(row, column)[0] = frameVideo.at<Vec3b>(row, column)[0];
                        frameCap.at<Vec3b>(row, column)[1] = frameVideo.at<Vec3b>(row, column)[1];
                        frameCap.at<Vec3b>(row, column)[2] = frameVideo.at<Vec3b>(row, column)[2];
                    }
                }
            }
        } 

Unfortunately I can’t get it to work with OF

    newPicture.allocate(kinect.getPixelsRef().getWidth(), kinect.getPixelsRef().getHeight(), OF_IMAGE_COLOR);

videoPlayer.getPixelsRef().resize(kinect.getPixelsRef().getWidth(), kinect.getPixelsRef().getHeight());

for (int row = 0; row < kinect.getPixelsRef().getHeight(); row++) {
    for (int column = 0; column < kinect.getPixelsRef().getWidth(); column++) {
        
        ofColor colorVideo = ofColor(videoPlayer.getPixelsRef().getColor(column, row));
        ofColor colorCamera = ofColor(kinect.getPixelsRef().getColor(column, row));
        
        newPicture.setColor(column, row, colorVideo);
    }
}

I’m not allowed to upload pictures so I will describe it:
without the line videoPlayer.getPixelsRef().resize(kinect.getPixelsRef().getWidth(), kinect.getPixelsRef().getHeight()); it’s takes about half of the height of the image and the full width where it is shown twice(left and right).
With the resize line it get’s even more shrinked and takes about 1/4 of the height and the full width (also twice the picture). But I want it to fill the whole area and don’t show it twice on the left half and the right halt of the area.

I hope you can understand what I mean.

Thanks in advance.