Amould commited on
Commit
3c887d3
·
verified ·
1 Parent(s): ae94caa

Update codes.py

Browse files
Files changed (1) hide show
  1. codes.py +2 -2
codes.py CHANGED
@@ -148,11 +148,11 @@ def transform_standard_points(Affine_mat, x,y):
148
  yt0 = XYt[1]
149
  return xt0, yt0
150
 
151
- def wrap_points(img, x_source, y_source, l=1):
152
  for i in range(len(y_source)):
153
  x0 = x_source[i].int()
154
  y0 = y_source[i].int()
155
- if (x0<dim) and (x0>0) and (y0<dim) and (y0>0):
156
  img[:,:,x0-l:x0+l,y0-l:y0+l] = 0
157
  return img
158
 
 
148
  yt0 = XYt[1]
149
  return xt0, yt0
150
 
151
+ def wrap_points(img, x_source, y_source, l=1, DIM =128):
152
  for i in range(len(y_source)):
153
  x0 = x_source[i].int()
154
  y0 = y_source[i].int()
155
+ if (x0<DIM) and (x0>0) and (y0<DIM) and (y0>0):
156
  img[:,:,x0-l:x0+l,y0-l:y0+l] = 0
157
  return img
158