Skip to content
Snippets Groups Projects
Commit ee8b2a6e authored by Tamino Huxohl's avatar Tamino Huxohl
Browse files

update remove bed script

parent c6ae15cb
No related branches found
No related tags found
No related merge requests found
...@@ -145,7 +145,7 @@ if __name__ == "__main__": ...@@ -145,7 +145,7 @@ if __name__ == "__main__":
while True: while True:
# compute image to display # compute image to display
to_show = mu_map[_slice] to_show = mu_map[_slice]
to_show = to_grayscale(to_show) to_show = to_grayscale(to_show, min_val=mu_map.min(), max_val=mu_map.max())
to_show = cv.resize(to_show, (window_size, window_size)) to_show = cv.resize(to_show, (window_size, window_size))
if visual_mode == VisualMode.DRAW_CONTOURS: if visual_mode == VisualMode.DRAW_CONTOURS:
...@@ -178,10 +178,11 @@ if __name__ == "__main__": ...@@ -178,10 +178,11 @@ if __name__ == "__main__":
key = cv.waitKey(100) key = cv.waitKey(100)
if key == ord("q"): if key == ord("q"):
# write current contours to output file # write current contours to output file
scale_points(points, 1.0 / scale) if len(points) > 0:
bed_contours[str(_id)] = points.copy() scale_points(points, 1.0 / scale)
with open(args.output_file, mode="w") as f: bed_contours[str(_id)] = points.copy()
f.write(json.dumps(bed_contours, sort_keys=True)) with open(args.output_file, mode="w") as f:
f.write(json.dumps(bed_contours, sort_keys=True))
exit(0) exit(0)
elif key == ord("d"): elif key == ord("d"):
points = points[:-1] points = points[:-1]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment