star_detection.py 文件源码

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

项目:pynephoscope 作者: neXyon 项目源码 文件源码
def removeBackground(self, image):
        gray = np.float32(cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)) / 255

        if self.background_gaussian is None or self.background_gaussian.shape[0] != Configuration.gaussian_kernel_size:
            self.background_gaussian = cv2.getGaussianKernel(Configuration.gaussian_kernel_size, -1, cv2.CV_32F)

        background = cv2.sepFilter2D(gray, cv2.CV_32F, self.background_gaussian, self.background_gaussian)

        result = gray - background

        result = result * self.mask

        mi = np.min(result)
        ma = np.max(result)

        #result = (result - mi) / (ma - mi)
        return result / ma
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号