- defined COLORs added legend
- ocv_template_mnatching uses video
This commit is contained in:
+4
-2
@@ -8,7 +8,8 @@ def template_match_rotation(source, template, angle, center, rot_min=-1.0, rot_m
|
||||
best_angle = 0
|
||||
best_r = 0
|
||||
best_max_loc = 0
|
||||
r = 0
|
||||
best_res = None
|
||||
|
||||
im_source = im.resize(source, scale * source.shape[0], scale * source.shape[1])
|
||||
for dangle in np.linspace(rot_min, rot_max, n_steps):
|
||||
# rotated and scale up to IMG_SCALE_UP-size
|
||||
@@ -23,6 +24,7 @@ def template_match_rotation(source, template, angle, center, rot_min=-1.0, rot_m
|
||||
best_r = r
|
||||
best_angle = dangle
|
||||
best_max_loc = (maxLoc[0]/scale, maxLoc[1]/scale)
|
||||
best_res = res
|
||||
else:
|
||||
break
|
||||
|
||||
@@ -30,4 +32,4 @@ def template_match_rotation(source, template, angle, center, rot_min=-1.0, rot_m
|
||||
loc_x = best_max_loc[0]
|
||||
loc_y = best_max_loc[1]
|
||||
|
||||
return angle, (loc_x, loc_y)
|
||||
return angle, (loc_x, loc_y), best_res
|
||||
|
||||
Reference in New Issue
Block a user