Lockpattern recognition