本文整理汇总了C++中AContainer::minPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ AContainer::minPoint方法的具体用法?C++ AContainer::minPoint怎么用?C++ AContainer::minPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AContainer
的用法示例。
在下文中一共展示了AContainer::minPoint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
ImageEx EstimatorRender::render(const AContainer &group, AProcessWatcher *watcher) const {
auto planes_amount = group.image(0).size();
auto min_point = group.minPoint();
ProgressWrapper( watcher ).setTotal( planes_amount * iterations * group.count() );
auto est = AverageRender().render( group ); //Starting estimate
est.scaleFactor( upscale_factor );
auto beta = color::WHITE * this->beta / group.count();
for( unsigned c=0; c<planes_amount; ++c ){
for( int i=0; i<iterations; i++ ){
if( ProgressWrapper(watcher).shouldCancel() )
return {};
auto output_copy = est[c];
//Improve estimate
for( unsigned j=0; j<group.count(); j++, ProgressWrapper( watcher ).add() )
sign( output_copy, degrade( est[c], {group, j, c} ), group.image(j)[c], group.pos(j)-min_point
, beta, channelScale(group, j, c)*upscale_factor );
//Regularization
if( lambda > 0.0 )
regularize( est[c], output_copy, reg_size, alpha, beta, lambda );
else
est[c] = output_copy;
}
//DEBUG: See how close our model gets to the input data
for( unsigned j=0; j<group.count(); j++ ){
save( degrade( est[c], {group, j, c} ), "deg" + QString::number(c) + "-" + QString::number(j) );
save( group.image(j)[c], "low" + QString::number(c) + "-" + QString::number(j) );
}
}
return est;
}
示例2: setLimit
static void setLimit( QCustomPlot& plot, const AContainer& images, Point<bool> moves ){
auto min_point = images.minPoint();
auto max_point = images.maxPoint();
plot.xAxis->setRange( moves.x ? min_point.x : 0, moves.x ? max_point.x : images.count() );
plot.yAxis->setRange( moves.y ? min_point.y : 0, moves.y ? max_point.y : images.count() );
plot.yAxis->setLabel( moves.y ? QObject::tr("Y") : QObject::tr("Id") );
plot.xAxis->setLabel( moves.y ? QObject::tr("X") : QObject::tr("Id") );
}
示例3: render
ImageEx AverageRender::render( const AContainer& aligner, AProcessWatcher* watcher ) const{
Timer t( "AverageRender::render()" );
//Abort if no images
if( aligner.count() == 0 ){
qWarning( "No images to render!" );
return ImageEx();
}
unsigned planes_amount = for_merging ? 1 : aligner.image(0).size();
ProgressWrapper( watcher ).setTotal( aligner.count() * planes_amount );
//Determine if we need to care about alpha per plane
bool use_plane_alpha = false;
for( unsigned i=0; i<aligner.count(); ++i )
if( aligner.alpha( i ) || aligner.imageMask( i ) >= 0 ){
use_plane_alpha = true;
break;
}
//Check for movement in both direction
auto movement = aligner.hasMovement();
if( movement.first && movement.second )
use_plane_alpha = true;
auto color_space = aligner.image(0).getColorSpace();
ImageEx img( for_merging ? color_space.changed( Transform::GRAY ) : color_space );
AlphaScales masks;
for( unsigned c=0; c<planes_amount; c++ ){
auto scale = upscale_chroma ? Point<double>(1,1)
: aligner.image( 0 )[c].getSize().to<double>() / aligner.image( 0 )[0].getSize().to<double>();
masks.addScale( aligner, scale );
}
auto min_point = aligner.minPoint();
auto full = aligner.size().size;
for( unsigned c=0; c<planes_amount; c++ ){
//Determine local size
auto scale = upscale_chroma ? Point<double>(1,1)
: aligner.image( 0 )[c].getSize().to<double>() / aligner.image( 0 )[0].getSize().to<double>();
//TODO: something is wrong with the rounding, chroma-channels are slightly off
SumPlane sum( (scale * full).ceil() );
sum.spacing = spacing;
sum.offset = offset;
for( unsigned j=0; j<aligner.count(); j++ ){
auto& image = aligner.image( j );
auto pos = (scale * (aligner.pos(j) - min_point)).round();
auto plane = getScaled( image[c], (scale * image[0].getSize()).round() );
const Plane& alpha_plane = masks.getAlpha( c, aligner.imageMask( j ), aligner.alpha( j ) );
if( use_plane_alpha && alpha_plane.valid() )
sum.addAlphaPlane( plane(), alpha_plane, pos );
else
sum.addPlane( plane(), pos );
ProgressWrapper( watcher ).add();
}
img.addPlane( sum.average() );
if( c == 0 && use_plane_alpha )
img.alpha_plane() = sum.alpha();
//TODO: what to do about the rest? We should try to fill in the gaps?
}
return img;
}
示例4: container
Parameters( const AContainer& container, unsigned index, unsigned channel /*const Plane& background*/ )
: container(container), index(index), channel(channel) /*background(background)*/ {
min_point = container.minPoint();
}