0

I am using OpenCV on android to build a a DCT steganography app. I have to change the CvType of the image mat according to the different processes like dct, idct..etc.

Steps: (and required type of mat for that step)

  1. Load image bitmap and get image mat (CvType.CV_8UC4) from it.
  2. Convert image from RGB to YCrCb
  3. Divide the image into blocks of 8 x 8 blocks.
  4. Center pixel values around 0 [0-255 => -128-127] (CvType.CV_32SC1)
  5. Apply DCT transformation to get DCT coefficients for the block. (CvType.CV_32FC1)
  6. Quantization [divide the DCT coefficients with quant matrix]
  7. Now substitute the LSBs of the non 0/1/DC coefficients with our secret message. (CvType.CV_8SC1)
  8. inverse quantization**(CvType.CV_32FC1)**
  9. inverse DCT
  10. [0-255 <= -128-127]
  11. YCbCr to RGB
  12. Get bitmap from image mat (CvType.CV_8UC4)
  13. Save the bitmap as jpeg.

Problem :

In the 11th step I have to convert image mat to the original type imOut.convertTo(imOut, imIn.type()). By testing, I have found out, that at this step a small percentage of pixel values get changed (example - one of the DCT coeff : 13 to 12) which changes the steg message from aaaaaa to aaaa!a

Any solutions ?

Utkarsh Singh
  • 51
  • 1
  • 7
  • Either don't save to jpeg, or implement jpeg steganography properly. See [here](https://stackoverflow.com/questions/35396977/lsb-dct-based-image-steganography) for example. – Reti43 May 10 '21 at 16:16
  • @Reti43 yes saving as jpeg will create a problem, but currently the problem I'm facing is at step 11, which I have checked by printing the DCT coefficients before and after step 11. – Utkarsh Singh May 10 '21 at 16:45

0 Answers0