本文整理汇总了C++中ColorMap::erodeCircular方法的典型用法代码示例。如果您正苦于以下问题:C++ ColorMap::erodeCircular方法的具体用法?C++ ColorMap::erodeCircular怎么用?C++ ColorMap::erodeCircular使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ColorMap
的用法示例。
在下文中一共展示了ColorMap::erodeCircular方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getAggregatedARMap
ColorMap* getAggregatedARMap(const ColorMap* map, Real cleaningFactor, Real aggregationFactor, const string& projection)
{
// We convert the factors from arcsec to pixels
cleaningFactor /= sqrt(map->PixelArea());
aggregationFactor /= sqrt(map->PixelArea());
ColorMap* aggregated = new ColorMap(map);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "pure.fits");
#endif
if(projection == "exact")
{
/*! Clean the color map to remove very small components (like protons)*/
aggregated->erodeCircularProjected(cleaningFactor, 0);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "eroded.fits");
#endif
/*! Aggregate the blobs together */
aggregated->dilateCircularProjected(cleaningFactor + aggregationFactor, 0);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "dilated.fits");
#endif
/*! Give back the original size */
aggregated->erodeCircularProjected(aggregationFactor, 0);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "closed.fits");
#endif
}
else
{
/*! Apply the projection */
if(projection == "equirectangular")
{
aggregated->equirectangular_projection(map, false);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "equirectangular_projection.fits");
#endif
// We adjust the factors because in the projection the pixel size changes
cleaningFactor *= (2./3.);
aggregationFactor *= (2./3.);
}
else if(projection == "lambert")
{
aggregated->Lambert_cylindrical_projection(map, false);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "Lambert_cylindrical_projection.fits");
#endif
// We adjust the factors because in the projection the pixel size changes
cleaningFactor *= (2./3.);
aggregationFactor *= (2./3.);
}
else if(projection == "sinusoidal")
{
aggregated->sinusoidal_projection(map, false);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "sinusoidal_projection.fits");
#endif
// We adjust the factors because in the projection the pixel size changes
cleaningFactor *= (2./3.);
aggregationFactor *= (2./3.);
}
else if(projection != "none")
{
cerr<<"Unknown projection type "<<projection<<endl;
exit(EXIT_FAILURE);
}
/*! Clean the color map to remove very small components (like protons)*/
aggregated->erodeCircular(cleaningFactor, 0);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "eroded.fits");
#endif
/*! Aggregate the blobs together */
aggregated->dilateCircular(cleaningFactor + aggregationFactor, 0);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "dilated.fits");
#endif
/*! Give back the original size */
aggregated->erodeCircular(aggregationFactor, 0);
#if defined DEBUG
aggregated->writeFits(filenamePrefix + "closed.fits");
#endif
/* Apply the deprojection */
if(projection == "equirectangular")
{
ColorMap* projeted = new ColorMap(aggregated);
aggregated->equirectangular_deprojection(projeted, false);
//.........这里部分代码省略.........