Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ofxCvColorImage::getRoiPixelsRef() =>BUG! . (of0.8.0) #2520

Closed
yty opened this issue Aug 28, 2013 · 2 comments
Closed

ofxCvColorImage::getRoiPixelsRef() =>BUG! . (of0.8.0) #2520

yty opened this issue Aug 28, 2013 · 2 comments

Comments

@yty
Copy link

yty commented Aug 28, 2013

ofImage img;
ofxCvColorImage cvimg;
ofImage roiImg;

void testApp::setup(){
    ofSetDataPathRoot("E:/Program Files/of_v0.8.0_vs_release/examples/graphics/imageLoaderExample/bin/data/images/");
    img.loadImage("gears.gif");
    cvimg.allocate(img.getWidth(),img.getHeight());
    roiImg.allocate(100,100,OF_IMAGE_COLOR);


}

//--------------------------------------------------------------
void testApp::update(){
    cvimg.setFromPixels(img.getPixelsRef());
    cvimg.setROI(0,0,100,100);
    roiImg.setFromPixels(cvimg.getRoiPixelsRef()); ;  =>>0.80 BUG!! of0.74 no problem 
    cvimg.resetROI();

}

//--------------------------------------------------------------
void testApp::draw(){
    cvimg.draw(0,0);

        roiImg.draw(320,240);
}

roiPixel width = 0,height = 0 channels = 0 bAllocated =false pixelsOwner = false

[ofGLUtils: error ] ofGetGlFormatAndType(): internal format not recognized, returning GL_RGBA

void ofTexture::loadData(const ofPixels & pix){
ofSetPixelStorei(pix.getWidth(),pix.getBytesPerChannel(),pix.getNumChannels());
loadData(pix.getPixels(), pix.getWidth(), pix.getHeight(), ofGetGlFormat(pix), ofGetGlType(pix)); =>>cout error...
}

@HalfdanJ
Copy link
Member

HalfdanJ commented Dec 1, 2013

Found the bug, and solved with this PR

@yty
Copy link
Author

yty commented Dec 4, 2013

@HalfdanJ

hi,doing really no problem?

of0.74 is bRoiPixelsDirty not bPixelsDirty ...

doing so will be better?
...
cvimg.resetROI();
cvimg.flagImageChanged();
...

arturoc added a commit that referenced this issue Mar 16, 2014
Fixes typo in ofxCvImage that broke getRoiPixelsRef, fixes #2520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants