imageutils.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:astrobase 作者: waqasbhatti 项目源码 文件源码
def nparr_to_full_jpeg(nparr,
                       out_fname,
                       outsizex=770,
                       outsizey=770,
                       scale=True,
                       scale_func=clipped_linscale_img,
                       scale_func_params={'cap':255.0,
                                          'lomult':2,
                                          'himult':2.5}):
    '''
    This just writes a numpy array to a JPEG.

    '''
    if scale:
        scaled_img = scale_func(nparr,**scale_func_params)
    else:
        scaled_img = nparr

    resized_img = scipy.misc.imresize(scaled_img,
                                      (outsizex,outsizey))
    if out_fname is None:
        out_fname = fits_image + '.jpeg'
    scipy.misc.imsave(out_fname,resized_img)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号