我想尝试从已插入的消息before..but有与说明书波纹管的错误图像中提取消息..这个隐写术提取代码有什么问题?
此代码提取物:
% Read Image Stego
IS = imread('imagestego.bmp');
% Extract RedChannel
RedChannel = IS(:,:,1);
% Convert RedChannel to biner
bitstego = uint8(reshape(dec2bin(RedChannel,8)',1,[]) = '0');
nBitstego = length(bitstego);
% Extraction
extBits = bitget(RedChannel(1:end),1).';
extMessage = char(bin2dec(reshape(int2str(extBits),8,[]).').');
,并从提取的代码此错误:
>> latihanextract
Error: File: latihanextract.m Line: 8 Column: 55
The expression to the left of the equals sign is not a valid target for an assignment.
这是嵌入代码之前..它的工作!
coverImage = imread('foto1.jpg');
message = 'IMRON';
%EMBEDDING
RedChannel = coverImage(:,:,1);
GreenChannel = coverImage(:,:,2);
BlueChannel = coverImage(:,:,3);
bits = uint8(reshape(dec2bin(message,8)',1,[]) - '0');
nBits = length(bits);
RedChannel(1:nBits) = bitset(RedChannel(1:nBits),1,bits);
Imageresults = cat(3,RedChannel,GreenChannel,BlueChannel);
imwrite(Imageresults,'imagestego.bmp');
所以有什么问题?
我不知道你在做什么,但是在代码中你有错误而不是'message'你在第8行有'RedChannel' –
@VaheTshitoyan这是因为得到错误的代码试图* *从'RedChannel'中提取**位,而不是**将'message'的位插入到图像中。 – beaker
请包含[mcve]作为文本而不是截图。此外,尝试阅读并理解您的代码,并使用matlab调试器来分析错误发生的原因,即检查变量并检查为什么要求索引超出矩阵尺寸。 – m7913d