Implementation [of texture perception model]
The exact matches for a template σ in data containing elements 0 and 1 can be obtained from
Sign[ListCorrelate[2σ - 1, data] - Count[σ, 1, 2]] + 1
Implementation [of texture perception model]
The exact matches for a template σ in data containing elements 0 and 1 can be obtained from
Sign[ListCorrelate[2σ - 1, data] - Count[σ, 1, 2]] + 1