function I=EncodeImageinto4SubcellmnPlainImg Encode each cell of Plain Image into 4 subcells I = zeros4nm1; PlainImg=PlainImg; Imgsize=nm; for i=1Imgsize num2decomposed = Pl
def EncodeImageinto4Subcell(m, n, PlainImg): # Encode each cell of Plain Image into 4 subcells I = [0] * (4 * n * m) PlainImg = PlainImg.flatten() Imgsize = n * m
for i in range(Imgsize):
num2decomposed = PlainImg[i]
for z in range(4):
rem = num2decomposed % 4
I[4 * (i - 1) + (5 - z)] = rem
num2decomposed = num2decomposed // 4
return I
原文地址: https://www.cveoy.top/t/topic/iYY9 著作权归作者所有。请勿转载和采集!