Some stimuli useful for studying motion perception

barberpole @ low contrast

barberpole.fli

rays

rays.fli

competing clouds

fig_competing_clouds.gif

Chromatic barberpole

Chromatic_barberpole.gif

   1 #!/usr/bin/env python
   2 """
   3 chromatic_barberpole.py
   4 
   5 """
   6 import os, matplotlib, numpy, pylab, scipy
   7 
   8 filename = 'chromatic_barberpole.gif'
   9 N_X = 512.0 # size of image
  10 N_Y = N_X # size of image
  11 N_frame = 65.0 # a full period. in time frames
  12 contrast = 1.0 / 8.
  13 #initialize grid
  14 from scipy import mgrid
  15 x,y,t = mgrid[-1:1:1j*N_X,-1:1:1j*N_Y,-1:1:1j*N_frame]
  16 # compute grating
  17 theta, fs, ft = numpy.pi/2.0,  60.0, numpy.pi
  18 grating = numpy.sin( fs*numpy.cos(theta)*x + fs*numpy.sin(theta)*y -ft*t)
  19 barberpole = grating * (numpy.abs(x +y) < .15)*(numpy.abs(x - y) < .5)*contrast
  20 
  21 # makes animation
  22 files = []
  23 color_image = numpy.zeros((N_X,N_Y,3))
  24 from scipy.misc import imsave
  25 #from pylab import imsave
  26 for frame in range(int(N_frame)):
  27     fname = '_tmp%03d.png'%frame
  28     contrast_image = barberpole[:,:,frame]
  29     color_image[:,:,1] = contrast_image       # G channel
  30     color_image[:,:,2] = - contrast_image     # B channel
  31     color_image[0,0,:] , color_image[N_X-1,N_Y-1,:] = [-1,-1,-1], [1,1,1] # extremes
  32     imsave(fname, color_image)
  33     files.append(fname)
  34 
  35 # creates animated GIF
  36 os.system("convert _tmp*png " + filename)
  37 # cleans up
  38 for fname in files: os.remove(fname)
  39 # displays
  40 os.system('open ' + filename)

Motion Clouds

results

[ATTACH]

[ATTACH]

[ATTACH]

[ATTACH]

|| from top to bellow white, pink, red and brown noises. These stimuli contain all possible velocities. ||

[ATTACH]

rotating the plane of the envelop

[ATTACH]

selecting just one frequency blob

[ATTACH]

selecting two frequency blobs

[ATTACH]

selecting a donut ring

[ATTACH] [ATTACH] [ATTACH]
[ATTACH] [ATTACH] [ATTACH]

note that from the FFT properties, these stimuli are periodic in time and space (frequencies are normalized on the width and period) and that for economy, they can be stacked)


TagMotion TagFlagged

welcome: please sign in