I want to do the embedding operation by converting Hessenberg
1 view (last 30 days)
Show older comments
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 Comments
Walter Roberson
on 13 Feb 2022
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?
Answers (2)
Walter Roberson
on 14 Feb 2022
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 Comments
Walter Roberson
on 15 Feb 2022
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
on 15 Feb 2022
11 Comments
Walter Roberson
on 20 Feb 2022
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.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!