@@ -47,16 +47,16 @@ def __init__(self, targs, cpar, cal, tol=0.00001, reset_numbers=True):
4747 self .buf = np .empty (self ._num_pts , \
4848 dtype = np .dtype ([('x' , np .float64 ), ('y' , np .float64 ), ('pnr' , np .int32 )]))
4949
50- for tnum in range ( self . _num_pts ):
51- targ = targs . _tarr [tnum ]
50+ for tnum , targ in enumerate ( targs ):
51+ targ = targs [tnum ]
5252 if reset_numbers :
5353 targ .pnr = tnum
5454
5555 self .buf [tnum ]['x' ], self .buf [tnum ]['y' ] = pixel_to_metric (
56- targ .x , targ .y , cpar . _control_par
57- )
56+ targ .x , targ .y , cpar )
57+
5858 self .buf [tnum ]['x' ], self .buf [tnum ]['y' ] = dist_to_flat (
59- self .buf [tnum ]['x' ], self .buf [tnum ]['y' ], cal . _calibration , tol
59+ self .buf [tnum ]['x' ], self .buf [tnum ]['y' ], cal , tol
6060 )
6161 self .buf [tnum ]['pnr' ] = targ .pnr
6262
@@ -244,7 +244,7 @@ def three_camera_matching(
244244 for i in range (target_counts [i1 ]):
245245 for i2 in range (i1 + 1 , num_cams - 1 ):
246246 p1 = corr_list [i1 ][i2 ][i ].p1
247- if p1 > nmax or tusage [i1 ][p1 ] > 0 :
247+ if p1 >= nmax or tusage [i1 ][p1 ] > 0 :
248248 continue
249249
250250 # print(f"p1 {p1} candidates {corr_list[i1][i2][i].n } ")
@@ -323,14 +323,14 @@ def consistent_pair_matching(
323323 for i2 in range (i1 + 1 , num_cams ):
324324 for i in range (target_counts [i1 ]):
325325 p1 = corr_list [i1 ][i2 ][i ].p1
326- if p1 > nmax or tusage [i1 ][p1 ] > 0 :
326+ if p1 >= nmax or tusage [i1 ][p1 ] > 0 :
327327 continue
328328
329329 if corr_list [i1 ][i2 ][i ].n != 1 :
330330 continue
331331
332332 p2 = corr_list [i1 ][i2 ][i ].p2 [0 ]
333- if p2 > nmax or tusage [i2 ][p2 ] > 0 :
333+ if p2 >= nmax or tusage [i2 ][p2 ] > 0 :
334334 continue
335335
336336 corr = corr_list [i1 ][i2 ][i ].corr [0 ] / corr_list [i1 ][i2 ][i ].dist [0 ]
@@ -423,6 +423,7 @@ def match_pairs(
423423
424424 # search for a conjugate point in corrected[i2]
425425 # cand = [Correspond() for _ in range(MAXCAND)]
426+
426427 cand = find_candidate (
427428 corrected [i2 ],
428429 frm .targets [i2 ],
@@ -682,7 +683,7 @@ def correspondences(
682683
683684
684685 """
685- nmax = 1000 # NMAX
686+ nmax = NMAX
686687
687688 # Allocation of scratch buffers for internal tasks and return-value space
688689 con0 = [n_tupel () for _ in range (nmax * cpar .num_cams )]
0 commit comments