M-File Help: testpattern | View code for testpattern |
Create test images
im = testpattern(type, w, args) creates a test pattern image. If w is a scalar the image is WxW else w(2)xW(1). The image is specified by the string type and one or two (type specific) arguments:
'rampx' | intensity ramp from 0 to 1 in the x-direction. ARGS is the number of cycles. |
'rampy' | intensity ramp from 0 to 1 in the y-direction. ARGS is the number of cycles. |
'sinx' | sinusoidal intensity pattern (from -1 to 1) in the x-direction. ARGS is the number of cycles. |
'siny' | sinusoidal intensity pattern (from -1 to 1) in the y-direction. ARGS is the number of cycles. |
'dots' | binary dot pattern. ARGS are dot pitch (distance between centres); dot diameter. |
'squares' | binary square pattern. ARGS are pitch (distance between centres); square side length. |
'line' | a line. ARGS are theta (rad), intercept. |
A 256x256 image with 2 cycles of a horizontal sawtooth intensity ramp:
testpattern('rampx', 256, 2);
A 256x256 image with a grid of dots on 50 pixel centres and 20 pixels in diameter:
testpattern('dots', 256, 50, 25);
© 1990-2012 Peter Corke.