star_detection.py 文件源码

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

项目:pynephoscope 作者: neXyon 项目源码 文件源码
def hist_lines(image, start, end):
        scale = 4
        height = 1080

        result = np.zeros((height, 256 * scale, 1))

        hist = cv2.calcHist([image], [0], None, [256], [start, end])
        cv2.normalize(hist, hist, 0, height, cv2.NORM_MINMAX)
        hist = np.int32(np.around(hist))

        for x, y in enumerate(hist):
            cv2.rectangle(result, (x * scale, 0), ((x + 1) * scale, y), (255), -1)

        result = np.flipud(result)
        return result
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号