本文整理汇总了C++中Image2D::GetRMS方法的典型用法代码示例。如果您正苦于以下问题:C++ Image2D::GetRMS方法的具体用法?C++ Image2D::GetRMS怎么用?C++ Image2D::GetRMS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Image2D
的用法示例。
在下文中一共展示了Image2D::GetRMS方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
size_t inputCount = argc-pindex;
for(unsigned inputIndex=pindex;inputIndex<(unsigned) argc;++inputIndex)
{
cout << "Opening " << argv[inputIndex] << "..." << endl;
FitsFile fitsfile(argv[inputIndex]);
fitsfile.Open(FitsFile::ReadOnlyMode);
fitsfile.MoveToHDU(1);
unsigned images = Image2D::GetImageCountInHUD(fitsfile);
FitsFile *subtractFits = 0;
if(subtract) {
cout << "Opening " << subtractFile << "..." << endl;
subtractFits = new FitsFile(subtractFile);
subtractFits->Open(FitsFile::ReadOnlyMode);
subtractFits->MoveToHDU(1);
unsigned sImages = Image2D::GetImageCountInHUD(fitsfile);
if(sImages < images)
images = sImages;
}
std::vector<ImageInfo> variances;
if(removeNoiseImages > 0) {
cout << "Sorting images on noise level..." << endl;
for(unsigned i=0;i<images;++i)
{
if(i % 8 == 0) {
unsigned upper = i+9;
if(upper > images) upper = images;
cout << "Measuring noise level in images " << (i+1) << " - " << upper << "..." << endl;
}
Image2D *image = Image2D::CreateFromFits(fitsfile, i);
struct ImageInfo imageInfo;
imageInfo.variance = image->GetRMS();
imageInfo.index = i;
variances.push_back(imageInfo);
delete image;
}
sort(variances.begin(), variances.end());
cout << "The following images are removed because of too many noise: "
<< variances.front().index;
for(std::vector<ImageInfo>::const_iterator i=variances.begin()+1;i<variances.begin()+removeNoiseImages;++i)
{
cout << ", " << i->index;
}
cout << endl;
}
unsigned lowI, highI;
if(singleImage)
{
lowI = singleImageIndex;
highI = singleImageIndex+1;
} else {
lowI = 0;
highI = images;
}
for(unsigned i=lowI;i<highI;++i)
{
if(i % 8 == 0) {
unsigned upper = i+9;
if(upper > images) upper = images;
cout << "Adding image " << (i+1) << " - " << upper << "..." << endl;
}