简体   繁体   中英

Matlab: Partitioning an image into blocks and putting a watermark into the LSB of each block

I have an 256x256 image and I want to partition it into 16x16 blocks. Then I want to set the LSB of each block to zero. After that I want to use an MD5 function with a user key, an image ID, the image's width and height, the block's index and the image block X' (X' is the same with image block X with the exception of the LSB witch is set to zero) as parameters. Then I want to perform an XOR operation between the hash that has been produced by the MD5 function and the corresponding block of my watermark and insert the result of this to the LSB of my image block to get the watermarked image block. I'm trying to use the blockproc function, but I don't know what I shall use as a fun in this. I couldn't find anything on the net. Thank you for your help and sorry for my english!

You can use imread at native mode. Then you can convert blocks to byte and bits. Then you can replace the desired bits.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM