本文整理汇总了C++中Matrixf::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrixf::clone方法的具体用法?C++ Matrixf::clone怎么用?C++ Matrixf::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrixf
的用法示例。
在下文中一共展示了Matrixf::clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rotate
void Descriptor::rotate( size_t i)
{
// we will rotate and duplicate the i-th histogram. i generally is 0 ~ 2;
Matrixf* pm = new Matrixf(*m_vHistPtr[i] );
pm->clone();
pm->rshrows( size_z() );
m_vHistPtr.push_back( pm ); //k = 1
for( size_t k = 2; k < size_a(); ++k ){
Matrixf* pm = new Matrixf( *m_vHistPtr.back() );
pm->clone();
pm->rshrows( size_z() );
m_vHistPtr.push_back( pm );
}
}
示例2: difference
float difference(const Descriptor* desc1, const Descriptor* desc2, Descriptor& desc, float (*diff) (float, float) )
{
// assuming desc is valid
if( desc2 == 0){
desc.clear();
desc.m_na = desc1->size_a();
desc.m_nz = desc1->size_z();
desc.m_nr = desc1->size_r();
Matrixf *pm = new Matrixf( * desc1->getPage(0) );
pm->clone();
desc.m_vHistPtr.push_back(pm);
return 0.0f;
}
else if( desc1 == desc2 ){
desc.clear();
desc.m_na = desc1->size_a();
desc.m_nz = desc1->size_z();
desc.m_nr = desc1->size_r();
Matrixf *pm = new Matrixf( desc.m_na * desc.m_nz, desc.m_nr );
pm->setAllZeros();
desc.m_vHistPtr.push_back(pm);
return 0.0f;
}
else
return difference(*desc1, *desc2, desc, diff);
}
示例3: hFlip
void Descriptor::hFlip(bool duplicate)
{
Matrixf *pm = m_vHistPtr[0];
if( duplicate ){
pm = new Matrixf( *m_vHistPtr[0] );
pm->clone();
m_vHistPtr.push_back(pm);
}
for( size_t z = 0; z < size_z(); ++z){
for( size_t a = 0; a < size_a()/2; ++a){
pm->swaprows(a * size_z() + z, ( size_a() - a -1 )* size_z() + z);
}
}
}