I want to do the embedding operation by converting Hessenberg
2 次查看(过去 30 天)
显示 更早的评论
Hello,
I divided an image into 4x4 blocks and selected blocks randomly. Now I want to click on the selected Hessenberg matrix on these selected blocks and embed a binary image in the Hessenberg matrix. Thank you for your help.
5 个评论
Walter Roberson
2022-2-13
I still do not understand what the purpose of the clicking is.
I also do not understand what a Hessenberg matrix is in this situation.
Are you doing something like an LU decomposition, https://www.mathworks.com/help/matlab/ref/lu.html and then modifying one element of the U matrix, and then multiplying out to construct a modified matrix?
回答(2 个)
Walter Roberson
2022-2-14
Cover_filename = 'flamingos.jpg';
watermark_filename = 'cameraman.tif';
CoverImage = imresize(imread(Cover_filename), [256 256]);
watermarkImage = imresize( imread(watermark_filename), [8 8] );
watermarkBits = reshape((dec2bin(watermarkImage, 8) - '0').', 1, []);
num_watermarkBits = numel(watermarkBits);
image_blocks = mat2cell(CoverImage, 4 * ones(1,size(CoverImage,1)/4), 4 * ones(1,size(CoverImage,2)/4), ones(1,size(CoverImage,3)));
num_image_blocks = numel(image_blocks);
if num_image_blocks < num_watermarkBits
error('watermark image is too big to store in the cover image');
end
selected_blocks = randperm(numel(image_blocks), num_watermarkBits);
new_blocks = image_blocks;
displayed_once = false;
for idx = 1 : num_watermarkBits
blocknum = selected_blocks(idx);
thisblock = image_blocks{blocknum};
[P, H] = hess(double(thisblock));
H1 = typecast(H(1,end), 'uint64');
H1 = typecast(bitset(H1, 64, watermarkBits(idx)), 'double');
reconstructed_block = cast(P * H * P', class(thisblock));
new_blocks{blocknum} = reconstructed_block;
end
watermarkedImage = cell2mat(new_blocks);
figure(); imshow(CoverImage); title('Cover image');
figure(); imshow(watermarkImage); title('image to watermark with');
figure(); imshow(watermarkedImage); title('image after watermarking');
imshowpair(CoverImage, watermarkedImage)
Watermarked image is the same as the original image.
8 个评论
Walter Roberson
2022-2-15
Telling me that you cannot do the embedding and extraction correctly does not tell me what code you are using, or what problems you are encountering.
The implied message from posting what you posted is that you expect me to read the article and produce a debugged implementation for you, but I am not going to do that. If I have the resources then I will assist you in debugging your code.
javad danesh
2022-2-15
11 个评论
Walter Roberson
2022-2-20
In that source for pdfbdec, the file lprec.m duplicates lpdec.m . MATLAB does not consider that to be an error, so the program would not give an error unless the calling sequence happened to be incompatible. But without the correct lprec.m I cannot run the program correctly.
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!