This is the first design flowchart that Zihao made for the program:
These are the first images our program has created after decoding the hidden text in an image:
(1) (2)
(3) (4)
At this point we were concerned with how the text should look like when it is revealed on the image as concealing it in the cover image was fairly easy to do by simply overwriting the last digit of the cover image's pixels with a 1 for white color, 0 for black color and later on we decided to add a value of 2 for red color.
Picture (1) shows the text revealed on the image and it has a white background so it would be visible, but it looked rather ugly.
Picture (2) shows the text revealed on the image without any background, but it can be hard to read when the text overlaps with a part of the picture that has the same color as the text.
Picture (3) shows the approach that we were most satisfied with. White text where each character has red pixels around it to make it visible when overlapping any color of the cover image, however we overlooked a small detail when we hid the pixels and as a result, during the decoding process some pixels were lost and the result is fairly visible.
Picture (4) shows the output after the bug was fixed. The problem was that while preparing the cover image's pixels to receive data ( matrix(r, c, :) =round ( matrix(r, c, :)/10 ) *10 ) by setting their last digits to 0, we were rounding towards nearest integer. So 255/10 = 25.5 which rounds up to 26, we multiply by 10 and we get 260 which is cut down to the maximum pixel size of 255. And when we add the text value (1, 0 or 2) this values are lost, and that's why certain parts of the text in image (3) are missing. This was fixed fairly easy by subtracting 6 out of all pixels in the matrix with a value grater than 250.
On the other hand, hiding images inside other images has presented us with new challenges. We had to take into account what to do with different image sizes ( cover image is smaller that the image that was supposed to be concealed), how well can we hide the image, how much would the image degrade if we hide it in different ways.
(1) (2)
(3)
(4) (5)
(6)
Implementation progress:
ReplyDeleteProgram is able to read images and save them into 3D arrays
Program is able to convert a string to a matrix of 1s and 0s (Using ASCII )
Program is able to divide text on multiple rows without losing meaning
Program can not split a word if it is too long (yet)
Program can hide and reveal the text in the middle of the cover image
Program is able to hide pixel values in the last digit of another pixel
Password protection is not implemented yet
Bugs encountered:
Errors are generated when input image does not have a RGB format (size = R*C*1)
Program ends when a long word is encountered
Text is not always visible, needs a background, or something
Text size should be relevant to the picture scale
Hidden image is noticeable on the cover image
Hidden image is revealed with 25% deterioration
Errors encountered when hidden image is bigger than the cover image
Program is not split conveniently into small functions and is not commented
Week 3 Design updates:
Program should offer options for image degradation preferences
---Low image degradation and weak concealing
---Higher image degradation and strong concealing
Error messages should be prompted according to program limitations