Hello!
How can i increase the contrast a CvColorImage ?
also im trying contrastStretch() get this [warning] ofxCvColorImage: contrastStretch(): not implemented
Hello!
How can i increase the contrast a CvColorImage ?
also im trying contrastStretch() get this [warning] ofxCvColorImage: contrastStretch(): not implemented
these functions exist for grayscale images, so maybe you can convert to ofxCvGrayscaleImages (creating a grayscale image for the red, green and blue channels) via
then use the brightnessContrast() function on each of the channels (ie the red,green,blue ofxCvGrayscaleImages):
http://openframeworks.cc/documentation/ofxOpenCv/ofxCvGrayscaleImage.html
then convert back to color with:
Great! i will give i try.
Many thanks zach.
Here is the code if someone needed:
ofxCvColorImage photoCV;
ofImage fotoA;
ofxCvGrayscaleImage r,g,b;
photoCV.setFromPixels(fotoA.getPixelsRef());
photoCV.convertToGrayscalePlanarImages(r, g, b);
r.brightnessContrast(.2, .7);
g.brightnessContrast(.2, .7);
b.brightnessContrast(.2, .7);
photoCV.setFromGrayscalePlanarImages(r, g, b);
photoCV.flagImageChanged();
photoCV.draw(0,0,500,500);