谁能帮我存储姓名、城市和电话号码。在 8 位图像的最低 3 个有效位上。我想显示图像,然后提取存储数据并打印它。
2 回答
您在这里要做的所有事情都非常简单。我建议您学习如何使用 matlab,而不是为您编写代码。如果您时间紧迫,请找人帮助您。
我也强烈建议您阅读这篇文章:http: //blogs.mathworks.com/steve/2006/10/17/the-story-behind-the-matlab-default-image/
I thought about it some more, and I really don't think what you're asking for is metadata. Setting the metadata is just easier than what you seem to be actually asking for.
Anyway, if all you really want to do is set the metadata, this can be done by rewritting the image using imwrite, with the 'Comment' parameter set. Look up MATLAB's imwrite for more information on this.
If instead what you want is steganography, then you need to use dec2bin to translate the string into binary data. Then go through this bitstring bit by bit, and OR it with the least significant bits of the image (apply dec2bin to it as well). You'll need to covnert the bitstring back to uint8 since the bitstrings are chars. Also, you can't save it in a lossy format, so no jpegs.
This solution is fairly complicated and requires careful coding. More than I feel like writing here. Especially when you're trying to read it all back (remember that the size of the image and the length of the string you want to hide will vary from image to image, and your de-encrypter will need to be able to handle this).