A very beginner in OpenCV I am trying to implement text steganography: Trying to hide a text message in an image. What I do is, I hide each of the characters from the text message by modifying the pixels in the image. For each of the characters I take the binary representation of the character and replace the last bit of a pixel with the LSB of the character, and gain last bit of another pixel with the 2nd bit of the character, and so on .... for the whole message. After this encryption of the text into the image I store it on the disk using cv::imwrite.
This image is again read in by another routine and decrypts it doing the reverse opeartions used for encrypting.
But, the problem is decryption is not working if i read in the image(encrypted image) whihc is stored using cv::imwrite. But, it works if I pass-on the encrypted matrix (cv::Mat) object to the decryption routine rather than reading a image again.
Seems, something is getting changed when i store the encrypted matrix into an image. Not sure what is going on behind the scenes. Any help is appreciated.