Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

How can i Convert 4 channel image to 3 channel image?

$
0
0

@limpBizkit wrote:

how can i Convert 4 channel image to 3 channel image?
i was using this code long time ago now i’m getting a error.

    photo.setFromPixels(camera.getPixelsRef());
    nChannels = photo.getPixelsRef().getNumChannels();
    photoCvPix = photoCV.getPixels();
    photoPix = photo.getPixels();
    for (int i = 0; i < capW * capH; i++){
    photoCvPix[ i * 3 + 0] = photoPix[i*nChannels + 0];
    photoCvPix[ i * 3 + 1] = photoPix[i*nChannels + 1];
    photoCvPix[ i * 3 + 2] = photoPix[i*nChannels + 2];
        }
    
    photoCV.flagImageChanged();

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles