本文整理汇总了C++中ofxCvImage::getWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ ofxCvImage::getWidth方法的具体用法?C++ ofxCvImage::getWidth怎么用?C++ ofxCvImage::getWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofxCvImage
的用法示例。
在下文中一共展示了ofxCvImage::getWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cvMul
//--------------------------------------------------------------------------------
void ofxCvImage::operator *= ( ofxCvImage& mom ) {
if( !mom.bAllocated ){
ofLogError("ofxCvImage") << "operator*=: mom needs to be allocated";
return;
}
if( !bAllocated ){
ofLogNotice("ofxCvImage") << "operator*=: allocating to match dimensions: "
<< mom.getWidth() << " " << mom.getHeight();
allocate(mom.getWidth(), mom.getHeight());
}
if( mom.getCvImage()->nChannels == cvImage->nChannels &&
mom.getCvImage()->depth == cvImage->depth )
{
if( matchingROI(getROI(), mom.getROI()) ) {
float scalef = 1.0f / 255.0f;
cvMul( cvImage, mom.getCvImage(), cvImageTemp, scalef );
swapTemp();
flagImageChanged();
} else {
ofLogError("ofxCvImage") << "operator*=: region of interest mismatch";
}
} else {
ofLogError("ofxCvImage") << "operator*=: images type mismatch";
}
}
示例2: cvAnd
//--------------------------------------------------------------------------------
void ofxCvImage::operator &= ( ofxCvImage& mom ) {
if( !mom.bAllocated ){
ofLogError("ofxCvImage") << "operator&=: source image not allocated";
return;
}
if( !bAllocated ){
ofLogNotice("ofxCvImage") << "operator&=: allocating to match dimensions: "
<< mom.getWidth() << " " << mom.getHeight();
allocate(mom.getWidth(), mom.getHeight());
}
if( mom.getCvImage()->nChannels == cvImage->nChannels &&
mom.getCvImage()->depth == cvImage->depth )
{
if( matchingROI(getROI(), mom.getROI()) ) {
cvAnd( cvImage, mom.getCvImage(), cvImageTemp );
swapTemp();
flagImageChanged();
} else {
ofLogError("ofxCvImage") << "operator&=: region of interest mismatch";
}
} else {
ofLogError("ofxCvImage") << "operator&=: images need to have matching type";
}
}
示例3: cvMul
//--------------------------------------------------------------------------------
void ofxCvImage::operator *= ( ofxCvImage& mom ) {
if( !mom.bAllocated ){
ofLog(OF_LOG_ERROR, "in *=, mom needs to be allocated");
return;
}
if( !bAllocated ){
ofLog(OF_LOG_NOTICE, "in *=, allocating to match dimensions");
allocate(mom.getWidth(), mom.getHeight());
}
if( mom.getCvImage()->nChannels == cvImage->nChannels &&
mom.getCvImage()->depth == cvImage->depth )
{
if( matchingROI(getROI(), mom.getROI()) ) {
float scalef = 1.0f / 255.0f;
cvMul( cvImage, mom.getCvImage(), cvImageTemp, scalef );
swapTemp();
flagImageChanged();
} else {
ofLog(OF_LOG_ERROR, "in *=, ROI mismatch");
}
} else {
ofLog(OF_LOG_ERROR, "in *=, images need to have matching type");
}
}
示例4: cvMul
//--------------------------------------------------------------------------------
void ofxCvFloatImage::operator *= ( ofxCvImage& mom ) {
if( mom.getWidth() == 0 || mom.getHeight() == 0 ){
ofLog(OF_LOG_ERROR, "in *=, mom width or height is 0");
return;
}
if( !bAllocated ){
ofLog(OF_LOG_ERROR, "in *=, image is not allocated");
return;
}
if( mom.getCvImage()->nChannels == cvImage->nChannels && mom.getCvImage()->depth == cvImage->depth ){
if( matchingROI(getROI(), mom.getROI()) ) {
cvMul( cvImage, mom.getCvImage(), cvImageTemp );
swapTemp();
flagImageChanged();
} else {
ofLog(OF_LOG_ERROR, "in *=, ROI mismatch");
}
} else {
ofLog(OF_LOG_ERROR, "in *=, images need to have matching type");
}
}
示例5: cvAnd
//--------------------------------------------------------------------------------
void ofxCvFloatImage::operator &= ( ofxCvImage& mom ) {
if( mom.getWidth() == 0 || mom.getHeight() == 0 ){
ofLog(OF_LOG_ERROR, "in &=, mom width or height is 0");
return;
}
if( !bAllocated ){
ofLog(OF_LOG_ERROR, "in &=, image is not allocated");
return;
}
if( mom.getCvImage()->nChannels == cvImage->nChannels && mom.getCvImage()->depth == cvImage->depth ){
if( matchingROI(getROI(), mom.getROI()) ) {
//this is doing it bit-wise; probably not what we want
cvAnd( cvImage, mom.getCvImage(), cvImageTemp );
swapTemp();
flagImageChanged();
} else {
ofLog(OF_LOG_ERROR, "in &=, ROI mismatch");
}
} else {
ofLog(OF_LOG_ERROR, "in &=, images need to have matching type");
}
}