class methods
Extends
This class extends others, you can call their methods on an instance of ofxCvColorImage too:
The ofxCvColorImage represents the data of each pixel as unsigned char values, like the ofxCvGrayscaleImage, but has 3 channels, RGB, to represent color images.
ofxCvColorImage(...)
ofxCvColorImage::ofxCvColorImage(const ofxCvColorImage &mom)
Copy constructor, which allows you to this:
ofxCvShortImage old;
// allocate old
ofxCvShortImage new(old);
clear()
void ofxCvColorImage::clear()
Clears the pixel data of the image. The image must be allocated again with a call to allocate() before it can be used.
contrastStretch()
void ofxCvColorImage::contrastStretch()
This increases the contrast of the image remapping the brightest points in the image to white and the darkest points in the image to black.
convertHsvToRgb()
void ofxCvColorImage::convertHsvToRgb()
Converts the image from values in the Hue Saturation and Value color space (sometimes called Hue Saturation Brightness) to values in the Red Green and Blue color space.
convertRgbToHsv()
void ofxCvColorImage::convertRgbToHsv()
Converts the image from values in the Red Green and Blue color space to values in the Hue Saturation and Value color space (sometimes called Hue Saturation Brightness)
convertToGrayscalePlanarImage(...)
void ofxCvColorImage::convertToGrayscalePlanarImage(ofxCvGrayscaleImage &grayImage, int whichPlane)
Copies the pixels of the ofxCvColorImage into an ofxCvGrayscale image. You can optionally specify whether you want to use the R G or B channel of the ofxCvColorImage to set the values of the ofxCvGrayscale.
convertToGrayscalePlanarImages(...)
void ofxCvColorImage::convertToGrayscalePlanarImages(ofxCvGrayscaleImage &red, ofxCvGrayscaleImage &green, ofxCvGrayscaleImage &blue)
Copies the different channels of the ofxCvColorImage into 3 different grayscale images using the R G and B channels of the ofxCvColorImage.
convertToRange(...)
void ofxCvColorImage::convertToRange(float min, float max)
Maps the pixels of an image to the min and max range passed in.
colors.setFromPixels(grabber.getPixels());
first = colors; // will leave unaltered
second = colors; // change it
second.convertToRange(100, 140); // super low contrast
operator+=(...)
void ofxCvColorImage::operator+=(float value)
Adds the pixel data of the right hand side image from the current image:
first += second; // both are ofxCvFloatImage instances
operator-=(...)
void ofxCvColorImage::operator-=(float value)
Subtracts the pixel data of the right hand side image from the current image:
first -= second; // both are ofxCvFloatImage instances
operator=(...)
void ofxCvColorImage::operator=(const ofPixels &_pixels)
Copies the data from an IplImage into the ofxCvColorImage using the = symbol.
operator=(...)
void ofxCvColorImage::operator=(const ofxCvColorImage &mom)
Copies the data from an ofxCvColorImage into the instance using the = symbol.
colorImage1 = colorImage2; // make sure that the dimensions and ROI match
operator=(...)
void ofxCvColorImage::operator=(const ofxCvFloatImage &mom)
Copies the data from an ofxCvFloatImage into a ofxCvShortImage using the = symbol.
colorImage = floatColorImage; // make sure that the dimensions and ROI match
operator=(...)
void ofxCvColorImage::operator=(const ofxCvGrayscaleImage &mom)
Copies ofxCvGrayscaleImage to another ofxCvShortImage using the = symbol.
~~~~{.cpp} imageOne = imageTwo; // make sure that the dimensions and ROI match
operator=(...)
void ofxCvColorImage::operator=(const ofxCvShortImage &mom)
Copies the data from a ofxCvShortImage into the ofxCvColorImage using the = symbol.
colorImage = shortColorImage; // make sure that the dimensions and ROI match
scaleIntoMe(...)
void ofxCvColorImage::scaleIntoMe(ofxCvImage &mom, int interpolationMethod)
Scales the image passed in to be the size of the current image,
ofxCvImage first;
first.allocate(640, 480);
ofxCvImage second;
second.allocate(320, 240);
second.scaleIntoMe(first); // first is now 320,240
set(...)
void ofxCvColorImage::set(float value)
Set all the pixels in the image to the float value passed in. This is useful for blanking or filling an image quickly. The values are 0.0 to 1.0.
set(...)
void ofxCvColorImage::set(int valueR, int valueG, int valueB)
Set all the pixels in the image to the float value passed in as a color using 0 to 255 scale for each channel. This is useful for blanking or filling an image quickly.
setFromGrayscalePlanarImages(...)
void ofxCvColorImage::setFromGrayscalePlanarImages(ofxCvGrayscaleImage &red, ofxCvGrayscaleImage &green, ofxCvGrayscaleImage &blue)
This method allows you use multiple ofxCvGrayscaleImage images to create a full color image. Each ofxCvGrayscaleImage represents the data of one channel, r, g, b.
setFromPixels(...)
void ofxCvColorImage::setFromPixels(const unsigned char *_pixels, int w, int h)
Set all the pixels in a ofxCvShortImage from a pointer to an array of unsigned char values, using the w and h parameters to determine the dimensions of the image.
setRoiFromPixels(...)
void ofxCvColorImage::setRoiFromPixels(const unsigned char *_pixels, int w, int h)
Set the Region Of Interest using a pointer to an unsigned char array and a w,h to define the area of the ROI
Last updated 토요일, 17 8월 2024 20:45:49 UTC - 99bfb4fd7929e233b87b05758efc36f91505592e
If you have any doubt about the usage of this module you can ask in the forum.
If you want to contribute better documentation or start documenting this section you can do so here
If you find anything wrong with this docs you can report any error by opening an issue