-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathborderPyramid.py
executable file
·43 lines (24 loc) · 1.29 KB
/
borderPyramid.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import numpy as np
from vonMisesSum import vonMisesSum
def borderPyramid(csPyrL,csPyrD,cPyr,params):
data = (csPyrL,csPyrL,csPyrL,csPyrL)
ori = np.zeros((4,10))
invmsk_set = np.zeros((4,10,13,13))
bPyr1 = {'data':data,'ori':ori,'invmsk':invmsk_set}
bPyr3 = bPyr1
bPrs = params['bPrs']
vmPrs = params['vmPrs']
vmL1, msk1, vmL2, msk2 = vonMisesSum(csPyrL, vmPrs)
vmD1, csmsk1, vmD2, csmsk2 = vonMisesSum(csPyrD, vmPrs)
for ori in range(bPrs['numOri']):
for l in range(10):
bPyr1['ori'][ori][l] = msk1['ori'][ori][l]
bPyr1['invmsk'][ori][l][:] = msk1['data'][ori]
bPyr3['ori'][ori][l] = msk1['ori'][ori][l]
bPyr3['invmsk'][ori][l][:] = msk1['data'][ori][l]
# cPyr(l).orientation(ori).data. * (1 + bPrs.alpha. * (vmL1(l).orientation(ori).data - bPrs.CSw. * vmD2(l).orientation(ori).data))
bPyr1['data'][ori][l] = cPyr[l][ori] * (1+ bPrs['alpha'] *(vmL1[ori][l] - bPrs['CSw'] * vmD2[ori][l]))
bPyr1['data'][ori][l][(bPyr1['data'][ori][l]<0).astype(int)] = 0
bPyr3['data'][ori][l] = cPyr[l][ori] * (1+ bPrs['alpha'] *(vmD1[ori][l] - bPrs['CSw'] * vmL2[ori][l]))
bPyr3['data'][ori][l][(bPyr3['data'][ori][l] < 0).astype(int)] = 0
return bPyr1,bPyr3