我想嘗試從已插入的消息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