• 大小: 2KB
    文件类型: .py
    金币: 1
    下载: 0 次
    发布日期: 2021-01-06
  • 语言: Python
  • 标签: python  LSBR  

资源简介

对隐藏的图片矩阵的隐藏那一层对应的二维矩阵进行左移四位操作,得到对应提取图像的矩阵,进行矩阵转化为对应图片输出。

资源截图

代码片段和文件信息

#Writen by  Liuchang
from PIL import Image
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.image as mpimg

def secretCover(count):
    cover = Image.open(‘C:/Users/user/Desktop/picture1.bmp‘)
    secret = Image.open(‘C:/Users/user/Desktop/picture2.bmp‘)
    secretCopy = Image.open(‘C:/Users/user/Desktop/picture2.bmp‘).convert(‘L‘)
    secretMatrix = np.array(secretCopy)
    coverMatrix = np.array(cover)

    row col = secretMatrix.shape
    for i in range(row - 1):
         for j in range(col - 1):
             coverMatrix[i j count] = coverMatrix[i j count] & 240
             secretMatrix[i j] = secretMatrix[i j] >> 4
             coverMatrix[i j count] = coverMatrix[i j count] | secretMatrix[i j]
   

评论

共有 条评论