matlabimage-processingmatlab-cvst

Stereograms: Decoding an image from a pattern


Inside this pattern there is an image of a kettle. You can see it if you really focus. I'd like to know if I can use Matlab to decode this pattern? Give me some tips or code samples.

enter image description here enter image description here


Solution

  • Warning

    This answer will not attempt to solve this programatically ... Instead it focuses on letting Matlab do the eye crossing* for you however you still need to decide how far* to cross them...

    * this terminology sounds wrong but I'm just going to go with it

    Method

    Simply shifting the image and subtracting it from the original should give reasonable results, choosing the shift however is the tricky part, but once you know it something as simple as imData-circshift(imData,[shiftY,shiftX,0]) should give a good image...

    Here is a crude but simple GUI wrapper for the line of code above... (just run the function with an image file name as an argument)

    It doesn't give great results for the given image but it works better on some of these

    Example

    Initial Image

    Unsolved Magic eye

    After a little playing solved Magic eye