【发布时间】:2014-03-21 07:34:42
【问题描述】:
我是 MATLAB 新手。我正在尝试在 MATLAB 中加密视频文件。我加密了视频的单个帧。我正在使用 MATLAB 7.10.0 (R2010a) ,这就是我使用“mmreader”功能的原因。但现在我不知道如何将所有加密帧重新组合成一个新视频。这是我的代码,
vid = mmreader('videoSampl.avi');
numFrame = vid.NumberOfframes;
for i = 1:2:3
frame = read(vid, i);
gray = rgb2gray(frame);
n = numel(gray);
plaintext = reshape(gray, n, 1);
cipherImg = cipher (plaintext, w, s_box, poly_mat, 1);
re_plaintext = inv_cipher (cipherImg, plaintext, w, inv_s_box, inv_poly_mat, 1);
img = reshape(cipherImg, 128, 128);
imwrite(img,['videoaes/encrypted/image' int2str(i), '.jpg']);
imgP = reshape(re_plaintext, 128, 128);
imwrite(imgP,['videoaes/decrypted/Dimage' int2str(i), '.jpg']);
im(i)=image(frames);
end
我有两个加密解密的文件夹,我想把这些文件夹再转成avi视频。
【问题讨论】:
-
见
help VideoWriter。为什么要为加密数据选择有损格式?
标签: image matlab image-processing video-conversion