当前位置: 首页>>代码示例>>C++>>正文


C++ ColorMap::dilateCircular方法代码示例

本文整理汇总了C++中ColorMap::dilateCircular方法的典型用法代码示例。如果您正苦于以下问题:C++ ColorMap::dilateCircular方法的具体用法?C++ ColorMap::dilateCircular怎么用?C++ ColorMap::dilateCircular使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ColorMap的用法示例。


在下文中一共展示了ColorMap::dilateCircular方法的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);
//.........这里部分代码省略.........
开发者ID:bmampaey,项目名称:SPoCA,代码行数:101,代码来源:ActiveRegion.cpp


注:本文中的ColorMap::dilateCircular方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。