void LUT(InputArray src, InputArray lut, OutputArray dst, int interpolation=0 )根据查找表在8位数组中进行替换,并将结果存储在dst中。
opencv 关于这一职能的正式文件对interpolation参数保持沉默。它的用途是什么,它可以传递什么值?
发布于 2015-05-05 09:26:24
它似乎是多余的(或者为将来的扩展保留)。
如果您查看该函数的实现,您将看到以下内容(请注意函数主体第二行中的断言!):
void cv::LUT( InputArray _src, InputArray _lut, OutputArray _dst, int interpolation )
{
Mat src = _src.getMat(), lut = _lut.getMat();
CV_Assert( interpolation == 0 );
int cn = src.channels();
int lutcn = lut.channels();
CV_Assert( (lutcn == cn || lutcn == 1) &&
lut.total() == 256 && lut.isContinuous() &&
(src.depth() == CV_8U || src.depth() == CV_8S) );
_dst.create( src.dims, src.size, CV_MAKETYPE(lut.depth(), cn));
Mat dst = _dst.getMat();
LUTFunc func = lutTab[lut.depth()];
CV_Assert( func != 0 );
const Mat* arrays[] = {&src, &dst, 0};
uchar* ptrs[2];
NAryMatIterator it(arrays, ptrs);
int len = (int)it.size;
for( size_t i = 0; i < it.nplanes; i++, ++it )
func(ptrs[0], lut.data, ptrs[1], len, cn, lutcn);
}https://stackoverflow.com/questions/30048362
复制相似问题