本文整理汇总了C++中MatrixF::Rows方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixF::Rows方法的具体用法?C++ MatrixF::Rows怎么用?C++ MatrixF::Rows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MatrixF
的用法示例。
在下文中一共展示了MatrixF::Rows方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemapImage
void RemapImage(
const MatrixF& src,
float g0,
const Remapping& remapping,
MatrixF& dest )
{
dest.Resize( src.Rows(), src.Cols() );
for( int y = 0; y < src.Rows(); ++y )
{
for( int x = 0; x < src.Cols(); ++x )
{
dest[y][x] = remapping( g0, src[y][x] );
}
}
}
示例2: FindLaplacianValue
float FindLaplacianValue(
const MatrixF& img,
const Remapping& remapping,
float gvalue,
int level,
int row,
int col )
{
//find the total size we need
int size = 3 * ( pow(2.0f,level+2) - 1 );
int halfSize = size / 2;
//find the corresponding point from that level to original image
int rowTemp = row*pow(2.0f,level);
int colTemp = col*pow(2.0f,level);
//copy the whole block (replicating when necessary)
MatrixF mat[2];
MatrixF* dest0 = &(mat[0]);
MatrixF* dest1 = &(mat[1]);
Point topLeft( colTemp - halfSize, rowTemp - halfSize );
Point bottomRight( colTemp + halfSize, rowTemp + halfSize );
Copy( img, topLeft, bottomRight, *dest0 );
RemapImage(*dest0, gvalue, remapping, *dest0);
Pyramid::Gaussian( *dest0, *dest1, 0.4f );
Copy( *dest1, Point(2,2), Point(dest1->Cols()-3,dest1->Rows()-3), *dest1);
Decimate(*dest1,*dest1);
for(int i = 0; i < level; ++i)
{
std::swap( dest0, dest1 );
Pyramid::Gaussian( *dest0, *dest1, 0.4f );
Copy( *dest1, Point(2,2), Point(dest1->Cols()-3,dest1->Rows()-3), *dest1);
Decimate(*dest1,*dest1);
}
//expand
assert( dest1->Rows() == 3 );
assert( dest1->Cols() == 3 );
ExpandOdd( *dest1, *dest1, 0.4f ); //now 5X5
//we need to also reduce dest0
Copy( *dest0, Point(2,2), Point(dest0->Cols()-3,dest0->Rows()-3), *dest0);
MatrixF laplacian;
Subtract(*dest0, *dest1, laplacian);
return laplacian[laplacian.Rows()/2][laplacian.Cols()/2];
}