Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

[open] Pictures from blurry to clear

edited April 2013 in OpenSesame

Hello. I'm working on my bachelor study Psychology. In the experiment we use OpenSesame. Part of the experiment is a task that tests the implicit memory about a movie. We want to let go a image from the film very slowly from blurred to sharp. The participants have to press a button when they recognize the subjects. The reaction time should then be saved as a measure.

Who can help us to program?

Comments

  • edited 12:30PM

    Hi Donna,

    The easy-but-time-consuming way would be to create blurred copies of your image using a graphics program (e.g. gimp).

    However, you can also do the blurring automatically using an inline script, for example using the Picture.blur() method, which is part of Expyriment. The following script shows an image with various levels of blurring and halts the presentation when a key is pressed (see code for comments):

    from expyriment.stimuli import Picture
    from openexp.keyboard import keyboard
    
    # Presentation duration
    dur = 500
    
    # Maximum blurring
    maxBlur = 10
    
    # Minimum blurring (1 = no blur)
    minBlur = 1
    
    # Get a picture path from the file pool
    picPath = exp.get_file('armadillo.jpg')
    
    # Create a keyboard object
    my_keyboard = keyboard(exp)
    
    # Create a list of pictures with different
    # levels of blur
    picList = []
    # Loop from maxBlur to minBlur with decreasing steps
    for blurLevel in range(maxBlur, minBlur-1, -1):
        # New picture
        pic = Picture(picPath)
        # Apply blur
        pic.blur(blurLevel)
        # Add picture to list
        picList.append(pic)
    
    # Note the start time
    t1 = self.time()
    
    # Show all pictures!
    for pic in picList:
        pic.present()
        # Wait and poll the keyboard. If a key is pressed
        # exit the loop.
        response, t2 = my_keyboard.get_key(timeout=dur)
        if response != None:
            break
    
    # Set the response variables
    response_time = t2 - t1
    exp.set('response_time', response_time)
    exp.set('response', response)
    

    This requires the xpyriment back-end, as directly invokes functionality from Expyriment. For more information, see:

    Hope this helps!

    Cheers,
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • edited 12:30PM

    Thanks you very much!!

Sign In or Register to comment.