Skip to content

Commit 161f15d

Browse files
committed
Minor aesthetic changes
1 parent 6aee0c2 commit 161f15d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

seismic/receiver_fn/digitizer.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def __init__(self, image_fn, profile_fn=None):
2424
self._xio = None
2525
self._yio = None
2626
self._digitization_coords = []
27+
self._newly_added_coords = []
2728
self._geod = None
2829
self._az = None
2930
self._baz = None
@@ -129,10 +130,11 @@ def _load_profile(self):
129130
def mouse_callback(event, x, y, flags, self):
130131
if(not self._calibrated): return
131132
if (event == (cv2.EVENT_LBUTTONDOWN) and flags == (cv2.EVENT_LBUTTONDOWN + cv2.EVENT_FLAG_CTRLKEY)):
133+
node = [x, y, float(self._xio(x)), float(self._yio(y))]
134+
self._digitization_coords.append(node)
135+
self._newly_added_coords.append([x, y])
136+
132137
self._gui_circle(x, y, add_to_master=False)
133-
self._digitization_coords.append([x, y,
134-
float(self._xio(x)),
135-
float(self._yio(y))])
136138
# end if
137139
# end func
138140

@@ -141,11 +143,16 @@ def clear(self):
141143
cv2.imshow(self._window_name, self._work_img)
142144
# end func
143145

144-
def _gui_circle(self, x, y, color=(0,0,0), radius=5, add_to_master=True):
146+
def _gui_circle(self, x, y, color=(0, 255, 255), radius=15, add_to_master=True):
147+
148+
border_lw = 5
149+
if([x, y] in self._newly_added_coords): border_lw = 30
145150
if(add_to_master):
151+
cv2.circle(self._master_img, (x, y), radius, (0, 0, 0), border_lw)
146152
cv2.circle(self._master_img, (x, y), radius, color, -1)
147153
# end if
148154

155+
cv2.circle(self._work_img, (x, y), radius, (0, 0, 0), border_lw)
149156
cv2.circle(self._work_img, (x, y), radius, color, -1)
150157
cv2.imshow(self._window_name, self._work_img)
151158
# end func

0 commit comments

Comments
 (0)