本文整理汇总了C++中ImageFeature::resize方法的典型用法代码示例。如果您正苦于以下问题:C++ ImageFeature::resize方法的具体用法?C++ ImageFeature::resize怎么用?C++ ImageFeature::resize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageFeature
的用法示例。
在下文中一共展示了ImageFeature::resize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: iDCT
void iDCT(ImageFeature &src, ImageFeature &dest) {
dest.resize(src.xsize(),src.ysize(),src.zsize()); //NB Not efficient
for(uint c=0;c<src.zsize();++c) {
uint i,j,k;
double sum;
// Transform in x direction
ImageFeature horizontal(src.xsize(), src.ysize(),1);
for (j = 0; j < src.ysize(); j++) {
for (i = 0; i < src.xsize(); i++) {
sum = 0.0;
for (k = 0; k < src.xsize(); k++) {
sum += alpha(k,src.xsize())*src(k,j,0)* cos(double(2*i+1)*M_PI*double(k)/(double(2*src.xsize())));
}
horizontal(i,j,0) = sum;
}
}
// Transform in y direction
for (i = 0; i < src.xsize(); i++) {
for (j = 0; j < src.ysize(); j++) {
sum = 0.0;
for (k = 0; k < src.ysize(); k++) {
sum += alpha(k, src.xsize())*horizontal(i,k,0)* cos(double(2*j+1)*M_PI*double(k)/(double(2*src.ysize())));
}
dest(i,j,c) = sum;
}
}
}
}
示例2: shave
void shave(ImageFeature &imga, const uint shaver) {
ImageFeature tmp(imga);
imga.resize(imga.xsize()-2*shaver, imga.ysize()-2*shaver, imga.zsize());
for(uint x=0;x<tmp.xsize();++x) {
if(x>=shaver and x<tmp.xsize()-shaver) {
for(uint y=0;y<tmp.ysize();++y) {
if(y>=shaver and y<tmp.ysize()-shaver) {
for(uint z=0;z<tmp.zsize();++z) {
imga(x-shaver,y-shaver,z)=tmp(x,y,z);
}
}
}
}
}
}
示例3: appendHorizontally
void appendHorizontally(ImageFeature &imga, const ImageFeature &imgb) {
if(imga.ysize()!=imgb.ysize() || imga.zsize() != imgb.zsize()) {
ERR << "Images have to have same width and depth" << endl;
} else {
ImageFeature tmp(imga);
imga.resize(imga.xsize()+imgb.xsize(),imga.ysize(),imga.zsize());
for(uint y=0;y<tmp.ysize();++y) {
for(uint z=0;z<tmp.zsize();++z) {
for(uint x=0;x<tmp.xsize();++x) {
imga(x,y,z)=tmp(x,y,z);
}
for(uint x=tmp.xsize();x<tmp.xsize()+imgb.xsize();++x) {
imga(x,y,z)=imgb(x-tmp.xsize(),y,z);
}
}
}
}
}