本文整理汇总了C++中DImage::setDerivative方法的典型用法代码示例。如果您正苦于以下问题:C++ DImage::setDerivative方法的具体用法?C++ DImage::setDerivative怎么用?C++ DImage::setDerivative使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DImage
的用法示例。
在下文中一共展示了DImage::setDerivative方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDxs
//--------------------------------------------------------------------------------------------------------
// function to compute dx, dy and dt for motion estimation
//--------------------------------------------------------------------------------------------------------
void OpticalFlow::getDxs(DImage &imdx, DImage &imdy, DImage &imdt, const DImage &im1, const DImage &im2)
{
//double gfilter[5]={0.01,0.09,0.8,0.09,0.01};
//double gfilter[5]={0.02,0.11,0.74,0.11,0.02};
//double gfilter[5]={0,0,1,0,0};
if(1)
{
//DImage foo,Im;
//Im.Add(im1,im2);
//Im.Multiplywith(0.5);
////foo.imfilter_hv(Im,gfilter,2,gfilter,2);
//Im.dx(imdx,true);
//Im.dy(imdy,true);
//imdt.Subtract(im2,im1);
DImage Im;
// im1.imfilter_hv(Im1,gfilter,2,gfilter,2);
// im2.imfilter_hv(Im2,gfilter,2,gfilter,2);
// Im.copyData(Im1);
// Im.Multiplywith(0.4);
// Im.Add(Im2,0.6);
//Im.Multiplywith(0.5);
//Im1.copyData(im1);
//Im2.copyData(im2);
Im.copyData(im2);
Im.dx(imdx,true);
Im.dy(imdy,true);
imdt.Subtract(im2,im1);
}
else
{
// Im1 and Im2 are the smoothed version of im1 and im2
// DImage Im1,Im2;
//
// im1.imfilter_hv(Im1,gfilter,2,gfilter,2);
// im2.imfilter_hv(Im2,gfilter,2,gfilter,2);
//Im1.copyData(im1);
//Im2.copyData(im2);
// Im2.dx(imdx,true);
// Im2.dy(imdy,true);
// imdt.Subtract(Im2,Im1);
}
imdx.setDerivative();
imdy.setDerivative();
imdt.setDerivative();
}