# Create “Ostagram” like Images using Wavelet Transforms

I am trying to make an "ostagram" like image using wavelet transforms and image keypoints. This is done using neural networks, which I at present am not sure how to implement in Mathematica.

What I am trying to do is the following:

1. Import two images of the same size and type:

testImage1 = Import["https://i.stack.imgur.com/TQnFX.jpg"];
testImage2 = Import["https://i.stack.imgur.com/JAVdX.jpg"];

2. Segment one image using ImageKeypoints with a specific size (in this case 25x25 px) of partitions:

ImageSegment[img_, param_] :=
Module[{i = img, p = param},
ImageTrim[i, {#}, p] & /@ ImageKeypoints[i, "KeypointStrength" -> .001]
];
n = ImageSegment[testImage1, 25];

3. Use the wavelet transform on one image so that I can extract the detail coefficients and reassemble them into one image:

(takes the wavelet transform of the second image)

dwd = StationaryWaveletTransform[testImage2, CDFWavelet[], 3];


(only keeps detail coefficients)

detail = InverseWaveletTransform[dwd, Automatic, {___, 1 | 2 | 3}];
Binarize@detail


Now, how do I get the segmented images from the first image overlaid on the detailed wavelet coefficients to produce those cool images from the link?

• It would help to include example images – Simon Woods Mar 9 '16 at 20:58
• Do you have any reason to expect that this wavelet operation can give anything remotely like the deep neural network images? – Simon Woods Mar 9 '16 at 21:00

A example in the StationaryWaveletTransform(Application/ImageFusion) seem can do this

{image, txture} =
Import /@ {"https://i.stack.imgur.com/TQnFX.jpg","https://i.stack.imgur.com/JAVdX.jpg"}
img = Sharpen[image];
txt = ImageMultiply[txture, .5];
{dwdImg, dwdTxt} =
StationaryWaveletTransform[#, CDFWavelet[], 3] & /@ {img, txt};
{rval1, rval2} = #[{___, 1 | 2 | 3}, "Values"] & /@ {dwdImg, dwdTxt};
wind = Cases[dwdImg["WaveletIndex"], {___, 1 | 2 | 3}];
nimg = (Image[#1, Interleaving -> False] &) /@ (1/2 (rval1 + 2 rval2)); 