5.0

5.0 | 1 rating Rate this file 31 downloads (last 30 days) File Size: 1.59 MB File ID: #24102

Droste Effect Tool

by Steve Hoelzer

 

13 May 2009 (Updated 13 May 2009)

Code covered by BSD License  

Apply the Droste Effect to an image using a GUI or function call.

Download Now | Watch this File

File Information
Description

Apply the Droste Effect to an image using a GUI or function call.

The Droste Effect is when an image recursively includes itself. The basic method is to insert a scaled copy of the image, but more interesting results can be achieved via conformal mapping.

The GUI can load an image, set a rectangular region for the effect, apply the Droste Effect, adjust parameters of the effect, and save the final image back to disk. The GUI uses droste_effect.m, which is a stand alone function for applying the Droste Effect.

img_out = droste_effect(img, reg) will apply the Droste Effect to matrix img within the region specified by reg. The img matrix can be 2-D or 3-D, corresponding to a grayscale or RGB image. The reg vector specifies [left, top, width, height] in pixels.

img_out = droste_effect(img, reg, 'p1', v1, 'p2', v2, ...) specifies optional parameters (pn) and values (vn) associated with the Droste Effect. The table below describes these parameters.

Parameters
    zoom: Scale. Default = 1.0x.
    hshift: Horizontal shift, normalized [0...1]. Default = 0.
    vshift: Vertical shift, normalized [0...1]. Default = 0.
    rotate: Rotate. Default = 0 degrees.
    nspiral: Number of spirals. Default = 1.
    ncopies: Number of copies of image per spiral rotation. Default = 1.
    maxrecur: Max recursion allowed to compute output. Default = 10.
    width: Width of output in pixels. Default = same resolution as input.
    aafactor: Anti-aliasing factor. Default = 1, higher = smoother. (0 = disable)

Example:
    load penny
    reg = [45 45 40 40];
    img_out = droste_effect(P, reg, 'width', 400);
    figure
    imshow(round(img_out),copper(256))

Running out of memory? Reduce the size of the input image before using this GUI for function.

Required Products Image Processing Toolbox
MATLAB release MATLAB 7.6 (R2008a)
Zip File Content  
Published M Files The Droste Effect
Other Files
droste_demo.m,
droste_effect.m,
droste_gui.fig,
droste_gui.m,
droste_gui.png,
html/droste_demo.png,
html/droste_demo_01.png,
html/droste_demo_02.png,
html/droste_demo_03.png,
html/droste_demo_04.png,
html/droste_demo_05.png,
html/droste_demo_06.png,
html/droste_demo_07.png,
html/droste_demo_08.png,
html/droste_demo_09.png,
html/droste_demo_10.png,
html/droste_demo_11.png,
html/droste_demo_12.png
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
16 May 2009 Alan Brooks

Very interesting and fun.

Please login to add a comment or rating.
Updates
13 May 2009

Show GUI screenshot in the published m-file.

13 May 2009

Fix spelling typo

Tag Activity for this File
Tag Applied By Date/Time
droste Steve Hoelzer 13 May 2009 09:58:31
gui Steve Hoelzer 13 May 2009 09:58:31
image processing Steve Hoelzer 13 May 2009 09:58:31
demo Steve Hoelzer 13 May 2009 09:58:31
conformal mapping Steve Hoelzer 13 May 2009 09:58:31
special effects Steve Hoelzer 20 May 2009 10:45:02
recursive Steve Hoelzer 20 May 2009 10:45:07
graphics Steve Hoelzer 20 May 2009 10:48:03
example Steve Hoelzer 20 May 2009 10:48:10
image Steve Hoelzer 20 May 2009 10:49:37
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com