1
$\begingroup$

How can I extract a hidden image using discrete wavelet transform? I have used the function ImageFusion from this site to hide an image inside another one.

ImageFusion[{img1_Image, wts1_}, {img2_Image, wts2_}, 
  index_: Automatic] := 
 Module[{dwd, wcoeff, nwcoeff, nimg, wind, rnew}, 
  dwd = Map[
    StationaryWaveletTransform[#, CDFWavelet[], 3] &, 
    {img1, img2}
    ];
  wcoeff = #[index, {"Image", "ImageFunction" -> Identity}] & /@ dwd;
  nwcoeff = MapThread[
    Rule[
     First[#1],
     ImageAdd[ImageMultiply[Last[#1], wts1], ImageMultiply[Last[#2], wts2]]
     ] &,
    wcoeff
    ];
  nwcoeff = Append[
    nwcoeff,
    First[
     dwd[[1]][{0, 0, 0}, {"Image", "ImageFunction" -> (ImageMultiply[#, wts1] &)}]
     ]
    ];
  InverseWaveletTransform[ 
   DiscreteWaveletData[
    nwcoeff, 
    CDFWavelet[], 
    StationaryWaveletTransform
    ]
   ]
  ]

But I couldn't extract it again... Please help 🙏

$\endgroup$
  • 4
    $\begingroup$ Please consider sharing the image and the code you used for hiding in a copyable form. That will help other users to help you. Otherwise, this question is really abstract. $\endgroup$ – Henrik Schumacher Jun 1 '18 at 7:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.