main.py 文件源码

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

项目:ImageSteganography 作者: AhmedAtef07 项目源码 文件源码
def convert_to_binary_image(img_path, preview):
    img = cv2.imread(img_path)
    if preview: _preview_image("Original Message Image", img, keep_open=True)

    img_gray = cv2.imread(img_path, cv2.CV_LOAD_IMAGE_GRAYSCALE)
    if preview: _preview_image("Gray Scale Message Image", img_gray, keep_open=True)

    (thresh, img_bw) = cv2.threshold(img_gray, 128, 255, cv2.THRESH_BINARY | cv2.THRESH_OTSU)
    if preview:  _preview_image("Black & White Message Image", img_bw)

    return img_bw
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号